Video resource downloading method, device, system and equipment and storage medium

By filtering and connecting multiple high-quality servers and timely switching to the backup server, the problem of not being able to switch servers in time during downloading video resources in the existing technology is solved, and the effect of reducing switching costs and saving switching time is achieved.

CN119629164APending Publication Date: 2025-03-14BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411600417.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In the prior art, if there is a problem with the download process of video resource download, the server cannot be switched in time, resulting in high switching costs and long switching time.

Method used

By obtaining the list information of multiple second servers, filtering and connecting at least two high-quality servers, determining the current server and the backup server, and switching to the backup server in time to reduce switching costs and save switching time.

Benefits of technology

It realizes timely switching servers during the download process, reduces switching costs, saves switching time, and ensures service consistency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629164A_ABST
    Figure CN119629164A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a video downloading method, device, system and equipment and a storage medium, and the method comprises the steps: obtaining the list information of second servers under the condition of downloading a video resource from a first server, and screening at least two second servers based on the list information of the second servers; establishing connection with the screened second servers, and determining a current server used for downloading video resources and a backup server used for keeping heartbeat connection in the connected second servers; stopping downloading the video resource from the first server, and switching to downloading the video resource from the current server; and in the process of downloading the video resources from the current server, if it is judged that the service quality of the current server does not meet the first preset condition, switching to download the video resources from the backup server keeping the heartbeat connection, so that the servers can be switched in time, the switching cost is reduced, and the switching time is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the technical field of data downloading, and in particular, to a method, apparatus, system, device and storage medium for downloading video resources. Background Art

[0002] In the related art, real-time streaming is generally played using Hypertext Transfer Protocol-Flash Video (HTTP-FLV) long link stream. Considering the cost, some low-priced servers are used to provide bandwidth resources for the playback, but these servers are of various types.

[0003] Since there are many types of servers and the stability of the servers is different, it is important to choose a high-quality server for downloading. In traditional technology, when downloading video resources from the server, if there is a problem with the download, the download cannot be completed in time, and a high switching cost is required. Summary of the invention

[0004] The embodiments of the present application provide a method, apparatus, system, device and storage medium for downloading video resources, which can switch servers in a timely manner, reduce switching costs and save switching time.

[0005] In a first aspect, the present application provides a method for downloading video resources, comprising:

[0006] In the case of downloading video resources from the first server, obtaining list information of the second server, and screening at least two second servers based on the list information of the second server;

[0007] Establishing a connection with the screened second server, and determining a current server for downloading video resources and a backup server for maintaining a heartbeat connection in the second server to which the connection is established;

[0008] Stop downloading video resources from the first server, and switch to downloading video resources from the current server;

[0009] In the process of downloading the video resource from the current server, if it is determined that the service quality of the current server does not meet the first preset condition, the video resource is downloaded from the backup server that maintains the heartbeat connection.

[0010] In a second aspect, the present application provides a video resource downloading device, comprising:

[0011] A screening module, configured to obtain list information of a second server when downloading video resources from a first server, and screen at least two second servers based on the list information of the second server;

[0012] A connection module, used for establishing a connection with the screened second server, and determining a current server for currently downloading video resources and a backup server for maintaining a current heartbeat connection in the second server to which the connection is established;

[0013] A first switching module, used to stop downloading video resources from the first server and switch to downloading video resources from the current server;

[0014] The second switching module is used to switch to downloading the video resource from the backup server if it is determined that the service quality of the current server does not meet the first preset condition during the process of downloading the video resource from the current server.

[0015] In a third aspect, an embodiment of the present application provides a video downloading system, including a playback terminal, a first server and at least two second servers;

[0016] The first server and the second server are used to provide video resources to the playback end;

[0017] The playback end is used for:

[0018] In the case of downloading video resources from the first server, obtaining list information of the second server, and screening at least two second servers based on the list information of the second server;

[0019] Establishing a connection with the screened second server, and determining a current server for downloading video resources and a backup server for maintaining a heartbeat connection in the second server to which the connection is established;

[0020] Stop downloading resources from the first server, and switch to downloading video resources from the current server;

[0021] In the process of downloading the video resource from the current server, if it is determined that the service quality of the current server does not meet the first preset condition, the video resource is downloaded from the backup server that maintains the heartbeat connection.

