CN106713846B - Live connection establishing method and device - Google Patents

Live connection establishing method and device Download PDF

Info

Publication number
CN106713846B
CN106713846B CN201611028774.0A CN201611028774A CN106713846B CN 106713846 B CN106713846 B CN 106713846B CN 201611028774 A CN201611028774 A CN 201611028774A CN 106713846 B CN106713846 B CN 106713846B
Authority
CN
China
Prior art keywords
live connection
encoder
established
resolution
live
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611028774.0A
Other languages
Chinese (zh)
Other versions
CN106713846A (en
Inventor
汪辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201611028774.0A priority Critical patent/CN106713846B/en
Publication of CN106713846A publication Critical patent/CN106713846A/en
Application granted granted Critical
Publication of CN106713846B publication Critical patent/CN106713846B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/1066Session management
    • H04L65/1069Session establishment or de-establishment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • H04N7/181Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources

Abstract

The invention provides a live connection establishing method and a live connection establishing device, wherein the method comprises the following steps: receiving a live connection request aiming at the target front-end equipment and sent by the target back-end equipment; judging whether live connection corresponding to the target back-end equipment is allowed to be established or not according to live connection information corresponding to each encoder started by the target front-end equipment, live connection information carried in the live connection request, and encoder resource information and encoding capacity resource information of the target front-end equipment; if yes, distributing an encoder for the live connection corresponding to the target back-end equipment, and establishing the live connection corresponding to the target back-end equipment; otherwise, determining that the live connection establishment fails. The embodiment of the invention can improve the utilization rate of the coding and decoding resources of the front-end equipment and the back-end equipment.

Description

Live connection establishing method and device
Technical Field
The invention relates to the technical field of video monitoring, in particular to a live connection establishing method and device.
Background
In the neighborhood of video monitoring technology, live preview is a service function which is most frequently used, and in an actual project, multiple paths of monitoring videos generally exist, so that a back-end device needs to support a multi-picture live preview function.
The method comprises the following steps that a back-end device determines an adopted split screen mode according to the number of paths for watching a live scene simultaneously in a live scene preview service, determines a main stream, an auxiliary stream or a three-stream for requesting a front-end device according to the size of a sub-picture, and requests the live scene stream from the front-end device through a standard or private protocol; the front-end equipment starts an encoder to encode the live code stream according to the requirement of the back-end equipment, and sends the main stream, the auxiliary stream or the three streams requested by the back-end equipment according to the specified transmission protocol; and after receiving the live code stream, the back-end equipment decodes the live code stream, and displays the decoded live picture after the decoded live picture is scaled to the display resolution of the sub-picture.
Disclosure of Invention
The invention provides a live connection establishing method and a live connection establishing device, which are used for improving the utilization of coding and decoding resources of live connected front-end equipment and back-end equipment in a video monitoring system.
According to a first aspect of the present invention, there is provided a live connection establishing method, applied to a target front-end device in a video surveillance system, the method including:
receiving a live connection request which is sent by target back-end equipment and aims at the target front-end equipment, wherein the live connection request carries live connection information; wherein the live connection information comprises recommended resolution and maximum resolution of the backend device corresponding to the live connection;
judging whether live connection corresponding to the target back-end equipment is allowed to be established or not according to live connection information corresponding to each encoder started by the target front-end equipment, live connection information carried in the live connection request, and encoder resource information and encoding capacity resource information of the target front-end equipment;
if yes, distributing an encoder for the live connection corresponding to the target back-end equipment, and establishing the live connection corresponding to the target back-end equipment;
otherwise, determining that the live connection establishment fails.
According to a second aspect of the present invention, there is provided a live connection establishing apparatus, applied to a target front-end device in a video surveillance system, the apparatus comprising:
the system comprises a receiving unit, a sending unit and a receiving unit, wherein the receiving unit is used for receiving a live connection request which is sent by target back-end equipment and aims at the target front-end equipment, and the live connection request carries live connection information; wherein the live connection information comprises recommended resolution and maximum resolution of the backend device corresponding to the live connection;
a determining unit, configured to determine whether to allow establishment of live connection corresponding to the target backend device according to live connection information corresponding to each encoder that has been started by the target frontend device, live connection information carried in the live connection request, and encoder resource information and encoding capability resource information of the target frontend device;
the establishing unit is used for distributing an encoder for the live connection corresponding to the target back-end equipment if the establishing unit allows the live connection corresponding to the target back-end equipment, and establishing the live connection corresponding to the target back-end equipment; otherwise, determining that the live connection establishment fails.
By applying the technical scheme disclosed by the invention, a live connection request carrying live connection information and sent by target back-end equipment is received, whether live connection corresponding to the target back-end equipment is allowed to be established is judged according to the live connection information corresponding to each encoder started by the target front-end equipment, the live connection information carried in the live connection request, and the encoder resource information and the encoding capacity resource information of the target front-end equipment, if yes, an encoder is distributed for the live connection corresponding to the target back-end equipment, and the live connection corresponding to the target back-end equipment is established; otherwise, determining that the live connection is failed to be established, and improving the utilization rate of the encoding and decoding resources of the front-end equipment and the rear-end equipment through the resolution negotiation of the front-end equipment and the rear-end equipment in the live connection process.
Drawings
Fig. 1 is a schematic flowchart of a live connection establishing method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a live connection establishing apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of another live connection establishing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions in the embodiments of the present invention better understood, a brief explanation of some noun concepts appearing herein follows. Wherein:
encoder resources: the maximum number of encoders supported by the front-end equipment, namely the maximum number of encoders which can be simultaneously started by the front-end equipment;
coding capability resource: the maximum/minimum coding resolution, the maximum/minimum coding frame rate and the like supported by each coder started by the front-end equipment are indicated;
recommended resolution of backend device: the display resolution of the back-end equipment;
maximum resolution of the backend device: the resolution corresponding to the available decoding resources of the back-end equipment is indicated;
recommended resolution for live connection: the recommended resolution of the back-end equipment corresponding to the live connection is indicated;
maximum resolution for live connection: refers to the maximum resolution of the backend device to which the live connection corresponds.
In order to make the aforementioned objects, features and advantages of the embodiments of the present invention more comprehensible, embodiments of the present invention are described in detail below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flowchart illustrating a live connection establishing method according to an embodiment of the present invention, where the method may be applied to any front-end device (referred to as a target front-end device herein) in a video surveillance system, and as shown in fig. 1, the live connection establishing method may include the following steps:
step 101, receiving a live connection request for a target front-end device, which is sent by a target back-end device, where the live connection request carries live connection information.
In the embodiment of the present invention, the target backend device does not refer to a fixed backend device, but may refer to any backend device in the video monitoring system, and the following description of the embodiment of the present invention is not repeated.
In the embodiment of the invention, in consideration of the fact that in the existing live video-on-demand scheme, the back-end equipment can only select to request the main stream, the auxiliary stream or the three streams from the front-end equipment according to the number of live channels and the size of the sub-picture which are required to be watched simultaneously, and the resolution of the live stream received by the back-end equipment is probably not matched with the sub-picture display resolution of the back-end equipment, so that the waste of the coding resource of the front-end equipment or the decoding resource of the back-end equipment can be caused.
Accordingly, in the embodiment of the present invention, when the target backend device needs to request a live stream of the target frontend device, the target backend device may send a live connection request to the target frontend device, where the live connection request needs to carry live connection information, where the live connection information may include, but is not limited to, a recommended resolution, a maximum resolution, and the like of the target backend device.
And step 102, judging whether live connection corresponding to the target back-end equipment is allowed to be established or not according to the live connection information corresponding to each encoder started by the target front-end equipment, the live connection information carried in the live connection request, and the encoder resource information and the encoding capacity resource information of the target front-end equipment. If yes, go to step 103; otherwise, go to step 104.
In the embodiment of the present invention, when receiving a live connection request sent by a target backend device, a target front-end device may obtain live connection information carried in the live connection request, and determine an encoding resolution of an encoder corresponding to the target backend device according to a recommended resolution and a maximum resolution of the target backend device included in the live connection information.
Considering that, for any backend device, the recommended resolution of the backend device is usually smaller than the maximum resolution, and in some specific scenarios, the recommended resolution of the backend device is also greater than or equal to the maximum resolution, because when the encoding resolution of the encoder started by the front-end device as the backend device is consistent with the display resolution (i.e., the recommended resolution) of the backend device, the utilization rate of encoding and decoding resources of the front-end device and the back-end device is the highest, and when the encoding resolution of the encoder started by the front-end device exceeds the maximum resolution of the backend device, the backend device cannot normally decode, therefore, when the front-end device starts the encoder as the backend device, it is required to ensure that the resolution of the encoder is as close as possible to the recommended resolution of the backend device (when the recommended resolution of the backend device is smaller than the maximum resolution) or the maximum resolution (when the recommended resolution of the backend device is smaller than the maximum resolution) when the resolution of the encoder is not exceeded by the maximum Greater than or equal to the maximum resolution).
As an alternative implementation, in the embodiment of the present invention, the following principle may be followed when allocating the encoder to the backend device:
1. if the maximum resolution of the back-end equipment is smaller than the recommended resolution, preferentially establishing a live situation according to the maximum resolution of the back-end equipment, namely preferentially distributing an encoder with the encoding resolution being the maximum resolution of the back-end equipment to the back-end equipment;
if the maximum resolution of the back-end equipment is greater than or equal to the recommended resolution, preferentially establishing a live situation according to the recommended resolution of the back-end equipment, namely preferentially distributing an encoder with the encoding resolution as the recommended resolution of the back-end equipment to the back-end equipment;
2. and preferentially using the started encoder to provide the live stream for the back-end equipment, and applying a new encoder to provide the live stream for the back-end equipment when the started encoder cannot meet the requirements.
Accordingly, in the embodiment of the present invention, the determining whether to allow establishment of live streaming connection corresponding to the target backend device according to the live connection information corresponding to each encoder that has been started by the target frontend device, the live connection information carried in the live connection request, and the encoder resource information and the encoding capability resource information of the target frontend device may include:
for any encoder started by target front-end equipment, judging whether an encoding resolution adjustment scheme meeting the requirements of the live connection established by the encoder and the live connection to be established exists in the encoder; if so, adding the encoding resolution adjustment scheme into an adjustment scheme set;
traversing all the encoders started by the target front end, and judging whether the adjustment scheme set is empty;
if the current connection is empty, judging whether the residual encoder resources and the residual encoding capacity resources of the target front-end equipment meet the requirements of the live connection to be established; if yes, determining that live connection to the target back-end equipment is allowed to be established; if not, determining that the live connection of the target back-end equipment is not allowed to be established;
if not, determining to allow the establishment of the live connection corresponding to the target backend equipment.
In this embodiment, when the target front-end device receives a live connection request sent by the target back-end device, the target front-end device may first traverse all the activated encoders, and determine whether there is an encoder with an encoding resolution equal to the recommended resolution of the target back-end device (in a case where the recommended resolution of the target back-end device is less than or equal to the maximum resolution) or the maximum resolution (in a case where the recommended resolution of the target back-end device is greater than the maximum resolution) in all the activated encoders; if yes, determining an encoding resolution adjustment scheme that the encoder meets the requirements of the encoder for establishing the live connection and the live connection to be established; if not, the target front-end device may further determine whether the encoding resolution of the started encoder can be adjusted to meet the established live connection and the live connection to be established (i.e., the live connection corresponding to the target back-end device); if so, determining that the encoder meets the encoding resolution adjustment scheme meeting the requirements of the live connection established by the encoder and the live connection to be established; otherwise, it is determined that there is no encoding resolution adjustment scheme that meets the requirements of the live connection already established by the encoder and the live connection to be established.
In this embodiment, the target front-end device may add an encoding resolution adjustment scheme to the set of adjustment schemes upon determining that any encoder exists for an encoding resolution adjustment scheme that satisfies the requirements of the live connection that the encoder has established and the live connection to be established.
After the above operations are performed on all the encoders started by the target front-end device, the target front-end device may determine whether the adjustment scheme set is empty; if not, determining to allow to establish live connection of the corresponding target back-end device, wherein at this time, the target front-end device may select an encoding resolution adjustment scheme from the adjustment scheme set, adjust the encoding resolution of the corresponding encoder according to the encoding resolution adjustment scheme, and provide live stream for the target back-end device through the encoder with the adjusted encoding resolution;
if the adjustment scheme set is empty, that is, all the encoders started by the target front-end device cannot meet the live request of the target back-end device, the target front-end device may determine the current residual encoder resources and the residual encoding capacity resources, and determine whether the residual encoder resources and the residual encoding capacity resources meet the requirements of the live connection to be established; if yes, determining that the corresponding live connection of the target back-end equipment is allowed to be established, and starting a new encoder by the target front-end equipment to provide live stream for the target back-end equipment according to the recommended resolution and the maximum resolution of the target back-end equipment; and if not, determining that the live connection of the corresponding target back-end equipment is not allowed to be established, namely that the live connection is failed to be established.
It should be noted that, in the embodiment of the present invention, when the target front-end device receives the live connection request sent by the target back-end device, the target front-end device may also apply for a new encoder to provide a live stream for the target back-end device, and in a case that the remaining encoder resources or/and the remaining encoding capability resources of the target front-end device are insufficient, consider providing a live stream for the target back-end device using the started encoder; furthermore, when the target front-end device selects an encoder that provides a live stream to the target back-end device, the target front-end device may select the encoder only on the basis that the encoding resolution does not exceed the maximum resolution of the target back-end device, without considering the problem of display effect.
Further, as an alternative implementation, when the front-end device uses the started encoder to provide the live stream to the back-end device, the following principle needs to be followed:
3. the newly established live connection cannot affect the display effect of the established live connection.
For this principle 3, considering that for live, the display effect depends on the display resolution, the encoding resolution of the encoder can be adjusted as follows:
when the encoding resolution of the encoder is greater than or equal to the maximum value of the display resolution (i.e., the recommended resolution) of the live connection established by the encoder, the encoding resolution of the encoder may be adjusted between the maximum value of the display resolution of the established live connection and the minimum value of the maximum resolution of the established live connection, that is, if the encoding resolution of the encoder needs to be increased, it is required to ensure that the encoding resolution of the encoder does not exceed the minimum value of the maximum resolution of the established live connection (to avoid the situation that the backend device cannot decode), and if the encoding resolution of the encoder needs to be decreased, it is required to ensure that the encoding resolution of the encoder is not lower than the maximum value of the maximum resolution of the established live connection (to avoid affecting the display.
When the encoding resolution of the encoder is smaller than the maximum value of the display resolution (i.e., the recommended resolution) of the live connection established by the encoder, the encoding resolution of the encoder may be adjusted between the current encoding resolution and the minimum value of the maximum resolution of the established live connection, that is, only the current encoding resolution may be maintained or the encoding resolution may be increased, and when the encoding resolution is increased, it is required to ensure that the encoding resolution of the encoder does not exceed the minimum value of the maximum resolution of the established live connection (to avoid the situation that the backend device cannot decode).
Accordingly, in this embodiment of the present invention, for any encoder that has been started by the target front-end device, determining whether there is an encoding resolution adjustment scheme for the encoder that meets the requirements of the live connection that has been established by the encoder and the live connection to be established includes:
if the encoding resolution of the encoder is greater than the maximum value of the recommended resolution corresponding to the live connection established by the encoder, determining that an encoding resolution adjustment scheme which meets the requirements of the live connection established by the encoder and the live connection to be established does not exist when the maximum value of the recommended resolution corresponding to the live connection established by the encoder is greater than the maximum resolution of the target back-end device; when the maximum value of the recommended resolution corresponding to the live connection established by the encoder is less than or equal to the maximum resolution of the target back-end equipment, determining that an encoding resolution adjusting scheme meeting the requirements of the live connection established by the encoder and the live connection to be established exists;
if the encoding resolution of the encoder is less than or equal to the maximum value of the recommended resolution corresponding to the live connection established by the encoder, and the encoding resolution of the encoder is less than or equal to the minimum value of the maximum resolution corresponding to the live connection established by the encoder, determining that an encoding resolution adjusting scheme meeting the requirements of the live connection established by the encoder and the live connection to be established does not exist when the encoding resolution of the encoder is greater than the maximum resolution of the target back-end device; when the encoding resolution of the encoder is less than or equal to the maximum resolution of the target backend device, determining that an encoding resolution adjustment scheme exists that meets the requirements of the live connection established by the encoder and the live connection to be established.
In this embodiment, if the encoding resolution of the encoder is greater than the maximum value of the recommended resolution corresponding to the live connection established by the encoder, the target front-end device may adjust the encoding resolution of the encoder between the maximum value of the recommended resolution corresponding to the live connection established by the encoder and the minimum value of the maximum resolution corresponding to the live connection established by the encoder.
In this case, when the maximum value of the recommended resolution corresponding to the live connection established by the encoder is greater than the maximum resolution of the target backend device, at this time, since the encoding resolution of the encoder needs to be adjusted to the maximum resolution of the target backend device or below to meet the live requirement of the target backend device, and the encoding resolution of the adjusted encoder is inevitably smaller than the maximum value of the recommended resolution corresponding to the live connection established by the encoder, the display effect of a part or all of the live streams in the live connection established by the encoder may be affected, and therefore, the target frontend device may determine that there is no encoding resolution adjustment scheme that meets the requirements of the live connection established by the encoder and the live connection to be established.
When the maximum value of the recommended resolution corresponding to the live connection established by the encoder is less than or equal to the maximum resolution of the target back-end device, the target front-end device may determine that an encoding resolution adjustment scheme meeting the requirements of the live connection established by the encoder and the live connection to be established exists, where the encoding resolution adjustment scheme is to adjust the encoding resolution between the maximum resolution of the target back-end device (in a case where the maximum resolution of the target back-end device is less than or equal to the minimum value of the maximum resolution corresponding to the live connection established by the encoder) and the maximum value of the recommended resolution corresponding to the live connection established by the encoder; or adjusting the encoding resolution between a minimum value of a maximum resolution corresponding to the live connection that the encoder has established (in the case that the maximum resolution of the target backend device is greater than the minimum value of the maximum resolution corresponding to the live connection that the encoder has established) and a maximum value of the recommended resolution corresponding to the live connection that the encoder has established.
If the encoding resolution of the encoder is less than or equal to the maximum value of the recommended resolution corresponding to the live connection established by the encoder, and the encoding resolution of the encoder is less than or equal to the minimum value of the maximum resolution corresponding to the live connection established by the encoder, the target front-end device can only maintain or improve the encoding resolution of the encoder, and can only adjust the encoding resolution between the current encoding resolution and the minimum value of the maximum resolution corresponding to the live connection established by the encoder.
In this case, when the encoding resolution of the encoder is greater than the maximum resolution of the target backend device, since the encoding resolution of the encoder needs to be adjusted to the maximum resolution of the target backend device or below to meet the live requirement of the target backend device, and the adjustment of the encoding resolution of the encoder inevitably affects the display effect of part or all of the live stream in the live connection established by the encoder, the target frontend device may determine that there is no encoding resolution adjustment scheme that meets the requirements of the live connection established by the encoder and the live connection to be established.
When the encoding resolution of the encoder is less than or equal to the maximum resolution of the target backend device, the target front-end device may determine that an encoding resolution adjustment scheme that satisfies the requirements of the encoder for establishing the live connection and the live connection to be established exists, where the encoding resolution adjustment scheme is to adjust the encoding resolution between the current encoding resolution and the maximum resolution of the target backend device (in a case where the maximum resolution of the target backend device is less than or equal to the minimum value of the maximum resolution corresponding to the live connection established by the encoder); or adjusting the encoding resolution between the current encoding resolution and the minimum of the maximum resolution corresponding to the live connection that the encoder has established (in the case that the maximum resolution of the target backend device is greater than the minimum of the maximum resolution corresponding to the live connection that the encoder has established).
Further, in the embodiment of the present invention, in consideration of the existing video surveillance networking, the live purpose may include live preview and storage, and it is generally required to preferentially ensure that the live purpose is the establishment of the stored live connection.
Accordingly, as an alternative implementation, when the front-end device allocates the encoder to the back-end device, the following principle needs to be followed:
4. a live stream targeted for storage (which may be referred to herein as a stored stream) has a higher priority than a live stream targeted for live preview (which may be referred to herein as a live preview stream), which may need to yield resources for the stored stream when resources are scarce.
Correspondingly, in the embodiment of the present invention, the live connection information sent by the back-end device to the front-end device may further include a live purpose, where the live purpose includes live preview or storage;
if the adjustment scheme set is empty and the remaining encoder resources and the remaining encoding capability resources of the target front-end device do not meet the requirement of the live connection to be established, before determining that the live connection corresponding to the target back-end device is not allowed to be established, the method may further include:
when the live purpose of the live connection to be established is storage, judging whether the encoder started by the target front-end equipment has the live purpose of the established live connection which is not the stored encoder;
if yes, determining to allow to establish live connection of the corresponding target back-end equipment;
and if not, determining that the step of determining that the establishment of the live connection of the corresponding target backend equipment is not allowed is executed.
In this embodiment, when the target front-end device receives a live connection request sent by the target back-end device, and determines that the started encoder cannot meet the live requirement of the target back-end device, and meanwhile, the remaining encoder resources or/and the remaining encoding capacity resources are not enough to start a new encoder to meet the live requirement of the target back-end device, if the live purpose of the live connection requested to be established by the target back-end device is storage, the target front-end device may further determine whether the live purpose of the established live connection in the currently started encoder is not a stored encoder; if the connection exists, the target front-end device may determine that the live connection corresponding to the target back-end device is allowed to be established, and at this time, the target front-end device may disconnect the live connection already established by the encoder, and establish the live connection corresponding to the target front-end device.
If a plurality of established live targets of the live connection are not stored encoders in the currently started encoders, the target front-end device can select the encoder with the minimum connection number from the encoders, and disconnect the established live connection of the encoder.
If no live connection is established in the currently started encoder, the target front-end device may determine that the live connection corresponding to the target back-end device is not allowed to be established, that is, the live connection fails.
It should be noted that, in practical use, in the embodiment of the present invention, a part of resources may be partitioned from the encoder resources and the encoding capability resources of the front-end device in advance, and are dedicated to establishing the live connection corresponding to the stored stream, so as to effectively reduce occurrence of a situation that a request for storing the stream causes a stream interruption of the live preview stream that has been established before.
And 103, distributing an encoder for the live connection of the corresponding target back-end equipment, and establishing the live connection corresponding to the target back-end equipment.
In this embodiment of the present invention, when the target front-end device determines that live connection corresponding to the target back-end device is allowed to be established, the target front-end device may select one encoding resolution adjustment scheme (in a case where the adjustment scheme set is not empty) from the adjustment scheme set to allocate a currently started encoder to the target back-end device; alternatively, a new encoder is started for the target backend device (case of null adjustment scheme).
When the adjustment scheme set is not empty, the target front-end device may adjust the selected currently started encoder for the target back-end device according to the encoding resolution adjustment scheme described in the above method flow.
For example, suppose CurEncRes selects the encoding resolution for the target front-end device before encoder adjustment for the target back-end device, and NewEncRes is the adjusted encoding resolution.
MinMaxRes is the minimum of the maximum resolution of the live connection currently established by the encoder, and MaxRecRes is the maximum of the recommended resolution of the live connection currently established by the encoder.
ReqRecRes is the recommended resolution of the target backend device, and ReqMaxRes is the maximum resolution of the target backend device.
1. If ReqRecRes is less than or equal to ReqMaxRes, the adjusted encoding resolution is obtained according to the following steps:
1) if ReqReccRes is less than or equal to CurEncRes is less than or equal to ReqMaxRes, then NewEncRes is equal to CurEncRes;
2) if CurEncRes < ReqRecRes, and
if ReqRecRes is less than or equal to MinMaxRes, then NewEncRes is ReqRecRes;
if ReqRecRes > MinMaxRes, NewEncRes ═ MinMaxRes;
3) if CurEncRes > ReqMaxRes, then
If ReqMaxRes is larger than or equal to MaxRecRes, NewEncRes is ReqMaxRes;
if ReqMaxRes < MaxRecRes, there is no valid adjustment scheme for the current encoder;
2. if ReqRecRes > ReqMaxRes, obtaining the adjusted encoding resolution according to the following steps:
1) if CurEncRes is less than or equal to ReqMaxRes, then
If ReqMaxRes is less than or equal to MinMaxRes, then NewEncRes is ReqMaxRes;
if ReqMaxRes > MinMaxRes, then
If MinMaxRes is larger than or equal to MaxRecRes, NewEncRes is MinMaxRes;
if MinMaxRes < MaxRecRes, the current encoder has no effective adjustment scheme;
2) if CurEncRes > ReqMaxRes, then
If ReqMaxRes is larger than or equal to MaxRecRes, NewEncRes is ReqMaxRes;
if ReqMaxRes < MaxRecRes, then the current encoder has no valid adjustment scheme.
And step 104, determining that the live connection is failed to be established.
In the embodiment of the present invention, when the target front-end device determines that the live connection corresponding to the target back-end device is not allowed to be established, the target front-end device may determine that the live connection is failed to be established.
It can be seen that, in the method flow shown in fig. 1, live connection information is carried in a live connection request sent to a front-end device by a back-end device, so that the front-end device can accurately know the recommended resolution and the maximum resolution of the back-end device, and further, the front-end device can reasonably allocate an encoder to the live connection of the back-end device according to the live connection information of the live connection established by the currently-started encoder, the live connection information of the back-end device currently requesting to establish the live connection, the current encoder resource and the current encoding capability resource of the front-end device, and determine the encoding resolution of the encoder to ensure that the encoding resolution of the encoder is consistent with the recommended resolution (when the recommended resolution of the back-end device is less than or equal to the maximum resolution) or the maximum resolution (when the recommended resolution of the back-end device is greater than the maximum resolution) of the back-end, the utilization rate of the encoding and decoding resources of the front-end equipment and the back-end equipment is improved.
Further, in the embodiment of the present invention, when there are many live connections simultaneously established by the target front-end device, a situation may occur that encoder resources need to be merged to meet a requirement of a new live connection. At this time, a plurality of encoder combination schemes can be calculated, and the most suitable merging scheme is selected according to the principles of the minimum encoder variation quantity, the minimum live connection influence quantity and the like, and the specific implementation thereof is not described herein again.
As can be seen from the above flow, in the technical solution provided in the embodiment of the present invention, by receiving a live connection request carrying live connection information sent by a target back-end device, and according to the live connection information corresponding to each encoder that has been started by the target front-end device, the live connection information carried in the live connection request, and the encoder resource information and the encoding capability resource information of the target front-end device, it is determined whether to allow establishment of a live connection corresponding to the target back-end device, and if so, an encoder is allocated for the live connection corresponding to the target back-end device, and the live connection corresponding to the target back-end device is established; otherwise, determining that the live connection is failed to be established, and improving the utilization rate of the encoding and decoding resources of the front-end equipment and the rear-end equipment through the resolution negotiation of the front-end equipment and the rear-end equipment in the live connection process.
Referring to fig. 2, a schematic structural diagram of a live connection establishing apparatus according to an embodiment of the present invention is provided, where the live connection establishing apparatus may be applied to a target front-end device in the foregoing method embodiment, and as shown in fig. 2, the live connection establishing apparatus may include:
a receiving unit 210, configured to receive a live connection request for a target front-end device sent by a target back-end device, where the live connection request carries live connection information; wherein the live connection information comprises recommended resolution and maximum resolution of the backend device corresponding to the live connection;
a determining unit 220, configured to determine whether to allow establishing a live connection corresponding to the target backend device according to live connection information corresponding to each encoder that has been started by the target frontend device, live connection information carried in the live connection request, and encoder resource information and encoding capability resource information of the target frontend device;
an establishing unit 230, configured to allocate an encoder to the live connection corresponding to the target backend device if the live connection is allowed, and establish the live connection corresponding to the target backend device; otherwise, determining that the live connection establishment fails.
Referring to fig. 3 together, a schematic structural diagram of another live connection establishing apparatus according to an embodiment of the present invention is shown in fig. 3, where, on the basis of the live connection establishing apparatus shown in fig. 2, in the live connection establishing apparatus shown in fig. 3, the determining unit 220 includes:
a determining subunit 221, configured to determine, for any encoder that has been started by the target front-end device, whether an encoding resolution adjustment scheme that meets the requirements of the live connection established by the encoder and the live connection to be established exists in the encoder;
an adding subunit 222, configured to add, if an encoding resolution adjustment scheme exists for the encoder that meets the requirements of the live connection already established by the encoder and the live connection to be established, the encoding resolution adjustment scheme to the adjustment scheme set;
the determining subunit 221 is further configured to determine whether the adjustment scheme set is empty after traversing all the encoders started by the target front-end device;
the determining subunit 221 is further configured to determine, if the adjustment scheme set is empty, whether the remaining encoder resources and the remaining encoding capability resources of the target front-end device meet the requirement of the live connection to be established;
a determining subunit 223, configured to determine, if yes, that live connection corresponding to the target backend device is allowed to be established; if not, determining that live connection corresponding to the target back-end equipment is not allowed to be established;
the determining subunit 223 is further configured to determine that live connection corresponding to the target backend device is allowed to be established if the adjustment scheme set is not empty.
In an optional embodiment, the determining subunit 221 is specifically configured to determine that there is no encoding resolution adjustment scheme that meets the requirements of the live connection established by the encoder and the live connection to be established when the maximum value of the recommended resolution corresponding to the live connection established by the encoder is greater than the maximum resolution of the target backend device if the encoding resolution of the encoder is greater than the maximum value of the recommended resolution corresponding to the live connection established by the encoder; and when the maximum value of the recommended resolution corresponding to the live connection established by the encoder is less than or equal to the maximum resolution of the target back-end equipment, determining that an encoding resolution adjusting scheme meeting the requirements of the live connection established by the encoder and the live connection to be established exists.
In an optional embodiment, the determining subunit 221 is specifically configured to determine that there is no encoding resolution adjustment scheme that meets the requirements of the live connection established by the encoder and the live connection to be established when the encoding resolution of the encoder is greater than the maximum resolution of the target backend device if the encoding resolution of the encoder is less than or equal to the maximum value of the recommended resolution corresponding to the live connection established by the encoder and the encoding resolution of the encoder is less than or equal to the minimum value of the maximum resolution corresponding to the live connection established by the encoder; determining that an encoding resolution adjustment scheme exists that meets the requirements of the live connection established by the encoder and the live connection to be established when the encoding resolution of the encoder is less than or equal to the maximum resolution of the target backend device.
In an alternative embodiment, the live connection information further comprises a live purpose; the live purpose comprises a live preview or store;
correspondingly, the determining subunit 221 is further configured to, if the adjustment scheme set is empty, and the remaining encoder resources and the remaining encoding capability resources of the target front-end device do not meet the requirement of the live connection to be established, determine, when the live purpose of the live connection to be established is storage, whether there is an encoder whose live purpose of the established live connection is not storage in each encoder started by the target front-end device;
the determining subunit 223 is further configured to determine that the live connection corresponding to the target backend device is allowed to be established if none of the live targets of the established live connection exists in the encoders started by the target frontend device and is not a stored encoder; otherwise, determining that performing the step of determining does not allow establishing a live connection corresponding to the target backend device.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the invention. One of ordinary skill in the art can understand and implement it without inventive effort.
As can be seen from the above embodiments, by receiving a live connection request carrying live connection information sent by a target backend device, and according to the live connection information corresponding to each encoder that has been started by the target backend device, the live connection information carried in the live connection request, and the encoder resource information and the encoding capability resource information of the target frontend device, it is determined whether the live connection corresponding to the target backend device is allowed to be established, if so, an encoder is allocated for the live connection corresponding to the target backend device, and the live connection corresponding to the target backend device is established; otherwise, determining that the live connection is failed to be established, and improving the utilization rate of the encoding and decoding resources of the front-end equipment and the rear-end equipment through the resolution negotiation of the front-end equipment and the rear-end equipment in the live connection process.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A live connection establishing method is applied to a target front-end device in a video monitoring system, and is characterized by comprising the following steps:
receiving a live connection request which is sent by target back-end equipment and aims at the target front-end equipment, wherein the live connection request carries live connection information; wherein the live connection information comprises recommended resolution and maximum resolution of the backend device corresponding to the live connection;
for any encoder which is started by the target front-end equipment, when the maximum value of the recommended resolution corresponding to the live connection established by the encoder is less than or equal to the maximum resolution of the target back-end equipment, adding an encoding resolution adjusting scheme for adjusting the encoding resolution between the maximum resolution of the target back-end equipment and the maximum value of the recommended resolution corresponding to the live connection established by the encoder into an adjusting scheme set, or between the minimum value of the maximum resolution corresponding to the live connection established by the encoder and the maximum value of the recommended resolution corresponding to the live connection established by the encoder;
for any encoder started by the target front-end equipment, when the encoding resolution of the encoder is less than or equal to the maximum resolution of the target back-end equipment, adding an encoding resolution adjusting scheme for adjusting the encoding resolution between the current encoding resolution and the maximum resolution of the target back-end equipment or between the current encoding resolution and the minimum value of the maximum resolution corresponding to the live connection established by the encoder into an adjusting scheme set;
traversing all the encoders started by the target front-end equipment, and determining to allow to establish live connection corresponding to the target back-end equipment when the adjustment scheme set is not empty;
when the live connection corresponding to the target back-end equipment is allowed to be established, an encoder is distributed for the live connection corresponding to the target back-end equipment, and the live connection corresponding to the target back-end equipment is established;
determining that live connection establishment fails when live connection corresponding to the target backend device is not allowed to be established.
2. The method of claim 1, further comprising:
when the adjustment scheme set is empty and the residual encoder resources and the residual encoding capacity resources of the target front-end equipment meet the requirements of live connection to be established, determining that the live connection corresponding to the target rear-end equipment is allowed to be established;
and when the adjustment scheme set is empty and the residual encoder resources and the residual encoding capacity resources of the target front-end equipment do not meet the requirements of the live connection to be established, determining that the live connection corresponding to the target back-end equipment is not allowed to be established.
3. The method of claim 1, further comprising:
and for any encoder which is started by the target front-end equipment, when the encoding resolution of the encoder is greater than the maximum value of the recommended resolution corresponding to the live connection established by the encoder and the maximum value of the recommended resolution corresponding to the live connection established by the encoder is greater than the maximum resolution of the target back-end equipment, determining that no encoding resolution adjusting scheme meeting the requirements of the live connection established by the encoder and the live connection to be established exists.
4. The method of claim 1, further comprising:
and for any encoder which is started by the target front-end equipment, when the encoding resolution of the encoder is less than or equal to the maximum value of the recommended resolution corresponding to the live connection established by the encoder, the encoding resolution of the encoder is less than or equal to the minimum value of the maximum resolution corresponding to the live connection established by the encoder, and the encoding resolution of the encoder is greater than the maximum resolution of the target back-end equipment, determining that an encoding resolution adjusting scheme which meets the requirements of the live connection established by the encoder and the live connection to be established does not exist.
5. The method of claim 2, wherein the live connectivity information further comprises a live purpose; the live purpose comprises a live preview or store;
if the set of adjustment schemes is empty and the remaining encoder resources and the remaining encoding capability resources of the target front-end device do not meet the requirements of the live connection to be established, determining that the live connection corresponding to the target back-end device is not allowed to be established, including:
when the adjustment scheme set is empty, and the residual encoder resources and the residual encoding capacity resources of the target front-end device do not meet the requirements of the live connection to be established, if the live purpose of the live connection to be established is storage and the live purpose of the live connection established by each encoder started by the target front-end device is storage, determining that the live connection corresponding to the target rear-end device is not allowed to be established;
the method further comprises the following steps:
when the adjustment scheme set is empty, and the residual encoder resources and the residual encoding capacity resources of the target front-end device do not meet the requirements of the live connection to be established, if the live purpose of the live connection to be established is storage and the live purpose of the live connection established by each encoder started by the target front-end device is not storage, determining that the live connection corresponding to the target rear-end device is allowed to be established.
6. An apparatus for establishing a live connection, applied to a target front-end device in a video surveillance system, the apparatus comprising:
the system comprises a receiving unit, a sending unit and a receiving unit, wherein the receiving unit is used for receiving a live connection request which is sent by target back-end equipment and aims at the target front-end equipment, and the live connection request carries live connection information; wherein the live connection information comprises recommended resolution and maximum resolution of the backend device corresponding to the live connection;
a determining unit, configured to add, to an adjustment scheme set, an encoding resolution adjustment scheme that adjusts, for any encoder that has been started by the target front-end device, an encoding resolution between a maximum resolution of the target back-end device and a maximum value of a recommended resolution corresponding to a live connection that has been established by the encoder, or that adjusts an encoding resolution between a minimum value of a maximum resolution corresponding to a live connection that has been established by the encoder and a maximum value of a recommended resolution corresponding to a live connection that has been established by the encoder, when the maximum value of the recommended resolution corresponding to the live connection that has been established by the encoder is less than or equal to the maximum resolution of the target back-end device; for any encoder started by the target front-end equipment, when the encoding resolution of the encoder is less than or equal to the maximum resolution of the target back-end equipment, adding an encoding resolution adjusting scheme for adjusting the encoding resolution between the current encoding resolution and the maximum resolution of the target back-end equipment or between the current encoding resolution and the minimum value of the maximum resolution corresponding to the live connection established by the encoder into an adjusting scheme set; traversing all the encoders started by the target front-end equipment, and determining to allow to establish live connection corresponding to the target back-end equipment when the adjustment scheme set is not empty;
the establishing unit is used for distributing an encoder to the live connection corresponding to the target back-end equipment and establishing the live connection corresponding to the target back-end equipment when the live connection corresponding to the target back-end equipment is allowed to be established; determining that live connection establishment fails when live connection corresponding to the target backend device is not allowed to be established.
7. The apparatus of claim 6, wherein the determining unit is further configured to:
when the adjustment scheme set is empty and the residual encoder resources and the residual encoding capacity resources of the target front-end equipment meet the requirements of live connection to be established, determining that the live connection corresponding to the target rear-end equipment is allowed to be established;
and when the adjustment scheme set is empty and the residual encoder resources and the residual encoding capacity resources of the target front-end equipment do not meet the requirements of the live connection to be established, determining that the live connection corresponding to the target back-end equipment is not allowed to be established.
8. The apparatus of claim 6, wherein the determining unit is further configured to:
and for any encoder which is started by the target front-end equipment, when the encoding resolution of the encoder is greater than the maximum value of the recommended resolution corresponding to the live connection established by the encoder and the maximum value of the recommended resolution corresponding to the live connection established by the encoder is greater than the maximum resolution of the target back-end equipment, determining that no encoding resolution adjusting scheme meeting the requirements of the live connection established by the encoder and the live connection to be established exists.
9. The apparatus of claim 6, wherein the determining unit is further configured to:
and for any encoder which is started by the target front-end equipment, when the encoding resolution of the encoder is less than or equal to the maximum value of the recommended resolution corresponding to the live connection established by the encoder, the encoding resolution of the encoder is less than or equal to the minimum value of the maximum resolution corresponding to the live connection established by the encoder, and the encoding resolution of the encoder is greater than the maximum resolution of the target back-end equipment, determining that an encoding resolution adjusting scheme which meets the requirements of the live connection established by the encoder and the live connection to be established does not exist.
10. The apparatus of claim 7, wherein the live connection information further comprises a live purpose; the live purpose comprises a live preview or store;
if the adjustment scheme set in the determination unit is empty and the remaining encoder resources and the remaining encoding capability resources of the target front-end device do not meet the requirement of the live connection to be established, determining that the live connection corresponding to the target back-end device is not allowed to be established, including:
when the adjustment scheme set is empty, and the residual encoder resources and the residual encoding capacity resources of the target front-end device do not meet the requirements of the live connection to be established, if the live purpose of the live connection to be established is storage and the live purpose of the live connection established by each encoder started by the target front-end device is storage, determining that the live connection corresponding to the target rear-end device is not allowed to be established;
the judging unit is further configured to:
when the adjustment scheme set is empty, and the residual encoder resources and the residual encoding capacity resources of the target front-end device do not meet the requirements of the live connection to be established, if the live purpose of the live connection to be established is storage and the live purpose of the live connection established by each encoder started by the target front-end device is not storage, determining that the live connection corresponding to the target rear-end device is allowed to be established.
CN201611028774.0A 2016-11-14 2016-11-14 Live connection establishing method and device Active CN106713846B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611028774.0A CN106713846B (en) 2016-11-14 2016-11-14 Live connection establishing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611028774.0A CN106713846B (en) 2016-11-14 2016-11-14 Live connection establishing method and device

