Summary of the invention
Fundamental purpose of the present invention is to provide a kind of data processing method and device, to solve in prior art the problem of looking for the status data efficiency comparison that matches with representation of data low.
To achieve these goals, according to an aspect of the embodiment of the present invention, a kind of data processing method is provided.Data processing method according to the present invention comprises: obtain the performance time to be matched corresponding to representation of data to be found; To status data table, the associated data associated with representation of data table in the associated data table obtained is divided into groups, and wherein, each grouped record has status data and the representation of data of same advertisement major key; Obtain many associated datas corresponding with the described performance time to be matched, wherein, every bar associated data comprises the bar state data in described status data table and a representation of data in described representation of data table; Calculate the state for time in described every bar associated data and the interval of performance time one by one, obtain minimum spacing value; And using the status data in an associated data corresponding to described minimum spacing value as the data corresponding with the described performance time to be matched.
Further, to associate before the associated data in the associated data table obtained divides into groups with representation of data table to status data table, described data processing method also comprises: obtain described status data table and described representation of data table; Extract the advertisement major key in the advertisement major key of described status data table and described representation of data table; Successively the every bar state data in described status data table are associated with every bar representation of data of status data same advertisement major key with having in described representation of data table, obtain associated data table, wherein, the every bar associated data in described associated data table all comprises status data and representation of data.
Further, the associated data associated with representation of data table status data table in the associated data table obtained is carried out grouping and is comprised: extract the associated data with identical described advertisement major key; To the associated data of identical described performance time be belonged to as a grouping in the associated data extracted.
Further, calculate the state for time in described every bar associated data and the interval of performance time one by one, obtain minimum spacing value and comprise: judge that whether described state for time is early than the described performance time; If described state for time is early than the described performance time, then recording in described associated data with the state major key corresponding to described state for time is negative value, and wherein, described state major key is state major key corresponding with described state for time in described associated data table; If described state for time is later than the described performance time, then record in described associated data with the state major key corresponding to described state for time on the occasion of; Minimum value is searched in the state major key of record; And using the state major key in the described associated data table corresponding to the absolute value of minimum value that finds as described minimum spacing value.
Further, before obtaining the performance time to be matched corresponding to representation of data to be found, described data processing method also comprises: obtain the first state for time of the first status data in described status data table and the first state major key corresponding with described first status data; Obtain the second state for time and the second state major key of the second status data be inserted in described status data table; Judge that whether described second state for time is early than described first state for time; If described second state for time is early than described first state for time, then the second state major key of described second status data is adjusted to described first state major key, and the first state major key of described first status data is adjusted to described second state major key; If described second state for time is later than described first state for time, then the state major key of described second status data is set to described second state major key.
To achieve these goals, according to the another aspect of the embodiment of the present invention, provide a kind of data processing equipment.Data processing equipment according to the present invention comprises: the first acquiring unit, for obtaining the performance time to be matched corresponding to representation of data to be found; Grouped element, divide into groups for the associated data associated with representation of data table status data table in the associated data table that obtains, and wherein, each grouped record has status data and the representation of data of same advertisement major key; Second acquisition unit, for obtaining many associated datas corresponding with the described performance time to be matched, wherein, every bar associated data comprises the bar state data in described status data table and a representation of data in described representation of data table; Computing unit, for calculating the interval of state for time in described every bar associated data and performance time one by one, obtains minimum spacing value; And determining unit, for using the status data in an associated data corresponding to described minimum spacing value as the data corresponding with the described performance time to be matched.
Further, described data processing equipment also comprises: the 3rd acquiring unit, for associate before the associated data in the associated data table obtained divides into groups with representation of data table to status data table, obtains described status data table and described representation of data table; Extraction unit, for extracting the advertisement major key in the advertisement major key of described status data table and described representation of data table; Associative cell, for successively the advertisement major key in described status data table being associated with every bar representation of data in described representation of data table with same advertisement major key, obtain associated data table, wherein, the every bar associated data in described associated data table all comprises status data and representation of data.
Further, described grouped element comprises: extraction module, for extracting the associated data with identical described advertisement major key; Determination module, for will belonging to the associated data of identical described performance time as a grouping in the associated data extracted.
Further, described computing unit comprises: judge module, for judging that whether described state for time is early than the described performance time; Logging modle, for when described state for time is early than the described performance time, recording in described associated data with the state major key corresponding to described state for time is negative value; When described state for time is later than the described performance time, record in described associated data with the state major key corresponding to described state for time on the occasion of, wherein, described state major key is state major key corresponding with described state for time in described associated data table; Search module, for searching minimum value in the state major key of record; And determination module, for the state major key in the described associated data table corresponding to the absolute value of minimum value that will find as described minimum spacing value.
Further, described data processing equipment also comprises: the 4th acquiring unit, for before obtaining the performance time to be matched corresponding to representation of data to be found, obtain the first state for time of the first status data in described status data table and the first state major key corresponding with described first status data; 5th acquiring unit, for obtaining the second state for time and the second state major key of the second status data be inserted in described status data table; Judging unit, for judging that whether described second state for time is early than described first state for time; Adjustment unit, for when described second state for time is early than described first state for time, second state major key of described second status data is adjusted to described first state major key, and the first state major key of described first status data is adjusted to described second state major key; When described second state for time is later than described first state for time, the state major key of described second status data is set to described second state major key.
According to inventive embodiments, after representation of data table is associated with status data table, do not need his-and-hers watches current between carry out sorting to search and the data corresponding to the performance time to be matched, but by judging that the time interval of performance time in same associated data and state for time judges that the status data in which bar associated data is the data corresponding with the performance time to be matched, because the performance of sequence is lower, the efficiency of coupling can be reduced, and the present embodiment does not carry out sequence just can obtain matching result, solve in prior art the problem of looking for the status data efficiency comparison that matches with representation of data low, reach the effect improving search efficiency.
Embodiment
It should be noted that, when not conflicting, the embodiment in the application and the feature in embodiment can combine mutually.Below with reference to the accompanying drawings and describe the present invention in detail in conjunction with the embodiments.
The present invention program is understood better in order to make those skilled in the art person, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the embodiment of a part of the present invention, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, should belong to the scope of protection of the invention.
It should be noted that, term " first ", " second " etc. in instructions of the present invention and claims and above-mentioned accompanying drawing are for distinguishing similar object, and need not be used for describing specific order or precedence.Should be appreciated that the data used like this can be exchanged, in the appropriate case so that embodiments of the invention described herein.In addition, term " comprises " and " having " and their any distortion, intention is to cover not exclusive comprising, such as, contain those steps or unit that the process of series of steps or unit, method, system, product or equipment is not necessarily limited to clearly list, but can comprise clearly do not list or for intrinsic other step of these processes, method, product or equipment or unit.
Embodiments provide a kind of data processing method.This data processing method can be used in the Data processing of monitoring of the advertisement.Advertisement monitored by usual employing status data table and representation of data table, have recorded the status attribute of ad data, the time of the change of this state, the mark etc. of every bar state in status data table, the representation of data table record performance attribute of advertisement, record the time of this performance attribute and the mark etc. of every bar representation of data.When carrying out monitoring of the advertisement, need to search the status data corresponding with this representation of data according to representation of data, with bonding state data and representation of data, advertisement is analyzed, the present embodiment may be used for searching the status data corresponding with representation of data, to solve in prior art the low problem of the efficiency comparison of searching the status data corresponding with representation of data.
Fig. 1 is the process flow diagram of the data processing method according to the embodiment of the present invention.As shown in Figure 1, to comprise step as follows for this data processing method:
Step S102, obtains the performance time to be matched corresponding to representation of data to be found;
Step S104, to status data table, the associated data associated with representation of data table in the associated data table obtained is divided into groups, and wherein, each grouped record has status data and the representation of data of same advertisement major key;
Step S106, obtains many associated datas corresponding with the performance time to be matched, and wherein, every bar associated data comprises the bar state data in status data table and a representation of data in representation of data table;
Step S108, calculates the state for time in every bar associated data and the interval of performance time one by one, obtains minimum spacing value;
Step S110, using the status data in the associated data of corresponding to minimum spacing value as the data corresponding with the performance time to be matched.
Status data table is as shown in table 1, and representation of data table is as shown in table 2, associates with representation of data table status data table, obtains the associated data table shown in table 3.As shown in table 1, every bar state data in status data table 1 comprise state major key, advertisement major key, state for time, attribute 1 and attribute 2, as shown in table 2, the every bar representation of data in representation of data table comprises performance major key, advertisement major key, performance time, index 1 and index 2.
Table 1 status data table
State major key |
Advertisement major key |
State for time |
Attribute 1 |
Attribute 2 |
1 |
3 |
2014-1-1 |
Aaaa |
Bbbb |
2 |
3 |
2014-1-10 |
Aaaa |
Cccc |
Table 2 representation of data table
Performance major key |
Advertisement major key |
The performance time |
Index 1 |
Index 2 |
1 |
3 |
2014-1-1 |
100 |
50 |
2 |
3 |
2014-1-11 |
200 |
150 |
Table 3 associated data table
As shown in table 3, each row of data in associated data table all comprises the status data and representation of data with same advertisement major key, the associated data corresponding with the time to be matched is searched in associated data table, and calculate the time interval of performance time each and to be matched corresponding associated data one by one, and using minimum for time interval value associated data as the status data with performance time match to be matched.
Such as, performance time 2014-1-11 to be matched, the two article data corresponding with this time are the 2nd article of associated data in associated data table and the 3rd article of associated data respectively, article 2, the state for time of associated data is 2014-1-10, article 3, the state for time of associated data is 2014-1-1, article 2, associated data state for time and performance the time interval there is minimum spacing value, the data of status data corresponding to the performance time to be matched then in the 2nd article of associated data, as attribute 1Aaaa and attribute 2Cccc.
Pass through above-described embodiment, after representation of data table is associated with status data table, do not need his-and-hers watches current between carry out sorting to search and the data corresponding to the performance time to be matched, but by judging that the time interval of performance time in same associated data and state for time judges that the status data in which bar associated data is the data corresponding with the performance time to be matched, because the performance of sequence is lower, the efficiency of coupling can be reduced, and the present embodiment does not carry out sequence just can obtain matching result, solve in prior art the problem of looking for the status data efficiency comparison that matches with representation of data low, reach the effect improving search efficiency.
Particularly, for the ease of the time interval of computing mode time with the performance time, can be calculated by state major key, namely calculate the state for time in every bar associated data and the interval of performance time one by one, obtain minimum spacing value and comprise: judge that whether state for time is early than the performance time; If state for time is early than the performance time, then recording in associated data with the state major key corresponding to state for time is negative value, and wherein, state major key is state major key corresponding with state for time in associated data table; If state for time is later than the performance time, then the state major key corresponding to the recording status time be on the occasion of; Minimum value is searched in the state major key of record; And to the state major key in the associated data table corresponding to the absolute value of the minimum value found as minimum spacing value.
State for time 2014-1-10 is early than performance time 2014-1-11, this state major key corresponding to bar state data is-2, state for time 2014-1-1 is early than performance time 2014-1-11, this state major key corresponding to bar state data is-1, wherein,-2 are less than-1, therefore-2 corresponding to absolute value 2 associated data in status data be then data corresponding to performance time to be matched, as the data of attribute 1Aaaa and attribute 2Cccc corresponding to the performance time to be matched.
Preferably, in order to ensure that the time interval calculated according to state major key accurately can embody state for time order sooner or later, when adding data in status data table, state for time is comparatively early that the value of state major key corresponding to data is also less, namely before obtaining the performance time to be matched corresponding to representation of data to be found, data processing method also comprises: obtain the first state for time of the first status data in status data table and the first state major key corresponding with the first status data; Obtain the second state for time and the second state major key of the second status data be inserted in status data table; Judge that whether the second state for time is early than the first state for time; If the second state for time is early than the first state for time, then the second state major key of the second status data is adjusted to the first state major key, and the first state major key of the first status data is adjusted to the second state major key; If the second state for time is later than the first state for time, then the state major key of the second status data is set to the second state major key.
If insert bar state data in the status data table of such as table 4, the change time of this status data is 2014-1-1, the attribute 1 of advertisement major key corresponding to the status data of 3 is Aaaa, attribute 2 is Bbbb, when inserting these bar state data to table 4, judge that the time of the time 2014-1-1 of the status data be inserted into is early than the state for time 2014-1-10 in table 4, and the state major key in table 4 is 1, therefore, when the status data by state for time being 2014-1-1 is inserted into table 4, be that the state major key of 2014-1-1 is adjusted to 1 by state for time, the state major key being the status data of 1 by previous status major key in table 4 is adjusted to 2, the result of data inserting is as shown in table 1.
Table 4
State major key |
Advertisement major key |
State for time |
Attribute 1 |
Attribute 2 |
1 |
3 |
2014-1-10 |
Aaaa |
Cccc |
Particularly, associating with representation of data table status data table before the associated data in the associated data table obtained divides into groups, status data table being associated with representation of data table, namely obtains status data table and representation of data table; Extract the advertisement major key in the advertisement major key of status data table and representation of data table; Successively the every bar state data in status data table are associated with every bar representation of data of status data same advertisement major key with having in representation of data table, obtain associated data table, wherein, the every bar associated data in associated data table all comprises status data and representation of data.
The data with same advertisement major key are extracted from status data table and representation of data table, as shown in Table 1 and Table 2, when associating, the 1st article of data in table 1 associate with the 2nd article of data with article data of the 1st in table 2 successively, the 2nd article of data in table 1 associate with the 2nd article of data with article data of the 1st in table 2 successively, obtain associated data table as shown in table 3, obtain 4 data, status data and representation of data is all comprised in every bar data, in associated data table, every bar associated data all comprises the content in status data table in every bar state data, also comprise the content of every bar representation of data in representation of data table, owing to associating according to advertisement major key with during status data table in association performance tables of data, a row advertisement major key is only had in associated data table.
Particularly, the associated data associated with representation of data table status data table in the associated data table obtained is carried out grouping and is comprised: extract the associated data with same advertisement major key; To the associated data of identical performance time be belonged to as a grouping in the associated data extracted.
As shown in table 3, extract the associated data with same advertisement major key, and find the data of the performance time identical with the performance time to be matched, data corresponding with 2014-1-11 in table 3 are the 2nd article of data and the 3rd article of data in table 3, the 2nd article of data then in table 3 and the 3rd article of data are as a group, data corresponding with 2014-1-1 in table 3 are the 1st article of data in table 3 and the 4th article of data, then the 1st article of data in table 3 and the 4th article of data are as one group.
Pass through above-described embodiment, after representation of data table is associated with status data table, to belong to identical table current between associated data as a grouping, data during one identical with the performance time to be matched is divided into groups are calculated, calculate the time interval of performance time in every bar associated data and state for time, using the associated data that has compared with small time intervals as the data corresponding to the performance time to be matched, owing to avoiding the lower sequencer procedure of performance, solve in prior art the problem of looking for the status data efficiency comparison that matches with representation of data low, reach the effect improving search efficiency.
The embodiment of the present invention additionally provides a kind of data processing equipment.The data processing equipment of this embodiment of the present invention may be used for performing the data processing method that the embodiment of the present invention provides, and the data processing equipment that the data processing method of the embodiment of the present invention also can be provided by the embodiment of the present invention performs.
Fig. 2 is the schematic diagram of the data processing equipment according to the embodiment of the present invention.As shown in Figure 2, this data processing equipment comprises: the first acquiring unit 10, grouped element 20, second acquisition unit 30, computing unit 40 and determining unit 50.Wherein:
First acquiring unit 10 is for obtaining the performance time to be matched corresponding to representation of data to be found;
Grouped element 20 divides into groups for the associated data associated with representation of data table status data table in the associated data table that obtains, and wherein, each grouped record has status data and the representation of data of same advertisement major key;
Second acquisition unit 30 is for obtaining many associated datas corresponding with the performance time to be matched, and wherein, every bar associated data comprises the bar state data in status data table and a representation of data in representation of data table;
Computing unit 40, for calculating the interval of state for time in every bar associated data and performance time one by one, obtains minimum spacing value; And
Determining unit 50 for using the status data in the associated data of corresponding to minimum spacing value as the data corresponding with the performance time to be matched.
Status data table is as shown in table 1, and representation of data table is as shown in table 2, associates with representation of data table status data table, obtains the associated data table shown in table 3.
As shown in table 3, each row of data in associated data table all comprises the status data and representation of data with same advertisement major key, the associated data corresponding with the time to be matched is searched in associated data table, and calculate the time interval of performance time each and to be matched corresponding associated data one by one, and using minimum for time interval value associated data as the status data with performance time match to be matched.
Such as, performance time 2014-1-11 to be matched, the two article data corresponding with this time are the 2nd article of associated data in associated data table and the 3rd article of associated data respectively, article 2, the state for time of associated data is 2014-1-10, article 3, the state for time of associated data is 2014-1-1, article 2, associated data state for time and performance the time interval there is minimum spacing value, the data of status data corresponding to the performance time to be matched then in the 2nd article of associated data, as attribute 1Aaaa and attribute 2Cccc.
Pass through above-described embodiment, after representation of data table is associated with status data table, do not need his-and-hers watches current between carry out sorting to search and the data corresponding to the performance time to be matched, but by judging that the time interval of performance time in same associated data and state for time judges that the status data in which bar associated data is the data corresponding with the performance time to be matched, because the performance of sequence is lower, the efficiency of coupling can be reduced, and the present embodiment does not carry out sequence just can obtain matching result, solve in prior art the problem of looking for the status data efficiency comparison that matches with representation of data low, reach the effect improving search efficiency.
Particularly, for the ease of the time interval of computing mode time with the performance time, can be calculated by state major key, namely computing unit comprises: judge module, for judging that whether state for time is early than the performance time; Logging modle, for when state for time is early than the performance time, the state major key corresponding to the recording status time is negative value; When state for time is later than the performance time, the state major key corresponding to the recording status time be on the occasion of; Search module, for searching minimum value in the state major key of record; And determination module, for the state major key in the associated data table corresponding to the absolute value of minimum value that will find as minimum spacing value.
State for time 2014-1-10 is early than performance time 2014-1-11, this state major key corresponding to bar state data is-2, state for time 2014-1-1 is early than performance time 2014-1-11, this state major key corresponding to bar state data is-1, wherein,-2 are less than-1, therefore-2 corresponding to absolute value 2 associated data in status data be then data corresponding to performance time to be matched, as the data of attribute 1Aaaa and attribute 2Cccc corresponding to the performance time to be matched.
Preferably, in order to ensure that the time interval calculated according to state major key accurately can embody state for time order sooner or later, when adding data in status data table, state for time is comparatively early that the state value gradually corresponding to data is also less, namely data processing equipment also comprises: the 4th acquiring unit, for before obtaining the performance time to be matched corresponding to representation of data to be found, obtain the first state for time of the first status data in status data table and the first state major key corresponding with the first status data; 5th acquiring unit, for obtaining the second state for time and the second state major key of the second status data be inserted in status data table; Judging unit, for judging that whether the second state for time is early than the first state for time; Adjustment unit, for when the second state for time is early than the first state for time, is adjusted to the first state major key by the second state major key of the second status data, and the first state major key of the first status data is adjusted to the second state major key; When the second state for time is later than the first state for time, the state major key of the second status data is set to the second state major key.
If insert bar state data in the status data table of such as table 4, the change time of this status data is 2014-1-1, the attribute 1 of advertisement major key corresponding to the status data of 3 is Aaaa, attribute 2 is Bbbb, when inserting these bar state data to table 4, judge that the time of the time 2014-1-1 of the status data be inserted into is early than the state for time 2014-1-10 in table 4, and the state major key in table 4 is 1, therefore, when the status data by state for time being 2014-1-1 is inserted into table 4, be that the state major key of 2014-1-1 is adjusted to 1 by state for time, the state major key being the status data of 1 by previous status major key in table 4 is adjusted to 2, the result of data inserting is as shown in table 1.
Particularly, status data table is associated with representation of data table, data processing equipment also comprises: the 3rd acquiring unit, for associate before the associated data in the associated data table obtained divides into groups with representation of data table to status data table, obtains status data table and representation of data table; Extraction unit, for extracting the advertisement major key in the advertisement major key of status data table and representation of data table; Associative cell, for successively bar state data every in status data table being associated with every bar representation of data of status data same advertisement major key with having in representation of data table, obtain associated data table, wherein, the every bar associated data in associated data table all comprises status data and representation of data.
The data with same advertisement major key are extracted from status data table and representation of data table, as shown in Table 1 and Table 2, when associating, the 1st article of data in table 1 associate with the 2nd article of data with article data of the 1st in table 2 successively, the 2nd article of data in table 1 associate with the 2nd article of data with article data of the 1st in table 2 successively, obtain associated data table as shown in table 3, obtain 4 data, status data table and representation of data table is all comprised in every bar data, in associated data table, every bar associated data all comprises the content in status data table in every bar state data, also comprise the content of every bar representation of data in representation of data table, owing to associating according to advertisement major key with during status data table in association performance tables of data, a row advertisement major key is only had in associated data table.
Particularly, grouped element comprises: extraction module, for extracting the associated data with same advertisement major key; Determination module, for will belonging to the associated data of identical performance time as a grouping in the associated data extracted.
As shown in table 3, extract the associated data with same advertisement major key, and find the data of the performance time identical with the performance time to be matched, data corresponding with 2014-1-11 in table 3 are the 2nd article of data and the 3rd article of data in table 3, the 2nd article of data then in table 3 and the 3rd article of data are as a group, and the 1st article of data in data bit table 3 corresponding with 2014-1-1 in table 3 and the 4th article of data are as one group.
Pass through above-described embodiment, after representation of data table is associated with status data table, to belong to identical table current between associated data as a grouping, data during one identical with the performance time to be matched is divided into groups are calculated, calculate the time interval of performance time in every bar associated data and state for time, using the associated data that has compared with small time intervals as the data corresponding to the performance time to be matched, owing to avoiding the lower sequencer procedure of performance, solve in prior art the problem of looking for the status data efficiency comparison that matches with representation of data low, reach the effect improving search efficiency.
It should be noted that, for aforesaid each embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not by 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 instructions all belongs to preferred embodiment, and involved action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, in certain embodiment, there is no the part described in detail, can see the associated description of other embodiments.
In several embodiments that the application provides, should be understood that, disclosed device, the mode by other realizes.Such as, device embodiment described above is only schematic, the such as division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
If described integrated unit using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprises all or part of step of some instructions in order to make a computer equipment (can be personal computer, mobile terminal, server or the network equipment etc.) perform method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, ROM (read-only memory) (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), portable hard drive, magnetic disc or CD etc. various can be program code stored medium.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.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.