CN113163235A - Method and device for acquiring video watching time length - Google Patents

Method and device for acquiring video watching time length Download PDF

Info

Publication number
CN113163235A
CN113163235A CN202110547086.XA CN202110547086A CN113163235A CN 113163235 A CN113163235 A CN 113163235A CN 202110547086 A CN202110547086 A CN 202110547086A CN 113163235 A CN113163235 A CN 113163235A
Authority
CN
China
Prior art keywords
duration
behavior
watching
viewing
event
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110547086.XA
Other languages
Chinese (zh)
Inventor
黄立超
吴红
张亦弛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan MgtvCom Interactive Entertainment Media Co Ltd
Original Assignee
Hunan MgtvCom Interactive Entertainment Media Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan MgtvCom Interactive Entertainment Media Co Ltd filed Critical Hunan MgtvCom Interactive Entertainment Media Co Ltd
Priority to CN202110547086.XA priority Critical patent/CN113163235A/en
Publication of CN113163235A publication Critical patent/CN113163235A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2407Monitoring of transmitted content, e.g. distribution time, number of downloads
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44204Monitoring of content usage, e.g. the number of times a movie has been viewed, copied or the amount which has been watched

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention provides a method and a device for acquiring video watching time length, wherein the method comprises the following steps: when a viewing behavior message sent by a client is received, judging whether the viewing behavior message is an effective message or not based on a behavior identifier of the viewing behavior message; if the viewing behavior message is an effective message, determining a playing event type corresponding to the viewing behavior message; if the playing event type is a heartbeat event, acquiring a viewing duration corresponding to the heartbeat event in the viewing behavior message; judging whether the watching duration is effective watching duration or not; and if the watching duration is the effective watching duration, acquiring the accumulated watching duration corresponding to the behavior identifier, and adding the accumulated watching duration and the watching duration to obtain the current accumulated watching duration corresponding to the behavior identifier. The method for acquiring the video watching time provided by the invention can ensure the authenticity and the accuracy of the video watching time and provide powerful support for other services depending on the watching time.

Description

