Nothing Special   »   [go: up one dir, main page]

CN113992990A - Method and device for determining resource playing time, electronic equipment and storage medium - Google Patents

Method and device for determining resource playing time, electronic equipment and storage medium Download PDF

Info

Publication number
CN113992990A
CN113992990A CN202111250638.7A CN202111250638A CN113992990A CN 113992990 A CN113992990 A CN 113992990A CN 202111250638 A CN202111250638 A CN 202111250638A CN 113992990 A CN113992990 A CN 113992990A
Authority
CN
China
Prior art keywords
resource
playing
state
play
client
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111250638.7A
Other languages
Chinese (zh)
Inventor
李广
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202111250638.7A priority Critical patent/CN113992990A/en
Publication of CN113992990A publication Critical patent/CN113992990A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/458Scheduling content for creating a personalised stream, e.g. by combining a locally stored advertisement with an incoming stream; Updating operations, e.g. for OS modules ; time-related management operations
    • H04N21/4586Content update operation triggered locally, e.g. by comparing the version of software modules in a DVB carousel to the version stored locally
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Landscapes

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

Abstract

The disclosure relates to a method and a device for determining a resource playing time length, an electronic device and a storage medium. The method comprises the following steps: receiving a play state notification aiming at the multimedia resource sent by a client, and generating a resource state corresponding to the play state notification, wherein the play state notification is sent by the client when the play state of the multimedia resource is changed; and determining the playing time length of the multimedia resource according to the resource state and the generation time stamp of the resource state. According to the scheme disclosed by the invention, a set of play time statistical logic does not need to be separately developed for each form of client, so that the development cost of the play time statistical logic is greatly reduced.

Description