Publications (2)

Publication Number Publication Date
CN106713846A CN106713846A (en) 2017-05-24
CN106713846B true CN106713846B (en) 2020-04-10

Family

ID=58941160

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611028774.0A Active CN106713846B (en) 2016-11-14 2016-11-14 Live connection establishing method and device

Country Status (1)

Country Link
CN (1) CN106713846B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110072082A (en) * 2019-03-22 2019-07-30 视联动力信息技术股份有限公司 A kind of video broadcasting method and transfer server based on view networking
CN112367462B (en) * 2020-10-29 2022-04-22 北京达佳互联信息技术有限公司 Shooting method, shooting device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968101A (en) * 2006-11-23 2007-05-23 杭州华为三康技术有限公司 Method, system and administrative server for front-end equipment control
CN101729378A (en) * 2008-10-10 2010-06-09 华为技术有限公司 Routing scheduling method, device and system of media stream monitoring
CN101754002A (en) * 2008-12-02 2010-06-23 中兴通讯股份有限公司 Video monitoring system and realization method for dual-stream monitoring front end thereof
CN102811174A (en) * 2012-07-30 2012-12-05 浙江宇视科技有限公司 Method for processing monitor service and network video recorder (NVR)
EP2778897A1 (en) * 2013-03-13 2014-09-17 Ricoh Company, Ltd. Computer program product, information processing method, and information processing apparatus
CN104837032A (en) * 2014-02-11 2015-08-12 北京信威通信技术股份有限公司 Method for dynamically adjusting encoder resolution ratio in video monitoring system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657334B (en) * 2014-11-14 2018-12-18 中国移动通信集团公司 A kind of method of transmission of video, video monitoring platform and video monitoring equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968101A (en) * 2006-11-23 2007-05-23 杭州华为三康技术有限公司 Method, system and administrative server for front-end equipment control
CN101729378A (en) * 2008-10-10 2010-06-09 华为技术有限公司 Routing scheduling method, device and system of media stream monitoring
CN101754002A (en) * 2008-12-02 2010-06-23 中兴通讯股份有限公司 Video monitoring system and realization method for dual-stream monitoring front end thereof
CN102811174A (en) * 2012-07-30 2012-12-05 浙江宇视科技有限公司 Method for processing monitor service and network video recorder (NVR)
EP2778897A1 (en) * 2013-03-13 2014-09-17 Ricoh Company, Ltd. Computer program product, information processing method, and information processing apparatus
CN104837032A (en) * 2014-02-11 2015-08-12 北京信威通信技术股份有限公司 Method for dynamically adjusting encoder resolution ratio in video monitoring system

