A method for determining playback duration and related equipment
By acquiring the playback status and buffering status of the media and determining the timing status, the statistical complexity problem caused by the complexity of the player state machine in the prior art is solved, and the accuracy and efficiency of the playback time are improved.
Patent Information
- Application Number
- CN202010212570.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-24
- Publication Date
- 2025-01-14
- Estimated Expiration
- 2040-03-24
AI Technical Summary
When determining the duration of media data playback at one time, the prior art requires identification and operation of multiple complicated states in the player state machine, resulting in complex statistics, low efficiency and error-prone.
By obtaining the playback status and buffer status of the target media, determining the timing status, including timing and pause timing, to timing the playback duration, only two states are needed to identify, simplifying the statistical process.
Improves the accuracy and efficiency of playback time, simplifies the statistical process, and reduces the occurrence of errors.
Smart Images

Figure CN113453066B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing, and in particular to a method for determining playback duration and related equipment. Background Art
[0002] In some scenarios, it is usually necessary to count the duration of a user's playback of media data as analysis data for media data quality or object attributes, etc. It can be seen that data such as the duration of a user's playback of media data is of great significance in data analysis.
[0003] At present, the duration of a media data playback is mainly determined by the state in the player's state machine. The player is a device that plays media data. The player's state machine means that the player will transition between states in a limited set of states, which is the player's state machine. The player's state machine usually includes Idle, Initialized, Preparing, Started, Pause, Completed, etc.
[0004] This method requires identifying multiple complicated states of the state machine and taking corresponding operations, which makes the statistics complex, inefficient and prone to statistical errors. Summary of the invention
[0005] In order to solve the above technical problems, the present application provides a method for determining playback duration and related devices, which improve the accuracy and efficiency of determining playback duration.
[0006] The embodiments of the present application disclose the following technical solutions:
[0007] On the one hand, an embodiment of the present application provides a method for determining a playback duration, the method comprising:
[0008] When a start play mark for the target media is obtained, timing of the play time of the target media is started;
[0009] In the process of timing the target media, obtaining a first playing state and a first buffering state of the target media;
[0010] Determine the timing state of the target media according to the first playing state and the first buffering state, and count the playing time of the target media according to the timing state, wherein the timing state includes timing and pause timing;
[0011] When the end-of-play mark for the target media is obtained, the timing of the play time of the target media is ended.
[0012] Optionally, the target media includes one or more combinations of video and audio.
[0013] On the other hand, an embodiment of the present application provides a device for determining a playback duration, the device comprising:
[0014] A start timing unit, used to start timing the playing time of the target media when a start playing mark for the target media is obtained;
[0015] an acquisition unit, configured to acquire a first playback state and a first buffering state of the target media during the process of timing the target media;
[0016] a determining unit, configured to determine a timing state of the target media according to the first playing state and the first buffering state, and to time the playing time of the target media according to the timing state, wherein the timing state includes timing and pause timing;
[0017] The end timing unit is used to end the timing of the playing time of the target media when the end playing mark of the target media is obtained.
[0018] On the other hand, an embodiment of the present application provides a device, the device comprising a processor and a memory:
[0019] The memory is used to store program code and transmit the program code to the processor;
[0020] The processor is used to execute the above-mentioned playback duration determination method according to the instructions in the program code.
[0021] On the other hand, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the above-mentioned method for determining the playback duration.
[0022] It can be seen from the above technical solution that when the start playback mark for the target media is obtained, the playback duration of the target media is started to be timed; in the process of timing the target media, the first playback state and the first buffer state of the target media are obtained; and according to the first playback state and the first buffer state, the timing state of the target media is determined, that is, whether to continue timing the target media or pause timing, so as to time the playback duration of the target media according to the timing state; when the end playback mark for the target media is obtained, the timing of the playback duration of the target media is ended. This method only needs to obtain the two states of the playback state and the buffer state of the target media for identification, and the statistics are simple, thereby improving the accuracy and efficiency of determining the playback duration. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0024] Figure 1 A schematic diagram of an application scenario of a method for determining playback duration provided in an embodiment of the present application;
[0025] Figure 2 A flow chart of a method for determining playback duration provided in an embodiment of the present application;
[0026] Figure 3a A terminal device structure diagram provided for an embodiment of the present application
[0027] Figure 3b A structural diagram of a terminal device provided in an embodiment of the present application;
[0028] Figure 4 A flow chart of a method for determining playback duration provided in an embodiment of the present application;
[0029] Figure 5 A structural diagram of a device for determining playback duration provided in an embodiment of the present application;
[0030] Figure 6 A structural diagram of a data processing device provided in an embodiment of the present application;
[0031] Figure 7 A structural diagram of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0033] Currently, the duration of a media data playback is mainly determined by the state of the player's state machine. Since this method requires identification and corresponding operations for multiple complicated states of the state machine, the statistics are complex, inefficient, and prone to statistical errors.
[0034] To this end, an embodiment of the present application provides a method for determining playback duration, which only obtains two states, the playback state and the buffering state of the target media for identification, and the statistics are simple, thereby improving the accuracy and efficiency of determining the playback duration.
[0035] First, the execution subject of the embodiment of the present application is introduced. The method for determining the playback duration provided in the present application can be executed by a data processing device, which includes a player for playing media data, and the data processing device can be a terminal device. Among them, the terminal device can be, for example, a smart phone, a computer, a personal digital assistant (PDA), a tablet computer, a point of sales (POS), a car computer, and other devices.
[0036] The data processing device may also be a server, which can provide a play duration determination service for a terminal device equipped with a player. When the server executes the play duration determination method, it can obtain relevant data from the terminal device and use it to determine the play duration for the terminal device. The server may be an independent server or a server in a cluster.
[0037] In order to facilitate understanding of the technical solution of the present application, the following describes the method for determining the playback duration provided in the embodiment of the present application, taking the server as the execution entity and combining it with actual application scenarios.
[0038] See also Figure 1 , which shows a schematic diagram of an application scenario of a method for determining playback duration provided by an embodiment of the present application. Figure 1 As shown, the example includes a server 101 and a terminal device 102, and a player is deployed in the terminal device 102 for playing target media. The target media described here can be multimedia data played for users, such as video, audio data, etc. When the terminal device 102 plays the target media, the server 101 in the scenario executes the playback duration determination method provided in the embodiment of the present application to determine the duration of the terminal device 102 playing the target media this time.
[0039] In the embodiment of the present application, the terminal device 102 can obtain the data of the player starting to play the target media, and generate a start play mark of the target media, which can be used to mark the start of playing the target media. Then, the terminal device 102 can send the start play mark to the server 101.
[0040] When the server 101 obtains the start play mark for the target media, it starts timing the play duration of the target media. In the process of timing the target media, the server 101 can obtain the first play state (IsPlaying) and the first buffer state (IsBuffering) of the target media, wherein the first play state (first buffer state) and the second play state (second buffer state) mentioned later both refer to the play state (buffer state) of the target media. The play state can reflect whether the target media is currently in the play state, and the buffer state can reflect whether the target media is currently in the buffer state.
[0041] It can be understood that whether the target media is being played is related to its playback status and buffering status. For example, in the process of playing the target media, its playback status should be a playing status and the buffering status should be a non-buffered status, and it cannot be other states, such as a non-playing state, a buffering state, etc. Therefore, in an embodiment of the present application, the server 101 can determine the timing status of the target media based on the first playback status and the first buffering status. The timing status may include timing and pause timing, that is, according to the first playback status and the first buffering status, determine whether to continue timing or pause timing of the target media, thereby timing the playback duration of the target media according to the timing status.
[0042] When the terminal device 101 finishes playing the target media, it can obtain the data of finishing playing the target media and generate a finishing playing mark of the target media, which can be used to mark the finishing playing of the target media. Then, the terminal device 102 sends the finishing playing mark to the server 101.
[0043] When the server 101 obtains the end-of-play mark for the target media, the timing of the play time of the target media ends.
[0044] It can be seen that the method only obtains the two states of the target media, the playback state and the buffering state, for identification to time the playback duration of the target media. The statistics are simple and the accuracy and efficiency of determining the playback duration are improved.
[0045] Next, the method for determining the playback duration provided by the embodiment of the present application will be introduced with the terminal device as the execution subject, wherein a player is deployed in the terminal device for playing the target media.
[0046] See also Figure 2 , which shows a flow chart of a method for determining playback duration provided by an embodiment of the present application, the method may include:
[0047] S201: When a start play mark for a target media is obtained, start timing the play time of the target media.
[0048] The target media mentioned in the embodiments of the present application may be any type of multimedia data. In a possible implementation, the target media may be one or more combinations of video data or audio data.
[0049] In the embodiment of the present application, the terminal device can generate a corresponding start playing mark for the target media according to the data when the target media starts to be played. The data generated when the terminal device starts to play the target media can be, for example, a trigger operation of a user clicking to play the target media, etc., which is not limited in the present application.
[0050] It should be noted that the present application does not limit the type of the start play identifier, and the start play identifier may be data for starting to play the target media. That is, when the terminal device obtains data for starting to play the target media, it is equivalent to obtaining the start play identifier for the target media, so that the playing time of the target media can be started to be counted.
[0051] S202: In the process of timing the target media, a first playing state and a first buffering state of the target media are obtained.
[0052] In the embodiment of the present application, the terminal device may obtain a first playback state and a first buffering state of the target media during the process of timing the playback duration of the target media.
[0053] The playing state may reflect whether the target media is currently in a playing state, and the buffering state may reflect whether the target media is currently in a buffering state.
[0054] The embodiments of the present application do not limit the method for determining the first playback state and the first buffering state. In actual scenarios, the playback state of the target media can usually be determined based on the state machine of the current player. When the state of the current player is in the playing (IsPlaying) state, the playback state of the current target media can be determined to be playing. When the state of the current player is in other states, the current target media can be determined to be non-playing.
[0055] When the player used to play the target media does not have a corresponding state machine, see Figure 3a , which shows a terminal device structure diagram provided by an embodiment of the present application, such as Figure 3aAs shown, a player is deployed in the terminal device, and for the target media, the user can perform operations such as play, pause, etc. on the screen of the terminal device to control the playback of the target media. Among them, the interface program corresponding to the screen can interact with the player according to the user operation to respond to the user operation.
[0056] The interface program described here may be an instruction part specially designed for operators for operation and use and feedback information.
[0057] In the embodiment of the present application, the interface program can perform corresponding call operations on the player according to the user operation, such as data loading, playing, pausing, etc. of the target media. Thus, the player can perform corresponding tasks based on the call operation of the interface program to respond to the call operation of the interface program. When the player completes the task, it can send task information to the interface program, and the task information can be used to identify the execution result of the task corresponding to the call operation performed by the player (such as completion of data loading, etc.).
[0058] For example, when a user clicks a button on the screen for playing the target media, the interface program can call the player to load the target media based on the click operation. Thus, the player can load the target media based on the call operation, including parsing the target media through the network protocol, parsing through the encapsulation parser, and decoding through the decoder to achieve the loading of the target media. Then, task information for completing the loading of the target media can be sent to the interface program. The interface program plays the target media based on the task information.
[0059] In the embodiment of the present application, in the process of timing the target media, the calling operation of the interface program on the player and the task information sent by the player can be recorded in chronological order to obtain state data. The state data can reflect the various states generated by the player in sequence during the process of playing the target media. And for the state data, in the time period after recording state A, the state data will remain in the current state A until another state B is recorded in the state data.
[0060] Thus, the playing state can be determined by the state data. If the state currently maintained in the determined state data is playing, the current playing state can be determined to be playing, and if the state currently maintained in the determined state data is other states except playing, the current playing state can be determined to be not playing.
[0061] In this way, by recording the state changes of the player during the timing of the target media, it is possible to determine the playing state of the player without a state machine.
[0062] The buffering status can usually be determined based on the buffering information sent by the player. When the player sends the buffering information, it can be determined that the buffering status of the current target media is buffered. When the player does not send the buffering information, it can be determined that the buffering status of the current target media is non-buffered.
[0063] Thus, in one possible manner, the play state in the first media state is determined according to the playing state in the state machine; or, the play state is determined according to the state data recorded in the process of timing the target media, the state data is determined according to the calling operation of the interface program on the player and the task information sent by the player, and the task information is used to identify the execution result of the task corresponding to the calling operation performed by the player. The buffering state can be determined according to the sending of the buffering information.
[0064] The first playing state and the first buffering state of the target media can be determined by only determining whether the buffering information is sent and whether the target media is in the playing state, which is simpler and more efficient.
[0065] The embodiment of the present application does not limit S202, the method for obtaining the first playback state and the first buffer state of the target media. In a possible implementation, the method for obtaining the first playback state and the first buffer state of the target media may include:
[0066] A first playing state and a first buffering state of the target media are obtained according to a preset time interval.
[0067] Alternatively, the first playing state and the first buffering state of the target media are acquired in real time.
[0068] The preset time interval may be a time period for acquiring the first playing state and the first buffering state of the target media.
[0069] In this method, by acquiring the first play state and the first buffer state of the target media according to a preset time interval, the amount of calculation of the data processing device can be effectively reduced, and the calculation pressure can be reduced.
[0070] By acquiring the first playing state and the first buffering state of the target media in real time, it is helpful to determine in real time whether to continue timing the playing time of the target media, thereby improving the accuracy of timing the playing time.
[0071] S203: Determine a timing state of the target media according to the first playing state and the first buffering state, and time the playing time of the target media according to the timing state.
[0072] The timing status includes timing and pause timing.
[0073] The method of S203 is described in detail below. In a possible implementation, the method of S203 may include:
[0074] If it is determined that the first playing state is playing and the first buffering state is non-buffering, the timing state of the target media is determined to be timing, and the playing time of the target media continues to be timed.
[0075] In an embodiment of the present application, after the terminal device obtains the first media state, it can determine whether the current target media is in a playing and non-buffered state according to the first media state. It can be understood that when the buffering state of the target media is buffering, the target media must not be played at this time. When the buffering state of the target media is non-buffering, the target media may appear in other states at this time, such as a paused playback state, etc. When the first playback state of the target media is playback and the first buffering state is non-buffering, it can be determined that the target media must be being played. Therefore, if it is determined that the first playback state of the current target media is playback and the first buffering state is non-buffering, the timing state is determined to be timing, and the playback duration of the target media continues to be timed.
[0076] It is understandable that it is also possible to determine that the target media is in other states, such as a buffering state, a pause state, etc., according to the first playing state and the first buffering state. To this end, in a possible implementation, the method of S203 may further include:
[0077] If it is determined that the first playing state is non-playing or the first buffering state is buffering, the timing state of the target media is determined to be paused, and the timing of the playing time of the target media is paused.
[0078] Among them, when it is determined that the first playback state is non-playing or the first buffering state is buffering, that is, other states except playback and non-buffering, it can be determined that the current target media is not being played, thereby determining that the timing state of the target media is paused, so that the timing of the playback time of the target media can be paused.
[0079] When the second playback state and the second buffering state of the target media are obtained, and it is determined that the second playback state is playback and the second buffering state is non-buffering, the timing state of the target media can be determined to be timing, so that the timing of the playback duration of the target media can be restored.
[0080] The second playing state and the second buffering state are generated after the target media generates the first playing state and the first buffering state.
[0081] That is, if it is determined that the target media is being played again and is not buffered, the timing of the playing time of the target media can be resumed.
[0082] Through this method, timely resumption of the playback duration timing of the target media after being paused is guaranteed, further improving the accuracy of determining the playback duration.
[0083] S204: When the end-of-play mark for the target media is obtained, the timing of the play time of the target media is ended.
[0084] In an embodiment of the present application, the terminal device can generate a corresponding end-of-play mark for the target media according to the data when the target media is finished playing. The data generated when the target media is finished playing by the terminal device can be, for example, a trigger operation of a user clicking to stop playing the target media, etc., which is not limited in the present application.
[0085] It should be noted that the present application does not limit the type of the end-of-play mark, and the end-of-play mark can be the data when the target media is finished playing. That is, when the terminal device obtains the data when the target media is finished playing, it is equivalent to obtaining the end-of-play mark for the target media, so that the timing of the playing time of the target media can be stopped.
[0086] It can be seen from the above technical solution that when the start playback mark for the target media is obtained, the playback duration of the target media is started to be timed; in the process of timing the target media, the first playback state and the first buffer state of the target media are obtained; and according to the first playback state and the first buffer state, the timing state of the target media is determined, that is, whether to continue timing the target media or pause timing, so as to time the playback duration of the target media according to the timing state; when the end playback mark for the target media is obtained, the timing of the playback duration of the target media is ended. This method only needs to obtain the two states of the playback state and the buffer state of the target media for identification, and the statistics are simple, thereby improving the accuracy and efficiency of determining the playback duration.
[0087] In actual scenarios, for media data played on demand, the playback duration is usually measured based on player state machine recognition, and the timing method can be used. Among them, the on-demand playback method can refer to the method of playing the corresponding media program according to the needs of the user. The timing method of timing includes: by using a preset time period to compare the current player's playback position with the previous player's playback position, when the two playback positions change, the playback duration is accumulated (one time period is accumulated each time).
[0088] As for the media data played in live broadcast mode, since there is no playback position, the playback duration is usually measured based on the player state machine recognition method. Live broadcast can refer to setting up independent signal acquisition equipment (audio + video) on site to import it into the director terminal (director device or platform), then uploading it to the server through the network, and publishing it to the website for people to watch.
[0089] For the media data of these two playback methods, there will be slight differences when applying the above two methods to count the playback time, which will cause confusion in data statistics. In addition, the fixed-point timing method needs to be based on the current playback position, while the live broadcast playback method does not have a current playback position, so it is impossible to unify the timing method.
[0090] In order to solve the problem of statistical data differences and complexity, in a possible implementation, for the target media in the playback duration determination method provided in the embodiment of the present application, the playback mode can be one or more combinations of on-demand and live broadcast.
[0091] That is to say, no matter the target media is played on demand or live, the playback duration can be determined by the playback duration determination method provided in the embodiment of the present application.
[0092] This method determines the playback duration by judging whether the playback status of the target media is playing and whether the buffering status is non-buffering. It does not need to understand the complex player status in the player state machine, nor does it need to rely on the playback position in the fixed-point timing method. It unifies the statistical schemes of the on-demand playback method and the live playback method, and avoids data differences caused by the timing method.
[0093] Next, taking the media data as video data as an example, taking the terminal device as the execution subject, and combining with the actual application scenario, the method for determining the playback time provided in the embodiment of the present application is introduced.
[0094] See also Figure 3b , which shows a terminal device structure diagram provided by an embodiment of the present application, such as Figure 3b As shown, the terminal device may include a player 301 for playing videos, a media status timing push module 302, and a media status acquisition module 303.
[0095] Among them, the player 301 is an online video player, which is responsible for the playback and display of online videos, including playback in on-demand and live broadcast modes. The media status timing push module 302 is used to collect the playback status and buffering status of the current player 301, and push these two states out at fixed time intervals. The player data acquisition module 303 is used to collect and count the playback status and buffering status in the message by subscribing to the push message of the media status timing push module 302, and count the playback time of the target media. In other words, the media status acquisition module 303 executes the playback time determination method provided in the embodiment of the present application.
[0096] See also Figure 4 , which shows a flow chart of a method for determining playback duration provided by an embodiment of the present application, such as Figure 4 As shown, the method includes:
[0097] S401: The player outputs the playback status according to the current state machine (play, pause) status.
[0098] S402: The player outputs the buffering status according to whether a buffering message is currently being sent.
[0099] Among them, the player can judge the current state machine and extract two key media states, namely the playback state and the buffering state.
[0100] When the player determines that the state machine is in the Started (playing) state, IsPlaying = True, otherwise IsPlaying = False.
[0101] When the player determines that a buffering message is being sent, IsBuffering = True; when no buffering message is received, it is determined that buffering is finished, IsBuffering = False.
[0102] S403: The media status timing push module pushes the play status and buffer status of the current player to the data acquisition module that has subscribed to the data at fixed time intervals.
[0103] S404: When the player data collection module determines according to the judgment condition that the play state of the target media is playing and the buffer state is non-buffering, the play time is accumulated.
[0104] The playback duration is accumulated in the following manner: total duration = total playback duration + time interval of the media status timing push module.
[0105] S405: The player data collection module transmits the data such as the playing time to the player data statistics analysis server for further analysis.
[0106] Among them, the player data statistics and analysis server is used to receive data such as player playback time uploaded by the player data collection module, and perform more specific data statistics and analysis according to product needs.
[0107] Based on the above-mentioned method for determining the playing time, the embodiment of the present application further provides a device for determining the playing time, which can be applied to the above-mentioned data processing device. Figure 5 , which shows a structural diagram of a device for determining a playback duration provided in an embodiment of the present application, wherein the device 500 includes:
[0108] The start timing unit 501 is used to start timing the playing time of the target media when the start playing mark for the target media is obtained;
[0109] An acquisition unit 502 is used to acquire a first playback state and a first buffering state of the target media during the process of timing the target media;
[0110] The determining unit 503 is used to determine the timing state of the target media according to the first playing state and the first buffering state, and to time the playing time of the target media according to the timing state, wherein the timing state includes timing and pause timing;
[0111] The end timing unit 504 is used to end the timing of the playing time of the target media when the end playing mark of the target media is obtained.
[0112] In a possible implementation manner, the determining unit 503 is specifically configured to:
[0113] If it is determined that the first playing state is playing and the first buffering state is non-buffering, the timing state of the target media is determined to be timing, and the playing time of the target media continues to be timed.
[0114] In a possible implementation manner, the determining unit 503 is specifically configured to:
[0115] If it is determined that the first playback state is non-playing or the first buffering state is buffering, determining that the timing state of the target media is paused, and pausing the timing of the playback duration of the target media;
[0116] When the second playback state and the second buffering state of the target media are obtained, and it is determined that the second playback state is playback and the second buffering state is non-buffering, the timing state of the target media is determined to be timing, and the timing of the playback time of the target media is restored, wherein the second playback state and the second buffering state are generated after the target media generates the first playback state and the first buffering state.
[0117] In a possible implementation, the obtaining unit 502 is specifically configured to:
[0118] Acquire a first playback state and a first buffering state of the target media according to a preset time interval;
[0119] Alternatively, the first playing state and the first buffering state of the target media are acquired in real time.
[0120] In a possible implementation, the playing state is determined according to a playing state in a state machine;
[0121] Alternatively, the playback status is determined based on status data recorded during the timing of the target media, and the status data is determined based on the calling operation of the interface program on the player and the task information sent by the player, and the task information is used to identify the execution result of the task corresponding to the calling operation performed by the player.
[0122] In a possible implementation manner, the buffering status is determined according to whether buffering information is sent.
[0123] In a possible implementation, the target media is played in a mode of one or more combinations of on-demand and live broadcast.
[0124] In a possible implementation manner, the target media includes one or more combinations of video and audio.
[0125] It can be seen from the above technical solution that when the start play mark for the target media is obtained, the play time of the target media is started to be counted; in the process of timing the target media, the first play state and the first buffer state of the target media are obtained; and according to the first play state and the first buffer state, the timing state of the target media is determined, that is, whether to continue timing the target media or pause timing, so as to count the play time of the target media according to the timing state; when the end play mark for the target media is obtained, the timing of the play time of the target media is ended. This method only obtains the two states of the play state and the buffer state of the target media for identification, and the statistics are simple, thereby improving the accuracy and efficiency of determining the play time.
[0126] The present application embodiment also provides a device, which may be the data processing device mentioned above. The data processing device is introduced below in conjunction with the accompanying drawings. Figure 6 As shown, the embodiment of the present application provides a data processing device structure diagram, and the device may also be a terminal device. For example, the terminal device is a mobile phone:
[0127] Figure 6 FIG. 1 is a block diagram of a portion of the structure of a mobile phone provided in an embodiment of the present application. Figure 6 The mobile phone includes: a radio frequency (RF) circuit 610, a memory 620, an input unit 630, a display unit 640, a sensor 650, an audio circuit 660, a wireless fidelity (WiFi) module 670, a processor 680, and a power supply 690. Those skilled in the art will understand that Figure 6 The mobile phone structure shown in the figure does not constitute a limitation on the mobile phone, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0128] Combine the following Figure 6 A detailed introduction to the various components of the mobile phone:
[0129] The RF circuit 610 can be used for receiving and sending signals during the process of sending and receiving information or making calls. In particular, after receiving the downlink information of the base station, it is sent to the processor 680 for processing; in addition, the designed uplink data is sent to the base station. Generally, the RF circuit 610 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Low Noise Amplifier, LNA), a duplexer, etc. In addition, the RF circuit 610 can also communicate with the network and other devices through wireless communication. The above-mentioned wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (Global System of Mobile communication, GSM), General Packet Radio Service (General Packet Radio Service, GPRS), Code Division Multiple Access (Code Division Multiple Access, CDMA), Wideband Code Division Multiple Access (Wideband Code Division Multiple Access, WCDMA), Long Term Evolution (Long Term Evolution, LTE), email, Short Messaging Service (SMS), etc.
[0130] The memory 620 can be used to store software programs and modules. The processor 680 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 620. The memory 620 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 620 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0131] The input unit 630 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the mobile phone. Specifically, the input unit 630 may include a touch panel 631 and other input devices 632. The touch panel 631, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 631 or near the touch panel 631 using any suitable object or accessory such as a finger, stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 631 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 680, and can receive and execute commands sent by the processor 680. In addition, the touch panel 631 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 631, the input unit 630 may also include other input devices 632. Specifically, the other input devices 632 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, etc.
[0132] The display unit 640 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 640 may include a display panel 641. Optionally, the display panel 641 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 631 may cover the display panel 641. When the touch panel 631 detects a touch operation on or near it, it is transmitted to the processor 680 to determine the type of touch event. Subsequently, the processor 680 provides a corresponding visual output on the display panel 641 according to the type of touch event. Although in Figure 6 In the embodiment, the touch panel 631 and the display panel 641 are used as two independent components to realize the input and output functions of the mobile phone, but in some embodiments, the touch panel 631 and the display panel 641 can be integrated to realize the input and output functions of the mobile phone.
[0133] The mobile phone may also include at least one sensor 650, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 641 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 641 and / or the backlight when the mobile phone is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.
[0134] The audio circuit 660, the speaker 661, and the microphone 662 can provide an audio interface between the user and the mobile phone. The audio circuit 660 can transmit the received audio data to the speaker 661 after converting the received audio data into an electrical signal, which is converted into a sound signal for output; on the other hand, the microphone 662 converts the collected sound signal into an electrical signal, which is received by the audio circuit 660 and converted into audio data, and then the audio data is output to the processor 680 for processing, and then sent to another mobile phone through the RF circuit 610, or the audio data is output to the memory 620 for further processing.
[0135] WiFi is a short-range wireless transmission technology. The mobile phone can help users send and receive emails, browse web pages and access streaming media through the WiFi module 670. It provides users with wireless broadband Internet access. Figure 6A WiFi module 670 is shown, but it is understandable that it is not an essential component of the mobile phone and can be omitted as needed without changing the essence of the invention.
[0136] The processor 680 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 620, and calling data stored in the memory 620, it executes various functions of the mobile phone and processes data, thereby monitoring the mobile phone as a whole. Optionally, the processor 680 may include one or more processing units; preferably, the processor 680 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 680.
[0137] The mobile phone also includes a power supply 690 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 680 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions.
[0138] Although not shown, the mobile phone may also include a camera, a Bluetooth module, etc., which will not be described in detail here.
[0139] In this embodiment, the processor 680 included in the terminal device also has the following functions:
[0140] When a start play mark for the target media is obtained, timing of the play time of the target media is started;
[0141] In the process of timing the target media, obtaining a first playing state and a first buffering state of the target media;
[0142] Determine the timing state of the target media according to the first playing state and the first buffering state, and count the playing time of the target media according to the timing state, wherein the timing state includes timing and pause timing;
[0143] When the end-of-play mark for the target media is obtained, the timing of the play time of the target media is ended.
[0144] The data processing device provided in the embodiment of the present application may be a server. Figure 7 As shown, Figure 7A structural diagram of a server provided in an embodiment of the present application, the server 700 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 722 (for example, one or more processors) and a memory 732, and one or more storage media 730 (for example, one or more mass storage devices) storing application programs 742 or data 744. Among them, the memory 732 and the storage medium 730 can be short-term storage or permanent storage. The program stored in the storage medium 730 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 722 can be configured to communicate with the storage medium 730 and execute a series of instruction operations in the storage medium 730 on the server 700.
[0145] The server 700 may also include one or more power supplies 726, one or more wired or wireless network interfaces 750, one or more input and output interfaces 758, and / or one or more operating systems 741, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0146] The steps in the above embodiment may also be executed by a server, which may be based on the Figure 7 The server structure shown.
[0147] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the methods described in the above embodiments.
[0148] The embodiments of the present application also provide a computer program product including instructions, which, when executed on a computer, enables the computer to execute the methods described in the aforementioned embodiments.
[0149] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein, for example. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0150] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0151] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0152] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0153] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0154] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store program codes.
[0155] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
[0156] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.
[0157] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0158] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for determining playback duration, applied to a server, characterized in that: The method comprises: When a start play mark for a target media is obtained, the play duration of the target media is started to be counted; the start play mark is generated based on data generated when the terminal starts playing the target media and sent to the server, and the data generated when the target media starts playing includes a trigger operation of clicking to play the target media; the play mode of the target media is one or more combinations of on-demand and live broadcast; In the process of timing the target media, the first play state and the first buffer state of the target media are obtained according to a preset time interval; the play state refers to a state reflecting whether the target media is currently being played, and the buffer state refers to a state reflecting whether the target media is currently being buffered; when it is determined that the state machine of the player is in the playing state or the state currently maintained in the state data is playing, the play state of the target media is determined to be playing, otherwise, the state of the player is other states, and the play state of the target media is determined to be non-playing, the state data is obtained by recording the calling operation of the interface program on the player and the task information sent by the player, the state data is used to reflect the various states generated in sequence by the player in the process of playing the target media, and the task information is used to identify the execution result of the task corresponding to the calling operation performed by the player; when the player sends a buffering message, the buffering state of the target media is determined to be buffering, and when the player does not send a buffering message, the buffering state of the target media is determined to be non-buffering; Determine the timing state of the target media only according to the first playing state and the first buffering state, and count the playing time of the target media according to the timing state, wherein the timing state includes timing and pause timing; when the state of the player is playing and non-buffering, the timing state is timing; when the state of the player is other than playing and non-buffering, the timing state is pause timing; When the end playback identifier for the target media is obtained, the timing of the playback duration of the target media is ended. The end playback identifier is generated based on the data generated when the terminal ends playing the target media and is sent to the server. The data generated when the target media ends playing includes a trigger operation of clicking to stop playing the target media. The playback duration is accumulated as the sum of the total playback duration and the preset time interval.
2. The method according to claim 1, characterized in that The determining the timing state of the target media according to the first playing state and the first buffering state, and timing the target media according to the timing state, includes: If it is determined that the first playing state is playing and the first buffering state is non-buffering, the timing state of the target media is determined to be timing, and the playing time of the target media continues to be timed.
3. The method according to claim 2, characterized in that The method further comprises: If it is determined that the first playback state is non-playing or the first buffering state is buffering, determining that the timing state of the target media is paused, and pausing the timing of the playback duration of the target media; When the second playback state and the second buffering state of the target media are obtained, and it is determined that the second playback state is playback and the second buffering state is non-buffering, the timing state of the target media is determined to be timing, and the timing of the playback time of the target media is restored, wherein the second playback state and the second buffering state are generated after the target media generates the first playback state and the first buffering state.
4. The method according to claim 1, characterized in that The playing state is determined according to the playing state in the state machine; Alternatively, the playback state is determined based on state data recorded during the timing of the target media.
5. The method according to claim 1, characterized in that The buffering state is determined according to the buffering information sent by the player.
6. A device for determining playback duration, applied to a server, characterized in that: The device comprises: a start timing unit, for starting to time the playing time of the target media when a start playing mark for the target media is obtained; the start playing mark is generated based on data generated when the terminal starts playing the target media and sent to the server, the data generated when the target media starts playing includes a trigger operation of clicking to play the target media; the playing mode of the target media is one or more combinations of on-demand and live broadcast; an acquisition unit, for acquiring a first playback state and a first buffering state of the target media according to a preset time interval during the timing of the target media; when it is determined that the state machine of the player is in the playback state or the state currently maintained in the state data is playback, the playback state of the target media is determined to be playback; otherwise, the state of the player is other states, and the playback state of the target media is determined to be non-playing; the state data is obtained by recording the calling operation of the interface program on the player and the task information sent by the player; the state data is used to reflect the various states generated in sequence by the player during the playing of the target media; the task information is used to identify the execution result of the task corresponding to the calling operation performed by the player; when the player sends out buffering information, the buffering state of the target media is determined to be buffering; when the player does not send out buffering information, the buffering state of the target media is determined to be non-buffering; a determining unit, configured to determine a timing state of the target media only according to the first playing state and the first buffering state, and to time the playing time of the target media according to the timing state, wherein the timing state includes timing and pause timing; when the state of the player is playing and non-buffering, the timing state is timing; when the state of the player is other than playing and non-buffering, the timing state is pause timing; An end timing unit is used to end the timing of the playback duration of the target media when an end playback identifier for the target media is obtained. The end playback identifier is generated based on data generated when the terminal ends playing the target media and sent to the server. The data generated when the target media ends playing includes a trigger operation of clicking to stop playing the target media. The playback duration is accumulated as the sum of the total playback duration and a preset time interval.
7. The device according to claim 6, characterized in that The determining unit is specifically used for: If it is determined that the first playing state is playing and the first buffering state is non-buffering, the timing state of the target media is determined to be timing, and the playing time of the target media continues to be timed.
8. The device according to claim 7, characterized in that The determining unit is specifically used for: If it is determined that the first playback state is non-playing or the first buffering state is buffering, determining that the timing state of the target media is paused, and pausing the timing of the playback duration of the target media; When the second playback state and the second buffering state of the target media are obtained, and it is determined that the second playback state is playback and the second buffering state is non-buffering, the timing state of the target media is determined to be timing, and the timing of the playback time of the target media is restored, wherein the second playback state and the second buffering state are generated after the target media generates the first playback state and the first buffering state.
9. The device according to claim 6, characterized in that The playing state is determined according to the playing state in the state machine; Alternatively, the playback status is determined based on status data recorded during the timing of the target media, and the status data is determined based on the calling operation of the interface program on the player and the task information sent by the player, and the task information is used to identify the execution result of the task corresponding to the calling operation performed by the player.
10. The device according to claim 6, characterized in that The buffering state is determined according to the buffering information sent by the player.
11. A device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the playback duration determination method described in any one of claims 1-5 according to the instructions in the program code.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the playback duration determination method described in any one of claims 1-5.
13. A computer program product comprising instructions, characterized in that When the computer program product runs on a computer, the computer executes the method for determining the playback duration described in any one of claims 1 to 5.
Citation Information
Patent Citations
Detection method and device for video playing fluency
CN103533454A