Method and device for determining resource playing time, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method and an apparatus for determining a resource playing duration, an electronic device, a computer storage medium, and a computer product.
Background
With the development of internet technology, many platforms provide multimedia resources for users to watch, for example, for a live application platform, a main broadcast can play movie resources in a live broadcast manner in a live broadcast room scene, so that the movie resources can be watched and discussed synchronously with other users in the live broadcast room. The platform often needs to collect the duration of the multimedia resource played by the user account to meet specific service requirements.
In the related art, the playing duration of the user account may be collected based on the client. The method comprises the steps of configuring a state machine for maintaining resource playing at a client in advance, collecting playing time of resources through the state machine, and periodically reporting the collected playing time to a server. However, for applications having clients of various forms (for example, applications including android, web page, and other forms), a set of statistical logic for playing time duration needs to be developed separately for each form of client, which causes a problem of high development cost.
Disclosure of Invention
The present disclosure provides a method and an apparatus for determining a resource playing duration, an electronic device, a computer storage medium, and a computer product, so as to at least solve the problem of high development cost of statistical logic of resource playing duration in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, a method for determining a resource playing duration is provided, including:
receiving a play state notification aiming at a multimedia resource sent by a client, and generating a resource state corresponding to the play state notification, wherein the play state notification is sent by the client when the play state of the multimedia resource is changed;
and determining the playing time length of the multimedia resource according to the resource state and the generation time stamp of the resource state.
In one embodiment, the play status notification is information sent when the client receives a change operation of the play status.
In one embodiment, the determining the playing duration of the multimedia resource according to the resource status and the timestamp generated by the resource status includes:
when the current resource state is switched to other resource states except the resource state in playing, generating the current segment duration according to the generation timestamp of the current resource state and the generation timestamp of the previous resource state;
and accumulating the current segmentation time length to the playing time length of the multimedia resource until the resource state of the multimedia resource is generated to be the playing end, and obtaining the playing time length of the multimedia resource.
In one embodiment, the play status notification carries the current play speed of the multimedia resource;
when the current resource state is switched from playing to other resource states except for playing, the current segment duration is generated according to the generation timestamp of the current resource state and the generation timestamp of the previous resource state, and the method comprises the following steps:
when the current resource state is switched to other resource states except for the resource state in playing, acquiring the time difference between the generation time stamp of the current resource state and the generation time stamp of the last resource state;
and generating the current segmentation duration of the multimedia resource according to the current playing speed and the time difference.
In one embodiment, the playing status includes start of playing, pause of playing, end of playing;
the receiving a play state notification for the multimedia resource sent by the client, and generating a resource state corresponding to the play state notification includes:
receiving a play start notification aiming at the multimedia resource sent by the client, and generating a resource state of the multimedia resource as playing;
receiving a play pause notification aiming at the multimedia resource sent by the client, and generating that the resource state of the multimedia resource is pause;
and receiving a play end notification aiming at the multimedia resource sent by the client, and generating the resource state of the multimedia resource as the play end.
In one embodiment, the start playing notification is information sent by the client automatically invoking a playing start interface when determining that the multimedia resource starts playing;
the playing end notification is information sent by automatically calling a playing end interface when the client determines that the multimedia resources are completely played.
In one embodiment, the receiving a play end notification for the multimedia resource sent by the client, and generating that the resource status of the multimedia resource is play end includes:
and when the heartbeat message reported by the client is not received within the preset time length, determining that the playing end notification of the multimedia resource is received, and generating the resource state of the multimedia resource as the playing end.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for determining a resource playing duration, including:
the state receiving module is configured to execute receiving of a play state notification sent by a client for a multimedia resource, and generate a resource state corresponding to the play state notification, wherein the play state notification is sent by the client when the play state of the multimedia resource is changed;
and the time length determining module is configured to determine the playing time length of the multimedia resource according to the resource state and the generation timestamp of the resource state.
In one embodiment, the play status notification is information sent when the client receives a change operation of the play status.
In one embodiment, the duration determining module includes:
the segmentation duration determination unit is configured to execute that when the current resource state is switched to other resource states except for the current resource state during playing, the current segmentation duration is generated according to the generation timestamp of the current resource state and the generation timestamp of the last resource state;
and the time length determining unit is configured to accumulate the current segmentation time length into the playing time length of the multimedia resource until the resource state of the multimedia resource is generated to be the playing end, so as to obtain the playing time length of the multimedia resource.
In one embodiment, the play status notification carries the current play speed of the multimedia resource;
the segment duration determining unit includes:
a time difference acquisition subunit configured to acquire a time difference between a generation time stamp of a current resource state and a generation time stamp of a previous resource state when the current resource state is switched from being played to a resource state other than being played;
and the segmentation duration determining subunit is configured to generate the current segmentation duration of the multimedia resource according to the current playing speed and the time difference.
In one embodiment, the playing status includes start of playing, pause of playing, end of playing;
the state receiving module comprises:
a playing notification receiving unit configured to execute receiving a starting playing notification for the multimedia resource sent by the client, and generate a resource state of the multimedia resource as playing;
a pause notification receiving unit configured to execute receiving a play pause notification for the multimedia resource sent by the client, and generate a resource state of the multimedia resource as pause;
and the ending notice receiving unit is configured to execute receiving of a playing ending notice aiming at the multimedia resource sent by the client, and generate the resource state of the multimedia resource as playing ending.
In one embodiment, the start playing notification is information sent by the client automatically invoking a playing start interface when determining that the multimedia resource starts playing;
the playing end notification is information sent by automatically calling a playing end interface when the client determines that the multimedia resources are completely played.
In one embodiment, the end notification receiving unit is configured to determine that the play end notification of the multimedia resource is received when the heartbeat message reported by the client is not received within a preset time period, and generate a resource state of the multimedia resource as play end.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method for determining the resource playing time length as described in any embodiment of the first aspect.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, where instructions of the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method for determining a resource playing time length according to any one of the embodiments of the first aspect.
According to a fifth aspect of the embodiments of the present disclosure, a computer program product is provided, where the computer program product includes instructions, and when the instructions are executed by a processor of an electronic device, the electronic device is enabled to execute the method for determining a resource playing time length according to any one of the embodiments of the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the method comprises the steps that a state machine for maintaining the playing time of the resources is deployed in a server, the server generates a playing state corresponding to the playing state notification based on the playing state notification sent by a client, and the playing time of the multimedia resources is determined according to a generating timestamp of the playing state, so that a set of playing time statistical logic does not need to be separately developed for the clients in each form, and the development cost of the playing time statistical logic is greatly reduced. In addition, by deploying uniform playing time statistical logic in the server, when the playing time statistical logic has a problem, the problem can be quickly repaired under the condition that a user does not perceive the problem.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
Fig. 1 is a diagram illustrating an application environment of a method for determining a play-out duration of a resource according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a method for determining a play-out duration of a resource according to an exemplary embodiment.
FIG. 3 is a flowchart illustrating a step of determining a playout duration of a resource in accordance with an exemplary embodiment.
Fig. 4 is a flowchart illustrating a method for determining a play-out duration of a resource according to an exemplary embodiment.
FIG. 5 is a diagram illustrating a determination of a resource playout duration in accordance with an exemplary embodiment.
Fig. 6 is a block diagram illustrating an apparatus for determining a playing time duration of a resource according to an exemplary embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are both information and data that are authorized by the user or sufficiently authorized by various parties.
The method for determining the resource playing time provided by the present disclosure may be applied to an application environment as shown in fig. 1. Wherein the terminal 110 interacts with the server 120 through the network. The terminal 110 has installed therein an application program that enables a user account to play a multimedia asset. The application program can be a video application program, an instant messaging application program, a shopping application program, a live broadcast application program and the like. After determining the multimedia resource to be played, when the playing state of the acquired multimedia resource changes, the client sends a playing state change notification to the server 120, so as to notify the server 120 of the currently changed playing state. The server 120 generates a resource status corresponding to the play status change notification. And after the multimedia resource is played, generating a playing time length for the terminal 110 to play the multimedia resource according to the generation time stamp of the resource state.
The terminal 110 may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 120 may be implemented by an independent server or a server cluster formed by a plurality of servers.
Fig. 2 is a flowchart illustrating a method for determining a resource playing time length according to an exemplary embodiment, where as shown in fig. 2, the method for determining a resource playing time length is used in a server, and includes the following steps.
In step S210, a play state notification for the multimedia resource sent by the client is received, and a resource state corresponding to the play state notification is generated, where the play state notification is sent by the client when the play state of the multimedia resource is changed.
The multimedia resource may refer to a resource capable of digital transmission, including sound, video, animation, games, and the like.
A multimedia asset is an asset that a client is playing or is to be played. In one example, the multimedia asset is a video that the client is playing. The video may be played by the client in response to a click operation by the user. In another example, the multimedia resource may be a resource that the client shares in the virtual space. A virtual space may refer to a webcast room that shares multimedia resources, such as a live room that hosts movies, television shows, art programs, and the like.
The resource status may be, but is not limited to, ready to play, in play, paused in play, ended in play, etc. The change of the playing state refers to the change of the multimedia resource from a first playing state to a second playing state, and the first playing state is different from the second playing state. In one embodiment, the change of the playing status may be manually triggered by the user, for example, the client detects that the user clicks a pause button, and changes the playing status of the multimedia resource from playing to paused. In another embodiment, the change of the playing status may be automatically triggered by the client, for example, the client determines that the playing time of the advertisement is currently satisfied, and automatically changes the playing status of the multimedia resource from playing to pause. Or the client terminal automatically changes the playing state of the multimedia resource from playing to playing ending after the multimedia resource is completely played.
Specifically, a state machine for maintaining the playing of the multimedia resource is pre-deployed in the server. After the client acquires the multimedia resource and starts playing, the client can send a play starting notice to the server, so that the server creates a play record of playing the multimedia resource by a user account currently logged in the client. In the process of playing the multimedia resource, whenever the client detects that the playing state of the multimedia resource is changed, a corresponding playing state change notification is sent to the server so as to notify the server to generate the resource state corresponding to the current playing state change notification. In one example, when the client determines that the current play state of the multimedia asset is changed from play to play pause, a play pause notification is sent to the server. The server receives the play pause notification and generates the resource state as pause.
In step S220, the playing duration of the multimedia resource is determined according to the resource status and the timestamp generated by the resource status.
In this case, the generation timestamp of the resource status may be a timestamp when the playing status is changed, and in this case, the generation timestamp may be carried in the playing change notification. The generation timestamp of the resource status may also be a timestamp of when the server receives the play status change notification.
Specifically, after the client determines that the multimedia resource is played, a play end notification may be sent to the server, so that the server generates a play state in which the playing is ended. And the server generates the total playing time of the multimedia resource played by the user account according to the playing states generated by the user account playing the multimedia resource and the generating time stamp corresponding to each playing state.
In one example, when there is a timestamp in play in the resource state, the server obtains a time length between the generation timestamp in play and the generation timestamp in the next resource state in play (not in play), and takes the time length as the total play time length. When there are multiple in-play timestamps in the resource state, the server obtains the generation timestamp in each play and the segment duration between the generation timestamps of the next resource state (not in play) in each play. And taking the sum of the segment time lengths as the total playing time length.
In the method for determining the resource playing time, the state machine for maintaining the resource playing time is deployed in the server, so that the server generates the playing state corresponding to the playing state notification based on the playing state notification sent by the client, and the playing time of the multimedia resource is determined according to the generating timestamp of the playing state, thereby not needing to develop a set of playing time statistical logic for each form of client independently, and greatly reducing the development cost of the playing time statistical logic. In addition, by deploying uniform playing time statistical logic in the server, when the playing time statistical logic has a problem, the problem can be quickly repaired under the condition that a user does not perceive the problem.
In an exemplary embodiment, the playing state includes start playing, pause playing, end playing; and when the playing state of the multimedia resource acquired by the client is changed into playing start, sending a playing start notification to the server. And the server receives a starting playing notification aiming at the multimedia resource sent by the client, and generates the resource state of the multimedia resource as playing. And when the playing state of the multimedia resource acquired by the client is changed into pause, sending a play pause notification to the server. And the server receives a play pause notification aiming at the multimedia resource sent by the client and generates the resource state of the multimedia resource as pause. And when the playing state of the multimedia resource acquired by the client is changed to be finished, sending a playing finishing notice to the server. And the server receives a play end notification aiming at the multimedia resource sent by the client, and generates a resource state of the multimedia resource as the play end.
In one embodiment, the playing status further comprises changing the playing progress. The playing progress can be changed to a direction earlier than the current playing time, for example, the resource content currently played to the time of 1 hour can be backed to the resource content played for 40 minutes; the playing schedule may also be changed to a direction later than the current playing time, for example, the resource content currently played to the time of 1 hour may be advanced to the resource content played for 80 minutes. When the client side obtains the change playing progress, a change notification of the playing progress is sent to the server, so that the server generates a resource state of 'playing-change playing progress'.
In another embodiment, the play state further comprises changing the play speed. The playing speed may be changed to a direction slower than the current playing speed, for example, the current playing speed is 1 time, and the playing speed may be changed to 0.8 time; the playing speed may be changed to a direction faster than the current playing speed, for example, the current playing speed is 1 time speed, and the playing speed may be changed to 1.2 times speed. When the client acquires the change of the playing speed, a change notice of the playing speed is sent to the server, so that the server generates a resource state of 'playing-changing playing speed'.
In this embodiment, by configuring multiple play states, the play process of the multimedia resource is comprehensively monitored, and the recording accuracy of the play states can be ensured. In addition, by recording the relatively comprehensive playing state, an accurate data basis can be provided for the subsequent data analysis service requirement.
In an exemplary embodiment, the play status notification may be information that is automatically sent by the client.
In one embodiment, the start playing notification is sent by the client automatically invoking the play start interface when determining that the multimedia asset starts playing. According to one example, when the client detects that the user clicks the access entrance of the multimedia resource, a playing request of the multimedia resource is sent to the server, so that the server sends the data stream of the multimedia resource to the client according to the playing request. The client receives the data stream, automatically starts playing the multimedia resource, and automatically calls the playing start interface to send a playing start notification to the server.
In another example, the play end notification is information sent by the client automatically invoking the play end interface when it is determined that the multimedia resource is completely played.
In this embodiment, the automatic monitoring process of the client is included as a way of changing the playing state of the multimedia resource, so that the state change detection of the multimedia resource is more comprehensive, state omission and loss are avoided, and the accuracy of the determined playing duration is improved.
In an exemplary embodiment, the playing duration may be collected by a server. A long connecting channel is maintained between the client and the server, and the server can summarize the playing time of the multimedia resources by carrying the playing information of the multimedia resources in real time in the long connecting heartbeat. However, since extra service information is carried in the connection heartbeat, the maintenance cost of the long connection service is increased; in addition, the long connection heartbeat carrying extra service information also occupies a large amount of bandwidth, and the bandwidth cost of the server is obviously provided.
In another exemplary embodiment, the server and the client are connected in a long connection. And if the server does not receive the heartbeat message reported by the client within the preset time length, determining that a play end notification of the multimedia resource is received, so that the resource state of the multimedia resource generated by the server is the play end. Further, if the server does not receive the heartbeat message reported by the client within the preset time length, the server can detect the activity based on the heartbeat of the client and clear the invalid connection in time.
In this embodiment, by deploying the state machine in the server and combining the long connection heartbeat mode, the statistics of the playing time length can be accurately achieved at a low development cost, and meanwhile, extra communication cost and maintenance cost cannot be caused to the server.
In an exemplary embodiment, the play state notification is information sent when the client receives a change operation of the play state. That is, the change of the play state may be manually triggered by the user.
In one embodiment, the change operation of the playing state may be triggered by a voice instruction of the user. For example, if the client acquires voice data "start playing", a play start notification is sent to the server, so that the server generates a resource state "play in progress"; when the client acquires voice data 'pause playing', a playing pause notification is sent to the server so that the server generates a resource state 'pause'; and when the client acquires the voice data 'stop playing', sending a playing end notification to the server so as to enable the server to generate a resource state 'playing end'.
In another embodiment, the change operation of the playing state may be manually triggered by the user. For example, when the client detects that the user clicks a play button/changes a play page from a minimized to a normal display, a play start notification is sent to the server, so that the server generates a resource status "in play". When the client detects that the user clicks a pause key, clicks a playing page of the multimedia resource, opens other pages, minimizes the playing page of the multimedia resource and the like, the client sends a playing pause notification to the server so as to enable the server to generate a resource state pause. When the client detects that the user clicks a play end key, a page close button, an input close shortcut key and the like, a play end notification is sent to the server so that the server generates a resource state 'play end'.
In this embodiment, the active trigger operation of the user is included as a way of changing the playing state of the multimedia resource, so that the state change detection of the multimedia resource is more comprehensive, state omission and loss are avoided, and the accuracy of the determined playing duration is improved.
In an exemplary embodiment, as shown in fig. 3, the step S220 of determining the playing duration of the multimedia resource according to the resource status and the generation timestamp of the resource status includes:
in step S310, when the current resource state is switched from playing to a resource state other than playing, the current segment duration is generated according to the generation timestamp of the current resource state and the generation timestamp of the previous resource state.
In step S320, the current segment duration is accumulated into the playing duration of the multimedia resource until the resource state of the generated multimedia resource is the end of playing, so as to obtain the playing duration of the multimedia resource.
Specifically, each time the server changes the current resource state from playing to another resource state other than playing in response to the playing state change notification sent by the client, the server obtains the generation timestamp of the other resource state currently generated and the time difference between the generation timestamps of the last resource state of the current resource state (i.e., during playing), and generates the current segment duration according to the time difference. And accumulating the generated current segmentation time length into the playing time length of the multimedia resource. And repeating the process until the resource state of the generated multimedia resource is the playing end, and obtaining the accumulated playing time as the playing time of the multimedia resource played by the user account.
In the embodiment, the current segmentation time length is counted in real time, the total playing time length of the multimedia resource is updated in real time according to the current segmentation time length, the timeliness of data updating is ensured, and data loss or errors caused by unexpected faults and the like are avoided.
In an exemplary embodiment, the play status notification carries the current play speed of the multimedia asset; in step S310, when the current resource state is switched from playing to a resource state other than playing, generating a current segment duration according to the generation timestamp of the current resource state and the generation timestamp of the previous resource state, including: when the current resource state is switched from playing to other resource states except for playing, the time difference between the generation timestamp of the current resource state and the generation timestamp of the last resource state is acquired. And generating the current segmentation duration of the multimedia resource according to the current playing speed and the time difference.
Specifically, each time the server changes the current resource state from playing to another resource state other than playing in response to the play state change notification sent by the client, the generation timestamp of the other resource state currently generated and the time difference between the generation timestamps of the last resource state of the current resource state (i.e., in playing) are acquired. The server obtains the current playing speed carried in the current playing state change notice. And taking the product of the current playing speed and the time difference as the current segment time length.
In this embodiment, the real-time playing speed is carried in the playing state notification, so that the consistency between the playing time calculated by the server and the actual playing time of the client can be ensured.
Fig. 4 is a flowchart of a method for determining a resource playing time duration according to an exemplary embodiment, which is described with reference to the schematic diagram of determining a resource playing time duration shown in fig. 5 by taking the method as an example for a virtual space of a shared multimedia resource, and includes the following steps:
in step S402, a sharing request of a multimedia resource sent by a client (i.e., an anchor) is received, a play record of the multimedia resource is created, a play state is generated to be ready for playing, and a data stream of the multimedia resource is sent to the client.
In step S404, a play start notification sent by the client automatically invoking the play start interface is received, and the play state is generated as being played.
In step S406, during the playing process, if a play pause notification for the multimedia resource sent by the client is received, the resource state of the multimedia resource is generated as pause. Wherein the play pause notification may be generated according to a trigger operation of the anchor.
In step S408, a current segment duration is generated according to the generation timestamp of the current resource status (i.e. the playing pause) and the generation timestamp of the previous resource status, and the current segment duration is accumulated into the playing duration of the multimedia resource.
In step S410, when the notification of starting playing for the multimedia asset sent by the client is received again, the resource status of the multimedia asset is generated as being played, and the above steps S406 and S408 are repeated. Wherein the start playing notification may be generated according to a trigger operation of the anchor.
In step S412, if the play end notification for the multimedia resource sent by the client is received, the resource state of the multimedia resource is generated as the play end. The playing end notification may be generated according to a trigger operation of the anchor broadcast, or may be sent by automatically calling the playing end interface when the client determines that all multimedia resources are played, or may be automatically determined by the server according to the heartbeat message reported by the client.
In step S414, the currently accumulated playing duration of the multimedia resource is obtained as the total playing duration of the anchor playing multimedia resource.
It should be understood that, although the steps in the above-described flowcharts are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the above-mentioned flowcharts may include a plurality of steps or a plurality of stages, which are not necessarily performed at the same time, but may be performed at different times, and the order of performing the steps or the stages is not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a part of the steps or the stages in other steps.
It is understood that the same/similar parts between the embodiments of the method described above in this specification can be referred to each other, and each embodiment focuses on the differences from the other embodiments, and it is sufficient that the relevant points are referred to the descriptions of the other method embodiments.
Fig. 6 is a block diagram illustrating an apparatus 600 for determining a playing time duration of a resource according to an exemplary embodiment. Referring to fig. 6, the apparatus includes a status receiving module 602 and a duration determining module 604.
A state receiving module 602 configured to perform receiving a play state notification sent by a client for a multimedia resource, and generate a resource state corresponding to the play state notification, where the play state notification is sent by the client when a play state of the multimedia resource changes; a duration determining module 604 configured to determine the playing duration of the multimedia resource according to the resource status and the generation timestamp of the resource status.
In an exemplary embodiment, the play status notification is information sent when the client receives a change operation of the play status.
In an exemplary embodiment, the duration determination module 604 includes: the segmentation duration determination unit is configured to execute that when the current resource state is switched to other resource states except for the current resource state during playing, the current segmentation duration is generated according to the generation timestamp of the current resource state and the generation timestamp of the last resource state; and the time length determining unit is configured to accumulate the current segmentation time length into the playing time length of the multimedia resource until the resource state of the generated multimedia resource is the playing end, so as to obtain the playing time length of the multimedia resource.
In an exemplary embodiment, the play status notification carries the current play speed of the multimedia asset; a segment duration determination unit comprising: a time difference acquisition subunit configured to acquire a time difference between the generation time stamp of the current resource state and the generation time stamp of the last resource state when the current resource state is switched from being played to a resource state other than being played; and the segmentation duration determining subunit is configured to generate the current segmentation duration of the multimedia resource according to the current playing speed and the time difference.
In an exemplary embodiment, the playing state includes start playing, pause playing, end playing; a status receiving module 602, comprising: the playing notification receiving unit is configured to execute receiving of a starting playing notification for the multimedia resource sent by the client, and generate a resource state of the multimedia resource as playing; a pause notification receiving unit configured to execute receiving a play pause notification for the multimedia resource sent by the client, and generate a resource state of the multimedia resource as pause; and the ending notice receiving unit is configured to execute receiving of a playing ending notice aiming at the multimedia resource sent by the client, and generate the resource state of the multimedia resource as playing ending.
In an exemplary embodiment, the start playing notification is information sent by the client automatically invoking the play start interface when determining that the multimedia resource starts to play; the playing end notification is information sent by automatically calling the playing end interface when the client determines that the multimedia resources are completely played.
In an exemplary embodiment, the end notification receiving unit is configured to determine that a play end notification of the multimedia resource is received when the heartbeat message reported by the client is not received within a preset time period, and generate a resource state of the multimedia resource as a play end.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 7 is a block diagram illustrating an electronic device S00 for determining a resource playout duration in accordance with an exemplary embodiment. For example, the electronic device S00 may be a server. Referring to FIG. 7, electronic device S00 includes a processing component S20 that further includes one or more processors and memory resources represented by memory S22 for storing instructions, such as applications, that are executable by processing component S20. The application program stored in the memory S22 may include one or more modules each corresponding to a set of instructions. Further, the processing component S20 is configured to execute instructions to perform the above-described method.
The electronic device S00 may further include: the power supply module S24 is configured to perform power management of the electronic device S00, the wired or wireless network interface S26 is configured to connect the electronic device S00 to a network, and the input/output (I/O) interface S28. The electronic device S00 may operate based on an operating system stored in the memory S22, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, or the like.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory S22 comprising instructions, executable by the processor of the electronic device S00 to perform the above method is also provided. The storage medium may be a computer-readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided a computer program product comprising instructions executable by a processor of the electronic device S00 to perform the above method.
It should be noted that the descriptions of the above-mentioned apparatus, the electronic device, the computer-readable storage medium, the computer program product, and the like according to the method embodiments may also include other embodiments, and specific implementations may refer to the descriptions of the related method embodiments, which are not described in detail herein.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A method for determining a resource playing time length is characterized by comprising the following steps:
receiving a play state notification aiming at a multimedia resource sent by a client, and generating a resource state corresponding to the play state notification, wherein the play state notification is sent by the client when the play state of the multimedia resource is changed;
and determining the playing time length of the multimedia resource according to the resource state and the generation time stamp of the resource state.
2. The method according to claim 1, wherein the play status notification is a message sent by the client when receiving a change operation of the play status.
3. The method for determining the playing duration of the resource according to claim 1, wherein the determining the playing duration of the multimedia resource according to the resource status and the timestamp generated by the resource status comprises:
when the current resource state is switched to other resource states except the resource state in playing, generating the current segment duration according to the generation timestamp of the current resource state and the generation timestamp of the previous resource state;
and accumulating the current segmentation time length to the playing time length of the multimedia resource until the resource state of the multimedia resource is generated to be the playing end, and obtaining the playing time length of the multimedia resource.
4. The method for determining the playing duration of a resource according to claim 3, wherein the playing status notification carries the current playing speed of the multimedia resource;
when the current resource state is switched from playing to other resource states except for playing, the current segment duration is generated according to the generation timestamp of the current resource state and the generation timestamp of the previous resource state, and the method comprises the following steps:
when the current resource state is switched to other resource states except for the resource state in playing, acquiring the time difference between the generation time stamp of the current resource state and the generation time stamp of the last resource state;
and generating the current segmentation duration of the multimedia resource according to the current playing speed and the time difference.
5. The method for determining the playing duration of a resource according to claim 1, wherein the playing status includes start of playing, pause of playing, end of playing;
the receiving a play state notification for the multimedia resource sent by the client, and generating a resource state corresponding to the play state notification includes:
receiving a play start notification aiming at the multimedia resource sent by the client, and generating a resource state of the multimedia resource as playing;
receiving a play pause notification aiming at the multimedia resource sent by the client, and generating that the resource state of the multimedia resource is pause;
and receiving a play end notification aiming at the multimedia resource sent by the client, and generating the resource state of the multimedia resource as the play end.
6. The method for determining the playing duration of a resource according to claim 5, wherein the play start notification is a message sent by the client automatically invoking a play start interface when determining that the multimedia resource starts to play;
the playing end notification is information sent by automatically calling a playing end interface when the client determines that the multimedia resources are completely played.
7. An apparatus for determining a playing duration of a resource, comprising:
the state receiving module is configured to execute receiving of a play state notification sent by a client for a multimedia resource, and generate a resource state corresponding to the play state notification, wherein the play state notification is sent by the client when the play state of the multimedia resource is changed;
and the time length determining module is configured to determine the playing time length of the multimedia resource according to the resource state and the generation timestamp of the resource state.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method for determining a resource playout duration as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method for determining a resource playout duration of any one of claims 1-6.
10. A computer program product comprising instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the method for determining a playout duration of a resource as claimed in any one of claims 1 to 6.
CN202111250638.7A 2021-10-26 2021-10-26 Method and device for determining resource playing time, electronic equipment and storage medium Pending CN113992990A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111250638.7A CN113992990A (en) 2021-10-26 2021-10-26 Method and device for determining resource playing time, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111250638.7A CN113992990A (en) 2021-10-26 2021-10-26 Method and device for determining resource playing time, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113992990A true CN113992990A (en) 2022-01-28