[0022] In a fourth aspect, an embodiment of the present application provides a playback device, including:

[0023] Memory for storing computer programs;

[0024] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method provided in the embodiment of the present application is implemented.

[0025] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the method provided by the embodiment of the present application is implemented.

[0026] The technical solution provided by the embodiment of the present application is as follows: when downloading video resources from a first server, at least two second servers are selected from a plurality of second servers, and connections are established with the selected second servers, one of the second servers with established connections is used as the current server for downloading video resources, and the others are used as backup servers for maintaining heartbeat connections; downloading of video resources from the first server is stopped, and the video resources are switched to downloading from the current server. During the process of downloading video resources from the current server, if it is determined that the service quality of the current server does not meet the first preset condition, the video resources are switched to downloading from the backup server with a heartbeat connection, that is, during the process of downloading video resources from the current server, a connection is established with the backup server in advance. When switching, there is no need to establish a connection again, and the video resources can be downloaded directly, thereby reducing the switching cost and enabling timely switching, saving switching time; switching servers is performed based on the judgment of service quality, rather than switching servers when the download fails, so that the server can be switched in time before the download deteriorates to ensure the continuity and quality of the service. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0028] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0029] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0030] Figure 1 A flow chart of a video downloading method provided in an embodiment of the present application;

[0031] Figure 2 An architectural diagram between a playback terminal and a server provided in an embodiment of the present application;

[0032] Figure 3 A flow chart of a video downloading method provided in an embodiment of the present application;

[0033] Figure 4 A seamless switching flow chart provided in an embodiment of the present application;

[0034] Figure 5 A structural block diagram of a video downloading device provided in an embodiment of the present application;

[0035] Figure 6 It is a schematic diagram of the structure of a video downloading system provided in an embodiment of the present application;

[0036] Figure 7 It is a schematic diagram of the structure of a playback device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0038] In the related art, in the process of downloading video resources from the server, similar to the traditional double-click hot standby situation, when the download has failed and then the server is switched, the server switching is not timely, and when the server switches, the connection is established first, and then the resource is downloaded, which consumes a high switching cost.

[0039] To solve the above technical problems, the overall idea of ​​the technical solution provided by the embodiment of the present application is: when switching the backup server, establish a connection with the backup server in advance. When switching the backup server, there is no need to connect again, which reduces the switching cost and saves the switching time. The switch can be made in time based on the judgment of the server quality, rather than switching the server after the download fails. The server can be switched in time before the download deteriorates to ensure the continuity and quality of the service.

[0040] When the application implements server switching, a request is sent to carry the location information of the latest video frame of the downloaded video resource, so that the video resource corresponding to the location information is fed back, which can achieve seamless switching and ensure the continuity of the video; by downloading video resources from the first server and multiple types of second servers, multiple source devices can be used to download video resources, which can improve the sharing ratio. The technical solutions provided by the application are as follows:

[0041] Figure 1This is a flow chart of a video resource downloading method provided by an embodiment of the present application. The method can be executed by a video resource downloading device. The device can be configured in an electronic device such as a computer or a mobile terminal. The device can be configured at a playback end. The method can be applied in video playback scenarios. Figure 1 As shown, the method includes:

[0042] S110: When downloading video resources from a first server, obtain list information of a second server, and filter at least two second servers based on the list information of the second server.

[0043] In this embodiment, the video resource may be a video resource in HTTP-FLV format. Optionally, the first server may be a content delivery network (CDN) server, and the second server may be a peer to peer (P2P) server, wherein the first server may be a data source of the second server. Optionally, if the first server is a CDN server and the second server is a P2P server, the overall architecture diagram may refer to Figure 2 ,like Figure 2 As shown, the P2P function is mainly performed using RCache devices, RCache large intranet devices, and Inside devices. Among them, the CDN server is a regular CDN server, the data source of the P2P server comes from the CDN server, and the P2P control server can be used to manage the P2P server. Then, the RCache device, RCache large intranet device, and Inside device are used as P2P servers to provide P2P services and upload service functions. It should be noted that Figure 2 The example architecture diagram may also be applicable to the case where the first server and the second server are other types of servers.