Method and device for acquiring video watching time length
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for acquiring a video watching duration.
Background
With the development of internet technology, network video services are also developed vigorously, and more users watch network videos through the internet. In the process of watching the video, the client side can count the time length of watching the video and feed the time length back to a server of a video provider, and the video provider can design a service scheme according to the time length so as to improve the video watching experience of a user.
However, in a scenario where the client counts the viewing duration, the duration from the beginning to the end of the playing of the player is usually calculated, and the duration is taken as the viewing duration, however, the viewing duration is easily forged by a malicious user, and the viewing duration is low in reliability.
Disclosure of Invention
The invention aims to solve the technical problem of providing a method for acquiring the video watching time length, which can ensure the authenticity and the accuracy of the video watching time length.
The invention also provides a device for acquiring the video watching time length, which is used for ensuring the realization and the application of the method in practice.
A method for acquiring video watching time length comprises the following steps:
when a watching behavior message sent by a client is received, judging whether the watching behavior message is an effective message or not based on a behavior identifier in the watching behavior message; the behavior identifier is an identifier generated by the client under the condition that the user plays the video;
if the viewing behavior message is an effective message, determining a playing event type corresponding to the viewing behavior message;
if the playing event type is a heartbeat event, acquiring a viewing duration corresponding to the heartbeat event in the viewing behavior message;
judging whether the watching duration is effective watching duration or not;
and if the watching duration is the effective watching duration, acquiring the accumulated watching duration corresponding to the behavior identifier, and adding the accumulated watching duration and the watching duration to obtain the current accumulated watching duration corresponding to the behavior identifier.
The above method, optionally, further includes:
if the playing event type is a buffering event, obtaining a buffering duration corresponding to the buffering event in the watching behavior message; acquiring the accumulated watching duration corresponding to the behavior identifier;
judging whether the buffering time length is an effective buffering time length or not;
and if the buffering duration is the effective buffering duration, subtracting the buffering duration from the accumulated watching duration to obtain the current accumulated watching duration corresponding to the behavior identifier.
Optionally, in the method, after obtaining the current accumulated viewing duration corresponding to the behavior identifier, the method further includes:
judging whether the watching behavior corresponding to the behavior identification is finished or not;
and if the watching behavior corresponding to the behavior identification is finished, transmitting the current accumulated watching duration to a downstream system through a preset data transmission queue, so that the downstream system provides a recommendation service for the user based on the current accumulated watching duration.
Optionally, the method for determining whether the viewing behavior corresponding to the behavior identifier is ended includes:
judging whether the heartbeat event is the last heartbeat event or not;
judging whether the watching behavior messages of which the playing event types corresponding to the behavior identification are pause events and heartbeat events are not received within a preset time length;
if any judgment result is yes, determining that the watching behavior corresponding to the behavior identification is finished;
and if the two judgment results are negative, determining that the watching behavior corresponding to the behavior identification is not finished.
Optionally, the method for determining whether the viewing duration is an effective viewing duration includes:
judging whether the heartbeat event is a first heartbeat event or not;
determining a time difference value between the current moment and the historical receiving moment under the condition that the heartbeat event is not the first heartbeat event; the historical receiving time is the time of receiving the historical viewing behavior message of the previous heartbeat event of the heartbeat event;
if the time difference is greater than or equal to the watching time length, determining the watching time length as an effective watching time length;
if the time difference is smaller than the watching duration, determining that the watching duration is not the effective watching duration;
and under the condition that the heartbeat event is the first heartbeat event, determining the watching duration to be effective watching duration.
An apparatus for acquiring video watching time length comprises:
the receiving unit is used for judging whether the watching behavior message is an effective message or not based on the behavior identifier in the watching behavior message when the watching behavior message is received; the behavior identifier is an identifier generated by the client side under the condition that the user plays the video;
a determining unit, configured to determine a play event type corresponding to the viewing behavior message if the viewing behavior message is an effective message;
a first obtaining unit, configured to obtain, in the viewing behavior packet, a viewing duration corresponding to the heartbeat event if the play event type is the heartbeat event;
a first judging unit, configured to judge whether the viewing duration is an effective viewing duration;
the first execution unit is configured to, if the viewing duration is an effective viewing duration, obtain an accumulated viewing duration corresponding to the behavior identifier, and add the accumulated viewing duration and the viewing duration to obtain a current accumulated viewing duration corresponding to the behavior identifier.
The above apparatus, optionally, further comprises:
a second obtaining unit, configured to obtain, if the play event type is a buffering event, a buffering duration corresponding to the buffering event in the viewing behavior packet; acquiring the accumulated watching duration corresponding to the behavior identifier;
a second judging unit, configured to judge whether the buffering duration is an effective buffering duration;
and the second execution unit is used for subtracting the buffer duration from the accumulated watching duration to obtain the current accumulated watching duration corresponding to the behavior identifier if the buffer duration is the effective buffer duration.
The above apparatus, optionally, further comprises:
a third judging unit, configured to judge whether the viewing behavior corresponding to the behavior identifier has ended;
and the transmission unit is used for transmitting the current accumulated watching duration to a downstream system through a preset data transmission queue if the watching behavior corresponding to the behavior identifier is finished, so that the downstream system provides a recommendation service for the user based on the current accumulated watching duration.
Optionally, the apparatus described above, wherein the third determining unit includes:
the first judging subunit is configured to judge whether the heartbeat event is the last heartbeat event;
the second judging subunit is configured to judge whether the viewing behavior messages of which the play event types corresponding to the behavior identifiers are pause events and heartbeat events are not received within a preset time length;
a first determining subunit, configured to determine that the viewing behavior corresponding to the behavior identifier has ended if at least one of the determination result of the first determining subunit and the determination result of the second determining subunit is yes;
and the second determining subunit is configured to determine that the viewing behavior corresponding to the behavior identifier is not ended if the determination result of the first determining subunit and the determination result of the second determining subunit are both negative.
Optionally, the apparatus described above, wherein the first determining unit includes:
the third judging subunit is configured to judge whether the heartbeat event is a first heartbeat event;
a third determining subunit, configured to determine, when the heartbeat event is a non-first heartbeat event, a time difference between a current time and a historical receiving time; the historical receiving time is the time of receiving the historical viewing behavior message of the previous heartbeat event of the heartbeat event;
a fourth determining subunit, configured to determine, if the time difference is greater than or equal to the viewing duration, that the viewing duration is an effective viewing duration;
a fifth determining subunit, configured to determine that the viewing duration is not an effective viewing duration if the time difference is smaller than the viewing duration;
a sixth determining subunit, configured to determine, when the heartbeat event is a first heartbeat event, that the viewing duration is an effective viewing duration.
Compared with the prior art, the invention has the following advantages:
the invention provides a method and a device for acquiring video watching time length, wherein the method comprises the following steps: when a watching behavior message sent by a client is received, judging whether the watching behavior message is an effective message or not based on a behavior identifier in the watching behavior message; the behavior identifier is an identifier generated by the client under the condition that the user plays the video; if the viewing behavior message is an effective message, determining a playing event type corresponding to the viewing behavior message; if the playing event type is a heartbeat event, acquiring a viewing duration corresponding to the heartbeat event in the viewing behavior message; judging whether the watching duration is effective watching duration or not; and if the watching duration is the effective watching duration, acquiring the accumulated watching duration corresponding to the behavior identifier, and adding the accumulated watching duration and the watching duration to obtain the current accumulated watching duration corresponding to the behavior identifier. By applying the method for acquiring the video watching time length, the watching time length can be prevented from being forged, the video watching time length of a user can be accurately counted, and the accuracy and the authenticity of the video watching time length can be effectively guaranteed.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for acquiring a video viewing duration according to the present invention;
FIG. 2 is a flow chart of a process for buffering events provided by the present invention;
FIG. 3 is a flowchart of a process for determining whether the viewing duration is valid according to the present invention;
fig. 4 is a flowchart illustrating a method for acquiring a video watching time length according to the present invention;
fig. 5 is a diagram illustrating another flow of a method for acquiring a video watching time length according to the present invention;
fig. 6 is a schematic structural diagram of an apparatus for acquiring video watching time according to the present invention;
fig. 7 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In this application, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The embodiment of the invention provides a method for acquiring video watching duration, which can be applied to electronic equipment, wherein the electronic equipment can be a server, and a flow chart of the method is shown in fig. 1, and specifically comprises the following steps:
s101: when a viewing behavior message sent by a client is received, judging whether the viewing behavior message is an effective message or not based on a behavior identifier in the viewing behavior message, if so, executing S103; if not, executing S106; the behavior identifier is an identifier generated by the client under the condition that the user plays the video.
In the embodiment of the invention, a client generates a behavior identifier of a playing behavior under the condition that a user executes the playing behavior, and sends a viewing behavior message to a server under the condition that the client meets a preset event reporting condition in the process that the user watches videos, wherein the reporting condition can be that the user stops playing videos, the user stops playing videos or the video is detected to pause playing videos when reaching a preset heartbeat event reporting time node or buffer, drag, advance or retreat and other behaviors are generated in the playing process.
The behavior identifier can be judged whether to be a globally unique identifier, and if the behavior identifier is the globally unique identifier, the watching behavior message can be determined to be an effective message; if the behavior identifier is not a globally unique identifier, it may be determined that the viewing behavior packet is not an effective packet.
S102: and determining the playing event type corresponding to the watching behavior message.
In the method provided by the embodiment of the present invention, the type of the play event may be a heartbeat event, a buffering event, or a pause event.
And determining the type of the playing event corresponding to the watching behavior message according to the playing event identifier in the watching behavior message.
S103: and if the playing event type is a heartbeat event, acquiring the watching duration corresponding to the heartbeat event in the watching behavior message.
In the method provided by the embodiment of the present invention, the viewing duration corresponding to the heartbeat event may be obtained in the duration field of the viewing behavior packet.
S104: judging whether the watching duration is effective watching duration or not; if yes, go to step S105, otherwise go to step S106.
S105: and acquiring the accumulated watching time length corresponding to the behavior identifier, and adding the accumulated watching time length and the watching time length to acquire the current accumulated watching time length corresponding to the behavior identifier.
In the embodiment of the present invention, after the current accumulated watching time length corresponding to the behavior identifier is obtained, it may be determined whether the current accumulated watching time length is greater than a preset task standard time length, and if so, a task reward corresponding to the task standard time length is provided to the user, where the task reward may be a score.
S106: and filtering the watching behavior message and generating a log record of the watching behavior message.
By applying the method for acquiring the video watching time length, the watching time length can be prevented from being forged, the video watching time length of a user can be accurately counted, and the accuracy and the authenticity of the video watching time length can be effectively guaranteed.
In the method provided in the embodiment of the present invention, based on the implementation process, specifically, the method further includes a processing process of the buffering event, as shown in fig. 2, specifically as follows:
s201: if the playing event type is a buffering event, obtaining the buffering duration corresponding to the buffering event in the watching behavior message, and obtaining the accumulated watching duration corresponding to the behavior identifier.
The buffering duration may be time consumed by actions of buffering, dragging, forwarding, and/or backing, etc. generated by the client during the video playing process.
S202: and judging whether the buffer duration is the effective buffer duration, if so, executing S203, and if not, executing S204.
In the method provided in the embodiment of the present invention, a feasible way of determining whether the buffering duration is the effective buffering duration may be: judging whether the buffering time length is less than or equal to the accumulated watching time length, if the buffering time length is less than or equal to the accumulated watching time length, determining that the buffering time length is effective buffering time length, and if the buffering time length is greater than the accumulated watching time length, determining that the buffering time length is not effective buffering time length.
S203: and subtracting the buffer time length from the accumulated watching time length to obtain the current accumulated watching time length corresponding to the behavior identifier.
S204: and filtering the watching behavior message and generating a log record of the watching behavior message.
In the method provided in the embodiment of the present invention, based on the foregoing implementation process, specifically, after obtaining the current accumulated viewing duration corresponding to the behavior identifier in S106, the method further includes:
judging whether the watching behavior corresponding to the behavior identification is finished or not;
and if the watching behavior corresponding to the behavior identification is finished, transmitting the current accumulated watching duration to a downstream system through a preset data transmission queue, so that the downstream system provides a recommendation service for the user based on the current accumulated watching duration.
In the method provided in the embodiment of the present invention, based on the implementation process, specifically, the feasible manner of determining whether the viewing behavior corresponding to the behavior identifier has ended includes:
judging whether the heartbeat event is the last heartbeat event or not;
judging whether a new watching behavior message of which the playing event type corresponding to the behavior identifier is a pause event or a heartbeat event is not received within a preset time length;
if the heartbeat event is the last heartbeat event and/or a new viewing behavior message of which the playing event type corresponding to the behavior identifier is a pause event and a heartbeat event is not received within the prediction time, determining that the viewing behavior corresponding to the behavior identifier is ended;
and if the heartbeat event is not the last heartbeat event and a new viewing behavior message that the playing event corresponding to the behavior identifier is a pause event or a heartbeat event is received within the prediction time, determining that the viewing behavior corresponding to the behavior identifier is finished.
The heartbeat event counting information contained in the viewing behavior message can be acquired, and whether the heartbeat event is the last heartbeat event or not is judged based on the heartbeat event counting information.
For example, in the case where the heartbeat count information is 0, it may be determined that the heartbeat event is the last heartbeat event.
In the embodiment of the present invention, a reporting state of a next heartbeat event of the heartbeat event may be determined according to the heartbeat event count information, a first preset time duration corresponding to the reporting state is determined, if a new viewing behavior packet in which a play event type corresponding to a behavior identifier is a heartbeat event is not received within the first preset time duration, it may be determined that a viewing behavior corresponding to the behavior identifier is not finished, the first preset time durations corresponding to different reporting states are different, and the reporting state may at least include an initial reporting state or may be a stable reporting state, if the reporting state is the initial reporting state, the first prediction time duration may be 2 seconds, 3 seconds, 10 seconds, 15 seconds, 30 seconds, or the like, and if the reporting state is the stable state, the first prediction time duration may be 60 seconds or the like.
Optionally, it is determined whether a new viewing behavior message corresponding to the behavior identifier and having the play event type of the pause event is received within a second preset time, and if the new viewing behavior message is received, it may be determined that the viewing behavior corresponding to the behavior identifier is not finished, where the second preset time may be 60 seconds.
In the method provided in the embodiment of the present invention, based on the foregoing implementation process, specifically, the feasible manner for determining whether the viewing duration is the valid viewing duration includes, as shown in fig. 3:
s301: and judging whether the heartbeat event is the first heartbeat event, if not, executing S302, and if so, executing S305.
And judging whether the heartbeat event is the first heartbeat event or not according to the heartbeat event counting information in the watching behavior message.
S302: determining a time difference between the current time and the historical receiving time; and the historical receiving time is the time of receiving the historical viewing behavior message of the previous heartbeat event of the heartbeat event.
The current time may be a time when the viewing behavior packet is received.
S303: and if the time difference is greater than or equal to the watching time length, determining the watching time length as the effective watching time length.
S304: and if the time difference is smaller than the watching time length, determining that the watching time length is not the effective watching time length.
S305: and determining the watching duration as the effective watching duration.
The method for acquiring video viewing time provided by the embodiment of the invention can be applied to various scenes, for example, can be applied to a network video playing scene, which can comprise a server and a client, wherein the server can receive a viewing behavior message reported by the client and further can acquire the video viewing time of a user, the specific process is shown in fig. 4, the method is a flow chart of the method for acquiring video viewing time provided by the embodiment of the invention, the client acquires the time and the reported data field of the user needing to report data in the process of viewing the video in an SDK traceless code mode, reports the time and the reported data field to a collection server in an HTTPS mode, the server receives and sends the reported data to a kafka message queue in real time, the video viewing time data is calculated by a streaming calculation frame Flink, and the result is written into a Redis cache database at regular time, and providing other services for use through an API mode.
The client data reporting comprises heartbeat event reporting, buffer event reporting and pause event reporting.
Each time the user plays, a globally unique suiid is generated to identify the one-time play behavior of the user. In the video watching process, the suuid is brought to the data reported by the client each time.
And (3) reporting a heartbeat event: reporting once in 2 nd, 5 th, 15 th, 30 th and 60 th seconds after the video playing event occurs, and then stably reporting once every 60 seconds, when the player processes the pause state, stopping timing, and suspending reporting heartbeat, and continuing reporting after the user continues playing. And when the user stops playing, reporting to finish the heartbeat. And carrying out idx field in the reported data, increasing progressively from 1, reporting 1-N times of heartbeat respectively, and finishing the idx of the heartbeat to be 0.
And (3) reporting a buffering event: when actions such as buffering, dragging, advancing and retreating are generated in the video playing process, the consumed time is reported after the actions are finished.
And (3) suspending event reporting: in the video playing process, when the user pauses playing, a pause event is reported, every 60 seconds of the subsequent pause state, the pause event is reported, and when the user resumes playing, a pause resume event is reported.
In the embodiment of the present invention, referring to fig. 5, a diagram of another flowchart of a method for acquiring a video watching time length according to the embodiment of the present invention is shown; the client reports a viewing behavior message containing the viewing behavior data; and after receiving the message, the server determines whether the watching behavior message is effective, determines a behavior event under the condition that the watching behavior message is effective, and otherwise, filters the watching behavior message and records a log.
If the behavior event of the watching behavior message is a heartbeat event, judging the watching time length corresponding to the heartbeat through an idx field, judging the data validity (idx is unique, and the comparison difference value > with the previous heartbeat time is the watching time length of the current time), recording the last heartbeat time after the judgment, and accumulating the watching time length of the current time.
If the behavior event of the viewing behavior message is a buffer event, the data validity judgment is carried out (the buffer time is less than the accumulated viewing duration), and the buffer time is subtracted from the accumulated viewing duration after the data validity judgment is passed.
If the behavior event of the viewing behavior message is a pause event, only the pause/recovery state and the pause/recovery time are marked, and the duration is not processed.
And when the server side obtains the end heartbeat when idx is equal to 0, or no new heartbeat event or pause event exists for more than 60 seconds (solving the problem that part of the end heartbeats caused by directly closing the page by the client side are not reported), marking the end of the watching behavior, and obtaining the watching duration corresponding to the playing behavior.
In the calculation process, the settlement result is written into a redis cache every second, and the back-end service can acquire the current video watching duration data in real time through the api interface. And when the video watching action is finished once, the calculated complete duration data of the watching at this time is also sent to another topic of Kafka to be provided for other services for consumption.
Corresponding to the method illustrated in fig. 1, an embodiment of the present invention further provides an apparatus for acquiring video viewing duration, which is used to implement the method illustrated in fig. 1 specifically, and the apparatus for acquiring video viewing duration provided in the embodiment of the present invention may be applied to an electronic device, and a schematic structural diagram of the apparatus is illustrated in fig. 6, and specifically includes:
a receiving unit 601, configured to, when a viewing behavior message is received, determine whether the viewing behavior message is an effective message based on a behavior identifier in the viewing behavior message; the behavior identifier is an identifier generated by the client side under the condition that the user plays the video;
a determining unit 602, configured to determine, if the viewing behavior packet is an effective packet, a play event type corresponding to the viewing behavior packet;
a first obtaining unit 603, configured to obtain, if the play event type is a heartbeat event, a viewing duration corresponding to the heartbeat event in the viewing behavior message;
a first judging unit 604, configured to judge whether the viewing duration is an effective viewing duration;
the first executing unit 605 is configured to, if the viewing duration is an effective viewing duration, obtain an accumulated viewing duration corresponding to the behavior identifier, add the accumulated viewing duration and the viewing duration, and obtain a current accumulated viewing duration corresponding to the behavior identifier.
In an embodiment provided by the present invention, based on the above scheme, optionally, the apparatus for obtaining a video watching time duration further includes:
a second obtaining unit, configured to obtain, if the play event type is a buffering event, a buffering duration corresponding to the buffering event in the viewing behavior packet; acquiring the accumulated watching duration corresponding to the behavior identifier;
a second judging unit, configured to judge whether the buffering duration is an effective buffering duration;
and the second execution unit is used for subtracting the buffer duration from the accumulated watching duration to obtain the current accumulated watching duration corresponding to the behavior identifier if the buffer duration is the effective buffer duration.
In an embodiment provided by the present invention, based on the above scheme, optionally, the apparatus for obtaining a video watching time duration further includes:
a third judging unit, configured to judge whether the viewing behavior corresponding to the behavior identifier has ended;
and the transmission unit is used for transmitting the current accumulated watching duration to a downstream system through a preset data transmission queue if the watching behavior corresponding to the behavior identifier is finished, so that the downstream system provides a recommendation service for the user based on the current accumulated watching duration.
In an embodiment of the invention, based on the above scheme, optionally, the third determining unit includes:
the first judging subunit is configured to judge whether the heartbeat event is the last heartbeat event;
the second judging subunit is configured to judge whether the viewing behavior messages of which the play event types corresponding to the behavior identifiers are pause events and heartbeat events are not received within a preset time length;
a first determining subunit, configured to determine that the viewing behavior corresponding to the behavior identifier has ended if at least one of the determination result of the first determining subunit and the determination result of the second determining subunit is yes;
and the second determining subunit is configured to determine that the viewing behavior corresponding to the behavior identifier is not ended if the determination result of the first determining subunit and the determination result of the second determining subunit are both negative.
In an embodiment of the present invention, based on the above scheme, optionally, the first determining unit 604 includes:
the third judging subunit is configured to judge whether the heartbeat event is a first heartbeat event;
a third determining subunit, configured to determine, when the heartbeat event is a non-first heartbeat event, a time difference between a current time and a historical receiving time; the historical receiving time is the time of receiving the historical viewing behavior message of the previous heartbeat event of the heartbeat event;
a fourth determining subunit, configured to determine, if the time difference is greater than or equal to the viewing duration, that the viewing duration is an effective viewing duration;
a fifth determining subunit, configured to determine that the viewing duration is not an effective viewing duration if the time difference is smaller than the viewing duration;
a sixth determining subunit, configured to determine, when the heartbeat event is a first heartbeat event, that the viewing duration is an effective viewing duration.
The specific principle and the implementation process of each unit and each module in the apparatus for acquiring video viewing duration disclosed in the embodiment of the present invention are the same as the method for acquiring video viewing duration disclosed in the embodiment of the present invention, and reference may be made to the corresponding parts in the method for acquiring video viewing duration provided in the embodiment of the present invention, which are not described herein again.
The embodiment of the invention also provides a storage medium, which comprises a stored instruction, wherein when the instruction runs, the equipment where the storage medium is located is controlled to execute the method for acquiring the video watching time length.
An electronic device is provided in an embodiment of the present invention, and its structural diagram is shown in fig. 7, which specifically includes a memory 701 and one or more instructions 702, where the one or more instructions 702 are stored in the memory 701, and are configured to be executed by one or more processors 703 to perform the following operations according to the one or more instructions 702:
when a watching behavior message sent by a client is received, judging whether the watching behavior message is an effective message or not based on a behavior identifier in the watching behavior message; the behavior identifier is an identifier generated by the client under the condition that the user plays the video;
if the viewing behavior message is an effective message, determining a playing event type corresponding to the viewing behavior message;
if the playing event type is a heartbeat event, acquiring a viewing duration corresponding to the heartbeat event in the viewing behavior message;
judging whether the watching duration is effective watching duration or not;
and if the watching duration is the effective watching duration, acquiring the accumulated watching duration corresponding to the behavior identifier, and adding the accumulated watching duration and the watching duration to obtain the current accumulated watching duration corresponding to the behavior identifier.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The method for acquiring the video watching time length provided by the invention is described in detail above, a specific example is applied in the text to explain the principle and the implementation of the invention, and the description of the above embodiment is only used to help understanding the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A method for acquiring video watching time length is characterized by comprising the following steps:
when a watching behavior message sent by a client is received, judging whether the watching behavior message is an effective message or not based on a behavior identifier in the watching behavior message; the behavior identifier is an identifier generated by the client under the condition that the user plays the video;
if the viewing behavior message is an effective message, determining a playing event type corresponding to the viewing behavior message;
if the playing event type is a heartbeat event, acquiring a viewing duration corresponding to the heartbeat event in the viewing behavior message;
judging whether the watching duration is effective watching duration or not;
and if the watching duration is the effective watching duration, acquiring the accumulated watching duration corresponding to the behavior identifier, and adding the accumulated watching duration and the watching duration to obtain the current accumulated watching duration corresponding to the behavior identifier.
2. The method of claim 1, further comprising:
if the playing event type is a buffering event, obtaining a buffering duration corresponding to the buffering event in the watching behavior message; acquiring the accumulated watching duration corresponding to the behavior identifier;
judging whether the buffering time length is an effective buffering time length or not;
and if the buffering duration is the effective buffering duration, subtracting the buffering duration from the accumulated watching duration to obtain the current accumulated watching duration corresponding to the behavior identifier.
3. The method according to claim 1, wherein after obtaining the current accumulated viewing duration corresponding to the behavior identifier, further comprising:
judging whether the watching behavior corresponding to the behavior identification is finished or not;
and if the watching behavior corresponding to the behavior identification is finished, transmitting the current accumulated watching duration to a downstream system through a preset data transmission queue, so that the downstream system provides a recommendation service for the user based on the current accumulated watching duration.
4. The method of claim 3, wherein the determining whether the viewing behavior corresponding to the behavior identifier has ended comprises:
judging whether the heartbeat event is the last heartbeat event or not;
judging whether the watching behavior messages of which the playing event types corresponding to the behavior identification are pause events and heartbeat events are not received within a preset time length;
if any judgment result is yes, determining that the watching behavior corresponding to the behavior identification is finished;
and if the two judgment results are negative, determining that the watching behavior corresponding to the behavior identification is not finished.
5. The method of claim 1, wherein the determining whether the viewing duration is an active viewing duration comprises:
judging whether the heartbeat event is a first heartbeat event or not;
determining a time difference value between the current moment and the historical receiving moment under the condition that the heartbeat event is not the first heartbeat event; the historical receiving time is the time of receiving the historical viewing behavior message of the previous heartbeat event of the heartbeat event;
if the time difference is greater than or equal to the watching time length, determining the watching time length as an effective watching time length;
if the time difference is smaller than the watching duration, determining that the watching duration is not the effective watching duration;
and under the condition that the heartbeat event is the first heartbeat event, determining the watching duration to be effective watching duration.
6. An apparatus for acquiring video watching time length, comprising:
the receiving unit is used for judging whether the watching behavior message is an effective message or not based on the behavior identifier in the watching behavior message when the watching behavior message is received; the behavior identifier is an identifier generated by the client side under the condition that the user plays the video;
a determining unit, configured to determine a play event type corresponding to the viewing behavior message if the viewing behavior message is an effective message;
a first obtaining unit, configured to obtain, in the viewing behavior packet, a viewing duration corresponding to the heartbeat event if the play event type is the heartbeat event;
a first judging unit, configured to judge whether the viewing duration is an effective viewing duration;
the first execution unit is configured to, if the viewing duration is an effective viewing duration, obtain an accumulated viewing duration corresponding to the behavior identifier, and add the accumulated viewing duration and the viewing duration to obtain a current accumulated viewing duration corresponding to the behavior identifier.
7. The apparatus of claim 6, further comprising:
a second obtaining unit, configured to obtain, if the play event type is a buffering event, a buffering duration corresponding to the buffering event in the viewing behavior packet; acquiring the accumulated watching duration corresponding to the behavior identifier;
a second judging unit, configured to judge whether the buffering duration is an effective buffering duration;
and the second execution unit is used for subtracting the buffer duration from the accumulated watching duration to obtain the current accumulated watching duration corresponding to the behavior identifier if the buffer duration is the effective buffer duration.
8. The apparatus of claim 6, further comprising:
a third judging unit, configured to judge whether the viewing behavior corresponding to the behavior identifier has ended;
and the transmission unit is used for transmitting the current accumulated watching duration to a downstream system through a preset data transmission queue if the watching behavior corresponding to the behavior identifier is finished, so that the downstream system provides a recommendation service for the user based on the current accumulated watching duration.
9. The apparatus according to claim 8, wherein the third determining unit comprises:
the first judging subunit is configured to judge whether the heartbeat event is the last heartbeat event;
the second judging subunit is configured to judge whether the viewing behavior messages of which the play event types corresponding to the behavior identifiers are pause events and heartbeat events are not received within a preset time length;
a first determining subunit, configured to determine that the viewing behavior corresponding to the behavior identifier has ended if at least one of the determination result of the first determining subunit and the determination result of the second determining subunit is yes;
and the second determining subunit is configured to determine that the viewing behavior corresponding to the behavior identifier is not ended if the determination result of the first determining subunit and the determination result of the second determining subunit are both negative.
10. The apparatus according to claim 6, wherein the first determining unit comprises:
the third judging subunit is configured to judge whether the heartbeat event is a first heartbeat event;
a third determining subunit, configured to determine, when the heartbeat event is a non-first heartbeat event, a time difference between a current time and a historical receiving time; the historical receiving time is the time of receiving the historical viewing behavior message of the previous heartbeat event of the heartbeat event;
a fourth determining subunit, configured to determine, if the time difference is greater than or equal to the viewing duration, that the viewing duration is an effective viewing duration;
a fifth determining subunit, configured to determine that the viewing duration is not an effective viewing duration if the time difference is smaller than the viewing duration;
a sixth determining subunit, configured to determine, when the heartbeat event is a first heartbeat event, that the viewing duration is an effective viewing duration.
CN202110547086.XA 2021-05-19 2021-05-19 Method and device for acquiring video watching time length Pending CN113163235A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110547086.XA CN113163235A (en) 2021-05-19 2021-05-19 Method and device for acquiring video watching time length

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110547086.XA CN113163235A (en) 2021-05-19 2021-05-19 Method and device for acquiring video watching time length

