Video sending method and device, electronic equipment and medium

By sharing and caching video channels, the problem of low channel resource utilization during video transmission is solved, enabling multiple terminals to efficiently transmit videos at different times, thus reducing network and device load.

CN115134669BActive Publication Date: 2026-04-10VISIONVERA INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
VISIONVERA INFORMATION TECH CO LTD
Filing Date
2022-05-30
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Given limited network resources, the existing technology of establishing a video channel for each terminal results in low channel resource utilization and cannot meet the video needs of multiple terminals at different times, leading to excessive load on network resources and terminal devices.

Method used

By determining whether the target time period overlaps with existing video channels, the video of the target time period is sent using the video channels with overlapping time periods. If necessary, new video channels are created to send the video of the remaining time periods, thereby achieving video channel sharing and caching to meet the needs of different terminals.

Benefits of technology

It improves the utilization rate of video channels, reduces the load on terminal equipment and camera devices, saves network resources, and enables multiple terminals to efficiently send videos at different times.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115134669B_ABST
    Figure CN115134669B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a video sending method and device, electronic equipment and storage medium. The video sending method is applied to a server, and the method comprises: after receiving a request service of a target period video, determining whether there is a first video channel having a coincident period with the target period; wherein different video channels are used to push videos of different periods; if there is, at least using the first video channel to send the video of the target period. The video sending method of the embodiments of the present application can save channel resources.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of network communication, and in particular to a video sending method and device, electronic equipment and medium. BACKGROUND

[0002] At present, with the development of network technology, users are used to watching videos online, which include live videos such as live broadcast and monitoring, and recorded videos such as movies and TV series. Generally, a server sends a video requested by a user to a terminal where the user is located.

[0003] In related technologies, when providing a video sending service for a user, a video sending channel is generally established for each requested terminal to send related videos. However, a large number of channel resources are required, and in the case of limited channel resources, this method leads to low utilization of channel resources. SUMMARY

[0004] In view of the above problems, the present application provides a video sending method, device, electronic equipment and storage medium to overcome the above problems or at least partially solve the above problems.

[0005] The first aspect of the present application discloses a video sending method, which comprises:

[0006] After receiving a request service of a target period video, it is determined whether there is a first video channel with a coincident period with the target period; different video channels are used to push videos of different periods;

[0007] If there is, the video of the target period is sent at least by using the first video channel.

[0008] Optionally, sending the video of the target period at least by using the first video channel comprises:

[0009] For the coincident period in the target period, the video of the coincident period is sent by using the first video channel of the coincident period;

[0010] For the remaining period in the target period except the coincident period, a second video channel is newly established to send the video of the remaining period.

[0011] Optionally, the method further comprises:

[0012] When the video data is sent by using the first video channel, the video data is cached;

[0013] Sending the video of the target period at least by using the first video channel comprises:

[0014] extracting, from the cached video, a video corresponding to the overlapping time period, and sending the video using the first video channel.

[0015] Optionally, sending the video of the target time period using at least the first video channel comprises:

[0016] obtaining a terminal list corresponding to the first video channel; wherein a watching time period of a terminal in the terminal list overlaps with a time period corresponding to the first video channel;

[0017] based on the terminal list, sending, through the first video channel, the video of the respective target time period to each terminal in the terminal list in turn.

[0018] Optionally, the first video channel is a live channel; the method further comprises:

[0019] determining a current live broadcast play time of the first video channel;

[0020] sending the video of the target time period using at least the first video channel comprises:

[0021] for an overlapping time period in the target time period, determining a start time of the overlapping time period;

[0022] in a case where the start time is before the live broadcast play time, sending, through the first video channel, live data currently being played in real time and video data offset from the start time in turn;

[0023] in a case where the start time is after the live broadcast play time, waiting for the video data of the start time to arrive, and then live broadcasting, through the first video channel, the video of the overlapping time period.

[0024] Optionally, the method further comprises:

[0025] for each video channel in the plurality of created video channels, if the video channel currently has no video pushing task, releasing the video channel;

[0026] if the video channel currently has a video pushing task, cleaning out of the video channel a terminal that has ended watching; wherein the terminal that has ended watching is a terminal that is irrelevant to the video pushing task.

[0027] Optionally, the method further comprises:

[0028] if the first video channel does not exist, creating a new third video channel, and sending the video of the target time period using the third video channel.

[0029] The second aspect of the embodiment of the application provides a video sending device, characterized in application to a server, and the device comprises:

[0030] a channel determining module configured to determine whether a first video channel with a time period coinciding with the target time period exists after receiving a request service of the target time period video; wherein different video channels are used to push videos of different time periods;

[0031] a video sending module configured to send the video of the target time period at least by using the first video channel if the first video channel exists.

[0032] The embodiment of the application further provides an electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus; the memory is used to store a computer program; and the processor is used to execute the program stored on the memory to realize the steps of the video sending method according to the first aspect.

[0033] The embodiment of the application further discloses a computer readable storage medium, which stores a computer program, so that the processor executes the video sending method according to the first aspect of the embodiment of the application.

[0034] The embodiment of the application has the following advantages:

[0035] In the embodiment, whether a first video channel with a time period coinciding with the target time period exists can be determined after receiving a request service of the target time period video; if the first video channel exists, the video of the target time period is sent at least by using the first video channel.

[0036] According to the technical scheme of the application, different video channels are used to push videos of different time periods, so that the video is sent in the granularity of time period, so that the request service of the newly arrived target time period can be sent at least by using the first video channel in the case that the target time period coincides with the time period corresponding to the first video channel, and the video channel corresponding to the request service does not need to be newly built in the case that the target time period is the coinciding time period, so that the new request service and the previous request service can share the video channel, thereby saving the channel resource and improving the utilization rate of the channel resource. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical scheme of the embodiment of the application, the following will briefly introduce the drawings needed to be used in the description of the embodiment of the application. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without any creative labor.

[0038] Figure 1 is an implementation environment diagram of a video sending method of an embodiment of the present application;