[0044] In this embodiment, the playback end can download video resources from the first server at the beginning to obtain the video resources for the start of broadcasting. Specifically, the playback end sends a request to the first server to obtain the start-up video resources, and the first server feeds back the start-up video resources according to the request, so that the playback end receives the start-up video resources for the start of broadcasting. In this embodiment, the video resources are downloaded from the first server at the beginning because the response speed from the first server is faster than that from the second server (because there is no step of obtaining the list information of the server, screening, etc.).

[0045] In this embodiment, when the playback end downloads video resources from the first server, in order to maximize the utilization of resources and improve the resource sharing ratio, the playback end can download video resources from the second server. Therefore, the playback end can obtain the list information of the second server, wherein the list information of the second server includes the identification information of the second server, the response speed, the service upload status, etc. The playback end selects at least two high-quality second servers according to the list information of the second server, and the selected second servers are used to connect with the playback end.

[0046] S120: Establishing a connection with the screened second server, and determining a current server for downloading video resources and a backup server for maintaining a heartbeat connection in the second server to which the connection is established.

[0047] In this embodiment, the playback end establishes a connection with at least two screened second servers. After the connection is established, the health status data sent by the connected second server can be obtained, and the service quality of the second server is determined based on the health status data. The server with the best service quality is selected as the current server for downloading video resources, and the others are used as backup servers for maintaining heartbeat connections.

[0048] In one implementation of the present embodiment, optionally, the establishment of a connection with the screened second server includes: selecting a corresponding connection method according to the type of the screened second server to establish a connection with the screened second server; wherein the type of the second server includes at least two types. Among them, the types of the second server are different, and the corresponding connection methods are not the same. In the case where the first server is a CDN server and the second server is a P2P server, the P2P server includes an RCache device, an RCache large intranet device and an Inside device, and each device corresponds to a different communication protocol, so a corresponding connection method is used for connection. Among them, a better upload broadband RCache device with a public IP can use the Transmission Control Protocol (TCP) or a fast UDP Internet Connection (Quic) for connection; a better RCache large intranet device with a public IP can use the User Datagram Protocol (UDP) or QIC to establish a connection; for an Inside device that does not have a public IP, a fast UDP network connection QIC can be used to establish a connection.

[0049] S130: Stop downloading the video resource from the first server, and switch to downloading the video resource from the current server.

[0050] In this embodiment, the playback end stops downloading the video resource from the first server, and sends a request to download the video resource to the current server. The current server feeds back the video resource based on the request, and the playback end obtains the video resource for playback.

[0051] S140: During the process of downloading the video resource from the current server, if it is determined that the service quality of the current server does not meet a first preset condition, switching to downloading the video resource from the backup server that maintains the heartbeat connection.

[0052] In one implementation of the present embodiment, optionally, in the process of downloading video resources from the current server, if it is determined that the service quality of the current server does not meet the first preset condition, switch to downloading video resources from a backup server that maintains a heartbeat connection, including: in the process of downloading video resources from the current server, updating the service quality of the current server based on health status data of the current server obtained in real time and updating the service quality of the backup server based on health status data obtained in real time from the backup server that maintains a heartbeat connection; if it is determined that the service quality of the current server does not meet the first preset condition, switch to downloading video resources from the backup server with the best service quality.

[0053] Specifically, in the process of downloading video resources from the current server, the health status data of the current server and the backup server are obtained in real time, and the corresponding service quality is updated in real time based on the health status data. Among them, the health status data includes progress, upload status, upload congestion, download speed, etc. For the current server, the service quality can be determined by the download speed and the remaining buffer on the playback end. The faster the download speed and the larger the buffer, the higher the service quality. For the backup server, the faster the progress and the lower the upload congestion, the higher the service quality.

[0054] In this embodiment, optionally, the service quality does not meet the first preset condition, which may be that the download speed of the current server is less than the average bit rate speed, and the remaining cache gradually becomes smaller (for example, from 5 seconds -> 4.5 seconds -> 3.5 seconds). In this case, it is necessary to switch to the backup server to download the video resource. Optionally, there may be one backup server, or there may be more than one backup server. If there is more than one backup server, it is necessary to select the backup server with the best service quality according to the service quality of the backup server, and switch to the backup server with the best service quality. If the number of backup servers is 1, switch directly to the backup server.