Publications (1)

Publication Number Publication Date
CN113163235A true CN113163235A (en) 2021-07-23

Family

ID=76876667

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110547086.XA Pending CN113163235A (en) 2021-05-19 2021-05-19 Method and device for acquiring video watching time length

Country Status (1)

Country Link
CN (1) CN113163235A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992990A (en) * 2021-10-26 2022-01-28 北京达佳互联信息技术有限公司 Method and device for determining resource playing time, electronic equipment and storage medium
CN115002517A (en) * 2022-05-25 2022-09-02 北京永信至诚科技股份有限公司 Video learning duration anti-theft method and device
CN115250364A (en) * 2022-07-20 2022-10-28 北京永信至诚科技股份有限公司 Video playing time length reporting method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168506A (en) * 2014-08-13 2014-11-26 广州市香港科大***研究院 Method for obtaining user video experience quality by sniffing HTTP data packet
CN105933732A (en) * 2016-06-14 2016-09-07 天脉聚源(北京)传媒科技有限公司 Video playing duration counting method and system
WO2017148064A1 (en) * 2016-03-02 2017-09-08 乐视控股(北京)有限公司 Method and device for automatically pushing video based on user behavior analysis
CN110446079A (en) * 2019-07-03 2019-11-12 北京达佳互联信息技术有限公司 Obtain method, apparatus, electronic equipment and the storage medium of viewing duration

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104168506A (en) * 2014-08-13 2014-11-26 广州市香港科大***研究院 Method for obtaining user video experience quality by sniffing HTTP data packet
WO2017148064A1 (en) * 2016-03-02 2017-09-08 乐视控股(北京)有限公司 Method and device for automatically pushing video based on user behavior analysis
CN105933732A (en) * 2016-06-14 2016-09-07 天脉聚源(北京)传媒科技有限公司 Video playing duration counting method and system
CN110446079A (en) * 2019-07-03 2019-11-12 北京达佳互联信息技术有限公司 Obtain method, apparatus, electronic equipment and the storage medium of viewing duration

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113992990A (en) * 2021-10-26 2022-01-28 北京达佳互联信息技术有限公司 Method and device for determining resource playing time, electronic equipment and storage medium
CN115002517A (en) * 2022-05-25 2022-09-02 北京永信至诚科技股份有限公司 Video learning duration anti-theft method and device
CN115250364A (en) * 2022-07-20 2022-10-28 北京永信至诚科技股份有限公司 Video playing time length reporting method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN113163235A (en) Method and device for acquiring video watching time length
CN104410516B (en) A kind of customer service perceptibility appraisal procedure and device
CN111787345B (en) Interactive resource processing method and device based on network live broadcast room, server and storage medium
CN111064954B (en) Method and device for evaluating bypass video playing quality
WO2020192275A1 (en) Live broadcast playback video generation method, device and apparatus
CN107948672B (en) Method and system for storing video data, server and wearable device
CN108322350B (en) Service monitoring method and device and electronic equipment
CN112600902A (en) Notification message pushing method and device
CN106604137B (en) Method and device for predicting video watching duration
CN113223558B (en) Audio data silencing method and device, electronic equipment and storage medium
CN106961632B (en) Video quality analysis method and device
CN105872006A (en) Appointment reminding system and appointment reminding method
CN105916030A (en) Method, device and system for recording breakpoint information of video on demand
CN106911927B (en) Method and device for evaluating experience quality of network video user and DPI equipment
CN109982068A (en) Synthetic video method for evaluating quality, device, equipment and medium
CN106789209B (en) Exception handling method and device
CN112801684A (en) Advertisement playing method and device
CN106899843B (en) A kind of video service quality appraisal procedure and device
CN113691873A (en) Video playing method, device, system, terminal and storage medium
CN112752111A (en) Live stream processing method and device, computer-readable storage medium and electronic device
CN110602483B (en) Video fault determination method, device and computer readable storage medium
CN113037450A (en) Delayed message processing method, device, equipment and readable storage medium
US9692831B1 (en) Pausing interactive sessions
CN111949512A (en) Application program jamming detection method and device, terminal and medium
CN113873269B (en) Information pushing method, device, server and storage medium

Legal Events

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

Application publication date: 20210723

RJ01 Rejection of invention patent application after publication