[0039] Figure 2 is a step flow chart of a video sending method in an embodiment of the present application;

[0040] Figure 3 is a practical scene schematic diagram of scenario 1 in an embodiment of the present application;

[0041] Figure 4 is a practical scene schematic diagram of scenario 2 in an embodiment of the present application;

[0042] Figure 5 is a schematic diagram of an embodiment of the present application in which corresponding period videos are sent to different terminals in turn in the same video channel;

[0043] Figure 6 is another schematic diagram of an embodiment of the present application in which corresponding period videos are sent to different terminals in turn in the same video channel;

[0044] Figure 7 is a structural schematic diagram of a video sending method device in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below with reference to the drawings and specific embodiments.

[0046] In related technologies, online videos include live videos and recorded videos. Generally, the present application is directed to video watching with time period requirements. For example, when facing the viewing requirement of videos captured by a camera device, the videos captured by the camera device are called. The called videos are generally based on the time period to be called by a terminal, so as to call the videos in the corresponding time period. For example, a user terminal wants to watch the videos captured by the camera device in the time period of 15:00-16:00, and the videos captured in the time period of 15:00-16:00 are sent to the terminal accordingly. Of course, with different watching time periods, the called videos can be real-time videos captured by the camera device, or videos recorded and stored on the terminal equipment in the dispatching room.

[0047] Therefore, in this scenario, the videos captured by the camera device need to meet the viewing requirements of multiple terminals in different time periods, which has been a difficult problem in the industry, because:

[0048] The current camera device does not support the video difference output in the same period with the play time difference, so whether the video captured by the camera device in real time or the recorded video (in the terminal device of the dispatching room), generally, a mode similar to live broadcast is adopted to meet the video watching demand of multiple users for a certain period, or a unicast mode is adopted to individually meet the watching demand of each user. In the live broadcast mode, multiple users can simultaneously watch the video of the same period synchronously, but cannot achieve the difference in playing for these users. For example, user 1 requests to watch the video recording of the camera device in the period of 15:00-16:00, and user 2 requests to watch the video recording of the period of 15:00-16:00 ten minutes later, at this time, user 1 should watch the monitoring screen at 15:10, and user 2 should watch the screen at 15:00, but actually, user 2 watches the screen starting from 15:10 synchronously with user 1 when user 2 comes in.

[0049] In the unicast mode, a video channel needs to be newly established for each terminal to initiate a retrieval request to the camera device, so that a video channel is established for each terminal, which causes the waste of video channel resources and the retrieval of video from the dispatching room or the camera device for each terminal. In this way, not only the channel resources are wasted, but also the load of the terminal device of the camera device or the dispatching room is increased.

[0050] Therefore, in this scenario, either the channel resources are prioritized and the live broadcast mode is adopted, which inevitably causes some users to give up the video screen of a certain period, or the users are prioritized and a video channel is established for each terminal, which consumes a large amount of network resources and the load of the video source (the camera device and the terminal device of the dispatching room). Therefore, the problem that the network resource guarantee is incompatible with the actual demand of the user occurs.

[0051] Therefore, the present applicant proposes a solution that can save channel resources and reduce the load of the terminal device, and the core idea is that when the video of a target period is provided to a terminal, the video channel of the period that overlaps with the target period is borrowed to send the video of the target period.

[0052] Referring to Figure 1 , an implementation environment diagram of the video sending method of the embodiment of the present application is shown, as shown in Figure 1As shown, the server, the camera, the dispatching room and a plurality of terminals are included; wherein the camera is generally connected to the corresponding dispatching room, when the server needs to call the video of the camera, if the video needs to be captured in real time, it can be called from the camera, if the video is recorded, it can be called from the terminal device of the dispatching room, the terminal device of the dispatching room generally saves the video recorded after the video captured by the camera, generally, the video captured by the camera is saved in a day cycle, for example, the camera starts to run from January 1st, the current date is January 3rd, the video captured on January 1st and January 2nd is saved in the dispatching room, the video of January 3rd is still in the camera because the camera is capturing.

[0053] Among them, the plurality of terminals are user-side terminals, used to request the video captured by the camera from the server and play the received video.

[0054] Because the hardware equipment of the camera itself has low support for a large number of video scheduling, the terminal equipment of the dispatching room is generally limited in configuration and cannot cope with a large number of video scheduling requests in a short time, and the channel resources of the general network are also limited. For example, when data transmission is performed in the video live network, a corresponding virtual terminal of the video live network (hereinafter referred to as a virtual terminal) needs to be provided for the terminal, one virtual terminal generally identifies one terminal in the video live network, and data transmission is performed through the virtual terminal corresponding to the terminal. In this way, when the cached video of the same period is requested by a plurality of different terminals, the method of establishing a video sending channel for each terminal will require a large number of virtual terminals, however, the number of virtual terminals in the video live network is limited. Therefore, the problem of incompatibility between network resource guarantee and actual user demand in the related art occurs.

[0055] In Figure 1 The implementation environment is taken as an example to introduce the video sending method of the embodiment of the application, of course, in actual application, the video sending method can be not only used in Figure 1 the implementation environment, but also applicable to other video service scenarios, such as the application scenario of watching product live broadcast and the scenario of watching a television series with episodes (an episode can be considered as a period). Referring to Figure 2 As shown, the step flow chart of the video sending method of the embodiment of the application is shown, as Figure 2 shown, the video sending method can be applied to the server, including the following steps:

[0056] Step S201: after receiving the request service of the target period video, it is determined whether there is a first video channel with a coincident period with the target period.

[0057] Among them, different video channels are used to push videos of different periods.

[0058] In the embodiment, when a video of each time period is requested for the first time, the video of the time period is scheduled to the corresponding terminal through a video channel, so that different video channels can be used to schedule videos of different time periods, that is, different video channels send videos of different time periods to corresponding terminals. Wherein, the time period corresponding to each video channel (hereinafter referred to as channel time period) can be non-intersecting, so that the videos sent by multiple video channels are separated in time axis. For example, three video channels, the three video channels correspond to the videos of three time periods, the three time periods can be non-intersecting, such as 15:00-16:00, 14:00-15:00, and 12:00-13:00. Thus, each video channel can be responsible for the sending of the video of a time period.