[0055] Therefore, by updating the service quality of the current server and the backup server in real time and switching the backup server based on the service quality, the backup server can be switched to download in time before the service deteriorates, thereby ensuring the continuity and quality of the service. Since there are multiple types of second servers, the types of the current server and the backup server are not exactly the same. During the video download process, the playback end can download video resources from the current server. When the service quality of the current server does not meet the first preset condition, it switches to download video resources from the backup server. During this process, the playback end can download video resources from multiple source devices, thereby improving the sharing ratio.

[0056] In the related art, the cost of download switching is relatively high (connection, authentication cost, etc.), while the technical solution provided by the embodiment of the present application establishes a connection with the backup server in advance during the process of downloading video resources on the current server. That is to say, during the download process of the current server, preparations have been made in advance. When switching to the backup server, there is no need to establish a connection again, and the video resources can be downloaded directly, which reduces the switching cost, saves time, and switches in a timely manner. In the related art, the server is switched only when the download fails, while the present application switches the server based on the judgment of the service quality, rather than switching the server when the download fails. The server can be switched in time before the download deteriorates to ensure the continuity and quality of the service.

[0057] For step S130:

[0058] In an optional implementation, optionally, switching to downloading video resources from a server includes: sending a request to download video resources to a server, the request carrying the location information of the latest video frame in the downloaded video resources; wherein the location information includes the size, type and timestamp of the latest video frame; and receiving the video resources fed back by the server based on the location information in the request. Specifically, in the case of switching from downloading video resources from a first server to downloading video resources from a current server, the playback end sends a request to download video resources to the current server, the request carrying the location information of the latest video frame in the downloaded video resources, the location information including the size, type and timestamp of the latest frame, and receives the video resources fed back by the current server based on the location information in the request, and the playback end determines whether the received video resources are repeated, and if there are repeated, the repeated parts are discarded, and if there are no repeated parts, the video resources are played. wherein, after receiving the request, the current server searches for the corresponding video resources according to the location information in the request and feeds back to the playback end. The reason why the positioning information in this embodiment includes the size, type and timestamp of the latest video frame is that there are various types of audio and video files in the current server. If the positioning information only includes the timestamp, the audio file with the same timestamp may be fed back. Therefore, the size, type and timestamp are used to jointly locate an anchor point to achieve seamless switching and improve the viewing experience.

[0059] For step S140:

[0060] In an optional implementation, optionally, switching to downloading video resources from a server includes: sending a request to download video resources to a server, wherein the request carries the location information of the latest video frame in the downloaded video resources; wherein the location information includes the size, type and timestamp of the latest video frame; and receiving the video resources fed back by the server based on the location information in the request. Specifically, in the case of switching from downloading video resources from the current server to downloading video resources from a backup server, the playback end sends a request to download video resources to the backup server, wherein the request carries the size, type and timestamp of the latest video frame in the downloaded video resources. The backup server searches for the corresponding video resources based on the location information in the request and feeds back to the playback end. The playback end receives the video resources fed back by the backup server based on the location information in the request.

[0061] Therefore, in the embodiment of the present application, when the server switches, the request sent carries the location information of the latest video frame of the downloaded video resource, so that the video resource corresponding to the location information is fed back, and seamless switching can be achieved to ensure the continuity of the video.

[0062] against Figure 1The embodiment shown, as an optional implementation, before switching to the backup server, may also include: if a message of active exit sent by the current server is received, switching to the backup server to download video resources. Specifically, the current server may send a message of active exit to the playback terminal due to some reasons, and the playback terminal downloads the video resources from the backup server. Therefore, when the current server actively exits, by connecting to the backup server in advance and switching to the backup server, timely switching can be achieved to ensure the continuity and quality of the service.

