Summary of the invention
For the problem that the statistical efficiency of rating duration in correlation technique is low, not yet propose effective solution at present, for this reason, main purpose of the present invention is the acquisition methods and the acquisition device that provide a kind of rating duration, to solve the problem.
To achieve these goals, according to an aspect of the present invention, provide a kind of acquisition methods of rating duration, this acquisition methods comprises: receive the acquisition request obtaining rating duration, and wherein, the request of acquisition comprises the object time section of rating duration to be obtained; Obtain all time slices in object time section, wherein, time slice is split according to the viewing time of default granularity to user the time period obtained; The quantity of timing statistics fragment, obtains the rating duration of object time section.
Further, all time slices obtained in object time section comprise: the viewing behavior data reading in object time section all users that there is viewing behavior from database, and wherein, viewing behavior data comprise the viewing time of user; Split according to the viewing time of default granularity to user, obtain time slice.
Further, preset the unit of granularity and comprise one of the following: minute, second and millisecond.
Further, the quantity of timing statistics fragment, the rating duration obtaining object time section comprises: for each time slice arranges an identifier; The sum of statistics identifier, obtains the rating duration of object time section.
Further, the sum of statistics identifier, the rating duration obtaining object time section comprises: the total n obtaining the identifier of all time slices in object time section; According to following formulae discovery rating duration L, wherein, formula is: L=n × c, c are time period corresponding to default granularity.
To achieve these goals, according to a further aspect in the invention, a kind of acquisition device of rating duration is provided, this acquisition device comprises: receiver module, for receiving the acquisition request obtaining rating duration, wherein, the request of acquisition comprises the object time section of rating duration to be obtained; First acquisition module, for obtaining all time slices in object time section, wherein, time slice is split according to the viewing time of default granularity to user the time period obtained; Statistical module, for the quantity of timing statistics fragment, obtains the rating duration of object time section.
Further, the first acquisition module comprises: read module, and for reading in object time section the viewing behavior data of all users that there is viewing behavior from database, wherein, viewing behavior data comprise the viewing time of user; Segmentation module, for splitting according to the viewing time of default granularity to user, obtains time slice.
Further, preset the unit of granularity and comprise one of the following: minute, second and millisecond.
Further, statistical module comprises: arrange module, for arranging an identifier for each time slice; Statistics submodule, for adding up the sum of identifier, obtains the rating duration of object time section.
Further, statistics submodule comprises: the second acquisition module, for obtaining the total n of the identifier of all time slices in object time section; Computing module, for according to following formulae discovery rating duration L, wherein, formula is: L=n × c, c are time period corresponding to default granularity.
Adopt the embodiment of the present invention, according to default granularity, segmentation is carried out to the viewing time of user and obtain time slice, after receiving the acquisition request obtaining rating duration, only need add up the sum of the time slice in object time section, the rating duration of object time section can be obtained, without the need to end time of time started and viewing behavior of judging the viewing behavior of user to obtain zero-computing time and to calculate the end time, and deduct obtain the time difference zero-computing time with the calculating end time, again is added the rating duration that just can obtain object time section all time differences, eliminate a large amount of judgements and computational process, especially when data volume is larger, the statistical efficiency of rating duration can be improved.By the above embodiment of the present invention, solve the problem that the statistical efficiency of rating duration in prior art is low, achieve the effect of the statistical efficiency improving rating duration.
Embodiment
First, the part noun occurred in the process be described the embodiment of the present invention or term are applicable to description below:
Rating duration: in specific time period, all viewing time sums that there is the user of viewing behavior.
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 specification 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 as embodiments of the invention described herein can with except here diagram or describe those except order implement.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.
Fig. 2 is the flow chart of the acquisition methods of rating duration according to the embodiment of the present invention, and this acquisition methods comprises the steps: as shown in Figure 2
Step S202, receives the acquisition request obtaining rating duration.
Wherein, the object time section that request comprises rating duration to be obtained is obtained.
Step S204, obtains all time slices in object time section.
Wherein, time slice is split according to the viewing time of default granularity to user the time period obtained, and the viewing time of user is the duration of the viewing behavior of user, and e.g., user uses IPTV to watch the duration of TV programme.
Step S206, the quantity of timing statistics fragment, obtains the rating duration of object time section.
Adopt the embodiment of the present invention, according to default granularity, segmentation is carried out to the viewing time of user and obtain time slice, after receiving the acquisition request obtaining rating duration, only need add up the sum of the time slice in object time section, the rating duration of object time section can be obtained, without the need to end time of time started and viewing behavior of judging the viewing behavior of user to obtain zero-computing time and to calculate the end time, and deduct obtain the time difference zero-computing time with the calculating end time, again is added the rating duration that just can obtain object time section all time differences, eliminate a large amount of judgements and computational process, especially when data volume is larger, the statistical efficiency of rating duration can be improved.By the above embodiment of the present invention, solve the problem that the statistical efficiency of rating duration in prior art is low, achieve the effect of the statistical efficiency improving rating duration.
According to the above embodiment of the present invention, the all time slices obtained in object time section can comprise: the viewing behavior data reading in object time section all users that there is viewing behavior from database, wherein, viewing behavior data comprise the viewing time of user; Split according to the viewing time of default granularity to user, obtain time slice.
Particularly, the viewing behavior data of all users that there is viewing behavior are read in object time section from database, the viewing time of all users that there is viewing behavior in object time section is obtained from the viewing behavior data read, then split according to the viewing time of default granularity to this all user, obtain all time slices in object time section.
Such as, object time section is 9:00 to 10:00, user A brings into use IPTV to watch news program from 8:50, and stop using IPTV at 9:30, user B brings into use IPTV to watch entertainment at 9:15, and stopping using IPTV at 10:10, user C brings into use IPTV to watch TV play at 8:00, and stops using IPTV at 8:50.According to the above embodiment of the present invention, the viewing time of the viewing behavior of user C not in object time section, without the need to reading the viewing behavior data of user C from database.To add up the rating duration in this object time section, the viewing behavior data of user A and the viewing behavior data of user B are read from database, and from the viewing behavior data of user A and the viewing behavior data of user B, obtain the viewing time (i.e. 8:50 to 9:30) of user A and the viewing time (i.e. 9:15 to 10:10) of user B, then split according to the viewing time of default granularity to the viewing time of user A and user B, obtain the time slice of user A in object time section (i.e. the time slice of the viewing time of user A between 9:00 to 9:30) and the time slice of user B in object time section (i.e. the time slice of the viewing time of user B between 9:15 to 10:00), by the time slice of user A in object time section and user B, the time slice in object time section is added, namely all time slices in object time section are obtained.
Pass through the above embodiment of the present invention, can only split the viewing time of the user meeting object time section, without the need to processing the viewing time of the whole users in database, can reduce to need data volume to be processed, shorten the time of acquisition time fragment, improve the acquisition efficiency of rating duration.
In the above embodiment of the present invention, preset the unit of granularity and can comprise one of following unit: minute, second and millisecond.
Particularly, default granularity can be 10 minutes, 5 minutes, 1 minute, 10 seconds, 5 seconds, 1 second, 10 milliseconds, 5 milliseconds and 1 millisecond etc.
State on the invention in embodiment, the precision of the rating duration got can be adjusted by different default granularities, when not needing point-device statistics, select larger default granularity (as, 10 minutes), the processing time of the segmentation of the viewing time to user can be shortened, thus improve the acquisition efficiency of rating duration.When the accurate statistics of needs, less default granularity (e.g., 10 milliseconds) can be selected, ensure that the precision of the rating duration got meets required precision.
According to the above embodiment of the present invention, the quantity of timing statistics fragment, the rating duration obtaining object time section can comprise: for each time slice arranges an identifier; The sum of statistics identifier, obtains the rating duration of object time section.
Wherein, the identifier of each time slice can be identical, also can be different.
Particularly, for each time slice arranges an identifier, when the quantity of timing statistics fragment, only need add up the sum of identifier, make statistics more convenient and swift.
In above-described embodiment, by arranging identifier, the quantity of all time slices in object time section can be obtained easily, improving the efficiency of the rating duration obtained in object time section.
Fig. 3 is the flow chart of the acquisition methods of a kind of optional rating duration according to the embodiment of the present invention.Below for one second as default granularity, composition graphs 3 introduces above-described embodiment in detail.As shown in Figure 3, the method can comprise the steps:
Step S302, arranges an identifier (i.e. Viewcount) to the time started of the viewing behavior of all users in object time section.
Wherein, the viewing time of user comprises the time started of the viewing behavior of user and the end time of viewing behavior, and the viewing time as user is 8:50 to 9:30, then the time started of viewing behavior is 8:50, and the end time of viewing behavior is 9:30.
Step S304, each second after the time started of viewing behavior all arranges an identifier, till the end time of the viewing behavior of user.
Wherein, each identifier can be identical.
Step S306, the sum of all identifiers in statistics object time section, obtains the rating duration in object time section according to the sum of all identifiers.
Particularly, after getting the viewing time of all users that there is viewing behavior in object time section, an identifier Viewcount is arranged to the time started of the viewing behavior of the user in this viewing time, and each second after the time started of the viewing behavior of user all arranges an identifier Viewcount, till the end time of the viewing behavior of user, terminate this setting; The sum (sum of the identifier namely in above-described embodiment) of identifier Viewcount in statistics object time section, the result of gained is numerical value corresponding to rating duration in object time section, and this rating duration in seconds.
In the above embodiment of the present invention, the sum of statistics identifier, the rating duration obtaining object time section can comprise: the total n obtaining the identifier of all time slices in object time section; According to following formulae discovery rating duration L, wherein, formula is: L=n × c, c are time period corresponding to default granularity.
Particularly, the sum of the identifier of all time slices in object time section got is multiplied by time period corresponding to default granularity, acquired results is numerical value corresponding to rating duration in this object time section, and this rating duration is in units of the unit of default granularity.
Pass through the above embodiment of the present invention, without the need to end time of time started and viewing behavior of judging the viewing behavior of user to obtain zero-computing time and to calculate the end time, and deduct obtain the time difference zero-computing time with the calculating end time, again is added the rating duration that just can obtain object time section all time differences, eliminate a large amount of judgements and computational process, the rating duration in object time section can be obtained, especially, when data volume is larger, the statistical efficiency of rating duration can be improved.
It should be noted that, can perform in the computer system of such as one group of computer executable instructions in the step shown in the flow chart of accompanying drawing, and, although show logical order in flow charts, but in some cases, can be different from the step shown or described by order execution herein.
Fig. 4 is the schematic diagram of the acquisition device of rating duration according to the embodiment of the present invention, and as shown in Figure 4, this acquisition device can comprise: receiver module 10, first acquisition module 30 and statistical module 50.
Wherein, receiver module 10 obtains the acquisition request of rating duration for receiving, and wherein, the request of acquisition comprises the object time section of rating duration to be obtained; First acquisition module 30 is for obtaining all time slices in object time section, and wherein, time slice is split according to the viewing time of default granularity to user the time period obtained; Statistical module 50, for the quantity of timing statistics fragment, obtains the rating duration of object time section.
Wherein, the viewing time of user is the duration of the viewing behavior of user, and e.g., user uses IPTV to watch the duration of TV programme.
Adopt the embodiment of the present invention, according to default granularity, segmentation is carried out to the viewing time of user and obtain time slice, after receiving the acquisition request obtaining rating duration, only need add up the sum of the time slice in object time section, the rating duration of object time section can be obtained, without the need to end time of time started and viewing behavior of judging the viewing behavior of user to obtain zero-computing time and to calculate the end time, and deduct obtain the time difference zero-computing time with the calculating end time, again is added the rating duration that just can obtain object time section all time differences, eliminate a large amount of judgements and computational process, especially when data volume is larger, the statistical efficiency of rating duration can be improved.By the above embodiment of the present invention, solve the problem that the statistical efficiency of rating duration in prior art is low, achieve the effect of the statistical efficiency improving rating duration.
According to the above embodiment of the present invention, first acquisition module can comprise: read module, for reading in object time section the viewing behavior data of all users that there is viewing behavior from database, wherein, viewing behavior data comprise the viewing time of user; Segmentation module, for splitting according to the viewing time of default granularity to user, obtains time slice.
Particularly, the viewing behavior data of all users that there is viewing behavior are read in object time section from database, the viewing time of all users that there is viewing behavior in object time section is obtained from the viewing behavior data read, then split according to the viewing time of default granularity to this all user, obtain all time slices in object time section.
Pass through the above embodiment of the present invention, can only split the viewing time of the user meeting object time section, without the need to processing the viewing time of the whole users in database, can reduce to need data volume to be processed, shorten the time of acquisition time fragment, improve the acquisition efficiency of rating duration.
In the above-described embodiments, preset the unit of granularity and can comprise one of the following: minute, second and millisecond.
Particularly, default granularity can be 10 minutes, 5 minutes, 1 minute, 10 seconds, 5 seconds, 1 second, 10 milliseconds, 5 milliseconds and 1 millisecond etc.
State on the invention in embodiment, the precision of the rating duration got can be adjusted by different default granularities, when not needing point-device statistics, select larger default granularity (as, 10 minutes), the processing time of the segmentation of the viewing time to user can be shortened, thus improve the acquisition efficiency of rating duration.When the accurate statistics of needs, less default granularity (e.g., 10 milliseconds) can be selected, ensure that the precision of the rating duration got meets required precision.
According to the above embodiment of the present invention, statistical module can comprise: arrange module, for arranging an identifier for each time slice; Statistics submodule, for adding up the sum of identifier, obtains the rating duration of object time section.
Wherein, the identifier of each time slice can be identical, also can be different.
Particularly, for each time slice arranges an identifier, when the quantity of timing statistics fragment, only need add up the sum of identifier, make statistics more convenient and swift.
In above-described embodiment, by arranging identifier, the quantity of all time slices in object time section can be obtained easily, improving the efficiency of the rating duration obtained in object time section.
In the above-described embodiments, statistics submodule can comprise: the second acquisition module, for obtaining the total n of the identifier of all time slices in object time section; Computing module, for according to following formulae discovery rating duration L, wherein, formula is: L=n × c, c are time period corresponding to default granularity.
Particularly, the sum of the identifier of all time slices in object time section got is multiplied by time period corresponding to default granularity, acquired results is numerical value corresponding to rating duration in this object time section, and this rating duration is in units of the unit of default granularity.
Pass through the above embodiment of the present invention, without the need to end time of time started and viewing behavior of judging the viewing behavior of user to obtain zero-computing time and to calculate the end time, and deduct obtain the time difference zero-computing time with the calculating end time, again is added the rating duration that just can obtain object time section all time differences, eliminate a large amount of judgements and computational process, the rating duration in object time section can be obtained, especially, when data volume is larger, the statistical efficiency of rating duration can be improved.
The modules provided in the present embodiment is identical with the using method that the corresponding step of embodiment of the method provides, application scenarios also can be identical.It is noted, of course, that the scheme that above-mentioned module relates to can be not limited to content in embodiment of the method and scene, and above-mentioned module may operate in terminal or mobile terminal, can pass through software or hardware implementing.
As can be seen from the above description, present invention achieves following technique effect:
Adopt the embodiment of the present invention, according to default granularity, segmentation is carried out to the viewing time of user and obtain time slice, after receiving the acquisition request obtaining rating duration, only need add up the sum of the time slice in object time section, the rating duration of object time section can be obtained, without the need to end time of time started and viewing behavior of judging the viewing behavior of user to obtain zero-computing time and to calculate the end time, and deduct obtain the time difference zero-computing time with the calculating end time, again is added the rating duration that just can obtain object time section all time differences, eliminate a large amount of judgements and computational process, especially when data volume is larger, the statistical efficiency of rating duration can be improved.By the above embodiment of the present invention, solve the problem that the statistical efficiency of rating duration in prior art is low, achieve the effect of the statistical efficiency improving rating duration.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on network that multiple calculation element forms, alternatively, they can realize with the executable program code of calculation element, thus, they can be stored and be performed by calculation element in the storage device, or they are made into each integrated circuit modules respectively, or the multiple module in them or step are made into single integrated circuit module to realize.Like this, the present invention is not restricted to any specific hardware and software combination.
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.