[0059] Wherein, each video channel can use multicast to send the video of the corresponding time period to multiple terminals, so that one video channel can meet the viewing needs of multiple terminals for the video of the corresponding time period. For example Figure 1 As shown, when sending the video of the corresponding time period through the video channel, if it is a recording and broadcasting scenario, the server can retrieve the video of the corresponding time period from the terminal device in the scheduling room, and then multicast the retrieved video to multiple terminals to realize the viewing of the recorded video by multiple terminals; if it is a live broadcast scenario, the server can retrieve the video captured by the camera device in real time from the camera device, and then multicast the retrieved video to multiple terminals to realize the viewing of the live broadcast by multiple terminals.

[0060] Wherein, when receiving the request service of the video of the target time period, it can be determined whether there is a first video channel that overlaps with the target time period in the time periods (channel time periods) corresponding to the existing multiple video channels. Specifically, the target time period can be compared with the multiple channel time periods respectively, and if the corresponding channel time period overlaps with the target time period, the video channel of the channel time period is taken as the first video channel.

[0061] Of course, if the target time period is long and overlaps with multiple different channel time periods, there can be multiple first video channels. For example, the target time period is 11:30-16:00, and there are currently three video channels, which correspond to the channel time periods of 15:00-16:00, 14:00-15:00, and 12:00-13:00 respectively. It can be determined that the target time period overlaps with the three time periods, and the above three video channels are all first video channels.

[0062] Step S202: If there is a first video channel, at least the first video channel is used to send the video of the target time period.

[0063] In this embodiment, since the first video channel has the coincident time period, the video sent by the first video channel must have the video segment of the coincident time period, and thus the video of the coincident time period can be directly sent by the first video channel.

[0064] In one embodiment, the video of the target time period is sent by at least the first video channel, that is, the video of the coincident time period is sent by the first video channel, and the video of the time period other than the coincident time period in the target time period is sent by a newly created video channel. Alternatively, in another embodiment, the video of the coincident time period is sent by the first video channel, and the video of the time period other than the coincident time period in the target time period is also sent by the first video channel.

[0065] In a specific implementation, the terminal requesting the service of the target time period is added to the first video channel, and the coincident time period is marked, so that the first video channel can send the video of the coincident time period to the terminal.

[0066] Of course, when the first video channel is determined to have multiple coincident time periods, that is, the first video channel has multiple coincident time periods, the video of each coincident time period can be sent by the first video channel of the coincident time period. In the sending process, the video of each coincident time period can be sent by the first video channel in the order of the time of each coincident time period in the target time period, and the receiving end can receive the video of each coincident time period through the corresponding first video channel, and then play the video in the order of the time of each coincident time period in the target time period.

[0067] For example, the target time period is 15:30-16:00, and there are three video channels corresponding to the time periods of 15:00-16:00, 14:00-15:00, and 12:00-13:00, respectively. The video of 15:30-16:00 can be sent by the video channel of 15:00-16:00, without the need to create a new video channel, thereby saving the channel resources.

[0068] Since each video channel is responsible for sending the video of a time period, and the time periods of different video channels do not intersect with each other, as the requested time periods increase, the covered time periods become more comprehensive, so that when the service of a new target time period is requested, the existing video channels can be used to send the video, without the need to create a new video channel.

[0069] Therefore, the video of the target time period can be sent by the existing video channels according to the requested target time period, so that the requested target time period can share the existing video channels as much as possible, without the need to create a new video channel.

[0070] For example, the target time period is 12:30-16:00, and there are three video channels currently, and the corresponding time periods are 15:00-16:00, 14:00-15:00, and 12:00-13:00, respectively. Therefore, the existing video channels can be directly used to complete the video sending task of 12:30-16:00, and it is not necessary to newly create a video channel for the newly requested terminal.

[0071] By using the technical solution of the embodiment, on one hand, if the target time period is the overlapping time period, it is not necessary to newly create a video channel corresponding to the requested service, so that the newly requested service and the previously requested service can share the first video channel, thereby saving the channel resources. On the other hand, as shown in the figure, in the scenario of retrieving the video captured by the camera, the video of the overlapping time period can be directly sent by using the first video channel, so that the video of the overlapping time period does not need to be requested from the camera again. In this way, the load of the terminal device or the camera is reduced, the network resources for retrieving the video of the overlapping time period from the terminal device or the camera are saved, and since it is not necessary to request the video of the overlapping time period from the terminal device or the camera, the path for video scheduling can be shortened, thereby improving the efficiency of sending the video of the target time period. Figure 1

[0072] Of course, in an embodiment, if there is no first video channel, a new third video channel can be created, and the video of the target time period is sent by using the third video channel.

[0073] When the video of the target time period is sent by using the third video channel, the server can request the video of the target time period from the video source (the camera or the terminal device of the dispatching room), and then forward the video received from the video source to the terminal requesting the video of the target time period through the third video channel.

[0074] Of course, under the core technical idea of the present application, the channel time period corresponding to the third video channel is the target time period, so that another new time period has a video channel, thereby expanding the coverage range of the time period, and the third video channel can be reused for subsequent new requested services.

[0075] Next, the process of how to send the video of the target time period by using the first video channel is described.

[0076] 1.1, sending of the video of the target time period.

[0077] In an embodiment, for the overlapping time period in the target time period, the video of the overlapping time period is sent by using the first video channel of the overlapping time period; and for the remaining time period except the overlapping time period in the target time period, a second video channel is newly created to send the video of the remaining time period.

[0078] ​In this embodiment, when there is a remaining time period in the target time period in addition to the overlapping time period, the video of the part of the target time period has not been accessed by other terminals, in an example, the server can request the video of the time period from the video source and send it to the corresponding terminal, specifically, a second video channel corresponding to the remaining time period can be established to send the video of the remaining time period.