[0063] against Figure 1 The illustrated embodiment, as an optional implementation, may also include, before switching to the backup server: in the process of maintaining a heartbeat connection with the backup server, if the service quality of the backup server does not meet the second preset condition, reselecting a new second server from the list information of the second server as the backup server. Specifically, the service quality of the backup server does not meet the second preset condition, which may be that the progress of the backup server or the upload congestion level does not meet the condition. For example, the backup server may have a slow progress or a high upload congestion level. In this case, it is necessary to change the backup server in time, that is, reselect a new second server from the list information of the second server as the backup server. Thus, when the service quality of the backup server deteriorates, the service quality of the backup server can be guaranteed by replacing the backup server in time.

[0064] against Figure 1 The embodiment shown, as an optional implementation, after switching to the backup server, may also include: if an abnormal situation occurs when the backup server is switched, switching to downloading video resources from the first server; wherein the abnormal situation includes that the backup server does not exist, the backup server switching fails, the backup server reaches the switching number, or the backup server does not meet the switching condition. Wherein, the backup server does not meet the switching condition, which may be that the service quality of the backup server does not meet the second preset condition, or other reasons. The reason for the failure of the backup server switching may be network reasons. Optionally, the backup server can set the number of switching times, and when a certain number of switching times is reached, it will no longer switch to the backup server. Wherein, for the situation of switching back to the first server to download the video, a seamless switch is also performed, that is, the playback end obtains the video resource starting from the timestamp from the first server by sending a request carrying the timestamp of the latest video frame. The present application switches to downloading video resources from the first server when the backup server switching occurs abnormally, which can ensure the continuity of the service and effectively avoid the failure of downloading video resources.

[0065] In order to better illustrate the technical solution of the present application, optionally, the first server is a CDN server, and the second server is a P2P server, such as Figure 3 As shown, the technical solution provided by this application specifically includes:

[0066] The player sends a request to the CDN server to obtain the video resources to be played;

[0067] The CDN server feeds back the starting video resources to the player.

[0068] The player obtains the list information of the P2P server from the P2P server;

[0069] The P2P server feeds back the list information of the P2P server to the player;

[0070] The player screens based on the list information and selects at least two high-quality P2P servers for connection.

[0071] The player stops downloading video resources from the CDN server;

[0072] The player selects the corresponding connection method (TCP / UCP / Quic) according to the type of P2P server to connect;

[0073] The player sends a request to download video resources to the current P2P server;

[0074] The P2P server feeds the video resources back to the player;

[0075] The player updates the service quality of the current P2P server in real time;

[0076] The player updates the service quality of the backup P2P server in real time while maintaining a heartbeat connection with the backup P2P server;

[0077] The player determines whether the download status of the current P2P server is deteriorating and is able to switch to the backup server for downloading;

[0078] The player switches to the backup server for downloading;

[0079] If the player determines that switching to the backup server is abnormal, it determines to switch back to downloading video resources from the CDN server;

[0080] The playback end switches back to downloading video resources from the CDN server.

[0081] In the embodiments of the present application, RCache devices, RCache large intranet devices, and Inside devices are used to perform P2P functions, that is, P2P servers include RCache devices, RCache large intranet devices, and Inside devices. The resources on these servers are relatively special, with different performances, different communication methods, and various types. Through the method provided in the present application, video resources can be downloaded from multiple P2P servers, and the resources provided by multiple P2P servers can be maximized, thereby improving their capabilities as service sources, improving P2P data upload capabilities, and improving P2P sharing ratios.

[0082] In this embodiment, the process of downloading video resources from CDN server->P2P server->P2P server->CDN server is based on the three elements of seamless switching, and the type, size, and timestamp of the video frame are used to locate an anchor point for switching. Optionally, the present application realizes seamless switching, and third-party CDN manufacturers do not need to provide additional support and customized development. They only need to keep the timestamp of the feedback video resources unchanged and support a certain cache start.

[0083] The specific seamless switching process may include:

[0084] The player sends a request to the CDN server to obtain the video resource (FLV format) to be played.

[0085] The CDN server returns the start video resource in FLV format;

[0086] The player determines the latest video frame in the video resource;

[0087] The player sends a request to the P2P server containing the size, type and timestamp of the latest video frame of the video resource;

[0088] The P2P server searches for the corresponding video resource according to the request;

[0089] The P2P server feeds back the video resource starting from the specified frame to the player;

[0090] The player determines whether the feedback video resources are repeated, discards the repeated ones, and stores the non-duplicate ones and plays them through the player;