Family

ID=79741918

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111250638.7A Pending CN113992990A (en) 2021-10-26 2021-10-26 Method and device for determining resource playing time, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113992990A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227301A (en) * 2007-12-27 2008-07-23 华为技术有限公司 Device and method for charging based on business visit time
CN104702563A (en) * 2013-12-06 2015-06-10 乐视网信息技术(北京)股份有限公司 Method and device for acquiring streaming media play time
WO2017181506A1 (en) * 2016-04-20 2017-10-26 深圳Tcl数字技术有限公司 Display terminal information source switching method and device
CN108337281A (en) * 2017-01-19 2018-07-27 北京京东尚科信息技术有限公司 Calculate the method and system of page browsing duration
CN112261447A (en) * 2020-10-16 2021-01-22 彩讯科技股份有限公司 Video effective playing time counting method and device, server and storage medium
CN112437329A (en) * 2020-11-05 2021-03-02 上海幻电信息科技有限公司 Method, device and equipment for playing video and readable storage medium
CN113163235A (en) * 2021-05-19 2021-07-23 湖南快乐阳光互动娱乐传媒有限公司 Method and device for acquiring video watching time length
CN113453066A (en) * 2020-03-24 2021-09-28 腾讯科技(深圳)有限公司 Playing time determining method and related equipment

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101227301A (en) * 2007-12-27 2008-07-23 华为技术有限公司 Device and method for charging based on business visit time
CN104702563A (en) * 2013-12-06 2015-06-10 乐视网信息技术(北京)股份有限公司 Method and device for acquiring streaming media play time
WO2017181506A1 (en) * 2016-04-20 2017-10-26 深圳Tcl数字技术有限公司 Display terminal information source switching method and device
CN108337281A (en) * 2017-01-19 2018-07-27 北京京东尚科信息技术有限公司 Calculate the method and system of page browsing duration
CN113453066A (en) * 2020-03-24 2021-09-28 腾讯科技(深圳)有限公司 Playing time determining method and related equipment
CN112261447A (en) * 2020-10-16 2021-01-22 彩讯科技股份有限公司 Video effective playing time counting method and device, server and storage medium
CN112437329A (en) * 2020-11-05 2021-03-02 上海幻电信息科技有限公司 Method, device and equipment for playing video and readable storage medium
CN113163235A (en) * 2021-05-19 2021-07-23 湖南快乐阳光互动娱乐传媒有限公司 Method and device for acquiring video watching time length