[0079] In another example, when there are multiple overlapping time periods, since the video of the target time period is sent in the order of the time of each overlapping time period, if the remaining time period is inserted between each overlapping time period or after the last overlapping time period, when it is the turn to send the video of the remaining time period, it can be determined again whether there is a fourth video channel containing overlapping time period, if there is, the video of the remaining time period is directly sent by the fourth video channel; if not, the video of the remaining time period is accessed from the video source and sent by the second video channel.

[0080] For example, the target time period is 12:30-14:00, there are two existing video channels, and the corresponding time periods are 15:00-16:00 and 12:00-13:00, respectively, so the remaining time period is determined to be 13:00-14:00, the video of 12:30-13:00 is sent by the video channel of 12:00-13:00 first, after sending, it can be determined whether a new video channel containing 13:00-14:00 (i.e. fourth video channel) is added, if so, the video of 13:00-14:00 is directly sent by the new video channel, if not, a new video channel (i.e. second video channel) is created to send the video of 13:00-14:00 from the camera or terminal device to the corresponding terminal.

[0081] Of course, under the core technical idea of the present application, after the second video channel corresponding to the remaining time period is established, another new time period has a video channel, thereby expanding the coverage of the time period, and the second video channel can still be reused for subsequent new service requests.

[0082] 1.2, sending the video of the overlapping time period by the first video channel

[0083] As described in the above embodiment, each video channel can use multicast to send the video of the corresponding time period to multiple terminals, and in specific implementation, the server can access the video of the corresponding time period from the video source (terminal device of the dispatch room or camera) and then multicast it to multiple terminals. In this case, the same video channel of different terminals may receive the same video screen, i.e. at the same time, different terminals receive the same screen.

[0084] However, since the first video channel needs to send the video of the overlapping period, in some cases, the overlapping period can be located in the middle or later of the channel period of the first video channel, so it is needed to add that each terminal in the first video channel can watch the video required by itself according to its own watching requirement, for example, each terminal starts to watch the video from different starting time, i.e. the user needs to watch the picture from different time in the same period.

[0085] For example, the user 1 requests to watch the video recorded by the camera from 15:00 to 16:00, and the user 2 requests to watch the video from 14:00 to 15:30, which has an overlapping period with the channel of the user 1 from 15:00 to 15:30, at this time, the user 2 should start to watch the video from 15:00 when he enters, while the user 1 still keeps watching the picture from 15:10.

[0086] Therefore, in order to realize that different users can start to watch the video from different starting time, the video data retrieved can be cached, i.e. for each video channel, the video data retrieved by the video channel can be cached, so that the video of the overlapping period can be extracted from the cached video data and sent to the corresponding terminal. The first video channel is taken as an example and explained in detail as follows:

[0087] In the process of sending the retrieved video data by using the first video channel, the retrieved video data is cached, and then the video of the overlapping period can be extracted from the cached video data and sent by using the first video channel.

[0088] In some specific implementation scenarios, since the video of the overlapping period is to be extracted from the cached video, and the video cached by the first video channel is based on the real-time retrieved video stream, there can be a case that the video of the overlapping period has not been completely cached in the cached video, for example, the first video channel is for 15:00-16:00, and the overlapping period is 15:30-16:00, and if the current cached video is only up to 15:40 (not yet completely cached). In this case, the cached video of the overlapping period can be sent first, for example, the partial video data from 15:30 to 15:40 is sent first, then with the continuous retrieval of the real-time video stream, the cached video data is continuously improved, and the remaining video data of the overlapping period is dynamically sent, so as to realize complete sending.

[0089] Of course, when this implementation is adopted, the first video channel corresponds to multiple terminals, so for the multiple terminals added to the first video channel, the video required by each terminal can be acquired as needed, which not only saves the channel resource but also realizes the hierarchical playing of the video. In order to fully understand the advantages of the video sending in this implementation, the specific application scenarios are explained as follows:

[0090] Scenario 1: Scheduling a video recording (referred to as a video recording) of a video captured by a camera from a terminal device in a dispatch room. Referring to Figure 3 The, Figure 3 is a schematic diagram of an actual scenario of Scenario 1.

[0091] When user 1 requests to watch a video recording of the 15:00-16:00 time period, the server pulls a video stream of the 15:00-16:00 time period from the terminal device in the dispatch room, creates a new video channel 1, and caches the video while sending the video to user 1 using the video channel 1. After user 1 watches for 10 minutes, user 2 sends a request for a video recording of the 15:00-16:00 time period. The overlapping time period is 15:00-16:00, and the video of the 15:00-16:00 time period needs to be sent to user 2 using the video channel 1. At this time, the server determines that the video of the 15:00-16:00 time period has been cached, and can directly extract the corresponding video data from the cached video recording of the 15:00-16:00 time period and send the video data to user 2. At the play time of 15:15, user 1 watches the 15:15 screen, and user 2 watches the 15:05 screen.

[0092] It can be seen that, in this scenario, the server does not need to pull the video of the 15:00-16:00 time period required by user 2 from the terminal device, and does not need to create a new video channel. In the video channel 1, the video screen watched by user 1 and the video screen watched by user 2 can be different, thereby achieving the purpose of meeting the watching requirements of different users by borrowing the same video channel.

[0093] Scenario 2: Pulling a video captured by a camera in real time from the camera. Referring to Figure 4 The, Figure 4 is a schematic diagram of an actual scenario of Scenario 1.

[0094] User 1 has scheduled a video captured by a camera in real time from 15:00 to 16:00. When 15:00 arrives, the server starts to pull a video stream from camera 1 and caches the pulled video stream. After user 1 watches for 10 minutes, a request for watching a video of the 15:00-16:00 time period is received from user 2. The overlapping time period is 15:00-16:00, and the video of the 15:00-16:00 time period needs to be sent to user 2 using the video channel 1. The cached video of the time period is then sent to user 2.