Also Published As

Publication number Publication date
CN106713846A (en) 2017-05-24

Similar Documents

Publication Publication Date Title
KR102080116B1 (en) Method and apparatus for assigning video bitrate in mobile communicatino system
EP2418848A1 (en) Content location method and content delivery network node
EP2466911B1 (en) Method and device for fast pushing unicast stream in fast channel change
US10148990B2 (en) Video streaming resource optimization
EP3247121A1 (en) Streaming media data transmission method, client and server
EP2426918A1 (en) Method, terminal and server for allocating signal routing resources in video on demand service
WO2015120766A1 (en) Video optimisation system and method
KR101501189B1 (en) Method and apparatus for fast channel change
KR20150113145A (en) Method and device for transmitting streaming media data
US20130304933A1 (en) Multi-network environment adaptive media streaming transmission method and apparatus
CN106713846B (en) Live connection establishing method and device
US20110154393A1 (en) Iptv set-top box and channel switching method thereof
CN111866526B (en) Live broadcast service processing method and device
CN113259729A (en) Data switching method, server, system and storage medium
US20150288995A1 (en) Method and apparatus for transmitting and receiving hybrid broadcasting
US10270832B1 (en) Method and system for modifying a media stream having a variable data rate
US9832527B2 (en) System and a method for distributing content via static channel assignment in a mobile content gateway
EP2955960A1 (en) Wireless transmission method for service data, apparatus and device thereof
US20150271530A1 (en) Video quality enhancement method and apparatus
US10237582B2 (en) Video stream processing method and video stream device thereof
US10504482B2 (en) Smart small form-factor pluggable (SFP) transceiver
CN113396597A (en) Adaptive bit rate data broadcasting
US11622144B2 (en) Active video bandwidth management using SDV control
KR20130065985A (en) A method and apparatus for transmitting and receiving massive broadcasting progrm usign a broadcasting channel and a communication channel
KR102092292B1 (en) Broadcasting service apparatus and control method thereof

Legal Events

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