Live broadcast playing processing method and device, electronic equipment and storage medium
By detecting the current time point of live broadcast playback, determining the area where the video to be downloaded is located, and selecting the download source according to the area, the problem of lag rate and bandwidth cost increase caused by live broadcast playback processing is solved, and the effect of rapid download and reduced bandwidth cost is achieved.
Patent Information
- Application Number
- CN202411847895.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-03-04
AI Technical Summary
In the prior art, live broadcast playback processing will affect the terminal lag rate, and the required live broadcast bandwidth cost increases multiple times compared to before.
By detecting the current time point of live broadcast playback, determine the area where the video to be downloaded is located. If in the content distribution compensation area, pull the live sub-slice from the CDN service; if in the security area, obtain the video pushed by other terminals and cache the downloadable live sub-slice for video viewing.
While ensuring that the stutter rate is not affected, quickly download resources to reduce the required live broadcast bandwidth cost.
Smart Images

Figure CN119562085A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of live broadcast processing, and in particular to a live broadcast processing method, device, electronic equipment and storage medium. Background Art
[0002] With the rapid development of live broadcast technology, more and more film and television programs, such as variety shows, have begun to broadcast programs through live broadcast to attract users. When broadcasting programs through live broadcast, all terminals need to download live broadcast slices from CDN services to watch the programs. The above-mentioned live broadcast processing will affect the terminal freeze rate, and the required live broadcast bandwidth cost will increase many times compared with before. Summary of the invention
[0003] In view of this, the embodiments of the present invention provide a live broadcast processing method, device, electronic device and storage medium to solve the problem in the prior art that the terminal freeze rate is affected and the required live broadcast bandwidth cost is increased many times compared with before.
[0004] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0005] A first aspect of an embodiment of the present invention shows a live broadcast processing method, which is applied to a mobile terminal. The method includes:
[0006] When it is detected that the live broadcast of a certain program is triggered, the current broadcast time point of the program is obtained;
[0007] Determine the area where the video to be downloaded is located based on the current playback time point;
[0008] If it is determined that the video to be downloaded is in the content distribution compensation area, a live sub-slice corresponding to the video to be downloaded is pulled from the content distribution service;
[0009] If it is determined that the video to be downloaded is in the safe zone, obtaining a first video corresponding to the program pushed by other terminals that watch the same program and have established a point-to-point connection relationship;
[0010] For each first video, determining whether the video status of the first video is downloadable;
[0011] If so, cache the live sub-slice corresponding to the first video so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded.
[0012] Optionally, determining the area where the video to be downloaded is located based on the current playback time point includes:
[0013] Obtaining the first playback time point of the streaming file corresponding to each download address from the playback address list issued by the content distribution service of the program;
[0014] Determine the video to be downloaded of the program on the mobile terminal according to the current playback time point and the first playback time point of the streaming file corresponding to each download address;
[0015] The area where the video to be downloaded is located is determined based on the current playback time point and the first playback time point of the video to be downloaded.
[0016] Optionally, determining the area where the video to be downloaded is located based on the current playback time point and the first playback time point of the video to be downloaded includes:
[0017] Calculating a first difference between the current playback time point and a first playback time point of the video to be downloaded;
[0018] determining whether the first difference is within a content distribution compensation area;
[0019] If the first difference is in the content distribution compensation area, determining that the video to be downloaded is in the content distribution compensation area;
[0020] If the first difference is greater than the value corresponding to the content distribution compensation area, it is determined that the video to be downloaded is in a safe area.
[0021] Optionally, obtaining a first video corresponding to the program pushed by another terminal that watches the same program and has established a point-to-point connection relationship includes:
[0022] When it is detected that the live broadcast of a certain program is triggered, a point-to-point connection relationship creation request is sent to other terminals watching the same program;
[0023] Determine whether to receive a message notification of creating a request feedback based on a point-to-point connection relationship from other terminals watching the same program within a preset time;
[0024] If so, determine to establish a point-to-point connection relationship with other terminals watching the same program;
[0025] Subscription to the program is initiated to other terminals in a point-to-point connection relationship, so as to receive a first video related to the program pushed by the other terminals.
[0026] Optionally, also include:
[0027] Calculate an identification code corresponding to the live sub-slice corresponding to the first video;
[0028] Compare the identification code corresponding to the live sub-slice corresponding to the first video with the preset identification code of the live sub-slice;
[0029] If they are consistent, the step of caching the live sub-slice corresponding to the first video is executed so as to watch the video based on the live sub-slice corresponding to the video to be downloaded.
[0030] Optionally, also include:
[0031] If it is determined that the video to be downloaded is in the safe zone and is not cached, obtaining a first video corresponding to the program pushed by other terminals that watch the same program and have established a point-to-point connection relationship;
[0032] In the process of receiving the first video related to the program pushed by the other terminal, if it is determined that there is a first video with the same first playback time point as the video to be downloaded, the live sub-slice corresponding to the first video is cached so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded.
[0033] A second aspect of an embodiment of the present invention shows a live broadcast processing device, which is applied to a mobile terminal, and the device includes:
[0034] An acquisition unit, configured to acquire a current playback time point of a program when detecting that the live playback of a program is triggered;
[0035] A determination unit, configured to determine the area where the video to be downloaded is located based on the current playback time point;
[0036] The processing unit is used to, if it is determined that the video to be downloaded is in the content distribution compensation area, pull the live sub-slice corresponding to the video to be downloaded from the content distribution service; if it is determined that the video to be downloaded is in the safe area, obtain the first video corresponding to the program pushed by other terminals that watch the same program and establish a point-to-point connection relationship; for each first video, determine whether the video status of the first video is downloadable; if so, cache the live sub-slice corresponding to the first video, so as to watch the video based on the live sub-slice corresponding to the video to be downloaded.
[0037] Optionally, determine the unit, specifically for:
[0038] Obtain the first playback time point of the streaming file corresponding to each download address from the playback address list issued by the content distribution service of the program; determine the video to be downloaded of the program on the mobile terminal according to the current playback time point and the first playback time point of the streaming file corresponding to each download address; determine the area where the video to be downloaded is located based on the current playback time point and the first playback time point of the video to be downloaded.
[0039] A third aspect of an embodiment of the present invention shows an electronic device, which is used to run a program, wherein when the program is run, the live broadcast processing method shown in the first aspect of the embodiment of the present invention is executed.
[0040] The fourth aspect of an embodiment of the present invention shows a storage medium, which includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the live broadcast processing method shown in the first aspect of the embodiment of the present invention.
[0041] A live broadcast processing method, device, electronic device and storage medium provided based on the above-mentioned embodiments of the present invention are applied to mobile terminals, and the method includes: when it is detected that the live broadcast of a certain program is triggered, obtaining the current playback time point of the program; determining the area where the video to be downloaded is located based on the current playback time point; if it is determined that the video to be downloaded is in the content distribution compensation area, pulling the live sub-slice corresponding to the video to be downloaded from the content distribution service; if it is determined that the video to be downloaded is in a safe area, obtaining the first video corresponding to the program pushed by other terminals that watch the same program and establish a point-to-point connection relationship; for each first video, determining whether the video status of the first video is downloadable; if so, caching the live sub-slice corresponding to the first video, so as to watch the video based on the live sub-slice corresponding to the video to be downloaded. This application determines the area where the video to be downloaded by the mobile terminal is located, and selects different download sources according to different areas. If it is determined that the video to be downloaded is in the content distribution compensation area, the live sub-slice corresponding to the video to be downloaded is pulled from the CDN service; if it is determined that the video to be downloaded is in the safe area, the first video corresponding to the program pushed by other terminals that watch the same program and establish a point-to-point connection relationship is obtained; the live sub-slice corresponding to the first video whose video status is downloadable is cached, so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded. In order to ensure that the freeze rate is not affected, the resources can be downloaded quickly, thereby reducing the required live bandwidth cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0043] Figure 1 A flowchart of a live broadcast processing method according to an embodiment of the present invention is shown;
[0044] Figure 2 A schematic diagram of the architecture of a stream file shown in an embodiment of the present invention;
[0045] Figure 3 A schematic diagram of the architecture of various video regions shown in an embodiment of the present invention;
[0046] Figure 4 This is an example diagram of live broadcast processing shown in an embodiment of the present invention;
[0047] Figure 5 A schematic flow chart of another live broadcast processing method according to an embodiment of the present invention;
[0048] Figure 6 A schematic structural diagram of a live broadcast processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0050] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0051] It should be noted that the descriptions of "first", "second", etc. in the present invention are only used for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0052] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0053] See also Figure 1 A live broadcast processing method is shown in an embodiment of the present invention, and the method includes:
[0054] Step S101: when it is detected that the live broadcast of a certain program is triggered, the current broadcast time point of the program is obtained;
[0055] In the specific implementation of step S101, when it is detected that the live broadcast of a certain program is triggered, the current time of the mobile terminal is obtained and used as the current broadcast time point of the program on the local terminal.
[0056] If the program starts live broadcast at the starting time 7:30, and when it is detected that the live broadcast of a program is triggered, the current time of the mobile terminal is obtained as 8:00, and the current time of the mobile terminal 8:00 is used as the current broadcast time point of the program. That is to say, given that the program has been live for 30 minutes, the current broadcast time point is the sum of the program's starting time 7:30 and the 30 minutes of broadcast time.
[0057] It should be noted that if it is determined that the live broadcast of a certain program can be triggered, it means that the live broadcast has not ended.
[0058] Step S102: determining the area where the video to be downloaded is located based on the current playback time point.
[0059] Optionally, when a program is being broadcast live, the server controls the CDN service to package the live sub-slices of the live device in the order of the broadcast time axis according to the live broadcast time, that is, the broadcast time axis to generate a stream file, and construct the download address corresponding to each stream file; then write the download address into the broadcast address list in the order of the broadcast time. Next, calculate the corresponding identification code according to each live sub-slice in the stream file; and package the identification code and the broadcast address list corresponding to each live sub-slice so that the mobile terminal can obtain it.
[0060] It should be noted that the CDN service will send out approximately 3 download addresses each time the live broadcast device records the live broadcast, with a total of approximately 10 seconds of video data. In other words, the CDN service will refresh the playback address list based on the download address corresponding to the new live broadcast sub-slice.
[0061] Stream file, namely ts stream file, is a file format used for transmission and storage of audio and video data.
[0062] Live sub-slices are logical slices based on streaming files. Each streaming file is divided into N logical sub-slices according to a fixed size. Figure 2 shown.
[0063] Figure 2 An example of two stream files is shown, specifically including TS0 and TS1, TS0 includes sub-slice 0, sub-slice 1..., TS1 includes sub-slice 0, sub-slice 1...; that is, each stream file includes multiple sub-slices, namely live sub-slices.
[0064] The fixed size is the size determined in advance by the technician based on the jam rate.
[0065] If a user clicks on the live broadcast of a program in a mobile terminal, the processor of the terminal will regularly select the corresponding download address and the identification code corresponding to each live sub-slice from the m3u8 address list refreshed by the CDN service corresponding to the program.
[0066] It should be noted that the video to be downloaded refers to the live sub-slice of the program that has not yet been downloaded to the mobile terminal.
[0067] It should be noted that the specific process of calculating the corresponding identification code according to each live sub-slice in the stream file includes:
[0068] For each live sub-slice, the video data corresponding to the live sub-slice is encoded to obtain encoded data, and the encoded data is used as an identification code.
[0069] It should be noted that each identification code is an identifier that can uniquely identify the corresponding live sub-slice.
[0070] Optionally, the md5 value, ie, the identification code, of the video data corresponding to each live sub-slice may be calculated using the MD5 algorithm.
[0071] It should be noted that the play address list can be an m3u8 address list, and the download address is an m3u8 address. The terminal downloads the corresponding stream file from the corresponding m3u8 address through the CDN service, each m3u8 address corresponds to a stream file, and uses an address in the m3u8 address list to download the corresponding stream file, which includes multiple sub-slices.
[0072] m3u8 is a playlist. When you open it, the playback software does not play it, but finds the address of the corresponding audio and video file according to its index and plays it.
[0073] Optionally, the live broadcast shown in this application can be a method of live broadcasting using the HTTP Live Streaming (HLS) protocol. It is used for the transmission of real-time video and audio. It divides the media content into multiple small files, i.e., streaming files, and transmits them through the HTTP protocol, so that users can play videos smoothly in different network environments.
[0074] The specific implementation process of step S102 comprises the following steps;
[0075] Step S11: obtaining the first playback time point of the streaming file corresponding to each download address from the playback address list issued by the CDN service of the program;
[0076] It should be noted that a video to be downloaded is a stream file corresponding to a download address, that is, N live sub-slices.
[0077] There is a first play time point for each streaming file corresponding to each download address, and the play time point for each streaming file corresponding to each download address is the sum of the program start time to the recorded time.
[0078] For example, the first playback time point of stream file a is equal to the program start time 19:30 and the recorded time 30 minutes, that is, 20:00. That is to say, when the mobile terminal reaches the first playback time point 20:00, the live broadcast segment corresponding to stream file a is played.
[0079] Step S12: Determine the video to be downloaded of the program in the mobile terminal according to the current playback time point and the playback time point of the streaming file corresponding to each download address.
[0080] It should be noted that the current playing time point is the sum of the start time of the program and the elapsed playing time.
[0081] In the process of implementing step S12, the first playback time point of the streaming file corresponding to each download address and the size of the current playback time point are compared; the first playback time point greater than the current playback time point is obtained, and the streaming file corresponding to the first playback time point greater than the current playback time point, that is, the live sub-slice is used as the video to be downloaded.
[0082] For example: the current playback time is 20:00, and the program has been broadcast live for 30 minutes; at this time, the first playback time point greater than the current playback time point 20:00 is 20:10, 20:20, etc., and the first playback time point corresponds to N live sub-slices of the download address, that is, a streaming file as the video to be downloaded.
[0083] Step S13: determining the area where the video to be downloaded is located based on the current playback time point and the first playback time point of the video to be downloaded.
[0084] It should be noted that the specific implementation of step S13 includes the following steps:
[0085] Step S21: Calculate a first difference between the current playback time point and the first playback time point of the video to be downloaded;
[0086] Step S22: Determine whether the first difference is within the content distribution cdn compensation area; if the first difference is within the content distribution cdn compensation area, execute step S23; if the first difference is greater than the value corresponding to the content distribution cdn compensation area, execute step S24.
[0087] Step S23: Determine whether the video to be downloaded is in the content distribution compensation area;
[0088] Step S24: Determine whether the video to be downloaded is in a safe area.
[0089] In the process of specifically implementing steps S21 to S24, a first difference between the current playback time point and the first playback time point of the video to be downloaded is calculated; if the first difference is greater than or equal to the first endpoint in the range of the content distribution cdn compensation zone, and less than or equal to the second endpoint, it is determined that the video to be downloaded is in the content distribution compensation zone; if the first difference is greater than the second endpoint in the range of the content distribution cdn compensation zone, it is determined that the video to be downloaded is in the safe zone.
[0090] Optionally, if the first difference is smaller than the first endpoint in the range of the content distribution CDN compensation area, it indicates that the video to be downloaded is in the expired area, and at this time, it is determined whether the number of videos to be downloaded is greater than a preset value;
[0091] If yes, then wait, if no, then you can download videos that are less than the current time from other terminals.
[0092] It should be noted that this application includes expired areas, content distribution CDN compensation areas and security areas, such as Figure 3 shown.
[0093] A content distribution CDN compensation zone is set after the current playback time point, which is very close to the current playback time point to reduce the jam rate and quickly download sub-slice data from the CDN; an expiration zone is set before the current playback time point to store the live video that has been played on this end for local playback; a safety zone is set after the content distribution CDN compensation zone, where: the data in the safety zone is far from the current playback time point, and the data in the safety zone is mainly downloaded from other terminals.
[0094] In the embodiment of the present invention, the content distribution CDN compensation area is used to protect the jamming rate of the mobile terminal. If there is too little data in this area, it may cause jamming. If there is too much data, the bandwidth cost consumed by the CDN service will be too high, so this range is critical.
[0095] The present invention shows two ways to determine the content distribution CDN compensation area. One is to first use a preset initial configuration area range, which is generally set to 5s, and then adjust the preset initial configuration area range according to online data, such as the freeze rate and the p2p sharing rate, until it is adjusted to an optimal value, and use the optimal value as the range of the content distribution CDN compensation area.
[0096] The p2p sharing rate is the bandwidth consumed by downloading p2p programs, that is, the bandwidth consumed by mobile terminals with P2P / (the bandwidth consumed by downloading p2p programs + the bandwidth consumed by downloading from CDN services).
[0097] Another method is to confirm the area of the compensation zone based on the network conditions of the mobile terminal. When the network delay is less than the preset delay, it means that the network is good. At this time, the range of the corresponding content distribution CDN compensation zone is obtained according to the network delay. At this time, the range of the content distribution CDN compensation zone is pre-set and can be set smaller to download as little as possible from the CDN service. When the network delay is greater than or equal to the preset delay, it means that the network is poor. At this time, the area of the compensation zone is set larger.
[0098] When the network is good, data can be downloaded quickly from the CDN to ensure that there is data for the player to play. When the network is poor, the download speed from the CDN is slow. If more data is not cached, it may cause lag, so it is downloaded from other terminals.
[0099] Step S103: Determine whether the video to be downloaded is in the content distribution compensation area or the safety area. If it is determined that the video to be downloaded is in the content distribution compensation area, execute step S104; if it is determined that the video to be downloaded is in the safety area, execute step S105.
[0100] Step S104: Pull the live sub-slice corresponding to the video to be downloaded from the content distribution CDN service.
[0101] In the process of implementing step S104, since the data in the CDN compensation area is very close to the current playback position, that is, the current playback time point is very close, the data needs to be downloaded quickly, otherwise it will cause lag, so downloading data from the CDN service is the fastest and safest; specifically, the mobile terminal pulls the corresponding download address from the CDN service according to the playback time point of the video to be downloaded, and downloads the live sub-slice corresponding to the streaming file through the download address, so that when the playback time point corresponding to the live sub-slice reaches the corresponding current playback time point, the corresponding live sub-slice is played.
[0102] Step S105: obtaining a first video corresponding to the program pushed by other terminals that watch the same program and have established a point-to-point connection relationship;
[0103] It should be noted that the specific implementation of step S105 includes the following steps:
[0104] Step S31: when it is detected that the live broadcast of a certain program is triggered, a point-to-point connection relationship creation request is sent to other terminals watching the same program;
[0105] Step S32: Determine whether a message notification of creating a request feedback based on a point-to-point connection relationship from other terminals watching the same program is received within a preset time. If so, execute step S33; if not, execute connection failure.
[0106] Step S33: Determine to establish a point-to-point connection relationship with other terminals that watch the same program.
[0107] In the specific implementation of steps S31 to S33, when it is detected that the live broadcast of a certain program is triggered, attempts are made to establish connections with other terminals that watch the same program on a regular basis, that is, a point-to-point connection relationship creation request is sent to the server, and the server determines the IP addresses of other terminals that watch the same program based on the viewing list of the program, and forwards the point-to-point connection relationship creation request to the other terminals according to the IP addresses;
[0108] At the same time, a message notification forwarded by the server and sent by other terminals watching the same program based on a point-to-point connection relationship creation request is received, and a point-to-point connection relationship with the other terminals is established based on the IP in the message notification.
[0109] It should be noted that the point-to-point connection relationship is a stable long connection when watching the same program, that is, a P2P connection.
[0110] Step S34: initiating a subscription to the program to other terminals in the point-to-point connection relationship, so as to receive a first video related to the program pushed by the other terminals;
[0111] Optionally, after establishing a point-to-point connection relationship, it is determined that the mobile terminal and other terminals are in a live broadcast domain. At this time, each terminal (mobile terminal and other terminals) in the live broadcast domain initiates a subscription to the program to other terminals in the point-to-point connection relationship, so that after each terminal downloads some live broadcast data, that is, the first video, it will try to actively push these first videos to other actively subscribed terminals, that is, actively push the first video downloaded by itself to each terminal in the live broadcast domain except itself.
[0112] Optionally, the first video downloaded by itself is actively pushed to each terminal in the live broadcast domain except itself, and data is pulled and pushed according to sub-slices as the smallest unit. The advantage of this is that after each terminal downloads the live broadcast sub-slice, it can be quickly shared with other terminals, and the sending of other sub-slices in the pushed first video can be directly canceled when push is not needed.
[0113] In the embodiment of the present invention, by pushing live stream sub-slices, it is ensured that live resources can be quickly shared in a point-to-point connection relationship, because the live stream that can be downloaded is only a dozen seconds in total. If the speed is slow, it will cause the data to be downloaded from the CDN service, thus having no effect.
[0114] That is to say, other terminals push the first video in the form of live sub-slices. Therefore, the first video received by the mobile terminal is not a streaming file composed of multiple live sub-slices. Therefore, when the mobile terminal determines that the video status of the first video is not downloadable, it notifies the corresponding other terminals to cancel the push of the remaining live sub-slices.
[0115] Step S106: for each first video, determine whether the video status of the first video is downloadable, if so, execute step S107, if not, notify the corresponding other terminals to cancel the first video pushed this time.
[0116] In the process of implementing step S106, for each first video, it is determined whether there is a video identical to the first video in the mobile terminal according to the playback time point of the first video, or it is determined whether the live sub-slice being downloaded is the same as the first video according to the playback time point of the first video, or it is determined whether the first video does not belong to the safe zone according to the playback time point of the first video and the current playback time point. If any of the above conditions is met, it means that the video status of the first video in the mobile terminal is not downloadable, then the corresponding other terminals are notified to cancel the first video pushed this time; if it is determined that there is no identical first video on this end, there is no first video being downloaded, and the first video does not belong to the safe zone, execute step S107.
[0117] Step S107: caching the live sub-slice corresponding to the first video so as to watch the video based on the live sub-slice corresponding to the video to be downloaded.
[0118] In the specific implementation of step S107, the first video, that is, the live sub-slice corresponding to the streaming file is cached so that when the playback time point corresponding to the live sub-slice reaches the corresponding current playback time point, the corresponding live sub-slice is played.
[0119] For example, mobile terminal peer0 obtains first videos corresponding to the program pushed by other terminals peer1 and peer2 that watch the same program and establish a point-to-point connection relationship. For each first video a, b, c, and d sent by peer2, it is determined whether the video status of the first video in the mobile terminal is downloadable. If they can all be downloaded, each first video a, b, c, and d sent by peer2 is cached to the corresponding position of peer0 according to the corresponding playback time point; then, for each first video e, f, and g sent by peer1, it is determined whether the video status of the first video in the mobile terminal is downloadable. If it is determined based on the first video g that the first video d with the same playback time point has been downloaded, or is being downloaded, the first video g is discarded, and peer1 is notified not to continue pushing the first video g; if both the first videos e and f are downloadable, each first video e and f sent by peer2 is cached to the corresponding position of peer0 according to the corresponding playback time point, such as Figure 4 shown.
[0120] It should be noted that the mobile terminal peer0 can simultaneously receive the first video corresponding to the program pushed by other terminals peer1 and peer2 respectively.
[0121] In order to save the cost of live broadcast bandwidth, in the present invention, when the live broadcast of a certain program is detected to be triggered, the mobile terminal is used as the entrance to play the live video, and all strategy optimizations need to be initiated from the mobile terminal. It is ultimately expected that part of the live streaming data previously downloaded by the terminal from the CDN service can be downloaded from the best other terminal, that is, the P2P node (including terminal users, network service PCDN equipment, etc.), thereby saving the cost of CDN bandwidth. The PCDN equipment can be a user's idle router or PC computer or "mining" equipment.
[0122] Optionally, based on the method shown in the above embodiment of the present invention, before executing step S106 to cache the live sub-slice corresponding to the first video, the method further includes:
[0123] Calculate an identification code corresponding to the live sub-slice corresponding to the first video;
[0124] The identification code corresponding to the live sub-slice corresponding to the first video is compared with the preset identification code of the live sub-slice. If they are consistent, step S106 is executed; if they are inconsistent, they are discarded.
[0125] The preset identification code refers to the identification code of the live sub-slice corresponding to the playback time point of the first video obtained from the CDN service;
[0126] Specifically, after the terminal downloads each live sub-slice from the p2p node, it will calculate whether the identification code corresponding to the received live sub-slice is the same as the identification code of the live sub-slice transmitted by the cdn service. If they do not match, they will be discarded. If they are the same, they will be written into the local cache and transmitted to the local player, that is, step S107 is executed to ensure the security of the data.
[0127] In the embodiment of the present invention, the area where the video to be downloaded by the mobile terminal is located is determined, and different download sources are selected according to different areas. If it is determined that the video to be downloaded is in the content distribution compensation area, the live sub-slice corresponding to the video to be downloaded is pulled from the CDN service; if it is determined that the video to be downloaded is in the safe area, the first video corresponding to the program pushed by other terminals that watch the same program and establish a point-to-point connection relationship is obtained; for each first video, it is determined whether the video status of the first video is downloadable; if so, the live sub-slice corresponding to the first video is cached, so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded. In order to ensure that the freeze rate is not affected, the resources can be downloaded quickly, thereby reducing the required live bandwidth cost.
[0128] See also Figure 5 , is another live broadcast processing method shown in an embodiment of the present invention, the method comprising:
[0129] Step S501: when it is detected that the live broadcast of a certain program is triggered, the current broadcast time point of the program is obtained;
[0130] Step S502: Determine the area where the video to be downloaded is located based on the current playback time point.
[0131] Step S503: Determine whether the video to be downloaded is in the content distribution compensation area or the safety area. If it is determined that the video to be downloaded is in the content distribution compensation area, execute step S504; if it is determined that the video to be downloaded is in the safety area, execute step S505.
[0132] It should be noted that the specific implementation process of step S210 to step S503 is the same as the specific implementation process of the above-mentioned specific implementation steps S101 to step S103, and they can refer to each other.
[0133] Step S504: Pull the live sub-slice corresponding to the video to be downloaded from the CDN service.
[0134] Step S505: Determine whether the video to be downloaded has been cached. If not, execute step S506. If yes, continue to process the next video to be downloaded, that is, return to execute step S502.
[0135] In the process of implementing step S505, it is determined whether the local end, that is, the mobile terminal itself, has cached the video corresponding to the first playback time point of the video to be downloaded. If so, it indicates whether the video to be downloaded has been cached, and continues to process the next video to be downloaded, that is, returns to execute step S506; if not, execute step S504.
[0136] Step S506: Obtaining a first video corresponding to the program pushed by other terminals that watch the same program and have established a point-to-point connection relationship;
[0137] Step S507: Determine whether there is a first video with the same first playback time point as the video to be downloaded. If so, execute step S508; if not, continue processing the next video to be downloaded, that is, return to execute step S502.
[0138] In the process of specifically implementing step S506, in the process of receiving the first video related to the program pushed by the other terminal, the playback time points of all the first videos are searched to determine whether there is a first video with the same first playback time point as the video to be downloaded. If so, step S508 is executed. If not, the corresponding other terminals are notified to cancel the task of pushing data this time, and continue to process the next video to be downloaded, that is, return to execute step S502.
[0139] Step S508: caching the live sub-slice corresponding to the first video so as to watch the video based on the live sub-slice corresponding to the video to be downloaded.
[0140] In the specific implementation of step S508, the first video, that is, the live sub-slice corresponding to the streaming file is cached so that when the playback time point corresponding to the live sub-slice reaches the corresponding current playback time point, the corresponding live sub-slice is played.
[0141] In an embodiment of the present invention, the area where the video to be downloaded by the mobile terminal is located is determined, and different download sources are selected according to different areas. If it is determined that the video to be downloaded is in the content distribution compensation area, the live sub-slice corresponding to the video to be downloaded is pulled from the CDN service; if it is determined that the video to be downloaded is in the safe area and is not cached, the first video corresponding to the program pushed by other terminals that watch the same program and establish a point-to-point connection relationship is obtained; in the process of receiving the first video related to the program pushed by the other terminal, it is determined whether there is a first video with the same first playback time point as the video to be downloaded. If so, the live sub-slice corresponding to the first video is cached, so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded. In order to ensure that the freeze rate is not affected, the resources can be downloaded quickly, thereby reducing the required live bandwidth cost.
[0142] Optionally, based on the live broadcast processing method shown in the above embodiment of the present invention, the embodiment of the present invention accordingly shows a live broadcast processing device, such as Figure 6 As shown, the device comprises:
[0143] The acquisition unit 601 is used to acquire the current playback time point of a program when it is detected that the live broadcast of a program is triggered;
[0144] A determination unit 602, configured to determine the region where the video to be downloaded is located based on the current playback time point;
[0145] Processing unit 603 is used to, if it is determined that the video to be downloaded is in the content distribution compensation area, pull the live sub-slice corresponding to the video to be downloaded from the content distribution service; if it is determined that the video to be downloaded is in the safe area, obtain the first video corresponding to the program pushed by other terminals that watch the same program and establish a point-to-point connection relationship; for each first video, determine whether the video status of the first video is downloadable; if so, cache the live sub-slice corresponding to the first video so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded.
[0146] The specific principles and execution processes of each unit in the live broadcast processing control device disclosed in the above embodiment of the present invention are the same as the corresponding contents in the live broadcast processing method provided in the above embodiment of the present invention. Please refer to the corresponding parts of the live broadcast processing method disclosed in the above embodiment of the present invention, and no further details will be given here.
[0147] In the embodiment of the present invention, the area where the video to be downloaded by the mobile terminal is located is determined, and different download sources are selected according to different areas. If it is determined that the video to be downloaded is in the content distribution compensation area, the live sub-slice corresponding to the video to be downloaded is pulled from the CDN service; if it is determined that the video to be downloaded is in the safe area, the first video corresponding to the program pushed by other terminals that watch the same program and establish a point-to-point connection relationship is obtained; for each first video, it is determined whether the video status of the first video is downloadable; if so, the live sub-slice corresponding to the first video is cached, so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded. In order to ensure that the freeze rate is not affected, the resources can be downloaded quickly, thereby reducing the required live bandwidth cost.
[0148] Optionally, based on the live broadcast processing device shown in the above embodiment of the present invention, the determination unit 602 is specifically configured to:
[0149] Obtain the first playback time point of the streaming file corresponding to each download address from the playback address list issued by the content distribution service of the program; determine the video to be downloaded of the program on the mobile terminal according to the current playback time point and the first playback time point of the streaming file corresponding to each download address; determine the area where the video to be downloaded is located based on the current playback time point and the first playback time point of the video to be downloaded.
[0150] Wherein, determining the area where the video to be downloaded is located based on the current playback time point and the first playback time point of the video to be downloaded includes:
[0151] Calculating a first difference between the current playback time point and a first playback time point of the video to be downloaded;
[0152] determining whether the first difference is within a content distribution compensation area;
[0153] If the first difference is in the content distribution compensation area, determining that the video to be downloaded is in the content distribution compensation area;
[0154] If the first difference is greater than the value corresponding to the content distribution compensation area, it is determined that the video to be downloaded is in a safe area.
[0155] Optionally, based on the live broadcast processing device shown in the above embodiment of the present invention, the processing unit 603 for obtaining the first video corresponding to the program pushed by other terminals that watch the same program and establish a point-to-point connection relationship is specifically used to:
[0156] When it is detected that the live broadcast of a certain program is triggered, a point-to-point connection relationship creation request is sent to other terminals watching the same program;
[0157] Determine whether to receive a message notification of creating a request feedback based on a point-to-point connection relationship from other terminals watching the same program within a preset time;
[0158] If so, determine to establish a point-to-point connection relationship with other terminals watching the same program.
[0159] Subscription to the program is initiated to other terminals in a point-to-point connection relationship, so as to receive a first video related to the program pushed by the other terminals.
[0160] Optionally, based on the live broadcast processing device shown in the above embodiment of the present invention, the processing unit 603 is further used to:
[0161] Calculate an identification code corresponding to the live sub-slice corresponding to the first video;
[0162] Compare the identification code corresponding to the live sub-slice corresponding to the first video with the preset identification code of the live sub-slice;
[0163] If they are consistent, the live sub-slice corresponding to the first video is cached so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded.
[0164] Optionally, based on the live broadcast processing device shown in the above embodiment of the present invention, the processing unit 603 is further used to:
[0165] If it is determined that the video to be downloaded is in the safe zone and is not cached, obtaining a first video corresponding to the program pushed by other terminals that watch the same program and have established a point-to-point connection relationship;
[0166] In the process of receiving the first video related to the program pushed by the other terminal, if it is determined that there is a first video with the same first playback time point as the video to be downloaded, the live sub-slice corresponding to the first video is cached so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded.
[0167] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory is used to store program codes and data generated by live broadcast processing, and the processor is used to call program instructions in the memory to execute the steps shown in the live broadcast processing method in the above embodiment.
[0168] An embodiment of the present invention provides a storage medium, and a vehicle includes the electronic device provided by the above-mentioned embodiment of the present application, and the electronic device is used to execute the live broadcast processing method disclosed in the embodiment of the present application.
[0169] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0170] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0171] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A live broadcast processing method, characterized in that: Applied to a mobile terminal, the method comprises: When it is detected that the live broadcast of a certain program is triggered, the current broadcast time point of the program is obtained; Determine the area where the video to be downloaded is located based on the current playback time point; If it is determined that the video to be downloaded is in the content distribution compensation area, a live sub-slice corresponding to the video to be downloaded is pulled from the content distribution service; If it is determined that the video to be downloaded is in the safe zone, obtaining a first video corresponding to the program pushed by other terminals that watch the same program and have established a point-to-point connection relationship; For each first video, determining whether the video status of the first video is downloadable; If so, cache the live sub-slice corresponding to the first video so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded.
2. The method according to claim 1, characterized in that Determining the area where the video to be downloaded is located based on the current playback time point includes: Obtaining the first playback time point of the streaming file corresponding to each download address from the playback address list issued by the content distribution service of the program; Determine the video to be downloaded of the program on the mobile terminal according to the current playback time point and the first playback time point of the streaming file corresponding to each download address; The area where the video to be downloaded is located is determined based on the current playback time point and the first playback time point of the video to be downloaded.
3. The method according to claim 2, characterized in that Determining the area where the video to be downloaded is located based on the current playback time point and the first playback time point of the video to be downloaded includes: Calculating a first difference between the current playback time point and a first playback time point of the video to be downloaded; determining whether the first difference is within a content distribution compensation area; If the first difference is in the content distribution compensation area, determining that the video to be downloaded is in the content distribution compensation area; If the first difference is greater than the value corresponding to the content distribution compensation area, it is determined that the video to be downloaded is in a safe area.
4. The method according to claim 1, characterized in that: Acquiring a first video corresponding to the program pushed by other terminals that watch the same program and have established a point-to-point connection relationship, including: When it is detected that the live broadcast of a certain program is triggered, a point-to-point connection relationship creation request is sent to other terminals watching the same program; Determine whether to receive a message notification of creating a request feedback based on a point-to-point connection relationship from other terminals watching the same program within a preset time; If so, determine to establish a point-to-point connection relationship with other terminals watching the same program; Subscription to the program is initiated to other terminals in a point-to-point connection relationship, so as to receive a first video related to the program pushed by the other terminals.
5. The method according to claim 1, characterized in that Also includes: Calculate an identification code corresponding to the live sub-slice corresponding to the first video; Compare the identification code corresponding to the live sub-slice corresponding to the first video with the preset identification code of the live sub-slice; If they are consistent, the step of caching the live sub-slice corresponding to the first video is executed so as to watch the video based on the live sub-slice corresponding to the video to be downloaded.
6. The method according to claim 1, characterized in that Also includes: If it is determined that the video to be downloaded is in the safe zone and is not cached, obtaining a first video corresponding to the program pushed by other terminals that watch the same program and have established a point-to-point connection relationship; In the process of receiving the first video related to the program pushed by the other terminal, if it is determined that there is a first video with the same first playback time point as the video to be downloaded, the live sub-slice corresponding to the first video is cached so that the video can be watched based on the live sub-slice corresponding to the video to be downloaded.
7. A live broadcast processing device, characterized in that: Applied to a mobile terminal, the device comprises: An acquisition unit, configured to acquire a current playback time point of a program when detecting that the live playback of a program is triggered; A determination unit, configured to determine the area where the video to be downloaded is located based on the current playback time point; The processing unit is used to, if it is determined that the video to be downloaded is in the content distribution compensation area, pull the live sub-slice corresponding to the video to be downloaded from the content distribution service; if it is determined that the video to be downloaded is in the safe area, obtain the first video corresponding to the program pushed by other terminals that watch the same program and establish a point-to-point connection relationship; for each first video, determine whether the video status of the first video is downloadable; if so, cache the live sub-slice corresponding to the first video, so as to watch the video based on the live sub-slice corresponding to the video to be downloaded.
8. The device according to claim 7, characterized in that Determine the unit, specifically for: Obtaining a first playback time point of a streaming file corresponding to each download address from a playback address list issued by a content distribution service of the program; determining a video to be downloaded of the program on the mobile terminal according to the current playback time point and the first playback time point of the streaming file corresponding to each download address; The area where the video to be downloaded is located is determined based on the current playback time point and the first playback time point of the video to be downloaded.
9. An electronic device, characterized in that: The electronic device is used to run a program, wherein the live broadcast processing method as described in any one of claims 1-6 is executed when the program is run.
10. A storage medium, characterized in that: The storage medium includes a storage program, wherein when the program is running, the device where the storage medium is located is controlled to execute the live broadcast processing method as described in any one of claims 1-6.