[0095] In this case, the user 1 still watches the video retrieved in real time, and the user 2 lags behind the watching of the user 1, so that the differential playing of the real-time shooting video is realized, and the user 2 does not need to sacrifice the first 10 minutes of the picture or wait until the recording is completed to watch the video of the period of 15:00-16:00. Thus, not only the network channel resource is saved, but also the playback and live viewing needs of different users are simultaneously met in the live scene, the time-sharing playing of the live video according to different viewing time is realized, and the problem that the user can only watch the current latest picture in the live video playing and cannot watch the historical picture according to the own needs is solved.

[0096] When this embodiment is adopted, the terminals requesting the video of the same period can share the same video channel for video sending, and different users can start watching the video picture from different time based on the cached video data. In the retrieval scene of the video shot by the camera device, the video of the overlapping period is directly sent by the first video channel, so that the video of the overlapping period does not need to be requested from the camera device again. Thus, the load of the terminal device or the camera device is reduced, the network resource for retrieving the video of the overlapping period from the terminal device or the camera device is saved, and since the video of the overlapping period does not need to be requested from the terminal device or the camera device, the path for video scheduling is shortened, so that the efficiency of sending the video of the target period is improved.

[0097] 1.3, process of sending the video to the corresponding terminal through the first video channel

[0098] As described above, for the first video channel, there can be multiple terminals joining the first video channel, and for these terminals, the first video channel can send the video required by each terminal in turn.

[0099] In specific implementation, a terminal list corresponding to the first video channel can be acquired, and based on the terminal list, the video of the target period required by each terminal in the terminal list is sent to the terminal in turn through the first video channel, wherein the viewing period of the terminal in the terminal list is overlapped with the period corresponding to the first video channel.

[0100] When the video is sent to multiple terminals through the first video channel, the multiple terminals can occupy the first video channel in turn to acquire the video required by each terminal. In specific implementation, for each terminal joining the first video channel, the identifier of the terminal can be added to the terminal list, and the viewing period (channel period or overlapping period) corresponding to each terminal is marked.

[0101] Of course, since the first video channel is for a fixed channel period, the viewing period marked by the terminal added to the terminal list is either the channel period or a part of the channel period (overlapping period). For example, for video channel 1 from 15:00 to 16:00, the terminals added to the terminal list include terminal A, terminal B and terminal C, wherein the viewing period marked by terminal A is from 15:00 to 16:00, the viewing period marked by terminal B is from 15:00 to 15:30, and the viewing period marked by terminal C is from 15:20 to 16:00.

[0102] Thus, when sending the required video to the plurality of terminals through the first video channel, the terminals in the terminal list can be iterated based on the terminal list, and for each iterated terminal, the time offset is determined according to the start time of the viewing period and the current time, and the video data to be sent is determined based on the time offset, and then sent to the terminal.

[0103] Referring to Figure 5 As shown in FIG. 2, a schematic diagram of alternately sending corresponding period video data to different terminals in the same video channel is shown, as shown in FIG. 2, the viewing period marked by terminal A is from 15:00 to 16:00, the viewing period marked by terminal B is from 15:00 to 15:30, and the viewing period marked by terminal C is from 15:20 to 16:00. Figure 5 As shown in FIG. 2, a schematic diagram of alternately sending corresponding period video data to different terminals in the same video channel is shown, as shown in FIG. 2, the viewing period marked by terminal A is from 15:00 to 16:00, the viewing period marked by terminal B is from 15:00 to 15:30, and the viewing period marked by terminal C is from 15:20 to 16:00.

[0104] In an embodiment, since the video data retrieved in real time for each video channel can be cached, if the video of the corresponding period has been cached, for the terminal added to the first video channel later, the corresponding video data can be extracted from the cached video and sent to the terminal alternately.

[0105] For example, the viewing period marked by terminal B is from 15:00 to 15:30, and the viewing period marked by terminal C is from 15:20 to 16:00, and both have been cached, then the video data starting from 15:00 can be alternately sent to terminal B, for example, the video data from 15:00 to 15:01 is sent to terminal B, and then the video data from 15:20 to 15:21 is sent to terminal C; then the video data from 15:02 to 15:03 is sent to terminal B, and then the video data from 15:22 to 15:23 is sent to terminal C, and so on.

[0106] Of course, there also exists a situation that the video in the first video channel has not been buffered completely at the overlapping time period, for example, the first video channel is for 15:00-16:00, and the overlapping time period is 15:30-16:00, and the current video has only been buffered to 15:10 (not yet buffered completely). This situation is more common in the live mode. Hereinafter, the video sending in this scenario is explained by taking the first video channel as a live channel as an example.

[0107] In this scenario, when the video in the overlapping time period is sent by using the first video channel, the live play time of the first video channel at the current time can be determined first. In this way, the video in the overlapping time period can be reviewed or the video in the overlapping time period can be live broadcasted by using the first video channel according to the start time of the overlapping time period and the live play time.

[0108] Specifically, in the case that the start time is after the live play time, the video in the overlapping time period is live broadcasted by using the first video channel when the video data at the start time arrives; in the case that the start time is before the live play time, the live data currently retrieved and the video data offset from the start time are sent alternately by using the first video channel.

[0109] In this embodiment, the data in the stream is transmitted in the network when the video stream is retrieved, that is, the video is sent in the form of data packet. In this way, the play time of the video data in the corresponding time period can be determined when the corresponding video data is retrieved, and the play time is the live play time.

[0110] For example, the start time of the overlapping time period is 15:20, and the current live play time is 15:10, which indicates that the video data in the overlapping time period has not been buffered completely. In this case, the video data in the overlapping time period can be sent in the live mode by using the first video channel when the video data at the start time of the overlapping time period arrives.

[0111] For example, the start time of the overlapping time period is 15:10, and the current live play time is 15:20, which indicates that part of the video data in the overlapping time period has been buffered. In this case, the video data in the overlapping time period can be sent from the start time of the overlapping time period, and the live data currently retrieved can be sent in the live mode by using the first video channel for the terminal that needs to be live broadcasted.

