A live broadcast traffic scheduling method, device, electronic device, and storage medium
By determining the access path between the client and the camera device in the live broadcast technology and obtaining different live broadcast addresses, the problem of network security risks in the existing technology when reducing traffic costs is solved, and the traffic flows within the private network is realized, reducing security risks.
Patent Information
- Application Number
- CN202411698842.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-11-26
AI Technical Summary
When existing live broadcast technology reduces traffic costs, network security risks are high and has failed to effectively solve this problem.
By determining different ways of access to the client and the camera device, different live broadcast addresses are obtained according to different combinations of access channels, and then the video stream of the camera device is sent to the client according to the live broadcast address, avoiding the situation where the streaming media needs to open the port to expose the surface when the device accesses through the public network, thereby reducing network security risks.
It realizes reducing network security risks while reducing traffic costs. By allowing traffic to flow in the private network, it reduces port exposure and improves network security.
Smart Images

Figure CN119211590B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of streaming media, and in particular, to a live traffic scheduling method, apparatus, electronic device, and storage medium. Background Art
[0002] With the development of the video surveillance industry, the scale of devices connected to the cloud is increasing day by day. The click volume of public network live broadcasts is very high every day, and devices upload videos to the resource pool 24 hours a day, which will result in huge traffic costs during live broadcasts. Secondly, all streaming media accessed by devices through the public network need to open port exposure surfaces, increasing security risks.
[0003] In the existing live broadcast technology, most clients and device ends are in the same province or city. Generally, by optimizing video encoding and compression, using edge computing or using P2P technology, viewers can share video streams with each other. Although in the existing live broadcast technology, the server pressure and bandwidth requirements are reduced to save traffic costs, the network security risks caused by traffic scheduling are not considered in the existing live broadcast technology.
[0004] In view of the problem of relatively large network security risks in reducing traffic costs in the related art, no effective solution has been proposed yet. Summary of the Invention
[0005] In the present embodiment, a live traffic scheduling method, apparatus, electronic device, and storage medium are provided to reduce network security risks when reducing traffic costs.
[0006] In a first aspect, in the present embodiment, a live traffic scheduling method is provided, which is applied to a service platform. The service platform is respectively connected to a client and a camera device. The method includes:
[0007] Responding to a connection request initiated by the camera device, determining a first access path through which the camera device accesses;
[0008] Responding to a live address acquisition request initiated by the client, determining a second access path through which the client accesses;
[0009] Determining a target streaming media according to the first access path and the second access path; the target streaming media includes a streaming media registered from a private network to the service platform;
[0010] Determining a target live address according to the target streaming media, and returning the target live address to the client, so that the client can obtain the video stream of the camera device according to the target live address.
[0011] In some of these embodiments, the step of responding to a connection request initiated by the camera device and determining a first access path through which the camera device accesses includes:
[0012] In response to a connection request initiated by a camera device, obtain a connection request message for the connection request; the connection request is initiated by the camera device and forwarded through a private network proxy gateway.
[0013] Determine whether the connection request message carries a private network identifier; the private network identifier is extended by the private network proxy gateway on the connection request message.
[0014] If it carries a private network identifier, identify the first access path as private network access; if it does not carry a private network identifier, identify the first access path as public network access.
[0015] In some embodiments, the determining the second access path for the client to access includes:
[0016] In response to a live address acquisition request from the client, obtain an address request message in the live address acquisition request; the live address acquisition request is initiated by the client and forwarded through a private network proxy gateway.
[0017] Determine whether the address request message carries a private network identifier; the private network identifier is extended by the private network proxy gateway on the address request message.
[0018] If it carries the private network identifier, identify the second access path as private network access; if it does not carry the private network identifier, identify the second access path as public network access.
[0019] In some embodiments, determining a target streaming media according to the first access path and the second access path includes:
[0020] When the first access path is private network access and the second access path is public network access, send a first streaming media address to the camera device; the first streaming media address includes a streaming media address supported by the private network.
[0021] Receive a first login success signal sent by the camera device; the first login success signal indicates that the camera device logs in to a first private network streaming media through the first streaming media address.
[0022] Determine a first public network streaming media according to the public network accessed by the client; the load of the first public network streaming media reaches a preset condition.
[0023] Determine the target streaming media according to the first private network streaming media and the first public network streaming media.
[0024] In some embodiments, the target streaming media includes a second public network streaming media, and determining the target streaming media according to the first access path and the second access path includes:
[0025] When both the first access path and the second access path are public network accesses, send a second streaming media address to the camera device; the second streaming media address includes a streaming media address supported by both the public network and the private network.
[0026] Receive a second login success signal sent by the camera device; the second login success signal indicates that the camera device logs in to the second public network streaming media through the second streaming media address.
[0027] In some embodiments, the target streaming media includes a second private network streaming media. Determining the target streaming media according to the first access path and the second access path includes:
[0028] When both the first access path and the second access path are private network accesses, send a third streaming media address to the camera device; the third streaming media address includes a streaming media address supported by the private network.
[0029] Receive a third login success signal sent by the camera device; the third login success signal indicates that the camera device logs in to the second private network streaming media through the third streaming media address.
[0030] In some embodiments, after determining the target live broadcast address according to the target streaming media and returning the target live broadcast address to the client, further include:
[0031] Determine the pulling strategy of the client and the pushing strategy of the camera device according to the first access path and the second access path.
[0032] In a second aspect, a live broadcast traffic scheduling device is provided in this embodiment. The device includes: a request response module, a streaming media determination module, and an address sending module;
[0033] The request response module is configured to, in response to a connection request initiated by a camera device, determine a first access path to which the camera device is accessed; and in response to a live broadcast address acquisition request initiated by a client, determine a second access path to which the client is accessed;
[0034] The streaming media determination module is configured to determine a target streaming media according to the first access path and the second access path; the target streaming media includes a streaming media registered from a private network to a service platform;
[0035] The address sending module is configured to determine a target live broadcast address according to the target streaming media and return the target live broadcast address to the client, so that the client acquires the video stream of the camera device according to the target live broadcast address.
[0036] In a third aspect, an electronic device is provided in this embodiment, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the live traffic scheduling method described in the first aspect above is implemented.
[0037] In a fourth aspect, a storage medium is provided in this embodiment, on which a computer program is stored. When the program is executed by a processor, the live traffic scheduling method described in the first aspect above is implemented.
[0038] Compared with the related art, a live traffic scheduling method, device, electronic device, and storage medium provided in this embodiment determine different access paths for the client and the camera device end, obtain different live addresses according to different combinations of the access paths, and then send the video stream of the camera device to the client according to the live address, so as to avoid the situation where the streaming media needs to open the port exposure surface when the device accesses through the public network, thereby reducing the network security risk. At the same time, different access methods correspond to different streaming media addresses registered in the private network, so that the traffic flows in the private network, which is beneficial to reducing the traffic cost.
[0039] The details of one or more embodiments of the present application are set forth in the following drawings and description, so that the other features, objects, and advantages of the present application become more concise and understandable. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The drawings described herein are used to provide a further understanding of the present application and form a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:
[0041] Figure 1 is a hardware structure block diagram of a terminal for the live traffic scheduling method provided by an embodiment of the present application;
[0042] Figure 2 is a flowchart of the live traffic scheduling method provided by an embodiment of the present application;
[0043] Figure 3 is a timing diagram of streaming media access and camera access provided by this specific embodiment;
[0044] Figure 4 is a timing diagram in the scenario of the client's private network live broadcast provided by this specific embodiment;
[0045] Figure 5 is a timing diagram of the public network access of the camera device in the scenario of the client's public network live broadcast provided by this specific embodiment;
[0046] Figure 6It is a timing diagram of the private network access of a camera device in the public network live broadcast scenario provided by this specific embodiment;
[0047] Figure 7 It is a schematic diagram of the live broadcast traffic scheduling scenario provided by this specific embodiment;
[0048] Figure 8 It is a structural block diagram of the live broadcast traffic scheduling device of this embodiment. Specific implementation manners
[0049] To understand the purpose, technical solution and advantages of the present application more clearly, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments.
[0050] Unless otherwise defined, the technical terms or scientific terms involved in the present application shall have the general meanings understood by those with ordinary skills in the technical field to which the present application belongs. In the present application, words such as "a", "one", "a kind", "the", "these" and the like do not indicate a limitation in quantity, and they can be singular or plural. The terms "including", "comprising", "having" and any variants thereof involved in the present application are intended to cover non-exclusive inclusion; for example, a process, method, system, product or device including a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent in these processes, methods, products or devices. The terms "connected", "coupled" and the like involved in the present application do not limit to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in the present application means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" may mean: A exists alone, A and B exist simultaneously, and B exists alone. Usually, the character " / " indicates that the associated objects before and after are in an "or" relationship. The terms "first", "second", "third" and the like involved in the present application are only used to distinguish similar objects and do not represent a specific sorting for the objects.
[0051] In the method embodiment provided in this embodiment, it can be executed on a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 It is a hardware structural block diagram of the terminal of the live broadcast traffic scheduling method provided by an embodiment of the present application. As Figure 1 shown, the terminal may include one or more ( Figure 1A processor 102 (only one is shown) and a memory 104 for storing data, where the processor 102 may include, but is not limited to, processing devices such as a microprocessor MCU or a field-programmable gate array FPGA. The above terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those of ordinary skill in the art can understand that Figure 1 The structure shown is only illustrative and does not limit the structure of the above terminal. For example, the terminal may further include more or fewer components than those Figure 1 shown, or have a different configuration from that Figure 1 shown.
[0052] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the live traffic scheduling method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, implements the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memories. In some instances, the memory 104 may further include a memory remotely set relative to the processor 102, and these remote memories can be connected to the terminal through a network. Examples of the above network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0053] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one instance, the transmission device 106 includes a network adapter (Network Interface Controller, abbreviated as NIC), which can be connected to other network devices through a base station and thus communicate with the Internet. In one instance, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0054] In the existing video live streaming industry, live streaming is essentially a real-time video stream transmission, involving a large amount of data flowing in the network. With the development of the live streaming industry, the click-through rate of public network live streaming has reached billions of times. At the same time, in order to provide users with a better visual experience, many live streams will choose high-definition or even ultra-high-definition video quality, which will lead to a significant increase in the data volume of the video stream. Secondly, for the streaming media accessed by devices through the public network, it is necessary to open the port exposure surface, increasing the security risk. Most clients and device terminals are in the same province or city. In order to save costs and reduce security risks, many customers hope to build a private network in their own areas, hoping that the traffic will flow within the private network, saving cost, and at the same time minimizing the port exposure surface and providing the public network live streaming ability.
[0055] In this embodiment, a live streaming traffic scheduling method is provided, mainly aiming at the live streaming problems in three scenarios: the private network access of the camera device and the private network access of the client, the private network access of the camera device and the public network access of the client, and the public network access of the camera device and the public network access of the client, so that the traffic can flow within the private network as much as possible, reducing the traffic cost and increasing the economic benefits. At the same time, the port exposure surface is converged to reduce the network security risk. Figure 2 It is a flowchart of the live streaming traffic scheduling method provided by the embodiment of the present application. This live streaming traffic scheduling method is applied to an application platform, and the application platform is respectively connected to a camera device and a client; as Figure 2 shown, the process includes the following steps:
[0056] Step S210, in response to a connection request initiated by the camera device, determine the first access path through which the camera device accesses.
[0057] In this step, when a live streamer wants to conduct a live stream, they need to first access the service platform, that is, they need to initiate a connection request to the service platform to obtain the connection IP and port of the service platform to realize the connection between the camera device and the service platform. Here, the service platform receives the connection request initiated by the camera device, and then determines whether the first access path of the camera device is private network access or public network access. Exemplarily, the connection between the camera device and the service platform can be a long connection or a short connection, and a long connection is preferably adopted.
[0058] Step S220, in response to a live stream address acquisition request initiated by the client, determine the second access path through which the client accesses.
[0059] In this step, when the client needs to watch a live stream, the client sends a live stream address acquisition request to the service platform. After the service platform receives the live stream address acquisition request sent by the client, it determines whether the second access path through which the client accesses is private network access or public network access.
[0060] Step S230: Determine the target streaming media based on the first access path and the second access path; the target streaming media includes the streaming media registered from the private network to the service platform.
[0061] In this step, after the client's first access path and the camera device's second access path are determined respectively, the service platform obtains the accessed target streaming media from the first access path and the second access path respectively. The target streaming media is obtained from the streaming media registered from the private network and the public-private network to the service platform. Exemplarily, the combinations of different access paths mainly include: the first access path is private network access and the second access path is public network access, the first access path is public network access and the second access path is public network access, the first access path is private network access and the second access path is private network access. For these three access scenarios, the target streaming media registered in the private network corresponding to different access scenarios is different.
[0062] Among them, the private network refers to a network composed of a group of network devices and machines. Devices and machines can communicate directly with each other. Devices outside the private network cannot access devices inside the private network. Devices inside the private network can only access the external network through a proxy. The public-private network represents a combination of the private network and the public network. When the service is deployed to the public-private network, the client can access the service through the public network and can also access other services in the private network where it is located through the service proxy.
[0063] Step S240: Determine the target live broadcast address based on the target streaming media, and return the target live broadcast address to the client so that the client can obtain the video stream of the camera device according to the target live broadcast address.
[0064] Through the above steps, after the service platform determines the target streaming media, it sends the address of the target streaming media to the camera device so that the camera device can log in to the target streaming media. When the camera device logs in successfully, the service platform determines the target streaming media according to the access paths of the client and the camera device, and groups the corresponding live broadcast address, that is, the target live broadcast address. When the target live broadcast address is determined, it is sent to the client so that the client can pull the stream from the streaming media, and at the same time, the camera device can push the stream.
[0065] Through the above steps, different access paths of the client and the camera device are determined, different live broadcast addresses are obtained according to different combinations of the access paths, and then the video stream of the camera device is sent to the client according to the live broadcast address, so as to avoid the situation where the streaming media needs to open the port exposure surface when the device accesses through the public network, thereby reducing the network security risk. At the same time, different access methods correspond to different streaming media addresses registered in the private network, so that the traffic can all flow in the private network, which is beneficial to reducing the traffic cost.
[0066] In one specific embodiment, before accessing the camera device and the client, the service platform needs to access the streaming media of the private network and the public-private network, that is, register the private network streaming media and the public-private network streaming media corresponding to the private network and the public-private network in the corresponding provinces to the service platform, and respectively carry the private network identifier and the public network identifier. Among them, the public network cannot access the private network streaming media, and the public-private network streaming media is also within the private network, but the public network is allowed to access.
[0067] In some embodiments, in step S210, in response to the connection request initiated by the camera device, determining the first access path for the camera device to access includes: in response to the connection request initiated by the camera device, obtaining the connection request message of the connection request; the connection request is initiated by the camera device and forwarded through the private network proxy gateway to determine whether the connection request message carries the private network identifier; the private network identifier is extended by the private network proxy gateway on the connection request message; if the private network identifier is carried, it is identified that the first access path is private network access; if the private network identifier is not carried, it is identified that the first access path is public network access.
[0068] This step mainly involves the access of the camera device. In the entire system for realizing live broadcast traffic scheduling, in the private network scenario, it includes the service platform, the accessed camera device, the client, and the private network proxy gateway, and the private network proxy gateway is connected to the service platform. When the camera device wants to access the service platform, it needs to send a connection request to the service platform, that is, obtain the connection IP port from the service platform. This connection request passes through the private network proxy gateway. At this time, the private network proxy gateway will add an extension header to the connection request message, thereby identifying private network access. Then the private network proxy gateway forwards the connection request sent by the camera device to the service platform. The service platform receives this connection request and marks the private network access identifier for the camera device. Then the service platform returns the connection IP port to the camera device through the private network proxy gateway, so that the camera device can log in to the service platform through the connection IP port.
[0069] When in the public network scenario, the connection request initiated by the camera device does not need to pass through the private network proxy gateway, nor does the private network proxy gateway need to extend the connection request message; at this time, the camera device directly sends a connection request to the service platform, that is, the camera device obtains the connection IP port from the service platform. The service platform responds to this connection request and directly returns the connection IP port to the camera device. Then the camera device connects to the service platform to log in to the service platform.
[0070] After the service platform receives the connection request initiated by the camera device, in order to determine whether the camera device accesses in the private network scenario or the public network scenario, it only needs to determine whether the connection request message corresponding to the connection request initiated by the camera device carries the private network identifier extended by the private network proxy gateway, thereby determining the first access method of the camera device. Through the above steps, the efficiency of identifying the access path of the camera device is improved.
[0071] In some of these embodiments, determining the second access path for the client to access in step S220 includes: in response to a live address acquisition request from the client, obtaining the address request message in the live address acquisition request; the live address acquisition request is initiated by the client and forwarded through a private network proxy gateway; determining whether the address request message carries a private network identifier; the private network identifier is extended by the private network proxy gateway on the address request message; if it carries the private network identifier, then the second access path is identified as private network access; if it does not carry the private network identifier, then the second access path is identified as public network access.
[0072] Among them, this step mainly involves the access of the client. In the entire system for implementing live traffic scheduling, in the private network scenario, it includes a service platform, an access camera device, a client, and a private network proxy gateway, and the private network proxy gateway is connected to the service platform. When the client wants to watch a live broadcast, it needs to send a live address acquisition request to the service platform. This live address acquisition request passes through the private network proxy gateway. At this time, the private network proxy gateway will add an extension header to the live address acquisition request message, thereby identifying private network access. Subsequently, the private network proxy gateway forwards the live address acquisition request sent by the client to the service platform, and the service platform receives this live address acquisition request and determines whether the live address acquisition request carries a private network access identifier, thereby determining whether the client is private network access.
[0073] When in the public network scenario, the live address acquisition request initiated by the client does not need to pass through the private network proxy gateway, nor does the private network proxy gateway need to extend the live address acquisition request message; at this time, the client directly sends a live address acquisition request to the service platform, and the service platform responds to this live address acquisition request and determines whether the client is public network access.
[0074] After the service platform receives the live address acquisition request initiated by the client, in order to determine whether the client is accessing in the private network scenario or the public network scenario, it only needs to determine whether the message corresponding to the live address acquisition request initiated by the client carries the private network identifier extended by the private network proxy gateway, thereby determining the second access method of the client. Through the above steps, the efficiency of identifying the client access path is improved.
[0075] In some of these embodiments, determining the target streaming media according to the first access path and the second access path in step S230 includes: when the first access path is private network access and the second access path is public network access, sending a first streaming media address to the camera device; the first streaming media address includes the streaming media address supported by the private network; receiving the first login success signal sent by the camera device; the first login success signal indicates that the camera device logs in to the first private network streaming media through the first streaming media address; determining the first public network streaming media according to the public network accessed by the client; the load of the first public network streaming media reaches a preset condition; determining the target streaming media according to the first private network streaming media and the first public network streaming media.
[0076] In this embodiment, when both the imaging device and the client are connected to the service platform, and it is determined that the imaging device is connected through a private network and the client is connected through a public network, the service platform then selects a streaming media instance registered on the private network and a streaming media instance registered on the public network respectively. Subsequently, a first streaming media address is sent to the imaging device. The first streaming media address includes the streaming media address supported by the private network. The imaging device logs in to the first private network streaming media according to the first streaming media address. Here, the first private network streaming media is the streaming media instance registered on the private network selected by the service platform. After the imaging device logs in successfully, a first login success signal is sent to the service platform. After the service platform obtains the first login success signal sent by the imaging device, the service platform points to the first private network streaming media service according to the origin-pulling parameter of the first public network streaming media to obtain the origin-pulling live broadcast address. The service platform sends the origin-pulling live broadcast address to the client through the private network proxy gateway. Further, the first public network streaming media here includes the public-private network streaming media registered with the service platform.
[0077] Further, after determining the target live broadcast address according to the target streaming media and returning the target live broadcast address to the client, the pulling strategy of the client and the pushing strategy of the imaging device are also determined according to the first access path and the second access path.
[0078] Among them, when the imaging device is connected through a private network and the client is connected through a public network, after the client receives the origin-pulling live broadcast address sent by the service platform, it pulls the stream from the public-private network streaming media. The public-private network streaming media parses the origin-pulling live broadcast address to obtain the origin-pulling parameter. Subsequently, the public-private network streaming media pulls the stream from the private network streaming media for origin-pulling. The private network streaming media issues a pushing instruction to the imaging device so that the imaging device pushes the stream to the private network streaming media. Subsequently, the private network streaming media pushes the audio-video stream to the public-private network streaming media, and the public-private network streaming media forwards the audio-video stream to the client.
[0079] In some of these embodiments, the target streaming media includes a second public network streaming media. Determining the target streaming media according to the first access path and the second access path in step S230 includes: when both the first access path and the second access path are public network accesses, sending a second streaming media address to the imaging device; the second streaming media address includes the streaming media address supported by both the public network and the private network; receiving the second login success signal sent by the imaging device; the second login success signal indicates that the imaging device logs in to the second public network streaming media through the second streaming media address.
[0080] In this embodiment, when it is determined that both the client and the camera device are accessed through the public network, the service platform selects a streaming media instance from the streaming media instances accessed through the public and private networks. Subsequently, the service platform sends the second streaming media address of the public and private network streaming media instance to the camera device. After receiving the second streaming media address, the camera device logs in to the public and private network streaming media. After successful login, the camera device sends a second login success signal to the service platform. After receiving the second login success signal, the service platform groups the public network live broadcast address and sends the public network live broadcast address to the client.
[0081] Further, after determining the target live broadcast address according to the target streaming media and returning the target live broadcast address to the client, the pulling strategy of the client and the pushing strategy of the camera device are also determined according to the first access path and the second access path.
[0082] Among them, when both the client and the camera device are accessed through the public network, after the client receives the public network live broadcast address, the client pulls the stream from the public and private network streaming media. Subsequently, the public and private network streaming media sends a pushing instruction to the camera device, so that the camera device pushes the stream to the public and private network streaming media, and forwards the audio and video stream of the camera device to the client through the private network streaming media.
[0083] In some of these embodiments, the target streaming media includes a second private network streaming media. Determining the target streaming media according to the first access path and the second access path in step S230 includes: when both the first access path and the second access path are private network accesses, sending a third streaming media address to the camera device; the third streaming media address includes the streaming media address supported by the private network; receiving the third login success signal sent by the camera device; the third login success signal indicates that the camera device logs in to the second private network streaming media through the third streaming media address.
[0084] In this embodiment, when it is determined that both the first access path and the second access path are private network accesses, the service platform selects a third streaming media from the streaming media instances accessed through the private network. Subsequently, the service platform sends the third streaming media address, that is, the private network streaming media address, to the camera device. After receiving the private network streaming media address, the camera device logs in to the private network streaming media. When the camera device logs in successfully, a third login success signal is returned to the service platform. The service platform receives the third login success signal sent by the camera device and groups the private network live broadcast address according to the private network streaming media. Subsequently, the service platform sends the private network live broadcast address to the client through the private network proxy gateway.
[0085] Further, after determining the target live broadcast address according to the target streaming media and returning the target live broadcast address to the client, the pulling strategy of the client and the pushing strategy of the camera device are also determined according to the first access path and the second access path.
[0086] Among them, when both the client and the camera device are connected to the private network, after the client receives the private network live broadcast address sent by the service platform, it pulls the stream from the private network streaming media. Then, the private network streaming media sends a stream pushing instruction to the camera device. After receiving the stream pushing instruction, the camera device pushes the audio and video stream to the private network streaming media. Finally, the private network streaming media forwards the audio and video stream to the client.
[0087] In one possible embodiment, when the client is connected to the private network and the camera device is connected to the public network, an error is reported because the client cannot directly access the public network streaming media pushed by the camera device.
[0088] Through the different network types accessed by the above-mentioned client and camera device, different streaming media access methods are correspondingly obtained, and through different stream pushing strategies and stream pulling strategies, it is beneficial to realize the transfer of traffic within the private network; at the same time, it also has the ability to live broadcast with public network outflows; while reducing the traffic cost, it reduces the port exposure surface of the streaming media deployed within the private network, thereby reducing the security risk.
[0089] The following describes and illustrates this embodiment through specific embodiments.
[0090] The camera device includes devices that can capture audio and video, such as a camera, and are connected to the service platform. Here, the camera device is taken as an example of a camera. Figure 3 is the timing diagram of streaming media access and camera access provided by this specific embodiment. Refer to Figure 3 , the steps of streaming media access include: the private network streaming media registers to the service platform with the private network identifier; the public-private network streaming media registers to the service platform with the public network identifier. Among them, the public network cannot access the private network streaming media, but can access the public-private network streaming media. The public-private network streaming media is within the private network. The access of the camera is divided into private network scenarios and public network scenarios. In the private network scenario, the camera obtains the TCP long connection IP port from the service platform, and the message passes through the private network proxy gateway within the private network, such as the nginx proxy gateway. The nginx proxy gateway adds the extended header X-T: privNet to the request HTTP message header to identify private network access. Then, the nginx proxy gateway forwards the camera's request for obtaining the long connection IP port to the service platform on behalf of the camera; the service platform marks the private network access identifier for the camera and returns the TCP long connection IP and port to the camera through the nginx proxy gateway. The camera uses the TCP long connection to log in to the service platform. In the public network scenario, first, the camera obtains the TCP long connection IP port from the service platform, the service platform returns the TCP long connection IP and port to the camera, and the camera uses the TCP long connection to log in to the service platform. Here, the camera's obtaining the TCP long connection IP port from the service platform is the connection request sent by the camera device to the service platform mentioned in the foregoing embodiment.
[0091] Figure 4This is a timing diagram for the live broadcast scenario of the client private network provided by this specific embodiment. Figure 4 In the client private network live broadcast scenario, the client obtains the private network access camera live broadcast address from the business platform through a private network proxy gateway, such as an nginx proxy gateway, that is, in the aforementioned embodiment, the client initiates a live broadcast address acquisition request to the business platform through a private network proxy gateway. Thereafter, the private network proxy gateway extends the message corresponding to the live broadcast address acquisition request; exemplarily, the nginx proxy gateway adds an extension header XT:privNet to the request HTTP message header to identify the private network access. Then the nginx proxy gateway forwards the live broadcast address acquisition request to the business platform proxy. After receiving the live broadcast address acquisition request from the client, the business platform determines whether the client is private network accessed and whether the camera is private network accessed. If the camera is public network accessed, an error message is returned to the client, and no other steps are executed. If the camera is private network accessed, the business platform takes a streaming media instance with the smallest load from the streaming media instances accessed by the private network, and then sends the private network streaming media address to the camera. The camera logs in to the private network streaming media according to the private network streaming media address, and returns a login success message to the business platform after the login is successful. After receiving the successful login message, the business platform sets up a private network live broadcast address and returns the private network live broadcast address to the client through the nginx proxy gateway. After receiving the private network live broadcast address, the client pulls the stream to the private network streaming media. The private network streaming media sends a push stream instruction to the camera, so that the camera pushes the stream to the private network streaming media, and finally the private network streaming media transfers the audio and video stream to the client.
[0092] Figure 5 This is a timing diagram of the public network access of the camera device in the public network live broadcast scenario provided by the client in this specific embodiment. Figure 5 In the scenario of live broadcast on the client's public network, the client sends a request to the business platform to obtain the live broadcast address; after receiving the request, the business platform determines that the client is connected to the public network, and determines whether the camera is connected to the public network. When the camera is connected to the public network, the business platform takes a streaming media instance with the smallest load from the streaming media instances connected to the public network, and then sends a streaming media address that supports both public and private networks to the camera. The camera logs in to the provincial streaming media of the public and private networks according to the streaming media address, and returns a successful login response message to the business platform after successful login. Afterwards, the business platform assembles the public network live broadcast address and returns the live broadcast address to the client. The client pulls the stream from the provincial streaming media of the public and private networks according to the live broadcast address; the provincial streaming media of the public and private networks sends a push stream instruction to the camera, and the camera pushes the stream to the provincial streaming media of the public and private networks, and finally the private network streaming client converts the audio and video stream.
[0093] Figure 6 This is a timing diagram of the camera device accessing the private network in the live broadcast scenario of the client on the public network provided by this specific embodiment. Figure 6, in the public network live broadcast scenario of the client, the client sends a live broadcast address acquisition request to the service platform; after receiving the request, the service platform determines that the client is connected to the public network and determines whether the camera is connected to the public network. When the camera is connected to the private network, the service platform selects a streaming media instance with the lowest load from the streaming media instances connected to the private network; at the same time, it selects a streaming media instance with the lowest load from the streaming media instances connected to the public network. Then, the service platform sends the private network streaming media address to the camera; the camera logs in to the private network streaming media according to this private network streaming media address; and returns a login success response message to the service platform.
[0094] Then, the service platform combines the public network streaming media and the private network streaming media to return the origin live broadcast address, for example: "rtsp: / / 215.148.12.4:8522 / app / stream orgin=aes256(rtsp: / / 192.168.143.12:8522 / app / stream token=xxx)". Among them, after the player gets the origin live broadcast address, it first accesses the streaming media connected to the public network (215.148.12.4), and then points to the private network streaming media service through the origin parameter in the streaming media, that is, the origin parameter, to obtain the origin live broadcast address. The player is a player similar to VLC or a monitoring client with a player. The origin parameter is the string after encrypting the rtsp live broadcast address by the Origin identifier.
[0095] The service platform returns the origin live broadcast address to the client through the nginx proxy gateway. The client pulls the stream from the public and private network provincial streaming media. The public and private network streaming media parses the live broadcast address to obtain the origin parameter and pulls the stream back to the private network streaming media. Then, the private network streaming media sends a stream pushing instruction to the camera. The camera pushes the stream to the private network streaming media according to the stream pushing instruction. The private network streaming media sends the audio and video stream to the public and private network provincial streaming media, and the public and private network provincial streaming media forwards the audio and video stream to the client.
[0096] The above Figures 3 to 6 The devices mentioned in can be understood as camera devices, and the camera is taken as an example in the figure.
[0097] In the prior art, the client and the camera are both connected to the streaming media service in the public network manner and push and pull the stream to and from the streaming media, so a large traffic cost is generated. In this embodiment, in order to reduce the traffic cost, based on the public and private network hybrid environment, different types of streaming media are scheduled according to the access methods of the client and the camera, so as to realize the transfer of traffic within the private network, and at the same time, it also has the ability to live broadcast with public network outflows, reducing the traffic cost. At the same time, according to different scheduling strategies, the streaming media deployed in the private network does not need to open the public network port for exposure, thus reducing the risk of being attacked.
[0098] In this application, a streaming media service is deployed on the public network, and a public network identifier and a business platform registration address are set. A streaming media service is also deployed on the private network, and a private network identifier and a business platform registration address are set. The streaming media services on the public network and the private network belong to the same network and can communicate with each other. The streaming media service on the public network has a public network IP and can provide external access. The streaming media on the private network only has an internal network IP and cannot be accessed from the external network. In both the private network and the public network, a certain number of cameras are connected and also connected to the business platform. When the user opens the client and clicks on the camera icon, the client sends a live address request to the business platform through the nginx proxy at this time. The business platform determines whether it is a private network access based on the HTTP extension headers when the client and the camera are connected. If the client is a private network access and the camera is a public network access, an error is reported because the client cannot directly access the public network streaming media pushed by the camera. If the client is a private network access and the camera is a private network access, the business platform allows the camera to log in to the streaming media on the private network, and at the same time groups the live address pointing to the streaming media on the private network and returns it to the client. After the client gets the live address, it obtains the video stream from the camera through the streaming media on the private network. If the client is a public network access and the camera is a private network access, the business platform allows the camera to log in to the streaming media on the private network, and at the same time selects the public network streaming media with the minimum load, and groups the live address pointing to the public network streaming media. The live address brings back the source parameter, and through this parameter, it can return to the streaming media on the private network to obtain the camera video stream. After the business platform groups the return source address, it returns it to the client. After the client gets the live address, it sends a live request to the public network streaming media. The public network streaming media interprets the live address, obtains the return source parameter, and returns to the streaming media on the private network through this parameter to obtain the camera video stream. If the client is a public network access and the camera is a public network access, the business platform allows the camera to log in to the streaming media on the public network, and at the same time groups the live address pointing to the public network streaming media and returns it to the client. After the client gets the live address, it obtains the video stream from the camera through the public network streaming media.
[0099] In a preferred embodiment, referring to Figure 7 , Figure 7 is a schematic diagram of the live traffic scheduling scenario provided by this specific embodiment. The network type accessed by the camera device (i.e., the device in Figure 7 ) is the private network. The private network stream of the camera device is sent to the streaming media in the city. At this time, the client accessed in the city is of the private network type, and the private network stream is directly sent to the client at this time. At the same time, the streaming media in the city sends the private network stream to the media proxy service in the province. Through this media proxy service, the public network stream is forwarded to the client with a public network type access, thereby providing different streaming media access methods and out - flow methods, reducing traffic costs and reducing security risks.
[0100] In this embodiment, a live broadcast traffic scheduling device is also provided. This device is used to implement the above-mentioned embodiments and preferred implementation manners, and those that have been described will not be repeated here. The following terms "module", "unit", "sub-unit", etc. can be a combination of software and / or hardware that can achieve a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware is also possible and contemplated.
[0101] Figure 8 is a structural block diagram of the live broadcast traffic scheduling device of this embodiment. As Figure 8 shown, the device includes: a request response module 10, a streaming media determination module 20, and an address sending module 30.
[0102] The request response module 10 is configured to determine a first access path through which the camera device accesses in response to a connection request initiated by the camera device; and determine a second access path through which the client accesses in response to a live broadcast address acquisition request initiated by the client.
[0103] The streaming media determination module 20 is configured to determine a target streaming media according to the first access path and the second access path; the target streaming media includes the streaming media registered from the private network to the service platform.
[0104] The address sending module 30 is configured to determine a target live broadcast address according to the target streaming media, and return the target live broadcast address to the client, so that the client can obtain the video stream of the camera device according to the target live broadcast address.
[0105] It should be noted that the above-mentioned each module can be a functional module or a program module, and can be implemented either by software or by hardware. For the modules implemented by hardware, the above-mentioned each module can be located in the same processor; or the above-mentioned each module can also be located in different processors in any combined form.
[0106] In this embodiment, an electronic device is also provided, including a memory and a processor. A computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0107] Optionally, the above-mentioned electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the above-mentioned processor, and the input / output device is connected to the above-mentioned processor.
[0108] Optionally, in this embodiment, the above-mentioned processor may be configured to execute the following steps through the computer program:
[0109] S1, in response to a connection request initiated by the camera device, determine a first access path through which the camera device accesses.
[0110] S2. In response to a live broadcast address acquisition request initiated by a client, determine a second access path to which the client is connected.
[0111] S3. Determine a target streaming media according to the first access path and the second access path; the target streaming media includes the streaming media registered from a private network to a service platform.
[0112] S4. Determine a target live broadcast address according to the target streaming media, and return the target live broadcast address to the client, so that the client can obtain the video stream of a camera device according to the target live broadcast address.
[0113] It should be noted that specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and will not be elaborated in this embodiment.
[0114] In addition, in combination with the live broadcast traffic scheduling method provided in the above embodiments, a storage medium can also be provided in this embodiment to implement it. A computer program is stored on the storage medium; when the computer program is executed by a processor, any one of the live broadcast traffic scheduling methods in the above embodiments is implemented.
[0115] It should be understood that the specific embodiments described here are only used to explain this application, rather than to limit it. According to the embodiments provided in this application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of this application.
[0116] Obviously, the drawings are only some examples or embodiments of this application. For those of ordinary skill in the art, this application can also be applied to other similar situations according to these drawings, but no creative work is required. In addition, it can be understood that although the work done during the development process here may be complex and time-consuming, for those of ordinary skill in the art, certain design, manufacturing, or production changes based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient disclosure of this application.
[0117] The term "embodiment" in this application means that the specific features, structures, or characteristics described in combination with the embodiment may be included in at least one embodiment of this application. The phrase appears in various positions in the specification does not necessarily mean the same embodiment, nor does it mean being independent or alternative to other embodiments and mutually exclusive. Those of ordinary skill in the art can clearly or implicitly understand that the embodiments described in this application can be combined with other embodiments without conflict.
[0118] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the scope of patent protection. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A live broadcast traffic scheduling method, characterized in that: Applied to a business platform, the business platform is connected to a client and a camera device respectively; the method comprises: In response to a connection request initiated by a camera device, determining a first access path for accessing the camera device; In response to a live broadcast address acquisition request initiated by a client, determining a second access path accessed by the client; Determine the target streaming media according to the first access path and the second access path; the target streaming media includes streaming media registered from a private network to a service platform; Determine a target live broadcast address according to the target streaming media, and return the target live broadcast address to the client, so that the client obtains the video stream of the camera device according to the target live broadcast address; Among them, determining the target streaming media according to the first access path and the second access path, determining the target live broadcast address according to the target streaming media, and returning the target live broadcast address to the client includes: when the first access path is a private network access and the second access path is a public network access, sending a first streaming media address to the camera device; the first streaming media address includes a streaming media address supported by the private network; receiving a first login success signal sent by the camera device; the first login success signal indicates that the camera device logs in to the first private network streaming media through the first streaming media address; the first private network streaming media includes a private network streaming media instance; determining the first public network streaming media according to the public network accessed by the client; the load of the first public network streaming media reaches a preset condition; determining the target streaming media according to the first private network streaming media and the first public network streaming media; determining the target live broadcast address according to the target streaming media, and returning the target live broadcast address to the client; Among them, the first public network streaming media is determined according to the public network accessed by the client; the load of the first public network streaming media reaches a preset condition; the target streaming media is determined according to the first private network streaming media and the first public network streaming media; the target live broadcast address is determined according to the target streaming media, and the target live broadcast address is returned to the client, including: respectively taking the public network streaming media instance and the private network streaming media instance with the smallest load from the streaming media instances accessed by the private network and the public network; determining the target streaming media according to the public network streaming media instance and the private network streaming media instance with the smallest load, combining them to obtain the back-to-source live broadcast address, and returning the back-to-source live broadcast address to the client through the private network proxy gateway; When the first access path and the second access path are both public network access, the second public network streaming media is taken from the streaming media instance of the public and private network access, and the second streaming media address is sent to the camera device; the second streaming media address includes the streaming media addresses supported by both the public network and the private network; the second login success signal sent by the camera device is received; the second login success signal indicates that the camera device logs in to the second public network streaming media through the second streaming media address, groups the public network live broadcast address according to the second public network streaming media, and sends the public network live broadcast address to the client; when the first access path and the second access path are both private network access, the second private network streaming media is taken from the streaming media instance of the private network access, and the third streaming media address is sent to the camera device; the third streaming media address includes the streaming media addresses supported by the private network; the third login success signal sent by the camera device is received; the third login success signal indicates that the camera device logs in to the second private network streaming media through the third streaming media address, groups the private network live broadcast address according to the second private network streaming media, and sends the private network live broadcast address to the client through the private network proxy gateway.
2. The live broadcast traffic scheduling method according to claim 1, characterized in that: The step of determining, in response to a connection request initiated by a camera device, a first access path for accessing the camera device comprises: In response to a connection request initiated by a camera device, a connection request message of the connection request is obtained; the connection request is initiated by the camera device and forwarded through a private network proxy gateway; Determine whether the connection request message carries a private network identifier; the private network identifier is extended by the private network proxy gateway on the connection request message; If it carries a private network identifier, it indicates that the first access path is private network access; if it does not carry a private network identifier, it indicates that the first access path is public network access.
3. The live broadcast traffic scheduling method according to claim 2, characterized in that: The determining of the second access path for the client to access comprises: In response to the live broadcast address acquisition request of the client, an address request message in the live broadcast address acquisition request is obtained; the live broadcast address acquisition request is initiated by the client and forwarded through the private network proxy gateway; Determine whether the address request message carries a private network identifier; the private network identifier is extended by the private network proxy gateway on the address request message; If the private network identifier is carried, the second access path is identified as private network access; if the private network identifier is not carried, the second access path is identified as public network access.
4. The live broadcast traffic scheduling method according to claim 1, characterized in that: After determining the target live broadcast address according to the target streaming media and returning the target live broadcast address to the client, the method further includes: According to the first access path and the second access path, a stream pulling strategy of the client and a stream pushing strategy of the camera device are determined.
5. A live broadcast traffic scheduling device, characterized in that: The device comprises: a request response module, a streaming media determination module and an address sending module; The request response module is used to determine a first access path for accessing the camera device in response to a connection request initiated by the camera device; and to determine a second access path for accessing the client in response to a live broadcast address acquisition request initiated by the client; The streaming media determination module is used to determine the target streaming media according to the first access path and the second access path; the target streaming media includes the streaming media registered from the private network to the service platform; The address sending module is used to determine the target live broadcast address according to the target streaming media, and return the target live broadcast address to the client, so that the client can obtain the video stream of the camera device according to the target live broadcast address; it is also used to send a first streaming media address to the camera device when the first access path is a private network access and the second access path is a public network access; the first streaming media address includes a streaming media address supported by the private network; receive a first login success signal sent by the camera device; the first login success signal indicates that the camera device logs in to the first private network streaming media through the first streaming media address; the first private network streaming media includes a private network streaming media instance; according to the The first public network streaming media is determined according to the public network accessed by the client; the load of the first public network streaming media reaches a preset condition; the target streaming media is determined according to the first private network streaming media and the first public network streaming media; the target live broadcast address is determined according to the target streaming media, and the target live broadcast address is returned to the client; wherein, the first public network streaming media is determined according to the public network accessed by the client; the load of the first public network streaming media reaches a preset condition; the target streaming media is determined according to the first private network streaming media and the first public network streaming media; the target live broadcast address is determined according to the target streaming media, and the target live broadcast address is returned to the client, including: respectively accessing the private network and the public network The method comprises the steps of: taking the public network streaming media instance and the private network streaming media instance with the smallest load from the streaming media instances input; determining the target streaming media according to the public network streaming media instance and the private network streaming media instance with the smallest load, combining them to obtain the back-to-source live broadcast address, and returning the back-to-source live broadcast address to the client through the private network proxy gateway; when the first access path and the second access path are both public network access, taking the second public network streaming media from the streaming media instance accessed by the public and private networks, and sending the second streaming media address to the camera device; the second streaming media address includes the streaming media address supported by both the public network and the private network; receiving the second login success signal sent by the camera device; the second login success signal indicates that the camera device has logged in through the The method comprises the following steps: logging in to the second public network streaming media through the second streaming media address, grouping the public network live broadcast address according to the second public network streaming media, and sending the public network live broadcast address to the client; when the first access path and the second access path are both private network access, taking the second private network streaming media from the streaming media instance of the private network access, and sending the third streaming media address to the camera device; the third streaming media address includes the streaming media addresses supported by the private network; receiving the third login success signal sent by the camera device; the third login success signal indicates that the camera device logs in to the second private network streaming media through the third streaming media address, groups the private network live broadcast address according to the second private network streaming media, and sends the private network live broadcast address to the client through the private network proxy gateway.
6. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the live broadcast traffic scheduling method according to any one of claims 1 to 4.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the live broadcast traffic scheduling method described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Method and system for acquiring network video
CN104683736A
Data transmission method and device
CN105978926A
5G message access method and system of private network chat robot Chatboot
CN118842777A