CN104346330B - A kind of method and device of data initialization - Google Patents
A kind of method and device of data initialization Download PDFInfo
- Publication number
- CN104346330B CN104346330B CN201310311344.XA CN201310311344A CN104346330B CN 104346330 B CN104346330 B CN 104346330B CN 201310311344 A CN201310311344 A CN 201310311344A CN 104346330 B CN104346330 B CN 104346330B
- Authority
- CN
- China
- Prior art keywords
- user
- date
- record
- predetermined information
- interim
- 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.)
- Active
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/23—Updating
- G06F16/2358—Change logging, detection, and notification
-
- 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/2282—Tablespace storage structures; Management thereof
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application provides a kind of method and device of data initialization, and this method includes:According to predetermined date of formation commencement date and deadline dimension table;According to the user list and the date dimension table for having predetermined information, daily one interim table recorded of each user is generated;According to the interim table and the predetermined information, daily one initial table recorded of each user is generated, wherein for each user, each record of the initial table includes the content item related to the predetermined information.Using the technical scheme of the application, when needing to count cumulative type index, accumulation process can be carried out respectively to every predefined parameter of each user in the initial table.
Description
Technical field
The application is related to microcomputer data processing field, more particularly to a kind of method and device of data initialization.
Background technology
In field of computer data processing, the processing for mass data, conventional way is that data are carried out initially
Change.However, in mass data initialization, all kinds of counting user generally require to count cumulative type index, example when recording
Such as, record sum, the record sum of the beginning of the month so far etc. year-to-date, because the data of user are likely to discontinuous, because
This, either inquires about by date, or by user to inquire about all is pretty troublesome, so as to be difficult to obtain these cumulative type numbers
According to.The data discontinuously refer to that the object of statistics might not have certain type of information content item to record in every day,
It is discontinuous so to may result in data.For example, to count certain website user login situation, and according to user log in situation to
Family is scored, and the user of the website may not log in daily, if be not logged on the day of the user counted, according to
Existing common practices, year-to-date login that can not be to user is total, and the beginning of the month logs in the indexs such as sum and counted so far, again
For example, the seller of certain shopping website may not be daily have punishment record, the same day if not punishing record, according to biography
The algorithm of system, punishment year-to-date that just can not be to those sellers is total, the cumulative type index such as the punishment sum of the beginning of the month so far
Counted.
The content of the invention
The main purpose of the application is to provide a kind of method and device of data initialization, to solve prior art presence
The discontinuous information data for user the problem of being difficult to count cumulative type index, wherein:
According to the one side of the application, there is provided a kind of method of data initialization, this method include:According to making a reservation for
Only date of formation on date dimension table;According to the user list and the date dimension table for having predetermined information, each user daily one is generated
The interim table of bar record;According to the interim table and the predetermined information, the initialization of the daily record of each user is generated
Table, wherein for each user, each record of the initial table includes the content item related to the predetermined information.
According to embodiments herein, in the method, according to the user list and the date dimension table for having predetermined information,
The interim table of the daily record of each user is generated, including:The user list for having predetermined information and the date are tieed up
Table does cartesian product, to generate the interim table of the daily record of each user.
According to embodiments herein, in the method, according to the interim table and each use of predetermined information generation
The initial table of the daily record in family, including:Every predefined parameter in the predetermined information is added to the interim table
In the record on middle relative users corresponding date;Do not have the items in the interim table in the record of corresponding predetermined information
Predefined parameter is set to zero.
According to embodiments herein, in the method, in addition to:To each daily note of user in the initial table
Every predefined parameter in record carries out cumulative from target date to the current record date respectively.
The another aspect of the application, there is provided a kind of device of data initialization, the device include:Date dimension table generates mould
Block, for according to predetermined date of formation commencement date and deadline dimension table;Temp table generation module, for being arranged according to the user for having predetermined information
Table and the date dimension table, generate the interim table of the daily record of each user;Initial table generation module, for according to institute
State interim table and the predetermined information generates the initial table of the daily record of each user, wherein for each user, institute
Each record for stating initial table includes the content item related to the predetermined information.
According to embodiments herein, in the apparatus, the temp table generation module is further used for:By it is described have it is pre-
The user list and the date dimension table for determining information do cartesian product, to generate the interim table of the daily record of each user.
According to embodiments herein, in the apparatus, the initial table generation module further comprises:First addition
Module, for every predefined parameter in the predetermined information to be added to the note on relative users corresponding date in the interim table
In record;Second add module, for not having to make a reservation for the items in the record of corresponding predetermined information in the interim table
Parameter is set to zero.
According to embodiments herein, in the apparatus, in addition to:Accumulator module, for every in the initial table
Every predefined parameter in the daily record of individual user carries out cumulative from target date to the current record date respectively.
Compared with prior art, according to the technical scheme of the application, according to the list and generation of the user for having predetermined information
Date dimension table generate the interim table of the daily record of each user, and then generate the initial of the daily record of each user
Change table, can be to every predefined parameter of each user in the initial table so as to when needing to count cumulative type index
Accumulation process is carried out respectively.
Brief description of the drawings
Accompanying drawing described herein is used for providing further understanding of the present application, forms the part of the application, this Shen
Schematic description and description please is used to explain the application, does not form the improper restriction to the application.In the accompanying drawings:
Fig. 1 is a kind of flow chart of the method for data initialization of the embodiment of the present application;
Fig. 2 is the particular flow sheet of the step S103 in Fig. 1 of the embodiment of the present application;And
Fig. 3 is a kind of structured flowchart of the device of data initialization of the embodiment of the present application.
Embodiment
The main thought of the application is, the date dimension table of the user list for having predetermined information and generation is handled,
The interim table of the daily record of each user is generated, and then obtains the initial table of the daily record of each user so that
Each user for having predetermined information has continuous record, to tire out respectively to every predefined parameter of each user in table
Add processing.
To make the purpose, technical scheme and advantage of the application clearer, below in conjunction with drawings and the specific embodiments, to this
Application is described in further detail.
In the following description, the reference to " one embodiment ", " embodiment ", " example ", " example " etc. shows
The embodiment or example so described can include special characteristic, structure, characteristic, property, element or limit, but not each real
Applying example or example all necessarily includes special characteristic, structure, characteristic, property, element or limit.In addition, phrase is reused " one
In individual embodiment " although it is possible to refer to identical embodiment, but it is not necessarily referring to identical embodiment.
According to embodiments herein, there is provided a kind of method of data initialization.With reference to figure 1, Fig. 1 is that the application is implemented
The flow chart of the method for the data initialization of example.
As shown in figure 1, in step S101, according to predetermined date of formation commencement date and deadline dimension table.Wherein, the date dimension table
It is the date dimension table on continuous date.Wherein, the predetermined commencement date and deadline refers to the predetermined Start Date counted and predetermined knot
The beam date, such as want the data in statistics first arrival in 2013 on July 8th, 2013, predetermined Start Date and predetermined Close Date point
It is not on January 1st, 2013 and on July 8th, 2013.Date and time information in the date dimension table can include:Date, the date be
Which day in week, which day of the moon, which day in season, the information such as which day in year, this week be the moon which can also include
In week, it which in year, current season is date, end of the season day at the beginning of which in year, the season of current season which week, this month in year are the moon in the season
Phase, the date at the end of month date at the beginning of the month of this month, all just information such as date, weekend dates of this week.For example, the day on January 1st, 2013
Phase dimension table, can be as shown in table 1:
Table 1
In step s 102, according to the user list and the date dimension table for having predetermined information, it is daily to generate each user
The interim table of one record.Wherein, the predetermined information, the information of predefined parameter to be handled can be included, it is described pre-
Determining parameter includes:Predefined action occurs for user and at least one of caused related parameter.For example, user's login times, user
Punish number, user's penalty score etc..The user list for having predetermined information, can be to be recorded in rising for the date dimension table
Only there is the ID of the user of the predetermined information in the date(Account)List.
It is possible to further by the way that the list of the user for having a predetermined information and the date dimension table are done into cartesian product
To generate the interim table of the daily record of each user.Specifically, the user for having predetermined information can be arranged
Each user in table(The ID of user)It is combined with each date in date dimension table, forms ordered pair, is ultimately produced every
The interim table of the individual daily record of user.
For example, predetermined commencement date and deadline is respectively on July 1st, 2013 and on July 3rd, 2013, there is the user of predetermined information
ID be respectively ID1, ID2, ID3, date dimension table can be as shown in table 2, and the other information in addition to the date is eliminated in table 2.
Table 2
The user list for having predetermined information can be as shown in table 3:
Table 3
Table 2 and table 3 are done into cartesian product can obtain interim table, as shown in table 4:
Table 4
In step s 103, according to the interim table and the predetermined information, the daily record of each user is generated
Initial table.Wherein, included for each user, each record of the initial table in related to the predetermined information
Rong Xiang, the content item can include:Predefined action occurs for user and at least one of caused related parameter.
Step S103 specifically can be as shown in Fig. 2 the particular flow sheet that Fig. 2 is step S103.
As shown in Fig. 2 in step s 201, every predefined parameter in the predetermined information is added to the interim table
In the record on middle relative users corresponding date.Namely will be described predetermined according to the corresponding user of the predetermined information and date
Every predefined parameter in information is added in the interim table in the record on relative users corresponding date.Wherein, the items
Predefined parameter can include:Predefined action occurs for user and at least one of caused related parameter, such as user returns due to disobeying
A certain rule and punishment number, penalty score, the stolen and caused account of user account are stolen number, quilt caused by bearing punishment
Steal the parameters such as penalty score.
It is alternatively possible to obtain user's predetermined information day summary sheet from data warehouse, user's predetermined information day converges
Summary table can include:Within the commencement date and deadline of the date dimension table, there are the ID, the predetermined information, institute of the user of predetermined information
State the date caused by predetermined information.Can be according to user's predetermined information day summary sheet by the predetermined information of each user
It is added in the interim table in corresponding record, specifically, can be according to the date of ID and the predetermined information, will
Every predefined parameter of the relative users in the predetermined information on corresponding date is added in the corresponding record of interim table.
In step S202, do not have every predetermined ginseng in the interim table in the record of corresponding predetermined information
Number is set to zero.
Because user may not have the predetermined information daily, for example, user will not daily in violation of rules and regulations, then the use
Family also would not all be related to punish the information of number and penalty score daily.It will can believe in interim table without predetermined accordingly
Every predefined parameter in the record of breath is set to 0, no matter user any one day in the range of the commencement date and deadline of date dimension table has not
There is the predetermined information, can all there is a record in this day, can so obtain the initial of the daily record of each user
Change table, the data to be counted are with regard to continuous, subsequently if it is intended to being added up to every predefined parameter on each user's date
Statistics(For example, the cumulative of every predefined parameter year-to-date, the every predefined parameter of the beginning of the month so far it is cumulative), can be direct
These parameters are added up to obtain using the initial table.
For example, returning that pre-defined rule is punished number and penalty score counts because disobeying to above-mentioned user, can obtain each
The initial table of the daily record of user is as shown in table 5:
Table 5
Alternatively, can also be by by the interim table and user's predetermined information day according to embodiments herein
Summary sheet does the initial table that left connection is set as the daily record of each user, specifically, can using the interim table as
Benchmark, ID and date corresponding predetermined information in user's predetermined information day summary sheet are traveled through, and by described in
Every predefined parameter in predetermined information is added in the interim table in the record on relative users corresponding date, unwritten
Every predefined parameter is then set to 0.
According to one embodiment of the application, can also include after step s 103:To each in the initial table
Every predefined parameter in the daily record of user carries out the cumulative step from target date to the current record date respectively.
The initial table of the daily record of each user is obtained in step S101-S103 more than, can be to described
Every predefined parameter in each record of initial table carries out the cumulative of target date to current record date respectively.It is specific next
Say, can be to every predefined parameter in record of each every predefined parameter of the user in daily record with before
Added up, obtain the cumulative data of every predefined parameter in every day of each user, for example, obtaining each user every
The accumulated value of every predefined parameter year-to-date of one day, the accumulated value of every predefined parameter of the beginning of the month so far etc..
The application be can apply in Distributed Computing Platform, and the data that needs are carried out with the record of cumulative statistics are carried out just
Beginningization, with realize subsequently to the data carry out accumulation calculating, obtain such as year-to-date record sum, the note of the beginning of the month so far
Record the interim statistical result such as sum.The application can use structuralized query(SQL)Sentence is realized.
It should be noted that form listed in embodiments herein is used for providing further understanding of the present application, not
For limiting the application.
The application also provides a kind of device of data initialization, with reference to figure 3, Fig. 3 be the invention relates to one kind
The structured flowchart of the device of data initialization, as shown in figure 3, the device 300 can include:Date dimension table generation module 310, face
When table generation module 320 and initial table generation module 330.
Wherein, date dimension table generation module 310, can be used for according to predetermined date of formation commencement date and deadline dimension table;
Temp table generation module 320, it can be used for according to the user list for having predetermined information and date dimension table generation
The interim table of the daily record of each user.
Initial table generation module 330, it can be used for generating each user according to the interim table and the predetermined information
The initial table of a daily record, wherein for each user, each record of the initial table include with it is described pre-
Determine the related content item of information..
The temp table generation module 320 can be also used for:By the user list for having predetermined information and the date
Dimension table does cartesian product, to generate the initial table of the daily record of each user.
The initial table generation module 330 may further include:First add module, the second add module.
First add module, it can be used for every predefined parameter in the predetermined information being added to described interim
In table in the record on relative users corresponding date;
Second add module, by institute in the record that can be used in the interim table not having corresponding predetermined information
State every predefined parameter and be set to zero.
Device 300 can also include:Accumulator module 340, it can be used for daily to each user in the initial table
Every predefined parameter in record carries out cumulative from target date to the current record date respectively.
In a typical configuration, computing device includes one or more processors (CPU), input/output interface, net
Network interface and internal memory.
Internal memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moved
State random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic cassette tape, the storage of tape magnetic rigid disk or other magnetic storage apparatus
Or any other non-transmission medium, the information that can be accessed by a computing device available for storage.Define, calculate according to herein
Machine computer-readable recording medium does not include non-temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It should be understood by those skilled in the art that, embodiments herein can be provided as method, system or computer program
Product.Therefore, the application can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the application can use the computer for wherein including computer usable program code in one or more
Usable storage medium(Including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)The computer program production of upper implementation
The form of product.
Embodiments herein is the foregoing is only, is not limited to the application, for those skilled in the art
For member, the application can have various modifications and variations.All any modifications within spirit herein and principle, made,
Equivalent substitution, improvement etc., should be included within the scope of claims hereof.
Claims (8)
- A kind of 1. method of data initialization, it is characterised in that including:According to predetermined date of formation commencement date and deadline dimension table;According to the user list and the date dimension table for having predetermined information, daily one interim table recorded of each user is generated;According to the interim table and the predetermined information, daily one initial table recorded of each user is generated, wherein being directed to Each user, each record of the initial table include the content item related to the predetermined information.
- 2. according to the method for claim 1, it is characterised in that tieed up according to the user list for having predetermined information and the date Table, the interim table of the daily record of each user is generated, including:There are the user list of predetermined information and the date dimension table to do cartesian product by described, to generate daily one of each user The interim table of record.
- 3. according to the method for claim 1, it is characterised in that generated according to the interim table and the predetermined information each The initial table of the daily record of user, including:Every predefined parameter in the predetermined information is added in the interim table in the record on relative users corresponding date;There is no that every predefined parameter is set into zero in the record of corresponding predetermined information in the interim table.
- 4. according to the method for claim 1, it is characterised in that also include:It is daily to each user in the initial table Record in every predefined parameter carry out respectively it is cumulative from target date to the current record date.
- A kind of 5. device of data initialization, it is characterised in that including:Date dimension table generation module, for according to predetermined date of formation commencement date and deadline dimension table;Temp table generation module, for according to having the user list of predetermined information and the date dimension table, it is every to generate each user The interim table of it record;Initial table generation module, for generating the daily record of each user according to the interim table and the predetermined information Initial table, wherein for each user, each record of the initial table is comprising related to the predetermined information Content item.
- 6. device according to claim 5, it is characterised in that the temp table generation module is further used for:There are the user list of predetermined information and the date dimension table to do cartesian product by described, to generate daily one of each user The interim table of record.
- 7. device according to claim 5, it is characterised in that the initial table generation module further comprises:First add module, for every predefined parameter in the predetermined information to be added into relative users in the interim table In the record on corresponding date;Second add module, for not having every predetermined ginseng in the interim table in the record of corresponding predetermined information Number is set to zero.
- 8. device according to claim 5, it is characterised in that also include:Accumulator module, in the initial table Every predefined parameter in the daily record of each user carries out cumulative from target date to the current record date respectively.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310311344.XA CN104346330B (en) | 2013-07-23 | 2013-07-23 | A kind of method and device of data initialization |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310311344.XA CN104346330B (en) | 2013-07-23 | 2013-07-23 | A kind of method and device of data initialization |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104346330A CN104346330A (en) | 2015-02-11 |
CN104346330B true CN104346330B (en) | 2018-02-02 |
Family
ID=52501962
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310311344.XA Active CN104346330B (en) | 2013-07-23 | 2013-07-23 | A kind of method and device of data initialization |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104346330B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003058554A (en) * | 2001-08-10 | 2003-02-28 | Shimizu Corp | Technical information storing and answering system |
CN101150822A (en) * | 2006-09-18 | 2008-03-26 | 上海欣泰通信技术有限公司 | A method for telecommunication operator to collect user numbers |
CN101923576A (en) * | 2010-08-31 | 2010-12-22 | 北京云快线软件服务有限公司 | System for dynamically querying bandwidth data |
JP2012014613A (en) * | 2010-07-05 | 2012-01-19 | Kadokawa Group Publishing Co Ltd | Terminal, information processing method, and program |
CN102609786A (en) * | 2012-01-18 | 2012-07-25 | 广州市动景计算机科技有限公司 | Method and device for forecasting whether user is off network |
CN103002329A (en) * | 2012-12-03 | 2013-03-27 | 合一网络技术(北京)有限公司 | Device and method for predicting reach-frequency table data of network video advertisements |
-
2013
- 2013-07-23 CN CN201310311344.XA patent/CN104346330B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2003058554A (en) * | 2001-08-10 | 2003-02-28 | Shimizu Corp | Technical information storing and answering system |
CN101150822A (en) * | 2006-09-18 | 2008-03-26 | 上海欣泰通信技术有限公司 | A method for telecommunication operator to collect user numbers |
JP2012014613A (en) * | 2010-07-05 | 2012-01-19 | Kadokawa Group Publishing Co Ltd | Terminal, information processing method, and program |
CN101923576A (en) * | 2010-08-31 | 2010-12-22 | 北京云快线软件服务有限公司 | System for dynamically querying bandwidth data |
CN102609786A (en) * | 2012-01-18 | 2012-07-25 | 广州市动景计算机科技有限公司 | Method and device for forecasting whether user is off network |
CN103002329A (en) * | 2012-12-03 | 2013-03-27 | 合一网络技术(北京)有限公司 | Device and method for predicting reach-frequency table data of network video advertisements |
Also Published As
Publication number | Publication date |
---|---|
CN104346330A (en) | 2015-02-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106547784B (en) | Data splitting and storing method and device | |
JP6725155B2 (en) | Method and system for identifying unique mobile devices based on changes in mobile device attributes over time | |
CN106899426B (en) | User access number statistical method and system thereof | |
WO2020211497A1 (en) | Method, system, apparatus and device for storing personal asset change record | |
CN110333951B (en) | Commodity purchase request distribution method | |
CN105303403A (en) | Method of issuing coupon and system | |
CN107346463B (en) | Method and device for training risk control model and determining model input data | |
CN106485566A (en) | A kind of information recommendation method and device | |
JP2015511036A (en) | Method and apparatus for determining redirection quality and method and apparatus for placing promotional information | |
US20150039418A1 (en) | Content item distribution based on user interactions | |
CN109657427A (en) | The method and device of permission control | |
TW202020767A (en) | Recording and inquiring method, device and electronic device for bill installment event | |
CN106909567B (en) | Data processing method and device | |
CN110442598A (en) | A kind of data query method and apparatus | |
CN105138897B (en) | Determine the method and device of user right | |
CN104346330B (en) | A kind of method and device of data initialization | |
CN111143546A (en) | Method and device for obtaining recommendation language and electronic equipment | |
CN109933759B (en) | Statistical data table generation method and device | |
JP6649502B2 (en) | System and method for resolving conflicts in order management of data products | |
US9230022B1 (en) | Customizable result sets for application program interfaces | |
CN106886546B (en) | Construction method and equipment of data website | |
CN108984572A (en) | Site information method for pushing and device | |
US10536458B2 (en) | Method and apparatus for managing a transaction right | |
CN111159654A (en) | Block chain-based digital album retail method, equipment and medium | |
CN106708845A (en) | Data processing method and device for Internet account |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20191209 Address after: P.O. Box 31119, grand exhibition hall, hibiscus street, 802 West Bay Road, Grand Cayman, Cayman Islands Patentee after: Innovative advanced technology Co., Ltd Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands Patentee before: Alibaba Group Holding Co., Ltd. |