Similar Documents

Publication Publication Date Title
US11665378B2 (en) Establishment and use of time mapping based on interpolation using low-rate fingerprinting, to help facilitate frame-accurate content revision
CN111901617B (en) Method and device for calculating live broadcast watching time length
CN108810657B (en) Method and system for setting video cover
CN106454389B (en) A kind of playback method and device of live video
JP7181989B2 (en) Advance preparation for content modifications based on expected wait times when retrieving new content
CN106998485B (en) Video live broadcasting method and device
CN112752114B (en) Method and device for generating live broadcast playback interactive message, server and storage medium
EP3754998B1 (en) Streaming media quality monitoring method and system
CN113518247A (en) Video playing method, related equipment and computer readable storage medium
CN112057846B (en) Interaction method, device, equipment and storage medium for cloud game service scheduling
CN112218115B (en) Control method and device for streaming media audio and video synchronization and computer equipment
CN112995776B (en) Method, device, equipment and storage medium for determining screen capture frame rate of shared screen content
WO2015154549A1 (en) Data processing method and device
CN110620699A (en) Message arrival rate determination method, device, equipment and computer readable storage medium
CN106657172A (en) Method and device for realizing information push
CN113992990A (en) Method and device for determining resource playing time, electronic equipment and storage medium
US20230353653A1 (en) System, method and computer-readable medium for notification
CN114422817B (en) Live broadcast room data processing method and device, electronic equipment and storage medium
CN113660540B (en) Image information processing method, system, display method, device and storage medium
CN109194971A (en) Method and device for generating multimedia file
CN114827653A (en) Live broadcast audio reporting method and device, equipment and storage medium
CN111479161B (en) Live broadcast quality data reporting method and device
CN112040328B (en) Data interaction method and device and electronic equipment
CN107734396A (en) A kind of multimedia resource player method, device and storage medium
CN114845142A (en) Data recording method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination