CN113438498B - Video playing method and device - Google Patents

Video playing method and device Download PDF

Info

Publication number
CN113438498B
CN113438498B CN202110705437.5A CN202110705437A CN113438498B CN 113438498 B CN113438498 B CN 113438498B CN 202110705437 A CN202110705437 A CN 202110705437A CN 113438498 B CN113438498 B CN 113438498B
Authority
CN
China
Prior art keywords
backup
target
video
backup address
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.)
Active
Application number
CN202110705437.5A
Other languages
Chinese (zh)
Other versions
CN113438498A (en
Inventor
易桂
李小红
彭一
赵仙勇
王亚飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Original Assignee
Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Happly Sunshine Interactive Entertainment Media Co Ltd filed Critical Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Priority to CN202110705437.5A priority Critical patent/CN113438498B/en
Publication of CN113438498A publication Critical patent/CN113438498A/en
Application granted granted Critical
Publication of CN113438498B publication Critical patent/CN113438498B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • H04N21/23116Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving data replication, e.g. over plural servers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/80Responding to QoS

Landscapes

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

Abstract

The application discloses a video playing method and device, wherein the method comprises the following steps: receiving a request for acquiring a play string of a target video, which is sent by a target client; judging whether a target backup address exists or not; the target backup address comprises a backup address corresponding to the target client and/or a backup address corresponding to the target video; the backup address corresponding to the target client is an address which is set in advance when the target client cannot play the video and is used for acquiring a backup play string of any one video; setting a backup address corresponding to the target video when the target video cannot be normally played in advance; if the target backup address exists, determining a backup play string of the target video based on the target backup address; feeding back the backup play string of the target video to the target client for playing; and if the target backup address does not exist, acquiring the original play string of the target video, and feeding the original play string of the target video back to the target client for playing.

Description

Video playing method and device
Technical Field
The present application relates to the field of video playing technologies, and in particular, to a method and an apparatus for playing a video.
Background
Although the current video technology has been developed to a higher level, the situation that the video cannot be played normally still occurs due to factors such as file errors and server failures, so how to effectively ensure the normal playing of the video still is an important problem in the field.
In the current video playing mode, when a user requests a video, a client sends a video playing request to a backend to obtain a playing string of the requested video. After receiving the video playing request, the back end finds an original playing string of the video requested to be played according to the video identifier in the video playing request, and feeds the original playing string back to the client for playing. When the video cannot be played normally in the user equipment, the problem needs to be located by technical personnel, and the located video file or server with the problem needs to be maintained correspondingly.
Therefore, in the existing playing mode, technicians need to locate problems and solve the problems, the technicians can normally visit the back end to obtain the video file which can be normally played for playing. However, since the maintenance process is relatively long, there is a problem that the video playing cannot be resumed in time, which seriously affects the user experience.
Disclosure of Invention
Based on the defects of the prior art, the application provides a video playing method and device, so as to solve the problem that the video playing cannot be timely recovered in the prior art.
In order to achieve the above object, the present application provides the following technical solutions:
a first aspect of the present application provides a method for playing a video, including:
receiving a request for acquiring a play string of a target video, which is sent by a target client;
judging whether a target backup address exists or not; the target backup address comprises a backup address corresponding to the target client and/or a backup address corresponding to the target video; the backup address corresponding to the target client is an address which is set before the request is received and when the target client cannot play videos and is used for storing a backup play string of any one video; setting a backup address corresponding to the target video before receiving the request and when the target video cannot be normally played;
if the target backup address exists, determining a backup play string of the target video based on the target backup address;
feeding back the backup play string of the target video to the target client for playing;
and if the target backup address does not exist, acquiring an original play string of the target video, and feeding the original play string of the target video back to the target client for playing.
Optionally, in the foregoing method, the determining whether the target backup address exists includes:
judging whether a backup address corresponding to the target client exists or not;
if the backup address corresponding to the target client does not exist, judging whether the backup address corresponding to the target video exists or not;
if the target backup address is determined to exist, determining a backup play string of the target video based on the target backup address, including:
if the backup address corresponding to the target client exists, searching a backup play string of the target video from a position indicated by the backup address corresponding to the target client;
and if the backup address corresponding to the target video exists, determining the backup address of the target video based on the backup address corresponding to the target video.
Optionally, in the foregoing method, the backup address corresponding to the target video includes a first backup address and/or a second backup address, and the determining whether the backup address corresponding to the target video exists includes:
judging whether the first backup address exists or not; when any client cannot play, configuring the backup play string of the target video as the first backup address and caching the first backup address in a play gateway;
if the first backup address does not exist, judging whether a second backup address exists or not; the second backup address is configured when any client cannot play the video and is used for acquiring addresses of backup play strings of a plurality of videos;
if it is determined that the backup address corresponding to the target video exists, determining the backup address of the target video based on the backup address corresponding to the target video includes:
if the first backup address exists, determining the first backup address cached in the playing gateway as a backup playing string of the target video;
and if the second backup address exists, searching a backup play string of the target video from a storage space indicated by the second backup address.
Optionally, in the foregoing method, the finding out the backup play string of the target video from the position indicated by the backup address corresponding to the target client includes:
removing the parameters of the specified type in the request to obtain a backup video request; wherein, at least the identification of the target video is reserved in the backup video request;
and forwarding the request with the parameters removed to a backup playing back end so as to find out a backup address corresponding to the target client from the position indicated by the backup address corresponding to the target client through the backup playing back end.
Optionally, in the above method, the method further includes:
polling and playing each target data in the operation background at regular time through a playing gateway; the target data comprises a backup address corresponding to the client, a backup address corresponding to the video, a client identifier and a video identifier;
and associating the backup address corresponding to the client with the client identifier corresponding to the client, associating the backup address corresponding to the video with the video identifier corresponding to the video, and caching the associated target data into the playback gateway.
A second aspect of the present application provides a video playing apparatus, including:
the receiving unit is used for receiving a request for acquiring a play string of a target video, which is sent by a target client;
the judging unit is used for judging whether a target backup address exists or not; the target backup address comprises a backup address corresponding to the target client and/or a backup address corresponding to the target video; the backup address corresponding to the target client is an address which is set before the request is received and when the target client cannot play videos and is used for storing a backup play string of any one video; setting a backup address corresponding to the target video before receiving the request and when the target video cannot be normally played;
the first determining unit is used for determining a backup play string of the target video based on the target backup address when the judging unit judges that the target backup address exists;
the first feedback unit is used for feeding back the backup play string of the target video to the target client for playing;
and the second feedback unit is used for acquiring the original playing string of the target video when the judging unit judges that the target backup address does not exist, and feeding back the original playing string of the target video to the target client for playing.
Optionally, in the above apparatus, the determining unit includes:
the first judging unit is used for judging whether a backup address corresponding to the target client exists or not;
a second judging unit, configured to, when the first judging unit judges that the backup address corresponding to the target client does not exist, judge whether a backup address corresponding to the target video exists;
wherein the first determination unit includes:
the second determining unit is used for searching a backup play string of the target video from a position indicated by a backup address corresponding to the target client when the first judging unit judges that the backup address corresponding to the target client exists;
a third determining unit, configured to determine, when the second determining unit determines that the backup address corresponding to the target video exists, the backup address of the target video based on the backup address corresponding to the target video.
Optionally, in the above apparatus, the backup address corresponding to the target video includes a first backup address and/or a second backup address, and the second determining unit includes:
a third judging unit, configured to judge whether the first backup address exists; when any client cannot play, configuring the backup play string of the target video as the first backup address, and caching the backup play string in a play gateway;
a fourth judging unit, configured to judge whether the second backup address exists when the third judging unit judges that the first backup address does not exist; the second backup address is configured when any client cannot play the video and is used for acquiring addresses of backup play strings of a plurality of videos;
wherein the third determining unit includes:
a third determining subunit, configured to determine, when the third determining unit determines that the first backup address exists, the first backup address cached in the playback gateway as a backup playback string of the target video;
and the searching unit is used for searching the backup play string of the target video from the storage space indicated by the second backup address when the fourth judging unit judges that the second backup address exists.
Optionally, in the above apparatus, the second determining unit includes:
the deleting unit is used for removing the parameters of the specified type in the request to obtain a backup video request; wherein, at least the identification of the target video is reserved in the backup video request;
and the second determining subunit is configured to forward the request with the parameter removed to a backup playing back end, so as to find out, by the backup playing back end, a backup address corresponding to the target client from a position indicated by the backup address corresponding to the target client.
Optionally, in the above apparatus, further comprising:
the polling unit is used for polling and playing each target data in the operation background at regular time through the playing gateway; the target data comprises a backup address corresponding to the client, a backup address corresponding to the video, a client identifier and a video identifier;
and the cache unit is used for associating the backup address corresponding to the client with the client identifier corresponding to the client, associating the backup address corresponding to the video with the video identifier corresponding to the video, and caching the associated target data into the playback gateway.
According to the video playing method, before a request sent by a target client currently is received, if the target client cannot play a target video, a target backup address is set. When the target client cannot play the video, setting a backup address corresponding to the target client and used for storing a backup play string of any video; and when the target video cannot be played normally, setting a backup address corresponding to the target video. Therefore, when a request currently sent by the target client is received, if the target backup address is determined to exist, it is indicated that the target client cannot normally acquire the original play string of the target video. At the moment, the backup playing string of the target video is determined based on the target backup address, and the backup playing string of the target video is fed back to the target client side to be played, so that the playing of the video can be quickly recovered no matter the client side has problems and cannot be played normally, and the maintenance of technicians on the problems is not needed.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic diagram of an architecture of a video playing system according to an embodiment of the present application;
fig. 2 is a flowchart of a video playing method according to another embodiment of the present application;
fig. 3 is a flowchart of a method for determining that a target backup address exists and determining a backup play string according to another embodiment of the present application;
fig. 4 is a flowchart of another video playing method according to another embodiment of the present application;
fig. 5 is a schematic diagram illustrating a method for searching for a backup playlist based on a backup address corresponding to a target client according to another embodiment of the present application;
fig. 6 is a schematic structural diagram of a video playing apparatus according to another embodiment of the present application;
fig. 7 is a schematic structural diagram of a second determining unit according to another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In this application, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The application provides a video playing method, which aims to solve the problem that video playing cannot be timely recovered in the prior art.
Optionally, in order to implement the method for playing a video provided by the present application, an embodiment of the present application provides a video playing system. As shown in fig. 1, a video playing system provided in an embodiment of the present application includes:
a playing gateway 101, a playing back end 102, a backup playing back end 103, and a playing operation background 104.
The playing gateway 101 is configured to obtain and cache a target backup address generated by the operation background 104, receive a request for obtaining a video playing string sent by the client, and then determine whether to cache the corresponding target backup address, so as to determine whether to feed back an original playing string of the video obtained by the playing back end to the client or to feed back a backup playing string of the video obtained by the backup playing back end 103 to the client.
The playing back end 102 provides a main interface for playing data for the client, and serves for video playing. The method is mainly used for providing playing data to the client through the playing gateway 101 when the video is played normally.
The backup playing back end 103 provides a backup interface for playing data for the client, and is mainly used for providing backup playing data, i.e. providing a backup playing string of the video, to the client through the playing gateway when the video cannot be played normally.
The playing operation background 104 is mainly used for dynamically setting a backup address corresponding to a corresponding video or a backup address corresponding to a client according to a playing failure condition when the playing fails.
Based on the video playing system provided above, another embodiment of the present application provides a video playing method, as shown in fig. 2, including the following steps:
s201, receiving a request for acquiring a play string of a target video, which is sent by a target client.
The play string of the target video refers to an address of a play file storing the target video. And the target video refers to a video requested by a user, and when the user requests the video through the client, the client sends a request for acquiring a play string of the target video to the play gateway.
Optionally, the request usually includes information of the target video, information of the client, and the like. Such as the identification of the target video and the identification of the client.
S202, judging whether a target backup address exists or not; the target backup address comprises a backup address corresponding to the target client and/or a backup address corresponding to the target video.
The backup address corresponding to the target client is an address which is set before the current request is received and when the target client cannot play the video and is used for storing the backup play string of any video.
When a problem occurs in the device and user logic processing, the playing server may cause that a particular client cannot normally acquire the playing string of the video from the playing back end and play the video, so that the video cannot be normally played. Therefore, in the embodiment of the present application, when a client that receives user feedback cannot normally play a video or detects that a certain client cannot normally play a video, a corresponding backup address is set for the client, so that when the client requests to play a video again, a request of the client is guided to the corresponding backup address to obtain a backup play string of the video, thereby recovering a function of the client that normally plays the video in time. For example, for an ID of: 2dc80, when the client cannot play video, the playing operation background sets corresponding backup address for the client as: "https:// bac. Bz. Mgtv.com/source", the interface defaults to VIP authority, and the playout gateway can obtain the ID and corresponding backup address of the client and then associate and cache them, such as: "2dc80- > https:// bac. Bz. Mgtv. Com/source".
And setting a backup address corresponding to the target video before receiving the current request and when the target video cannot be normally played. Because the video file has an error or cannot be played incorrectly, the target video normally acquired from the playing back end cannot be played, or the target video cannot be normally acquired from the playing back end. Therefore, in the embodiment of the application, when the target video cannot be played normally, the corresponding backup address is set, and when the client requests to play the target video, the backup play string of the target video is fed back to the client based on the backup address, so that the normal play of the target video is restored in time.
It should be noted that the target video that cannot be played normally is divided into two cases, one is a special case of the target video and a case that the target video cannot be played normally, and the other is a case that both the entire client and the video cannot be played normally, and the case also includes the case that the target video cannot be played. The first situation is usually caused by an error in the file of the target video normally acquired, and the second situation is usually caused by a failure in the playback service.
Alternatively, the backup address may be set only for the target video for the first case, thereby avoiding unnecessary work. Specifically, when the target video cannot be normally played in a monitored state or when the target video cannot be normally played after receiving feedback of a plurality of users, a fixed backup address is set for the target video in the playing operation background, so that the normal playing of the target video is timely recovered. And, the backup play string of the target video can be set as the backup address corresponding to the target video. For example, when monitoring or receiving feedback, the video "sister who breaks the wave by riding wind, stage 6" fails to be played, the ID of the video is 10000, and at this time, the corresponding backup address is set for the video as follows: "https:// www.mgtv.com/10000.m3u8", video ID and backup address can also be associated and stored by the playout gateway as: "10000- > https:// www.mgtv.com/10000.m3u8".
For the second case, when it is monitored that the whole client cannot play the video, a backup address can be set for a plurality of videos. The backup play string of each video in the plurality of videos can be found according to the backup address, so that the normal play of the plurality of videos can be restored in time. Alternatively, backup addresses may be set for all videos. However, in consideration of the workload and necessity, the backup address may be set only for a part of videos, for example, only for a hot video.
Optionally, after the backup address is set, the backup address may be cached in the playback gateway, so as to determine whether the target backup address exists in time. The specific caching mode comprises the following steps: and regularly polling and playing each target data in the operation background through the playing gateway. The target data comprise a backup address corresponding to the client, a backup address corresponding to the video, a client identifier and a video identifier.
And then associating the backup address corresponding to the client with the client identifier corresponding to the client, associating the backup address corresponding to the video with the video identifier corresponding to the video, and caching the associated target data into the play gateway.
It should be noted that, when it is determined that the target backup address exists, it is indicated that the target client can normally play the target video only by acquiring the backup play string of the target video, so step S203 is executed at this time. If it is determined that the target backup address does not exist, step S205 is executed.
S203, determining a backup play string of the target video based on the target backup address.
And the backup play string of the target video is the address of the backup play file of the target video.
Since the target backup address may correspond to a plurality of videos, a backup play string of the target video needs to be determined based on the target backup address.
It should be noted that, if a backup address corresponding to the target client and a backup address corresponding to the target video exist at the same time, the backup play string of the target video may be determined based on the backup address corresponding to the target client, or the backup play string of the target video may be determined based on the backup address corresponding to the target video, and both of the two manners may ensure that the target client plays the target video.
Optionally, since the target backup address includes a backup address corresponding to the target client and/or a backup address corresponding to the target video, an embodiment of steps S202 to S203, as shown in fig. 3, includes:
s301, judging whether a backup address corresponding to the target client exists.
That is to say, in the embodiment of the present application, it is preferentially determined whether a backup address corresponding to a target client exists. Of course, this is only one of the optional execution sequences, and both may be determined at the same time, or it is determined whether a backup address corresponding to the target video exists first.
If it is determined that the backup address corresponding to the target client does not exist, step S302 is performed. If it is determined that the backup address corresponding to the target client exists, step S303 is directly performed.
S302, judging whether a backup address corresponding to the target video exists.
If it is determined that the backup address corresponding to the target video exists, step S304 is executed. If it is determined that the backup address corresponding to the target video does not exist, it indicates that the target backup address does not exist, so step S205 is executed at this time.
S303, finding out the backup play string of the target video from the position indicated by the backup address corresponding to the target client.
S304, determining the backup address of the target video based on the backup address corresponding to the target video.
And S204, feeding back the backup play string of the target video to the target client for playing.
S205, obtaining an original play string of the target video, and feeding the original play string of the target video back to the target client for playing.
The original playing string of the target video is the address of the original playing file of the target video, and when the target backup address does not exist, the target client can normally play the target video, so the original playing string of the target video is normally acquired from the playing back end at the moment, and the original playing string of the target video is fed back to the target client for playing.
According to the video playing method provided by the embodiment of the application, when a client cannot play a video, a backup address corresponding to the client is set, and the backup address can be used for obtaining a backup playing string of any one video, so that when the playing string of the target video sent by the client is obtained, the backup playing string of the target video can be determined according to the existing backup address corresponding to the client and fed back to the client, the client can play the video by using the backup playing string, and the video playing function of the client is restored in time. And when the target video cannot be played normally, setting a backup address corresponding to the target video, determining a backup playing string of the target video according to the existing backup address corresponding to the target video, and feeding back the backup playing string to the client, so that the client can play the video by using the backup playing string of the target video and restore the normal playing of the target video in time. Therefore, the video playing method provided by the embodiment of the application can quickly recover the playing of the video no matter the client has a problem and the video cannot be normally played, and does not need to wait for the maintenance of technicians on the problems.
Optionally, another embodiment of the present application provides another video playing method, as shown in fig. 4, including the following steps:
s401, receiving a request for acquiring the play string of the target video sent by the target client.
S402, judging whether a backup address corresponding to the target client exists or not.
The backup address corresponding to the target client is an address which is set when the target client cannot play the video and is used for acquiring the backup play string of any one video. The specific setting process of the backup address corresponding to the target client may refer to the corresponding description in step S202, and is not described herein again.
It should be noted that, in the embodiment of the present application, it is preferentially determined whether a backup address corresponding to the target client exists, and when it is determined that the backup address corresponding to the target client does not exist, step S404 is executed. If it is determined that the backup address corresponding to the target client exists, step S403 is performed.
S403, searching the backup play string of the target video from the position indicated by the backup address corresponding to the target client.
Optionally, an implementation of step S403, as shown in fig. 5, includes the following steps:
s501, removing the parameters of the specified type in the request to obtain the backup video request.
And at least keeping the identification of the target video in the backup video request.
Because the back end can make many business logic judgments according to some attributes of the client, and finally a special play string may be returned, and there may be a situation that the play cannot be performed. It is necessary to remove the parameters related to the device in the request, such as the device name, user credentials, etc., and retain some necessary parameters such as the video ID, etc., so as to convert the request into a generic request, rather than a specific request for the target client, i.e., to exclude specificity.
S502, the request with the parameters removed is forwarded to a backup playing back end, so that a backup address corresponding to the target client is found out from the position indicated by the backup address corresponding to the target client through the backup playing back end.
S404, judging whether a first backup address exists or not.
When any client cannot play, the backup play string of the target video is configured as a first backup address and cached in the play gateway. It should be noted that the first backup address is a backup address set for the target video when the target video cannot be played normally. Since the backup address is set for only one video, the backup play string of the target video can be directly configured as the first backup address. For more specific setting process, reference may be made to corresponding description in step S202, and details are not described herein again.
When it is determined that the first backup address exists, step S405 is performed. If it is determined that the first backup address does not exist, step S406 is performed.
S405, determining the first backup address cached in the playing gateway as a backup playing string of the target video.
Since the backup play string of the target video is directly configured as the first backup address and cached in the playback gateway in the embodiment of the present application, the first backup address cached in the playback gateway can be directly determined as the backup play string of the target video and fed back to the target client, that is, the first backup address is directly fed back to the target client.
S406, judging whether a second backup address exists or not.
The second backup address is configured when any client cannot play the video, and is used for acquiring addresses of backup play strings of the plurality of videos. It should be noted that the first backup address is a backup address set for a plurality of videos when the entire client cannot play and identify the videos. For a specific setting process, reference may be made to corresponding descriptions in step S202, and details are not described herein again.
When it is determined that the second backup address exists, step S407 is performed. When it is determined that the second backup address does not exist, since the second backup address is determined last, it is indicated that the target backup address does not exist, so step S408 is performed at this time.
S407, the backup play string of the target video is found out from the storage space indicated by the second backup address.
S408, obtaining the original playing string of the target video, and feeding back the original playing string of the target video to the target client for playing.
And S409, feeding back the backup play string of the target video to the target client for playing.
Another embodiment of the present application provides a video playing apparatus, as shown in fig. 6, including the following units:
the receiving unit 601 is configured to receive a request for acquiring a play string of a target video sent by a target client.
A determining unit 602, configured to determine whether a target backup address exists.
The target backup address comprises a backup address corresponding to the target client and/or a backup address corresponding to the target video. The backup address corresponding to the target client is set before the current request is received and the target client cannot play the video, and is used for storing the backup play string of any video. The backup address corresponding to the target video is set before the current request is received and the target video cannot be played normally.
A first determining unit 603, configured to determine a backup play string of the target video based on the target backup address when the determining unit determines that the target backup address exists.
The first feedback unit 604 is configured to feed back the backup play string of the target video to the target client for playing.
A second feedback unit 605, configured to, when the determining unit determines that the target backup address does not exist, obtain an original play string of the target video, and feed the original play string of the target video back to the target client for playing.
Optionally, in a video playing apparatus provided in another embodiment of the present application, the determining unit includes:
the first judging unit is used for judging whether a backup address corresponding to the target client exists or not.
And the second judging unit is used for judging whether a backup address corresponding to the target video exists or not when the first judging unit judges that the backup address corresponding to the target client does not exist.
It should be noted that, the first determining unit in the embodiment of the present application includes:
and the second determining unit is used for finding out the backup play string of the target video from the position indicated by the backup address corresponding to the target client when the first judging unit judges that the backup address corresponding to the target client exists.
And the third determining unit is used for determining the backup address of the target video based on the backup address corresponding to the target video when the second judging unit judges that the backup address corresponding to the target video exists.
Optionally, in a video playing apparatus provided in another embodiment of the present application, a backup address corresponding to a target video includes a first backup address and/or a second backup address, and the second determining unit includes:
and the third judging unit is used for judging whether the first backup address exists or not.
When any client cannot play, the backup play string of the target video is configured as a first backup address and cached in the play gateway.
And the fourth judging unit is used for judging whether the second backup address exists or not when the third judging unit judges that the first backup address does not exist.
The second backup address is configured when any client cannot play the video, and is used for acquiring addresses of backup play strings of the plurality of videos.
Wherein, the third determining unit in this embodiment of the application includes:
and the third determining subunit is configured to determine, when the third determining unit determines that the first backup address exists, the first backup address cached in the playback gateway as the backup playback string of the target video.
And the searching unit is used for searching the backup play string of the target video from the storage space indicated by the second backup address when the fourth judging unit judges that the second backup address exists.
Optionally, in a video playing apparatus provided in another embodiment of the present application, as shown in fig. 7, the second determining unit includes:
a deleting unit 701, configured to remove the specified type of parameter in the request, so as to obtain a backup video request.
And at least keeping the identification of the target video in the backup video request.
The second determining subunit 702 is configured to forward the request with the parameter removed to the backup playing back end, so as to find out, by the backup playing back end, the backup address corresponding to the target client from the position indicated by the backup address corresponding to the target client.
Optionally, in the video playing apparatus provided in another embodiment of the present application, the method further includes:
and the polling unit is used for regularly polling and playing each target data in the operation background through the playing gateway.
The target data comprises a backup address corresponding to the client, a backup address corresponding to the video, a client identifier and a video identifier.
And the cache unit is used for associating the backup address corresponding to the client with the client identifier corresponding to the client, associating the backup address corresponding to the video with the video identifier corresponding to the video, and caching the associated target data into the playback gateway.
It should be noted that the units provided in the above embodiments of the present application may be units in various components in the video playing system shown in fig. 1. And the specific working process of each unit may refer to the corresponding step in the above method embodiment, which is not described herein again.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for playing a video, comprising:
receiving a request for acquiring a play string of a target video, which is sent by a target client;
judging whether a target backup address exists or not; the target backup address comprises a backup address corresponding to the target client and a backup address corresponding to the target video; the backup address corresponding to the target client is an address which is set before the request is received and when the target client cannot play videos and is used for storing backup play strings of a plurality of videos; setting a backup address corresponding to the target video before receiving the request and when the target video cannot be normally played;
if the backup address corresponding to the target client side and/or the backup address corresponding to the target video exist, determining a backup play string of the target video based on the target backup address;
feeding back the backup play string of the target video to the target client for playing;
and if the target backup address does not exist, acquiring the original play string of the target video, and feeding the original play string of the target video back to the target client for playing.
2. The method of claim 1, wherein the determining whether the target backup address exists comprises:
judging whether a backup address corresponding to the target client exists or not;
if the backup address corresponding to the target client does not exist, judging whether the backup address corresponding to the target video exists or not;
if the target backup address is determined to exist, determining a backup play string of the target video based on the target backup address, including:
if the backup address corresponding to the target client exists, searching a backup play string of the target video from a position indicated by the backup address corresponding to the target client;
and if the backup address corresponding to the target video exists, determining the backup address of the target video based on the backup address corresponding to the target video.
3. The method according to claim 2, wherein the backup address corresponding to the target video includes a first backup address and/or a second backup address, and the determining whether the backup address corresponding to the target video exists comprises:
judging whether the first backup address exists or not; when any client cannot play, configuring the backup play string of the target video as the first backup address and caching the first backup address in a play gateway;
if the first backup address does not exist, judging whether a second backup address exists or not; the second backup address is configured when any client cannot play videos and is used for acquiring addresses of backup play strings of a plurality of videos;
if it is determined that the backup address corresponding to the target video exists, determining the backup address of the target video based on the backup address corresponding to the target video includes:
if the first backup address exists, determining the first backup address cached in the playing gateway as a backup playing string of the target video;
and if the second backup address exists, searching a backup play string of the target video from a storage space indicated by the second backup address.
4. The method of claim 3, wherein the finding the backup play string of the target video from the location indicated by the backup address corresponding to the target client comprises:
removing the parameters of the specified type in the request to obtain a backup video request; wherein, at least the identification of the target video is reserved in the backup video request;
and forwarding the request with the parameters removed to a backup playing back end so as to find out a backup address corresponding to the target client from the position indicated by the backup address corresponding to the target client through the backup playing back end.
5. The method of claim 2, further comprising:
polling and playing each target data in the operation background at regular time through a playing gateway; the target data comprises a backup address corresponding to the client, a backup address corresponding to the video, a client identifier and a video identifier;
and associating the backup address corresponding to the client with the client identifier corresponding to the client, associating the backup address corresponding to the video with the video identifier corresponding to the video, and caching the associated target data into the playback gateway.
6. A video playback apparatus, comprising:
the receiving unit is used for receiving a request for acquiring a play string of a target video, which is sent by a target client;
the judging unit is used for judging whether a target backup address exists or not; the target backup address comprises a backup address corresponding to the target client and a backup address corresponding to the target video; the backup address corresponding to the target client is an address which is set before the request is received and when the target client cannot play the video and is used for storing backup play strings of a plurality of videos; setting a backup address corresponding to the target video before receiving the request and when the target video cannot be normally played;
the first determining unit is used for determining a backup play string of the target video based on the target backup address when the judging unit judges that the backup address corresponding to the target client exists and/or the backup address corresponding to the target video;
the first feedback unit is used for feeding back the backup play string of the target video to the target client for playing;
and the second feedback unit is used for acquiring the original playing string of the target video when the judging unit judges that the target backup address does not exist, and feeding back the original playing string of the target video to the target client for playing.
7. The apparatus according to claim 6, wherein the determining unit comprises:
the first judging unit is used for judging whether a backup address corresponding to the target client exists or not;
a second judging unit, configured to judge whether a backup address corresponding to the target video exists when the first judging unit judges that the backup address corresponding to the target client does not exist;
wherein the first determining unit includes:
the second determining unit is used for finding out a backup play string of the target video from a position indicated by a backup address corresponding to the target client when the first judging unit judges that the backup address corresponding to the target client exists;
a third determining unit, configured to determine, when the second determining unit determines that the backup address corresponding to the target video exists, the backup address of the target video based on the backup address corresponding to the target video.
8. The apparatus according to claim 7, wherein the backup address corresponding to the target video includes a first backup address and/or a second backup address, and the second determining unit includes:
a third judging unit, configured to judge whether the first backup address exists; when any client cannot play, configuring the backup play string of the target video as the first backup address, and caching the backup play string in a play gateway;
a fourth judging unit, configured to judge whether the second backup address exists when the third judging unit judges that the first backup address does not exist; the second backup address is configured when any client cannot play videos and is used for acquiring addresses of backup play strings of a plurality of videos;
wherein the third determining unit includes:
a third determining subunit, configured to determine, when the third determining unit determines that the first backup address exists, the first backup address cached in the playback gateway as a backup playback string of the target video;
and the searching unit is used for searching the backup play string of the target video from the storage space indicated by the second backup address when the fourth judging unit judges that the second backup address exists.
9. The apparatus of claim 8, wherein the second determining unit comprises:
the deleting unit is used for removing the parameters of the specified type in the request to obtain a backup video request; wherein, at least the identification of the target video is reserved in the backup video request;
and the second determining subunit is configured to forward the request with the parameter removed to a backup playing back end, so as to find out, by the backup playing back end, a backup address corresponding to the target client from a position indicated by the backup address corresponding to the target client.
10. The apparatus of claim 7, further comprising:
the polling unit is used for polling and playing each target data in the operation background at regular time through the playing gateway; the target data comprises a backup address corresponding to the client, a backup address corresponding to the video, a client identifier and a video identifier;
and the cache unit is used for associating the backup address corresponding to the client with the client identifier corresponding to the client, associating the backup address corresponding to the video with the video identifier corresponding to the video, and caching the associated target data into the playback gateway.
CN202110705437.5A 2021-06-24 2021-06-24 Video playing method and device Active CN113438498B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110705437.5A CN113438498B (en) 2021-06-24 2021-06-24 Video playing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110705437.5A CN113438498B (en) 2021-06-24 2021-06-24 Video playing method and device

Publications (2)

Publication Number Publication Date
CN113438498A CN113438498A (en) 2021-09-24
CN113438498B true CN113438498B (en) 2022-11-22

Family

ID=77754214

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110705437.5A Active CN113438498B (en) 2021-06-24 2021-06-24 Video playing method and device

Country Status (1)

Country Link
CN (1) CN113438498B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905841A (en) * 2014-03-18 2014-07-02 深圳市云宙多媒体技术有限公司 Multi-protocol multi-player video playing method and system based on self-adaptive network bandwidth
CN108513094A (en) * 2017-02-24 2018-09-07 腾讯科技(深圳)有限公司 Video frequency monitoring method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103546830B (en) * 2013-10-28 2017-08-08 Tcl集团股份有限公司 A kind of processing method and system of video address failure
CN110139131A (en) * 2018-02-09 2019-08-16 网宿科技股份有限公司 A kind of method and terminal of playing video file
CN109348284A (en) * 2018-11-28 2019-02-15 深圳市创维软件有限公司 A kind of channel playback method, device, equipment and medium
CN112118487B (en) * 2019-06-21 2022-01-28 腾讯科技(深圳)有限公司 Video playing control method, device, equipment and medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905841A (en) * 2014-03-18 2014-07-02 深圳市云宙多媒体技术有限公司 Multi-protocol multi-player video playing method and system based on self-adaptive network bandwidth
CN108513094A (en) * 2017-02-24 2018-09-07 腾讯科技(深圳)有限公司 Video frequency monitoring method and device

Also Published As

Publication number Publication date
CN113438498A (en) 2021-09-24

Similar Documents

Publication Publication Date Title
CN106843957B (en) System firmware upgrading method and device
US8719386B2 (en) System and method for providing configuration synchronicity
CN108933798B (en) Data storage method, storage server and system
US10904307B2 (en) Distributed management of live stream storage
US9588542B2 (en) Rack server system and method for automatically managing rack configuration information
US11032584B2 (en) Picture storage method, apparatus and video monitoring system
US20050038888A1 (en) Method of and apparatus for monitoring event logs
CN107453932B (en) Distributed storage system management method and device
CN107592199B (en) Data synchronization method and system
JP5617304B2 (en) Switching device, information processing device, and fault notification control program
US7849355B2 (en) Distributed object sharing system and method thereof
US20090271849A1 (en) Content transfer system and method, and home server
US20150149528A1 (en) Methods, Systems and Apparatus to Determine a Distributed Content Share Storage Scheme
WO2019205788A1 (en) Data storage method, storage server and cloud storage system
CN107040576A (en) Information-pushing method and device, communication system
CN108509296B (en) Method and system for processing equipment fault
JP6812171B2 (en) Network system and control method in network system
CN110012111B (en) Data service cluster system and data processing method
CN109245953B (en) Network configuration method and device
JP4612714B2 (en) Data processing method, cluster system, and data processing program
CN104158843B (en) The storage-unit-failure detection method and device of distributed file storage system
CN113438498B (en) Video playing method and device
CN113810216A (en) Cluster fault switching method and device and electronic equipment
CN110008681B (en) Access control method, device and system
JP2009025971A (en) Information processor and log data collection system

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
GR01 Patent grant
GR01 Patent grant