[0091] The player switches back to the CDN server and sends a request with a timestamp to the CDN server.

[0092] The CDN server feeds back the video resource starting from the specified timestamp to the player.

[0093] It should be noted that Figure 3 and Figure 4This is an example of the process of interaction between the playback terminal, the CDN server and the P2P server. In other embodiments, if the first server and the second server are other servers, the interaction between them and the playback terminal can refer to Figure 3 and Figure 4 The process shown.

[0094] Figure 5 is a structural block diagram of a video resource downloading device provided in an embodiment of the present application, such as Figure 5 As shown, the device comprises:

[0095] A screening module 510 is used to obtain the list information of the second server when downloading the video resource from the first server, and screen at least two second servers based on the list information of the second server;

[0096] A connection module 520 is used to establish a connection with the screened second server, and determine a current server for currently downloading video resources and a backup server for maintaining a current heartbeat connection in the second server to which the connection is established;

[0097] A first switching module 530, configured to stop downloading video resources from the first server and switch to downloading video resources from the current server;

[0098] The second switching module 540 is configured to switch to downloading the video resource from the backup server if it is determined that the service quality of the current server does not meet the first preset condition during the process of downloading the video resource from the current server.

[0099] Optionally, switch to downloading video resources from the server, including:

[0100] Sending a request to download a video resource to a server, wherein the request carries location information of the latest video frame in the downloaded video resource; wherein the location information includes the size, type and timestamp of the latest video frame;

[0101] Receive the video resource fed back by the server based on the positioning information in the request.

[0102] Optionally, establishing a connection with the screened second server includes:

[0103] A corresponding connection method is selected according to the type of the screened second server to establish a connection with the screened second server; wherein the types of the second server include at least two.

[0104] Optionally, in the process of downloading the video resource from the current server, if it is determined that the service quality of the current server does not meet the first preset condition, switching to downloading the video resource from the backup server maintaining the heartbeat connection includes:

[0105] In the process of downloading video resources from the current server, updating the service quality of the current server based on the health status data of the current server acquired in real time and updating the service quality of the backup server based on the health status data acquired in real time from the backup server maintaining the heartbeat connection;

[0106] If it is determined that the service quality of the current server does not meet the first preset condition, switch to downloading video resources from a backup server with the best service quality.

[0107] Optionally, the device further comprises a reselection module, configured to:

[0108] In the process of maintaining the heartbeat connection with the backup server, if the service quality of the backup server does not meet the second preset condition, a new second server is reselected from the list information of the second server as the backup server.

[0109] Optionally, the device further includes a third switching module, configured to:

[0110] If an active exit message sent by the current server is received, the backup server is switched to download video resources.

[0111] The device further includes a fourth switching module, configured to:

[0112] If an abnormality occurs when switching the backup server, the video resource is downloaded from the first server; wherein the abnormality includes that the backup server does not exist, the backup server switching fails, the backup server reaches the switching number, or the backup server does not meet the switching conditions.

[0113] The device provided in this embodiment executes the method provided in the embodiment of the present application, and has corresponding functional modules and corresponding technical effects.

[0114] Figure 6 is a schematic diagram of the structure of a video download system provided in an embodiment of the present application, such as Figure 6 As shown, the system includes:

[0115] A playback end, a first server and at least two second servers;

[0116] The first server and the second server are used to provide video resources to the playback end;

[0117] The playback end is used for:

[0118] In the case of downloading video resources from the first server, obtaining list information of the second server, and screening at least two second servers based on the list information of the second server;

[0119] Establishing a connection with the screened second server, and determining a current server for downloading video resources and a backup server for maintaining a heartbeat connection in the second server to which the connection is established;

[0120] Stop downloading resources from the first server, and switch to downloading video resources from the current server;

[0121] In the process of downloading the video resource from the current server, if it is determined that the service quality of the current server does not meet the first preset condition, the video resource is downloaded from the backup server that maintains the heartbeat connection.

[0122] It should be noted that for other specific functions of the playback end, reference can be made to the above embodiments and no further description will be given.

[0123] like Figure 7 As shown, the embodiment of the present application provides a playback device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0124] Memory 113, used for storing computer programs;

[0125] In one embodiment of the present application, the processor 111 is used to implement the video downloading method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 113.

[0126] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the video downloading method provided in any of the aforementioned method embodiments are implemented.

[0127] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0128] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0129] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0130] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A video resource downloading method, characterized in that: include: In the case of downloading video resources from the first server, obtaining list information of the second server, and screening at least two second servers based on the list information of the second server; Establishing a connection with the screened second server, and determining a current server for downloading video resources and a backup server for maintaining a heartbeat connection in the second server to which the connection is established; Stop downloading video resources from the first server, and switch to downloading video resources from the current server; In the process of downloading the video resource from the current server, if it is determined that the service quality of the current server does not meet the first preset condition, the video resource is downloaded from the backup server that maintains the heartbeat connection.

2. The method according to claim 1, characterized in that Switch to downloading video resources from the server, including: Sending a request to download a video resource to a server, wherein the request carries location information of the latest video frame in the downloaded video resource; wherein the location information includes the size, type and timestamp of the latest video frame; Receive the video resource fed back by the server based on the positioning information in the request.

3. The method according to claim 1, characterized in that The establishing a connection with the screened second server comprises: A corresponding connection method is selected according to the type of the screened second server to establish a connection with the screened second server; wherein the types of the second server include at least two.

4. The method according to claim 1, characterized in that: In the process of downloading the video resource from the current server, if it is determined that the service quality of the current server does not meet the first preset condition, switching to downloading the video resource from the backup server maintaining the heartbeat connection includes: In the process of downloading video resources from the current server, updating the service quality of the current server based on the health status data of the current server acquired in real time and updating the service quality of the backup server based on the health status data acquired in real time from the backup server maintaining the heartbeat connection; If it is determined that the service quality of the current server does not meet the first preset condition, switch to downloading video resources from a backup server with the best service quality.

5. The method according to claim 4, characterized in that Also includes: In the process of maintaining the heartbeat connection with the backup server, if the service quality of the backup server does not meet the second preset condition, a new second server is reselected from the list information of the second server as the backup server.

6. The method according to claim 1, characterized in that Also includes: If an active exit message sent by the current server is received, the backup server is switched to download video resources.

7. The method according to claim 1, characterized in that Also includes: If an abnormality occurs when switching the backup server, the video resource is downloaded from the first server; wherein the abnormality includes that the backup server does not exist, the backup server switching fails, the backup server reaches the switching number, or the backup server does not meet the switching conditions.

8. A video resource downloading device, characterized in that: include: A screening module, configured to obtain list information of a second server when downloading video resources from a first server, and screen at least two second servers based on the list information of the second server; A connection module, used for establishing a connection with the screened second server, and determining a current server for currently downloading video resources and a backup server for maintaining a current heartbeat connection in the second server to which the connection is established; A first switching module, used to stop downloading video resources from the first server and switch to downloading video resources from the current server; The second switching module is used to switch to downloading the video resource from the backup server if it is determined that the service quality of the current server does not meet the first preset condition during the process of downloading the video resource from the current server.

9. A video downloading system, characterized in that: It includes a playback terminal, a first server and at least two second servers; The first server and the second server are used to provide video resources to the playback end; The playback end is used for: In the case of downloading video resources from the first server, obtaining list information of the second server, and screening at least two second servers based on the list information of the second server; Establishing a connection with the screened second server, and determining a current server for downloading video resources and a backup server for maintaining a heartbeat connection in the second server to which the connection is established; Stop downloading resources from the first server, and switch to downloading video resources from the current server; In the process of downloading the video resource from the current server, if it is determined that the service quality of the current server does not meet the first preset condition, the video resource is downloaded from the backup server that maintains the heartbeat connection.

10. A playback device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute a computer program stored in the memory, and when the computer program is executed, implement the method described in any one of claims 1 to 7.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method and device for determining video data source of network player

    CN102547395A

  • Video live-broadcasting data transmission method and apparatus, storage medium and electronic apparatus

    CN107623723A

  • Video data downloading method and device, electronic equipment and storage medium

    CN114666609A

  • Multicast video source quality monitoring method and device

    CN116471397A

  • Control method and system for standby server, equipment and medium

    CN116962160A