CN112261447A - Video effective playing time counting method and device, server and storage medium - Google Patents
Video effective playing time counting method and device, server and storage medium Download PDFInfo
- Publication number
- CN112261447A CN112261447A CN202011112356.6A CN202011112356A CN112261447A CN 112261447 A CN112261447 A CN 112261447A CN 202011112356 A CN202011112356 A CN 202011112356A CN 112261447 A CN112261447 A CN 112261447A
- Authority
- CN
- China
- Prior art keywords
- playing time
- time length
- effective
- video
- effective playing
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 230000001960 triggered effect Effects 0.000 claims abstract description 31
- 238000004806 packaging method and process Methods 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 6
- 238000007619 statistical method Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000009471 action Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 238000003491 array Methods 0.000 description 2
- 230000001680 brushing effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000013508 migration Methods 0.000 description 1
- 230000005012 migration Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/239—Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
- H04N21/2393—Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
- H04N21/2407—Monitoring of transmitted content, e.g. distribution time, number of downloads
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/437—Interfacing the upstream path of the transmission network, e.g. for transmitting client requests to a VOD server
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/442—Monitoring 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/44204—Monitoring of content usage, e.g. the number of times a movie has been viewed, copied or the amount which has been watched
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/442—Monitoring 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/44213—Monitoring of end-user related data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/472—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
- H04N21/47217—End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Computer Networks & Wireless Communication (AREA)
- Health & Medical Sciences (AREA)
- General Health & Medical Sciences (AREA)
- Social Psychology (AREA)
- Human Computer Interaction (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The embodiment of the invention discloses a method, a device, a server and a storage medium for counting the effective playing time of a video, wherein the method comprises the following steps: acquiring a video playing request of a user; playing a target video stream according to the video playing request; determining the effective playing time length of the target video stream based on a periodically triggered time length statistic task; and when the effective playing time length meets a preset condition, uploading the effective playing time length to a server. According to the embodiment of the invention, when the effective playing time of the video is counted, the invalid playing time generated by dragging a progress bar, multi-speed fast forward, multi-speed fast backward and the like by a user is eliminated, and the accuracy of counting the effective playing time of the video is improved.
Description
Technical Field
The embodiment of the invention relates to the technical field of internet, in particular to a method and a device for counting the effective playing time of a video, a server and a storage medium.
Background
With the development of internet technology, more and more contents are displayed in a video mode, such as homemade short videos, television plays, movies, and the like. Video websites generally need to evaluate the attractiveness of each video to users to reasonably allocate resources, wherein the video playing time is an important index for evaluating the attractiveness of the video to the users.
The conventional method for counting the playing time of a video generally records a starting point and an end point of a video played by a user, and takes the time length between the starting point and the end point as the playing time of the video. However, when playing a video, a user may touch content that is not interesting to the user, and at this time, the user may often skip related content of the video by dragging a progress bar, fast forwarding at a multiple speed, fast rewinding at a multiple speed, and the like, and the video playing time length under such an operation is usually meaningless, which is difficult to distinguish by using a conventional video playing time length calculation method.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, an apparatus, a server and a storage medium for counting effective playing time of a video, so as to improve the accuracy of the effective playing time of the video.
In a first aspect, an embodiment of the present invention provides a method for counting an effective playing time of a video, including:
acquiring a video playing request of a user;
playing a target video stream according to the video playing request;
determining the effective playing time length of the target video stream based on a periodically triggered time length statistic task;
and when the effective playing time length meets a preset condition, uploading the effective playing time length to a server.
Further, determining the effective playing time length of the target video stream based on the periodically triggered time length statistic task includes:
determining the current effective playing time length of the target video stream based on the currently triggered time length counting task;
and taking the sum of the current effective playing time length and the historical effective playing time length as the effective playing time length of the target video stream.
Further, determining the current effective playing time length of the target video stream based on the currently triggered time length statistic task includes:
reading current video position information based on a currently triggered duration counting task;
determining historical video position information recorded by a last trigger time counting task;
and if the difference between the current video position information and the historical video position information is smaller than a preset threshold value, taking the difference between the current video position information and the historical video position information as the current effective playing time length.
Further, when the effective playing duration meets a preset condition, uploading the effective playing duration to a server includes:
and when the effective playing time length is greater than or equal to a preset time threshold value, packaging the effective playing time length into a data packet and uploading the data packet to a server.
Further, after uploading the effective playing duration to the server, the method further includes:
determining whether the data packet is uploaded successfully;
if the data packet is failed to be uploaded, caching the data packet and determining the uploading times of the data packet;
if the uploading times are less than or equal to the preset times, returning to the step of uploading the effective playing time to a server when the effective playing time meets the preset condition.
Further, after determining the number of times of uploading the data packet, the method further includes:
and if the uploading times are more than the preset times, migrating the data packet to an error directory.
Further, encapsulating the effective playing duration into a data packet and uploading the data packet to a server includes:
and carrying out AES encryption on the effective playing time length, packaging the effective playing time length into a data packet, and uploading the data packet to a server.
In a second aspect, an embodiment of the present invention provides a device for counting effective playing time of a video, including:
the playing request acquisition module is used for acquiring a video playing request of a user;
the video playing module is used for playing the target video stream according to the video playing request;
the effective playing time length determining module is used for determining the effective playing time length of the target video stream based on a periodically triggered time length counting task;
and the effective playing time uploading module is used for uploading the effective playing time to a server when the effective playing time meets a preset condition.
In a third aspect, an embodiment of the present invention provides a server, including:
one or more processors;
a storage device for storing one or more programs,
when the one or at least one program is executed by the one or more processors, the one or more processors implement the video valid playing time period statistical method provided by any embodiment of the invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the method for counting effective playing time of a video according to any embodiment of the present invention.
The method for counting the effective video playing time provided by the embodiment of the invention obtains the video playing request of a user; playing a target video stream according to the video playing request; determining the effective playing time length of the target video stream based on a periodically triggered time length statistic task; and when the effective playing time length meets a preset condition, uploading the effective playing time length to a server. When the effective playing time of the video is counted, the invalid playing time generated by dragging a progress bar, fast forwarding at multiple speeds, fast rewinding at multiple speeds and the like by a user is eliminated, and the accuracy of counting the effective playing time of the video is improved.
Drawings
Fig. 1 is a schematic flowchart of a method for counting effective playing time of a video according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a method for counting effective playing time of a video according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a video effective playing time period counting apparatus according to a third embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. A process may be terminated when its operations are completed, but may have additional steps not included in the figure. A process may correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
Furthermore, the terms "first," "second," and the like may be used herein to describe various orientations, actions, steps, elements, or the like, but the orientations, actions, steps, or elements are not limited by these terms. These terms are only used to distinguish one direction, action, step or element from another direction, action, step or element. The terms "first", "second", etc. are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "plurality", "batch" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Example one
Fig. 1 is a schematic flow chart of a method for counting effective video playing time according to an embodiment of the present invention, which is applicable to counting video playing time. As shown in fig. 1, a method for counting effective playing time of a video according to an embodiment of the present invention includes:
and S110, acquiring a video playing request of a user.
And S120, playing the target video stream according to the video playing request.
Specifically, a user clicks a video to be watched on the video playing software to generate a corresponding video playing request, and the video playing software acquires a corresponding target video stream from the server according to the video playing request and plays the target video stream.
S130, determining the effective playing time length of the target video stream based on the periodically triggered time length statistic task.
Specifically, the effective playing duration refers to the playing duration of the target video stream under the normal playing condition, and when the user plays the target video stream by dragging the progress bar, fast forwarding at multiple speeds, fast rewinding at multiple speeds and the like, the generated playing duration is an invalid playing duration and is not counted into the effective playing duration of the target video stream. In the playing process of the target video stream, periodically triggering the time length counting task, obtaining a section of effective playing time length of the target video stream by triggering the time length counting task once, and when the target video stream is played, the sum of all the sections of effective playing time lengths is the total effective playing time length of the target video stream. The first trigger of the duration counting task is when the first frame of the target video stream starts to play.
In this embodiment, when the periodically triggered duration counting task determines a section of effective playing duration of the target video stream, the counted duration is the effective playing duration between the current triggered duration counting task and the last triggered duration counting task, that is, the counted duration is the effective playing duration within one triggering period. Illustratively, the trigger period is 1 second, i.e., the duration counting task is triggered every 1 second. When the first frame of the target video stream starts to play (assuming that the first frame is 0 th second at this time), triggering a first time duration counting task, and triggering a second time duration counting task at the 1 st second, wherein the second time duration counting task calculates the effective playing duration between the 0 th second and the 1 st second. And triggering a third time duration statistic task at the time of 2 seconds, wherein the third time duration statistic task calculates the effective playing time duration between the 1 st second and the 2 nd second. And repeating the steps until the target video stream is played.
And S140, uploading the effective playing time to a server when the effective playing time meets a preset condition.
Specifically, the preset condition refers to a condition that the effective playing time duration is uploaded to the server, and if the preset condition is that the effective playing time duration is greater than 60 seconds. And when the effective playing time length meets the preset condition, uploading the effective playing time length to a server so as to be analyzed and used.
The method for counting the effective video playing time provided by the embodiment of the invention obtains the video playing request of a user; playing a target video stream according to the video playing request; determining the effective playing time length of the target video stream based on a periodically triggered time length statistic task; and when the effective playing time length meets a preset condition, uploading the effective playing time length to a server. When the effective playing time of the video is counted, the invalid playing time generated by dragging a progress bar, fast forwarding at multiple speeds, fast rewinding at multiple speeds and the like by a user is eliminated, and the accuracy of counting the effective playing time of the video is improved.
Example two
Fig. 2 is a schematic flow chart of a method for counting effective playing time of a video according to a second embodiment of the present invention, which is a further refinement of the above embodiments. As shown in fig. 2, a method for counting effective playing time of a video according to a second embodiment of the present invention includes:
s210, acquiring a video playing request of a user.
And S220, playing the target video stream according to the video playing request.
And S230, determining the current effective playing time length of the target video stream based on the currently triggered time length statistic task.
Specifically, the current effective playing time length refers to a period of effective playing time length counted by the currently triggered time length counting task. The method for counting the current effective playing time specifically comprises the following steps: reading current video position information based on a currently triggered duration counting task; determining historical video position information recorded by a last trigger time counting task; and if the difference between the current video position information and the historical video position information is smaller than a preset threshold value, taking the difference between the current video position information and the historical video position information as the current effective playing time length.
In the playing process of the target video stream, the playing position information of the target video stream at the triggering moment is read and recorded every time the time length counting task is triggered. Reading the current video position information by the current time trigger duration statistic task and recording as Pn(unit is millisecond), the historical video position information recorded by the last trigger time length statistic task is Pn-1If the difference between the current video position information and the historical video position information represents a segment of video playing time length, which is recorded as Tn=Pn-Pn-1. When T isnWhen the target video stream is smaller than the preset threshold value, the target video stream is in a normal playing process, and T is considerednThe current effective playing time length calculated by the time length statistic task triggered currently is Tn。
In this embodiment, the preset threshold is set to 2000 ms, i.e., when 0 < TnWhen the value is less than or equal to 2000, the value is regarded as TnThe current valid play time length. When T isnWhen the time length exceeds 2000, the playing position of the target video stream jumps too fast in a trigger period of the time length statistic task, and the situation is very likely that the user adopts the dragging-inAnd playing the target video stream in modes of a speed bar, multi-speed fast forward, multi-speed fast backward and the like, so that the playing time length is not counted into the effective playing time length.
S240, taking the sum of the current effective playing time length and the historical effective playing time length as the effective playing time length of the target video stream.
Specifically, the historical playing time is the effective playing time of the target video stream counted before the current trigger time counting task, and the effective playing time of the target video stream at the current moment can be obtained by overlapping the current effective playing time and the historical effective playing time. Record the history playing time as Tn-1If the effective playing time length T of the target video stream is equal to Tn+Tn-1。
And S250, when the effective playing time length is greater than or equal to a preset time threshold value, packaging the effective playing time length into a data packet and uploading the data packet to a server.
In this embodiment, the preset time threshold is set to 60 seconds, and when the effective playing time T of the target video stream is greater than or equal to 60 seconds (in the foregoing step, the unit of the effective playing time T is milliseconds, it can be understood that the unit conversion is performed here), the effective playing time T is encrypted and encapsulated into a data packet, and then the data packet is uploaded to the server. Therefore, the effective playing time of each uploading can be guaranteed to reach a certain length.
Optionally, when the target video stream starts to be played, a counter variable (with an initial value of 0) is set to calculate the number of times of triggering the duration statistics task. And when the counter variable conforms to the preset condition, encrypting and packaging the effective playing time into a data packet and uploading the data packet to the server. For example, in this embodiment, the trigger period of the duration counting task is 1 second, that is, the duration counting task is triggered once every 1 second, when the count variable counter can be divided by 60, it indicates that the counting of the effective playing duration of the target video stream has been performed for a certain period of time, and at this time, the effective playing duration is encrypted and encapsulated into a data packet and then uploaded to the server. This enables the effective playback duration to be uploaded once periodically (one minute period).
When a user plays a target video stream through video playing software, the video playing software generates a unique serial number when generating a video playing request according to user operation. The video playing software encrypts the serial number through an RSA public key (obtained by initializing when the video playing software is started by RSA public key information), and then requests an encryption parameter from the server based on the encryption serial number. The server decrypts the encrypted serial number through the RSA private key to generate an encryption parameter corresponding to the encrypted serial number, and the encryption parameter is encrypted through the RSA private key and then returned to the video playing software, wherein the encryption parameter comprises a playing ID and a random password. And the video playing software receives the encryption parameters and then decrypts and stores the encryption parameters through the RSA public key.
In this embodiment, when the valid playing time length is greater than or equal to the preset time threshold, the video playing software encrypts the valid playing time length by using an Advanced Encryption Standard (AES), where the password is a random password and a serial number. And then packaging the encrypted effective playing time into a data packet, uploading the data packet to a server, and synchronously uploading the playing ID to the server. And the server determines a corresponding random password and a sequence number according to the playing ID, decrypts the data packet, and then stores the decrypted effective playing time length to a database.
When the effective playing time length is uploaded, the effective playing time length is firstly encrypted and then packaged into a data packet uploading server. Therefore, the uploading safety of the effective playing time is improved, meanwhile, illegal requests caused by factors such as the brushing amount and the like can be filtered (for example, a large amount of similar requests are sent by means of simulation, copy and the like), and the generation of a large amount of dirty data is avoided.
And S260, determining whether the data packet is uploaded successfully.
S270, if the data packet is failed to be uploaded, caching the data packet and determining the uploading times of the data packet.
Specifically, after the data packet is uploaded, it is further required to determine whether the data packet is successfully uploaded. If the data packet is failed to be uploaded, the data packet is cached, namely the data packet is written into a cache file, and meanwhile, the uploading times of the data packet are determined so as to wait for the next uploading again. It can be understood that, as described herein, writing a packet into a cache file means that the packet fails to be uploaded for the first time, and if the packet is already written into the cache file before the current uploading, it is not necessary to write the packet into the cache file any more.
And S280, if the uploading times are less than or equal to the preset times, returning to the step S250.
And S290, if the uploading times are more than the preset times, migrating the data packet to an error directory.
Specifically, if the number of times of uploading the data packet is less than or equal to the preset number of times, the process returns to step S250 to upload the data packet again. In this embodiment, returning to step S250 to upload the data packet again is to read the cache file when a new data packet is uploaded, and upload the new data packet and the data packet in the cache file to the server together. Therefore, the problem of data packet loss caused by network jitter or server receiving problems is avoided, and the integrity and the accuracy of the effective playing time are ensured.
If the data packet is not successfully uploaded after the preset number of times of uploading, namely the number of times of uploading is greater than the preset number of times, the data packet or the uploading process of the data packet is abnormal, at the moment, the data packet is migrated to the error directory and is not continuously uploaded, and the situation that the data packet is repeatedly uploaded all the time and occupies resources is avoided.
According to the method for counting the effective playing time of the video, the ineffective playing time generated by dragging the progress bar, the multi-speed fast forward, the multi-speed fast backward and the like by the user is eliminated, and the accuracy of counting the effective playing time of the video is improved. The effective playing time is encrypted and encapsulated into a data packet for uploading, so that the problem of illegal data brushing is avoided, and the security of data uploading is improved. By repeatedly uploading the data packets which are failed to be uploaded, the problem of data packet loss caused by network jitter is avoided, and the accuracy of video effective playing time statistics is further improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a video effective playing time period counting apparatus according to a third embodiment of the present invention, which is applicable to counting video playing time periods. The device for counting the effective playing time of the video provided by the embodiment of the invention can realize the method for counting the effective playing time of the video provided by any embodiment of the invention, has corresponding functional structures and beneficial effects of the realization method, and the content which is not described in detail in the embodiment can refer to the description of any method embodiment of the invention.
As shown in fig. 3, a video effective playing time period statistic apparatus provided by the third embodiment of the present invention includes: a playing request obtaining module 310, a video playing module 320, an effective playing time determining module 330, and an effective playing time uploading module 340, wherein:
the playing request obtaining module 310 is configured to obtain a video playing request of a user;
the video playing module 320 is configured to play the target video stream according to the video playing request;
the effective playing time length determining module 330 is configured to determine an effective playing time length of the target video stream based on a periodically triggered time length statistic task;
the effective playing time uploading module 340 is configured to upload the effective playing time to a server when the effective playing time meets a preset condition.
Further, the effective playing time length determining module 330 includes:
a first effective playing time length determining unit, configured to determine a current effective playing time length of the target video stream based on a currently triggered time length counting task;
and the second effective playing time length determining unit is used for taking the sum of the current effective playing time length and the historical effective playing time length as the effective playing time length of the target video stream.
Further, the first effective playing time length determining unit is specifically configured to:
reading current video position information based on a currently triggered duration counting task;
determining historical video position information recorded by a last trigger time counting task;
and if the difference between the current video position information and the historical video position information is smaller than a preset threshold value, taking the difference between the current video position information and the historical video position information as the current effective playing time length.
Further, the effective playing duration uploading module 340 is specifically configured to:
and when the effective playing time length is greater than or equal to a preset time threshold value, packaging the effective playing time length into a data packet and uploading the data packet to a server.
Further, the method also comprises the following steps:
the uploading success determining module is used for determining whether the data packet is uploaded successfully;
the uploading frequency determining module is used for caching the data packet and determining the uploading frequency of the data packet if the data packet fails to be uploaded;
and the retransmission module is used for returning to the step of uploading the effective playing time to a server when the effective playing time meets the preset condition if the uploading times is less than or equal to the preset times.
Further, after determining the number of times of uploading the data packet, the method further includes:
and the data migration module is used for migrating the data packet to an error directory if the uploading times are greater than preset times.
Further, the effective playing duration uploading module 340 is further configured to:
and carrying out AES encryption on the effective playing time length, packaging the effective playing time length into a data packet, and uploading the data packet to a server.
According to the device for counting the effective playing time of the video, which is provided by the embodiment of the invention, through the playing request acquisition module, the video playing module, the effective playing time determination module and the effective playing time uploading module, when the effective playing time of the video is counted, the invalid playing time generated by dragging a progress bar, a multi-speed fast forward, a multi-speed fast backward and other modes by a user is eliminated, and the accuracy of counting the effective playing time of the video is improved.
Example four
Fig. 4 is a schematic structural diagram of a server according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary server 412 suitable for use in implementing embodiments of the present invention. The server 412 shown in fig. 4 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention.
As shown in FIG. 4, server 412 is in the form of a general purpose server. Components of server 412 may include, but are not limited to: one or more processors 416, a storage device 428, and a bus 418 that couples the various system components including the storage device 428 and the processors 416.
A program/utility 440 having a set (at least one) of program modules 442 may be stored, for instance, in storage 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 442 generally perform the functions and/or methodologies of the described embodiments of the invention.
The server 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing terminal, display 424, etc.), with one or more terminals that enable a user to interact with the server 412, and/or with any terminals (e.g., network card, modem, etc.) that enable the server 412 to communicate with one or more other computing terminals. Such communication may occur via input/output (I/O) interfaces 422. Further, server 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network, such as the Internet) via Network adapter 420. As shown in FIG. 4, network adapter 420 communicates with the other modules of server 412 via bus 418. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the server 412, including but not limited to: microcode, end drives, Redundant processors, external disk drive Arrays, RAID (Redundant Arrays of Independent Disks) systems, tape drives, and data backup storage systems, among others.
The processor 416 executes programs stored in the storage device 428 to perform various functional applications and data processing, for example, implementing a video valid playing time counting method provided by any embodiment of the present invention, which may include:
acquiring a video playing request of a user;
playing a target video stream according to the video playing request;
determining the effective playing time length of the target video stream based on a periodically triggered time length statistic task;
and when the effective playing time length meets a preset condition, uploading the effective playing time length to a server.
EXAMPLE five
An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a method for counting effective playing time of a video according to any embodiment of the present invention, where the method includes:
acquiring a video playing request of a user;
playing a target video stream according to the video playing request;
determining the effective playing time length of the target video stream based on a periodically triggered time length statistic task;
and when the effective playing time length meets a preset condition, uploading the effective playing time length to a server.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or terminal. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (10)
1. A video effective playing time length statistical method is characterized by comprising the following steps:
acquiring a video playing request of a user;
playing a target video stream according to the video playing request;
determining the effective playing time length of the target video stream based on a periodically triggered time length statistic task;
and when the effective playing time length meets a preset condition, uploading the effective playing time length to a server.
2. The method of claim 1, wherein determining the effective playback time duration of the target video stream based on a periodically triggered time duration statistics task comprises:
determining the current effective playing time length of the target video stream based on the currently triggered time length counting task;
and taking the sum of the current effective playing time length and the historical effective playing time length as the effective playing time length of the target video stream.
3. The method of claim 2, wherein determining a current active play-out duration of the target video stream based on a currently triggered duration statistics task comprises:
reading current video position information based on a currently triggered duration counting task;
determining historical video position information recorded by a last trigger time counting task;
and if the difference between the current video position information and the historical video position information is smaller than a preset threshold value, taking the difference between the current video position information and the historical video position information as the current effective playing time length.
4. The method of claim 1, wherein uploading the valid playing time duration to a server when the valid playing time duration meets a preset condition comprises:
and when the effective playing time length is greater than or equal to a preset time threshold value, packaging the effective playing time length into a data packet and uploading the data packet to a server.
5. The method of claim 4, wherein after uploading the valid playback time duration to a server, further comprising:
determining whether the data packet is uploaded successfully;
if the data packet is failed to be uploaded, caching the data packet and determining the uploading times of the data packet;
if the uploading times are less than or equal to the preset times, returning to the step of uploading the effective playing time to a server when the effective playing time meets the preset condition.
6. The method of claim 5, wherein after determining the number of uploads of the data packet, further comprising:
and if the uploading times are more than the preset times, migrating the data packet to an error directory.
7. The method of claim 5, wherein encapsulating the valid playback time into a data packet and uploading the data packet to a server comprises:
and carrying out AES encryption on the effective playing time length, packaging the effective playing time length into a data packet, and uploading the data packet to a server.
8. A video effective playing time counting device is characterized by comprising:
the playing request acquisition module is used for acquiring a video playing request of a user;
the video playing module is used for playing the target video stream according to the video playing request;
the effective playing time length determining module is used for determining the effective playing time length of the target video stream based on a periodically triggered time length counting task;
and the effective playing time uploading module is used for uploading the effective playing time to a server when the effective playing time meets a preset condition.
9. A server, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the video active play length statistics method of any of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the video active play duration statistical method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011112356.6A CN112261447A (en) | 2020-10-16 | 2020-10-16 | Video effective playing time counting method and device, server and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011112356.6A CN112261447A (en) | 2020-10-16 | 2020-10-16 | Video effective playing time counting method and device, server and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112261447A true CN112261447A (en) | 2021-01-22 |
Family
ID=74245677
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011112356.6A Pending CN112261447A (en) | 2020-10-16 | 2020-10-16 | Video effective playing time counting method and device, server and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112261447A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113596606A (en) * | 2021-07-27 | 2021-11-02 | 上海高顿教育科技有限公司 | Control method and device for counting real playing time of video |
CN113992990A (en) * | 2021-10-26 | 2022-01-28 | 北京达佳互联信息技术有限公司 | Method and device for determining resource playing time, electronic equipment and storage medium |
CN114173195A (en) * | 2021-12-10 | 2022-03-11 | 聚好看科技股份有限公司 | Display device and method for counting effective playing time of media assets |
CN114598924A (en) * | 2022-03-10 | 2022-06-07 | 恒安嘉新(北京)科技股份公司 | Method, device, equipment and medium for detecting client comprehensive video playing state |
CN115250364A (en) * | 2022-07-20 | 2022-10-28 | 北京永信至诚科技股份有限公司 | Video playing time length reporting method, device, equipment and storage medium |
CN116170618A (en) * | 2022-12-29 | 2023-05-26 | 北京奇树有鱼文化传媒有限公司 | Method and device for calculating play quantity, electronic equipment and readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105933732A (en) * | 2016-06-14 | 2016-09-07 | 天脉聚源(北京)传媒科技有限公司 | Video playing duration counting method and system |
CN110049318A (en) * | 2019-05-07 | 2019-07-23 | 苏州市职业大学 | A kind of learning quality appraisal procedure and relevant apparatus |
CN110213654A (en) * | 2019-05-18 | 2019-09-06 | 杭州当虹科技股份有限公司 | A kind of streaming media video effectively watches the detection device and method of content |
CN110996155A (en) * | 2019-12-12 | 2020-04-10 | 北京字节跳动网络技术有限公司 | Video playing page display method and device, electronic equipment and computer readable medium |
-
2020
- 2020-10-16 CN CN202011112356.6A patent/CN112261447A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105933732A (en) * | 2016-06-14 | 2016-09-07 | 天脉聚源(北京)传媒科技有限公司 | Video playing duration counting method and system |
CN110049318A (en) * | 2019-05-07 | 2019-07-23 | 苏州市职业大学 | A kind of learning quality appraisal procedure and relevant apparatus |
CN110213654A (en) * | 2019-05-18 | 2019-09-06 | 杭州当虹科技股份有限公司 | A kind of streaming media video effectively watches the detection device and method of content |
CN110996155A (en) * | 2019-12-12 | 2020-04-10 | 北京字节跳动网络技术有限公司 | Video playing page display method and device, electronic equipment and computer readable medium |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113596606A (en) * | 2021-07-27 | 2021-11-02 | 上海高顿教育科技有限公司 | Control method and device for counting real playing time of video |
CN113992990A (en) * | 2021-10-26 | 2022-01-28 | 北京达佳互联信息技术有限公司 | Method and device for determining resource playing time, electronic equipment and storage medium |
CN114173195A (en) * | 2021-12-10 | 2022-03-11 | 聚好看科技股份有限公司 | Display device and method for counting effective playing time of media assets |
CN114173195B (en) * | 2021-12-10 | 2024-04-12 | 聚好看科技股份有限公司 | Display equipment and method for counting effective playing time of media assets |
CN114598924A (en) * | 2022-03-10 | 2022-06-07 | 恒安嘉新(北京)科技股份公司 | Method, device, equipment and medium for detecting client comprehensive video playing state |
CN114598924B (en) * | 2022-03-10 | 2024-03-22 | 恒安嘉新(北京)科技股份公司 | Method, device, equipment and medium for detecting comprehensive video playing state of client |
CN115250364A (en) * | 2022-07-20 | 2022-10-28 | 北京永信至诚科技股份有限公司 | Video playing time length reporting method, device, equipment and storage medium |
CN116170618A (en) * | 2022-12-29 | 2023-05-26 | 北京奇树有鱼文化传媒有限公司 | Method and device for calculating play quantity, electronic equipment and readable storage medium |
CN116170618B (en) * | 2022-12-29 | 2023-11-14 | 北京奇树有鱼文化传媒有限公司 | Method and device for calculating play quantity, electronic equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN112261447A (en) | Video effective playing time counting method and device, server and storage medium | |
US10033787B2 (en) | Dynamic virtual chunking of streaming media content | |
US10225170B2 (en) | System and method for detecting active streams using a heartbeat and secure stop mechanism | |
US20170123713A1 (en) | Device and process for data storage and read/write efficiency | |
JP6314252B2 (en) | Network video playback method and apparatus | |
US8811797B2 (en) | Switching between time order and popularity order sending of video segments | |
CN112218115B (en) | Control method and device for streaming media audio and video synchronization and computer equipment | |
CN109144858B (en) | Fluency detection method and device, computing equipment and storage medium | |
US12010372B2 (en) | Content recording and group encryption | |
EP3895380A1 (en) | Handling timestamp inaccuracies for streaming network protocols | |
WO2014153963A1 (en) | Methods and systems for playing video on multiple terminals | |
CN112887761A (en) | Video playing method, device, server and storage medium | |
CN110620950B (en) | Method, device and equipment for storing audio and video files | |
CN109889922B (en) | Method, device, equipment and storage medium for forwarding streaming media data | |
CN109587517B (en) | Multimedia file playing method and device, server and storage medium | |
JP2004519930A (en) | Dynamic keyframe generation and use | |
US9076484B2 (en) | Methods for estimating playback time and handling a cumulative playback time permission | |
US9872060B1 (en) | Write confirmation of a digital video record channel | |
CN112866745B (en) | Streaming video data processing method, device, computer equipment and storage medium | |
CN113014956B (en) | Video playing method and device | |
CN114143486A (en) | Video stream synchronization method and device, computer equipment and storage medium | |
WO2020228128A1 (en) | Method and device for storing streaming media data and storage medium | |
Campos et al. | Formal verification and analysis of multimedia systems | |
CN114974314B (en) | Audio and video frame processing method, device and medium | |
US11457287B2 (en) | Method and system for processing video |
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: 20210122 |
|
RJ01 | Rejection of invention patent application after publication |