[0112] Reference Figure 6As shown, a schematic diagram of sending corresponding period video data to different terminals in turn in the same video channel is shown, and the first video channel is for the video of 15:00-16:00, for example, terminal A is a live demand terminal, the terminal B requests a period that coincides with 15:00-16:00, the coinciding period is 15:00-15:30, and the terminal C requests a period that coincides with 15:00-16:00, the coinciding period is 15:30-16:00;

[0113] The current live broadcast play time is 15:10, and before 15:10, live video is sent to terminal A; at the live broadcast play time of 15:10, 15:10-15:11 video data is first sent to terminal A in the first video channel, after sending, 15:00-15:01 video data is sent to terminal B, then 15:11-15:12 video data is sent to terminal A, after sending, 15:02-15:03 video data is sent to terminal B, and so on; until the live broadcast play time of 15:30 arrives, 15:30-16:00 video data is started to be live broadcast to terminal A and terminal C in the first video channel, and during the live broadcast process, for terminal B, the video starting from 15:20 is still sent according to the previous mode.

[0114] It should be noted that the above process of sending video data to corresponding terminals in turn through the first video channel can be executed by one thread in the server, without the need to open different threads for different purpose terminals, thus saving thread overhead in the server. In addition, since the process of polling the terminal list by the server, determining the play offset time of the polled terminal, and extracting the corresponding video data actually consumes very short time, therefore, the time length between receiving the previous video data and receiving the next video data at the terminal side is very short, and does not affect the continuous play of the video at the terminal side, thus there is almost no phenomenon of video lag.

[0115] 1.4, video caching process.

[0116] In this embodiment, when the video data of the corresponding period is cached for a video channel, GOP (Group of Pictures) data can be cached, and then the video is sent based on the GOP data. Specifically, in the case that the retrieved video frame is an I frame, the corresponding GOP data can be cached in a storage queue; and based on the GOP data cached in the storage queue and the corresponding play time, a mapping relationship between each GOP data and the play time is constructed.

[0117] Correspondingly, when sending the video data of the overlap period by using the first video channel, the corresponding target GOP data can be extracted from the storage queue based on the start time of the overlap period and the mapping relationship, and the GOP data starting from the target GOP data is sent to the terminal corresponding to the overlap period. Of course, the first video channel can correspond to multiple terminals, and different terminals correspond to different overlap periods. Thus, when the video of the overlap period is sent to multiple terminals by the first video channel in turn, the corresponding target GOP data can also be extracted from the storage queue based on the start time of the overlap period and the mapping relationship.

[0118] In the embodiment, a GOP is a group of pictures, and one GOP is a group of continuous pictures. Therefore, generally, an I frame (key frame, which is a frame in which a picture changes significantly) is needed for a picture presentation. In the embodiment, when an I frame is extracted, the I frame can be cached, and P frames and B frames after the I frame are cached accordingly until the next I frame is received, and the cached I frame, P frame, B frame, and the like are saved as a GOP. Thus, multiple GOP data are cached in the storage queue, each GOP data corresponding to a group of continuous pictures, and the playing of a picture has a time. Therefore, each GOP data corresponds to a playing time, and a mapping relationship between each GOP data and the playing time can be established in the embodiment.

[0119] It can be understood that the duration of the continuous pictures corresponding to one GOP data is the interval duration between the I frame in the GOP data and the I frame in the next GOP data.

[0120] When the video corresponding to the overlap period needs to be extracted from the cached video, the target GOP data having a mapping relationship with the start time can be found in the cache queue based on the start time of the overlap period, and then the subsequent GOP data in the storage queue is sent to the terminal corresponding to the overlap period in sequence from the target GOP data.

[0121] The playing time corresponding to the GOP data can be the time stamp represented by the I frame data in the GOP data, and the playing time can be a time based on the period corresponding to the first video channel, for example, the period is 15:00-16:00, and the playing time corresponding to the GOP data can be a time such as 15:01.

[0122] In one embodiment, the storage queue can be located in the memory cache of the server. When the number of GOP data in the storage queue reaches a preset number, the GOP data in the storage queue can be moved to the storage of the external storage of the server to avoid occupying too much memory space of the server.

[0123] When the embodiment is used, the GOP data can be sent to the corresponding terminal, so that the terminal receives the picture group including the I frame each time, and the terminal can directly decode and play, thereby avoiding the problem that the terminal cannot decode and appears black screen due to the fact that the video data does not include the I frame.

[0124] 1.5, release of channel resources.

[0125] In another embodiment, for the created multiple video channels, the video channel can be released when the video channel completes the video sending of all the terminals joining the video channel.

[0126] In a specific implementation, for each of the created multiple video channels, if the video channel currently does not exist a video pushing task, the video channel is released; if the video channel currently exists a video pushing task, the terminal that ends watching is cleaned out of the video channel; wherein the terminal that ends watching is a terminal irrelevant to the video pushing task.

[0127] The video pushing task can be a video sending task of sending the video of a corresponding time period to the terminal, including a channel time period video sending task and a coincident time period video sending task. When the video channel currently does not exist a video pushing task, it indicates that the current video channel does not send video to any terminal, so the video channel can be released, and the released channel resource can be multiplexed by the video sending service of other time periods.

[0128] When the video channel currently exists a video pushing task, it indicates that the video channel is still sending video to one or more terminals, that is, for each terminal joining the video channel, either the video of the entire channel time period is watched or the video of the coincident time period in the channel time period is watched, so the watching end time of different terminals can be different, that is, some terminals end watching first and some terminals end watching later. At this time, the terminal that has ended watching can be cleaned out of the video channel, that is, the terminal that ends watching the coincident time period or the channel time period is cleaned out, so as to avoid that the video channel is occupied by the terminal without watching demand.

[0129] When the embodiment is used, when the video channel alternately sends the differential video data to each terminal, the terminal that has ended watching can be dynamically cleaned out of the video sending team, for example, the terminal list is cleaned out, so as to avoid that the terminal that has ended watching video continues to occupy the video channel.

[0130] Next, the video sending method of the present application is described in the whole as an example of the implementation environment shown in FIG. 1. Figure 1

[0131] ​1. For the user 1 (corresponding to the user of terminal A) who requests the video data of 15:00-16:00 for the first time, if there is no video channel whose time period coincides with 15:00-16:00, a live channel A1 is created, and the video stream of 15:00-16:00 is pulled from the terminal device of the dispatch room to the user 1. At this time, the pulled video is cached in the server. Figure 1

[0132] 2. When a new user 2 (corresponding to the user of terminal B) requests to watch the video, it is determined whether the video of the time period requested by the user 2 is contained in the existing play according to the time period requested by the user 2. Figure 1

[0133] Specifically, the following cases are considered:

[0134] Case 1: The time period requested by the user 2 is a part of 15:00-16:00, such as 15:00-15:30. In this case, the user 2 subscribes to the A1 channel, and there is no need to establish a new live channel. The start time requested by the user 2 is notified to the A1 channel. According to the start time requested by the user 2 and the mapping relationship of the GOP data, the A1 channel determines the offset of the video data required by the user 2 in the storage queue, continuously traverses the subscription group, and sends the corresponding video data to the users in the group through the A1 channel. In this process, the user 2 occupies the A1 channel to send data until the end of the time period requested by the user 2, the subscription of the user 2 is cancelled, and the streaming is ended.

[0135] Case 2: The time period requested by the user 2 coincides with 15:00-16:00, and there is also a time period that does not coincide with 15:00-16:00.

[0136] Case 2-1: When the coinciding time period is in the front and the non-coinciding time period is in the back, for example, the time period requested by the user 2 is 15:30-17:00. The coinciding time period is sent according to case 1, and after the sending is completed, for the non-coinciding time period, it is determined whether there is a channel A3 that contains this time period (indicating that the video of this time period is cached). If there is a channel A3 that meets this condition, the user 2 subscribes to the A3 channel, and the start time of the non-coinciding time period is marked to the A3 channel. The A3 channel continuously traverses the subscription group and sends data to the users in the A3 channel.

[0137] It should be noted that if there is no channel A3 that meets this condition, the video of the non-coinciding time period can be requested from the channel that has ended watching. The channel that has ended watching can be the A1 channel that has ended watching or a channel of another time period. If there is none, a new channel A4 is established, and the video of the non-coinciding time period is sent through the new channel A4.

[0138] ​​Case 2-2: When the coinciding time period is later and the non-coinciding time period is earlier, for the non-coinciding time period, it is queried whether there is a channel (representing that the video of the time period is cached) containing the time period currently, if there is a channel A5 meeting the condition, the user 2 subscribes to the channel A5, marks the start time of the non-coinciding time period to the channel A5, continuously traverses the subscription group, and sends data to the users in the channel A5 in turn, and after the sending is completed, the video of the coinciding time period is sent to the user 2 through the channel A1 according to the process of case 1.

[0139] It should be noted that if the non-coinciding time period has no channel A5 meeting the condition, a new channel A6 can be created to request the video recording of the non-coinciding time period, and here, since the coinciding time period is later, the channel A1 needs to be reserved to send the video of the coinciding time period to the user 2.

[0140] Of course, if the user 1 in the channel A1 has ended watching when the video of the coinciding time period is sent to the user 2, in practice, the channel A1 can be reserved, or the channel A1 is released and a new channel A7 is created to send data to the user 2 through the channel A7, in this case, if a user 3 requests the video of 15:00-16:00, the user 3 (corresponding to the user of the terminal C) can be added to the channel A7 to send the video to the user 3 and the user 2 in turn. Figure 1

[0141] Case 3: The request time period of the user 2 has no intersection with 15:00-16:00, then a channel A8 is initially created according to the request of the user 2, and the video recording is called to the terminal device and sent to the user 2 through the channel A8.

[0142] Reference Figure 7 , shows a video sending method device, the device can specifically include the following modules:

[0143] The channel determination module 701 is configured to determine whether there is a first video channel having a coinciding time period with the target time period after receiving a request service of a target time period video; wherein different video channels are used to push videos of different time periods.

[0144] The video sending module 702 is configured to send the video of the target time period at least by using the first video channel in the case that the first video channel exists.

[0145] Optionally, the video sending module 702 includes:

[0146] The first sending unit is configured to send the video of the coinciding time period in the target time period by using the first video channel of the coinciding time period;

[0147] ​A second sending unit is configured to newly create a second video channel to send video of a remaining time period in the target time period except the overlapping time period.

[0148] Optionally, the apparatus further comprises:

[0149] A cache module is configured to cache the retrieved video data when the retrieved video data is sent by using the first video channel.

[0150] The video sending module 702 is specifically configured to extract video corresponding to the overlapping time period from the cached video, and send the video by using the first video channel.

[0151] Optionally, the video sending module 702 comprises:

[0152] A list obtaining unit is configured to obtain a terminal list corresponding to the first video channel, wherein a watching time period of a terminal in the terminal list is overlapped with a time period corresponding to the first video channel.

[0153] A video sending unit is configured to send video of a required target time period of each terminal in the terminal list to the terminal by using the first video channel in turn based on the terminal list.

[0154] Optionally, the first video channel is a live channel, and the apparatus further comprises:

[0155] A live moment determining module is configured to determine a current live playing moment of the first video channel.

[0156] The video sending module 702 comprises:

[0157] A start moment determining unit is configured to determine a start moment of the overlapping time period in the target time period.

[0158] A third sending unit is configured to send live data retrieved in real time currently and video data offset from the start moment by using the first video channel in turn in a case where the start moment is located before the live playing moment.

[0159] A fourth sending unit is configured to live video of the overlapping time period by using the first video channel when the video data of the start moment arrives in a case where the start moment is located after the live playing moment.

[0160] Optionally, the apparatus further comprises:

[0161] The first releasing module is configured to release each of the created video channels if the video channel currently has no video pushing task.

[0162] The second releasing module is configured to clean the end-watching terminal out of the video channel if the video channel currently has the video pushing task, wherein the end-watching terminal is a terminal irrelevant to the video pushing task.

[0163] Optionally, the apparatus further comprises:

[0164] The channel creating module is configured to create a new third video channel if the first video channel does not exist, and transmit the video of the target time period by using the third video channel.

[0165] It should be noted that the apparatus embodiment is similar to the method embodiment, and thus the description is relatively simple, and the related parts can be referred to the method embodiment.

[0166] The embodiment of the present application further provides a server, which comprises a remote service module, and the remote service module is configured to execute the video transmission method in any of the above-mentioned embodiments.

[0167] The embodiment of the present application further provides an electronic device, which comprises:

[0168] one or more processors; and

[0169] one or more machine-readable media having instructions stored thereon, which when executed by the one or more processors, cause the device to execute the video transmission method in any of the above-mentioned embodiments of the present application.

[0170] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program causes a processor to execute the video transmission method in any of the above-mentioned embodiments of the present application.

[0171] Each of the embodiments in the present specification is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same and similar parts between the embodiments can be referred to each other.

[0172] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, an apparatus, or a computer program product. Therefore, the embodiments of the present application can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present application can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0173] The embodiments of the present application are described with reference to the flowchart illustrations and / or block diagrams of the methods, terminal devices (systems) and computer program products according to the embodiments of the present application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal devices to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal devices, create means for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0174] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal devices to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0175] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal devices, such that a series of operational steps are carried out on the computer or other programmable terminal devices to produce a computer implemented process so that the instructions executed on the computer or other programmable terminal devices provide steps for implementing the functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams. Figure 1 one or more functions specified in the flowchart illustrations and / or block diagrams.

[0176] Although preferred embodiments of the present application have been described, those skilled in the art will be able to make additional modifications and variations to these embodiments without departing from the scope of the present application. Accordingly, the appended claims are intended to encompass all such modifications and variations as falling within the scope of the present application.

[0177] Finally, it needs to be pointed out that in this article, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between the entities or operations. Moreover, the term "includes", "contains" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, article or terminal device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or terminal device. Without more limitations, the element defined by the statement "includes a" does not exclude the presence of other identical elements in the process, method, article or terminal device including the element.

[0178] The above describes in detail the video sending method, device, electronic equipment and storage medium provided by the present application. The principles and implementation manners of the present application are described by applying specific examples in this article. The above example is only used to help understand the method of the present application and its core idea. Meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manner and application range will be changed. In summary, the content of the specification should not be understood as a limitation of the present application.

Claims

1. A video transmission method characterized by comprising: The method applied to a server comprises: after receiving a request service of a target time period video, determining whether a first video channel with a coincident time period of the target time period exists; wherein different video channels are used to push videos of different time periods; if the first video channel exists, sending the video of the target time period by using at least the first video channel; sending the video of the target time period by using at least the first video channel comprises: for the coincident time period in the target time period, sending the video of the coincident time period by using the first video channel of the coincident time period; for the remaining time period except the coincident time period in the target time period, creating a second video channel to send the video of the remaining time period.

2. The method of claim 1, wherein, The method further comprises: when sending the called video data by using the first video channel, caching the called video data; sending the video of the target time period by using at least the first video channel comprises: for the video of the coincident time period, extracting the video corresponding to the coincident time period from the cached video and sending the video by using the first video channel.

3. The method of claim 1, wherein, sending the video of the target time period by using at least the first video channel comprises: acquiring a terminal list corresponding to the first video channel; wherein the viewing time period of a terminal in the terminal list is coincident with the time period corresponding to the first video channel; based on the terminal list, sending the video of the required target time period of each terminal in the terminal list by using the first video channel in turn.

4. The method according to any of claims 1 to 3, characterized in that, The first video channel is a live channel; the method further comprises: determining the current live playing time of the first video channel; sending the video of the target time period by using at least the first video channel comprises: for the coincident time period in the target time period, determining the starting time of the coincident time period; in the case that the starting time is located before the live playing time, sending the live data currently called in real time and the video data offset from the starting time by using the first video channel in turn; in the case that the starting time is located after the live playing time, live broadcasting the video of the coincident time period by using the first video channel when the video data of the starting time arrives.

5. The method according to any of claims 1 to 3, characterized in that The method further comprises: for each video channel in the created multiple video channels, if the video channel currently does not exist a video pushing task, releasing the video channel; if the video channel currently exists a video pushing task, cleaning the terminal of ending viewing out of the video channel; wherein the terminal of ending viewing is a terminal irrelevant to the video pushing task.

6. The method of claim 1, wherein, The method further comprises: if the first video channel does not exist, creating a new third video channel and sending the video of the target time period by using the third video channel.

7. A video transmission apparatus characterized by comprising: The device applied to a server comprises: a channel determination module, configured to determine whether a first video channel with a coincident time period of the target time period exists after receiving a request service of a target time period video; wherein different video channels are used to push videos of different time periods; The video sending module is configured to, in the case that the first video channel exists, send the video of the target time period by using at least the first video channel. The video sending module comprises: A first sending unit is configured to, for the overlapping time period in the target time period, send the video of the overlapping time period by using the first video channel of the overlapping time period. A second sending unit is configured to, for the remaining time period in the target time period except the overlapping time period, newly create a second video channel to send the video of the remaining time period.

8. An electronic device, comprising: The apparatus comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus. The memory is configured to store a computer program. The processor is configured to execute the program stored on the memory to implement the video sending method in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer program stored in the memory is configured to enable the processor to execute the video sending method in any one of claims 1-6.

Citation Information

Patent Citations

  • Video processing method and device based on articulated naturality web

    CN110769310A

  • Monitoring data processing method and device and storage medium

    CN111064923A