Data transmission method and apparatus, electronic device, and computer-readable storage medium
By forwarding call requests and synchronizing media streams via dedicated lines between control nodes, the problem of excessive load on the central node in high-concurrency scenarios is solved, achieving decentralized media stream transmission, utilizing edge device resources, and improving user experience and scalability.
Patent Information
- Application Number
- CN202210958380.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-09
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2042-08-09
AI Technical Summary
In high-concurrency scenarios, existing real-time media streaming solutions often result in excessive load on the central node, making it unable to effectively distribute the load pressure, leading to poor scalability and a poor user experience.
By forwarding call requests between control nodes and allocating flow nodes to achieve a decentralized architecture, edge device resources are utilized to reduce the load pressure on central nodes.
It effectively distributes the load pressure in high-concurrency scenarios, improves system scalability and user experience, and makes full use of edge device resources.
Smart Images

Figure CN117640638B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data transmission technology, and in particular to data transmission methods, apparatus, electronic devices, and computer-readable storage media. Background Technology
[0002] Common real-time media streaming solutions typically use a cloud service platform as the central node and a Content Delivery Network (CDN) as the edge caching node. The streaming device collects media stream data and pushes it to the cloud service platform. User devices can directly pull the real-time media stream from the cloud service platform or pull the cached media stream data through the CDN for front-end display.
[0003] In high-concurrency scenarios, all performance pressure is borne by the cloud service platform. There is currently no solution in existing technology for how to meet the needs of massive device concurrency. Summary of the Invention
[0004] In view of this, the main objective of the embodiments of this application is to provide a data transmission method, apparatus, electronic device and computer-readable storage medium to solve the problem of excessive load on the central node in high-concurrency scenarios of real-time transmission of media streams in related technologies.
[0005] To achieve the above objectives, the technical solution of this application embodiment is implemented as follows:
[0006] This application provides a data transmission method applied to a first control node, the method comprising:
[0007] Receives a first call request from a first device; the first call request is used to request the retrieval of a first media stream; the first control node represents the control node to which the first device is connected.
[0008] The first call request is forwarded to the second control node, so that the second control node instructs the second device to push the first media stream; the second control node represents the control node to which the second device collecting the first media stream is connected.
[0009] Return a first address to the first device so that the first device can retrieve the first media stream collected by the second device from the first address.
[0010] In the above scheme, the first address represents the address of the first flow node, wherein the first flow node represents the flow node connected to the first control node.
[0011] In the above scheme, after forwarding the first call request to the second control node, the method further includes:
[0012] The second control node receives a second address returned by the second control node based on the first call request; the second address represents the address of the second stream node accessing the second control node; the second control node instructs the second device to push the first media stream to the second stream node;
[0013] After returning the first address to the first device, the method further includes:
[0014] The first streaming node is controlled to synchronize the first media stream from the second address via a dedicated line.
[0015] In the above scheme, returning the first address to the first device includes:
[0016] Return the address of the first stream node that meets the first set condition to the first device; wherein,
[0017] The first setting condition includes at least one of the following:
[0018] The first device and the first stream node are located in the same region;
[0019] The first stream node is the stream node with the smallest distance to the first device;
[0020] The first flow node is the flow node with the smallest load among the flow nodes connected to the first control node.
[0021] In the above scheme, the first address represents the address of the second device; before returning the first address to the first device, the method further includes:
[0022] Receive the address of the second device returned by the second control node based on the first call request.
[0023] In the above scheme, before receiving the first user call request from the first device, the method further includes:
[0024] When a second preset condition is met, the first device is connected, wherein the second preset condition includes at least one of the following:
[0025] The first device and the first control node are located in the same area;
[0026] The first control node is the control node with the smallest distance from the first device;
[0027] The first control node is the control node with the smallest load among the control nodes that the first device can access.
[0028] This application embodiment also provides a data transmission method applied to a second control node, the method comprising:
[0029] Receives a first call request forwarded by a first control node; the first control node represents the control node accessed by the first device that initiated the first call request; the first call request is used to request the retrieval of a first media stream;
[0030] The second device is instructed to push the first media stream; the second device represents a device that is connected to the second control node and collects the first media stream.
[0031] In the above scheme, instructing the second device to push the first media stream includes:
[0032] The second device is instructed to push the first media stream to the second stream node; the second stream node represents a stream node connected to the second control node;
[0033] The method further includes:
[0034] The first control node returns a second address; the second address represents the address of the second stream node, so that the first control node controls the first stream node to synchronize the first media stream from the second address via a dedicated line; the first stream node represents the stream node connected to the first control node.
[0035] In the above scheme, instructing the second device to push the first media stream to the second stream node includes:
[0036] The second device is instructed to push the first media stream to the second stream node that meets the third set condition; wherein,
[0037] The third setting condition includes at least one of the following:
[0038] The second device and the second stream node are located in the same area;
[0039] The second stream node is the stream node with the smallest distance to the second device;
[0040] The second flow node is the flow node with the smallest load among the flow nodes connected to the second control node.
[0041] The method in the above scheme further includes:
[0042] The first address is returned to the first control node; the first address represents the address of the second device, so that the first control node instructs the first device to pull the first media stream from the first address.
[0043] In the above scheme, before receiving the first call request forwarded by the first control node, the method further includes:
[0044] When a fourth preset condition is met, the second device is connected, wherein the fourth preset condition includes at least one of the following:
[0045] The second device and the second control node are located in the same area;
[0046] The second control node is the control node with the smallest distance from the second device;
[0047] The second control node is the control node with the smallest load among the control nodes that the second device can access.
[0048] This application embodiment also provides a data transmission device, the device comprising:
[0049] The request receiving module is used to receive a first call request from the first device; the first call request is used to request the retrieval of a first media stream; the first control node represents the control node accessed by the first device;
[0050] The request forwarding module is used to forward the first call request to the second control node, so that the second control node instructs the second device to push the first media stream; the second control node represents the control node accessed by the second device that collects the first media stream.
[0051] The result return module is used to return a first address to the first device so that the first device can retrieve the first media stream collected by the second device from the first address.
[0052] This application embodiment also provides a data transmission device, the device comprising:
[0053] The request transfer module is used to receive a first call request forwarded by a first control node; the first control node represents the control node accessed by the first device that initiated the first call request; the first call request is used to request the retrieval of a first media stream;
[0054] The control module instructs the second device to push the first media stream; the second device represents a device that is connected to the second control node and collects the first media stream.
[0055] This application also provides a data transmission device, including:
[0056] Memory, used to store executable instructions;
[0057] The processor, when executing executable instructions stored in the memory, implements the data transmission method provided in the embodiments of this application.
[0058] This application also provides a computer-readable storage medium storing executable instructions for implementing the data transmission method provided in this application when executed by a processor.
[0059] The embodiments of this application have the following beneficial effects:
[0060] The first control node receives a first call request from the first device, which requests to retrieve a first media stream. The first control node represents the control node to which the first device is connected, and forwards the first call request to a second control node, enabling the second control node to push the first media stream to the second device. The second control node represents the control node to which the second device collecting the first media stream is connected. This provides control nodes for both the first and second devices, decoupling the control plane from the data plane and providing a decentralized architecture. Based on this scheme, the first device can retrieve the first media stream collected by the second device through a first address returned by the first control node, thus reducing the load pressure in high-concurrency scenarios. Attached Figure Description
[0061] Figure 1 A schematic diagram illustrating the implementation flow of the data transmission method provided in this application embodiment;
[0062] Figure 2 This is a data transmission network structure diagram provided in the embodiments of this application;
[0063] Figure 3 A schematic diagram of the data transmission network provided in the embodiments of this application;
[0064] Figure 4 A schematic diagram illustrating the implementation flow of another data transmission method provided in this application embodiment;
[0065] Figure 5 A schematic diagram of a data transmission apparatus provided in an embodiment of this application;
[0066] Figure 6 A schematic diagram of another data transmission device provided in the embodiments of this application;
[0067] Figure 7 This is a schematic diagram of the hardware structure of the electronic device according to an embodiment of this application. Detailed Implementation
[0068] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0069] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0070] It should be noted that the technical solutions described in the embodiments of this application can be combined arbitrarily without conflict.
[0071] Furthermore, in the embodiments of this application, the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. The term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the term "at least one" indicates any combination of at least two of any one or more of a plurality of objects. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0073] Before providing a further detailed description of the embodiments of this application, the nouns and terms involved in the embodiments of this application will be explained, and the nouns and terms involved in the embodiments of this application shall be interpreted as follows.
[0074] 1) Streaming refers to the process by which streaming devices transmit the first media stream, which has been packaged during the acquisition phase, to the server.
[0075] 2) Pulling refers to the process by which a pulling device pulls an existing first media stream using a specified address.
[0076] 3) Media nodes, including control nodes and streaming nodes. The main functions of the control node include: device and streaming node management, call holding, call link establishment, control command forwarding, and allocation of push and pull streaming nodes; the main functions of the streaming node include media stream data leased line synchronization, device push and pull streaming, and streaming data processing.
[0077] Among related technologies, mainstream solutions for real-time media streaming mostly rely on cloud service platforms as their core, which has the following technical drawbacks:
[0078] The data plane and control plane are coupled. For high-concurrency scenarios, the content delivery network is usually used as a cache to provide live streaming capabilities. However, it has poor scalability for real-time streaming communication, making it difficult to achieve on-demand expansion and access from the nearest location.
[0079] The user side and video capture equipment are strongly correlated with the cloud platform. Equipment access and user equipment binding are heavily dependent on the platform. Different manufacturers' equipment need to be connected to different platforms, resulting in high user costs.
[0080] With the cloud service platform as the core, all performance pressure is borne by the cloud service platform, which fails to fully utilize edge device resources and cannot meet the needs of massive device concurrency scenarios.
[0081] This application aims to address the problems of centralization, poor scalability, strong dependence on cloud platforms, poor user experience, and poor utilization of edge resources.
[0082] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.
[0083] Figure 1 This is a schematic diagram illustrating the implementation flow of the data transmission method provided in the embodiments of this application, applied to the first control node, such as... Figure 1 As shown, the method includes:
[0084] Step 101: Receive a first call request from the first device; the first call request is used to request to pull a first media stream; the first control node represents the control node to which the first device is connected.
[0085] Here, the first device connects to the first control node. The first device can be a streaming device. The streaming device provided in this embodiment can be implemented as various types of streaming devices such as laptops, tablets, desktop computers, set-top boxes, and mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices). The first control node receives a first call request from the streaming device to request the retrieval of the first media stream.
[0086] Step 102: Forward the first call request to the second control node so that the second control node instructs the second device to push the first media stream; the second control node represents the control node accessed by the second device that collects the first media stream.
[0087] Here, the first control node forwards the first call request to the second control node. The first and second control nodes can be two control nodes located in the same area or two control nodes located in different areas. The second device can be a streaming device. The streaming device provided in this embodiment can be implemented as various types of streaming devices such as laptops, tablets, desktop computers, set-top boxes, and mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices). After receiving the first call request, the second control node instructs the streaming device connected to the second control node to push the first media stream collected by the streaming device.
[0088] Step 103: Return the first address to the first device so that the first device can retrieve the first media stream collected by the second device from the first address.
[0089] Here, the first address returned by the first control node to the streaming device can be sent by the second control node to the first control node, or the first address can be assigned by the first control node and not sent by the second control node. The streaming device can stream the first media through the first address.
[0090] Figure 2 The data transmission network structure diagram provided in the embodiments of this application is as follows: Figure 2 As shown:
[0091] The control plane of media node 401 includes control nodes 4101 and 4102, and the data plane includes stream nodes 4201, 4202, 4203, 4204, and switch 4301. The control plane of media node 402 includes control nodes 4103 and 4104, and the data plane includes stream nodes 4205, 4206, 4207, 4208, and switch 4302. Either control node 4101 or control node 4102 in media node 401 is the control node accessed by the streaming device 100. First, the corresponding accessed control node 4101 or control node 4102 of the streaming device 100 receives data from the streaming device 100. The first call request is used to request the retrieval of the first media stream. Either control node 4103 or control node 4104 in media node 402 is a control node accessed by the streaming device 200. Next, control node 4101 or control node 4102 accessed by the streaming device 100 forwards the first call request to control node 4103 or control node 4104 accessed by the streaming device 200. Control node 4103 or control node 4104 instructs the streaming device 200 to push the first media stream. Finally, control node 4101 or control node 4102 returns a first address to the streaming device 100, which can then retrieve the first media stream collected by the streaming device through the first address.
[0092] In some embodiments, prior to receiving the first user call request from the first device, the method further includes:
[0093] Step 201: When a second preset condition is met, connect the first device, wherein the second preset condition includes at least one of the following:
[0094] The first device and the first control node are located in the same area;
[0095] The first control node is the control node with the smallest distance from the first device;
[0096] The first control node is the control node with the smallest load among the control nodes that the first device can access.
[0097] Here, before receiving the first call request sent by the streaming device, the streaming device needs to be connected to the first control node. When connecting the streaming device to the first control node, the first control node must meet at least one of the following conditions:
[0098] The flow extraction equipment is located in the same area as the first control node;
[0099] The first control node is the control node with the smallest distance from the flow extraction device;
[0100] The first control node is the control node with the smallest load among the control nodes that can be connected to the pull flow device.
[0101] When the first control node meets all three conditions, it is the optimal first control node. When the streaming device connects to the first control node, it can either connect to the optimal first control node first, or connect to any control node first and then redirect to the optimal first control node.
[0102] In some embodiments, the first address returned to the first device may be the address of the stream node connected to the first control node or the address of the streaming device. The two cases are applicable to different streaming scenarios, and the embodiments of this application will be described in conjunction with specific scenarios.
[0103] Scenario 1: Live streaming scenario.
[0104] In some embodiments, a streamer broadcasts live in region A (i.e., via a push streaming device), while viewer b or viewer group b' watches in region B (i.e., via a pull streaming device), and viewer c or viewer group c' watches in region C (i.e., via a pull streaming device).
[0105] As an example of a live streaming scenario, the first address represents the address of the first stream node (pulling node), wherein the first stream node represents the stream node that is connected to the first control node.
[0106] In some embodiments, after forwarding the first call request to the second control node, the method further includes:
[0107] Step 301: Receive the second address returned by the second control node based on the first call request; the second address represents the address of the second stream node accessing the second control node; the second control node instructs the second device to push the first media stream to the second stream node;
[0108] Here, in order to push the first media stream to the streaming node in at least one region (region A and / or region B) to achieve "one-to-many" transmission, the second control node needs to first assign the second streaming node as the streaming node to the access streaming device, so that the streaming device pushes the first media stream to the streaming node, and then return the address of the streaming node (i.e. the second address) to the first control node.
[0109] In some embodiments, the media node consisting of the first control node and the streaming node can be located in region A, while another set of media nodes can be deployed in region B to achieve simultaneous streaming in different regions.
[0110] After returning the first address to the first device, the method further includes:
[0111] Step 401: Control the first streaming node to synchronize the first media stream from the second address via a dedicated line.
[0112] Here, the first control node controls the pull node to synchronize the first media stream from the address of the push node via a dedicated line, thereby achieving synchronization of the first media stream between the push node and the pull node. This allows the pull device to pull the first media stream from the pull node in real time via the address of the pull node. Furthermore, since the synchronization between the pull node and the push node is achieved via a dedicated line, secure and efficient transmission can be realized.
[0113] The above method assigns a push node to each push device and a pull node to each pull device, enabling the push device to push the first media stream to the corresponding pull node and synchronize the first media stream to the push node via a dedicated line. This allows the pull device to pull the first media stream through the pull node. Since the transmission between the first media streams is carried out by the corresponding push and pull nodes, there is no central node, which can alleviate the load pressure under high concurrency.
[0114] In some embodiments, returning the first address to the first device includes:
[0115] Step 1031: Return the address of the first stream node that meets the first set condition to the first device; wherein,
[0116] The first setting condition includes at least one of the following:
[0117] The first device and the first stream node are located in the same region;
[0118] The first stream node is the stream node with the smallest distance to the first device;
[0119] The first flow node is the flow node with the smallest load among the flow nodes connected to the first control node.
[0120] Here, the address of the pull node returned by the first control node to the pull device is used to allocate a stream node as the pull node before synchronizing the first media stream from the push node. When allocating the stream node, at least one of the following conditions is considered:
[0121] The flow extraction equipment and flow extraction nodes are located in the same area;
[0122] The pull node is the flow node with the smallest distance from the pull device;
[0123] The pull node is the stream node with the lowest load among the stream nodes connected to the first control node.
[0124] When a streaming node meets all three conditions, it is the optimal streaming node. When the first control node allocates a streaming node as a streaming node, it will give priority to allocating the optimal streaming node.
[0125] Figure 3 The data transmission network schematic diagram provided in the embodiments of this application is as follows: Figure 3 As shown:
[0126] The media node consisting of control node 4401, stream nodes 4402 and 4403 is located in region B; the media node consisting of control node 4501, stream nodes 4502 and 4503 is located in region C; and the media node consisting of control node 4601, stream nodes 4602 and 4603 is located in region A. The streaming device 1001 is located in region B, the streaming device 1002 is located in region C, and the streaming device 200 is located in region A.
[0127] A streamer is broadcasting live in region A. Viewer b or viewer group b' is watching the live stream in region B through streaming device 1001, and viewer c or viewer group c' is watching the live stream in region C through streaming device 1002. At this time, the streaming device 1001 located in region B first connects to the optimal first control node (i.e., control node 4401) and sends a first call request to control node 4401. Control node 4401 receives the first call request, assigns a stream node 4402 that meets the first set conditions as a streaming node to the streaming device 1001, and forwards the first call request to the second control node (i.e., control node 4601) to which the streaming device 200 is connected. Control node 4601 instructs the streaming device 200 to push the first media stream to the stream node 4602 connected to control node 4601. After that, the stream node 4402 synchronizes the first media stream to the stream node 4602 via a dedicated line. Control node 4401 returns the address of the stream node 4402 to the streaming device, and the streaming device 1001 can pull the first media stream through the address of the stream node 4402.
[0128] For the streaming device 1002 located in region C, it first connects to the optimal first control node (i.e., control node 4501) and sends a first call request to control node 4501. Control node 4501 receives the first call request, assigns a stream node 4502 that meets the first set conditions as a streaming node for the streaming device 1002, and forwards the first call request to the second control node (i.e., control node 4601) connected to the streaming device 200. Control node 4601 instructs the streaming device 200 to push the first media stream to the stream node 4602 connected to control node 4601. After that, the stream node 4502 synchronizes the first media stream to the stream node 4602 via a dedicated line. Control node 4501 returns the address of the stream node 4502 to the streaming device, and the streaming device 1002 can pull the first media stream through the address of the stream node 4502.
[0129] The above approach achieves decentralization of the cloud service platform, makes full use of edge device resources, and distributes the load pressure of each region to the edge devices of each region, thereby dispersing the load pressure and reducing the load pressure when multiple regions pull traffic simultaneously.
[0130] Scenario 2: Monitoring scenario.
[0131] In some embodiments, at least one monitoring device is deployed in region A. In this case, the monitoring device is also the streaming device. When the first media stream of any monitoring device is retrieved through the terminal (streaming device), since only the first media stream of the retrieved monitoring device is considered and other monitoring devices are not considered, it is necessary to perform "one-to-one" streaming for the target monitoring device.
[0132] As an example of a monitoring scenario, the first address represents the address of the second device (the streaming device).
[0133] In some embodiments, the first address represents the address of the second device; before returning the first address to the first device, the method further includes:
[0134] Step 501: Receive the address of the second device returned by the second control node based on the first call request.
[0135] Here, since the first call request is directed to a specific monitoring device (streaming device), and the requesting side is usually a single streaming device (e.g., a mobile phone or a computer), the transmission load on the first media stream is relatively low, and the requirements for connection efficiency are higher. Therefore, the second control node no longer allocates a second stream node for data transmission, but directly sends the address of the streaming device to the first control node. The first control node returns the address of the streaming device to the streaming device, and the streaming device can directly pull the first media stream from the streaming device based on the address of the streaming device.
[0136] See Figure 3 The streaming device 200 is one of several monitoring devices located in region A. The streaming device 1003 is located in region B. The streaming device 1003 first connects to the optimal first control node (i.e., control node 4401) and sends a first call request to control node 4401. Control node 4401 receives the first call request and forwards it to the second control node (i.e., control node 4601) to which the streaming device 200 is connected. Control node 4601 sends the address of the streaming device 200 to control node 4401. The streaming device 1003 can directly pull the first media stream through the address of the streaming device 200.
[0137] The above method provides a transmission approach for data transmission in scenarios with low load and high connection efficiency. Since the load is not high, the address of the push device can be directly provided to the pull device, allowing the pull device to directly pull the first media stream from the push device, thus improving connection efficiency. Furthermore, since the data transmission is "one-to-one", the low load means that directly pulling data from the pull device will not affect the smoothness of data transmission.
[0138] Figure 4 This is another schematic diagram of the data transmission method provided in the embodiments of this application, applied to the second control node, such as... Figure 4 As shown, the method includes:
[0139] Step 601: Receive a first call request forwarded by the first control node; the first control node represents the control node accessed by the first device that initiated the first call request; the first call request is used to request the retrieval of a first media stream;
[0140] Here, a first device is connected to a first control node. The first device can be a streaming device. The streaming device provided in this embodiment can be implemented as various types of streaming devices such as laptops, tablets, desktop computers, set-top boxes, and mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices). The first control node receives a first call request from the streaming device to request the retrieval of a first media stream and forwards the first call request to a second control node. The second control node receives the first call request forwarded by the first control node.
[0141] Step 602: Instruct the second device to push the first media stream; the second device represents a device that is connected to the second control node and collects the first media stream.
[0142] Here, after receiving the first call request forwarded by the first control node, the second control node instructs the streaming device connected to the second control node to push the first media stream.
[0143] See Figure 2 The control plane of media node 401 includes control nodes 4101 and 4102, and the data plane includes stream nodes 4201, 4202, 4203, 4204, and switch 4301. The control plane of media node 402 includes control nodes 4103 and 4104, and the data plane includes stream nodes 4205, 4206, 4207, 4208, and switch 4302. Either control node 4101 or control node 4102 in media node 401 is the control node accessed by the streaming device 100. First, the streaming device 100 receives data from the corresponding accessed control node 4101 or control node 4102. The first call request is used to request the pull of the first media stream; any one of the control nodes 4103 or 4104 in the media node 402 is a control node accessed by the streaming device 200. Next, the control node 4101 or 4102 accessed by the streaming device 100 forwards the first call request to the control node 4103 or 4104 accessed by the streaming device 200. The control node 4103 or 4104 instructs the streaming device 200 to push the first media stream. Finally, the control node 4101 or 4102 returns a first address to the streaming device 100, and the streaming device 100 can pull the first media stream collected by the streaming device through the first address.
[0144] In some embodiments, before receiving the first call request forwarded by the first control node, the method further includes:
[0145] Step 701: When the fourth preset condition is met, connect the second device, wherein the fourth preset condition includes at least one of the following:
[0146] The second device and the second control node are located in the same area;
[0147] The second control node is the control node with the smallest distance from the second device;
[0148] The second control node is the control node with the smallest load among the control nodes that the second device can access.
[0149] Here, before the second control node receives the first call request forwarded by the first control node, the streaming device needs to be connected to the second control node. When the streaming device is connected to the second control node, the second control node must meet at least one of the following conditions:
[0150] The propulsion device and the second control node are located in the same area;
[0151] The second control node is the control node with the smallest distance from the propulsion device;
[0152] The second control node is the control node with the smallest load among the control nodes that can be connected to the streaming device.
[0153] When a second control node meets all three conditions, it is the optimal second control node. When a streaming device connects to the second control node, it can either connect to the optimal second control node first, or connect to any control node first and then redirect to the optimal first control node.
[0154] In some embodiments, instructing the second device to push the first media stream may be instructing the second device to push the first media stream to a stream node accessing the second control node, or it may be instructing the second device to push the first media stream to the first device. This will be explained in conjunction with the above-described scenarios one and two.
[0155] As an example of a live streaming scenario, the second control node instructs the second device to push the first media stream to the streaming node that is connected to the second control node.
[0156] In some embodiments, instructing the second device to push the first media stream includes:
[0157] Step 6021: Instruct the second device to push the first media stream to the second stream node; the second stream node represents the stream node connected to the second control node;
[0158] The method further includes:
[0159] Step 801: Return a second address to the first control node; the second address represents the address of the second stream node, so that the first control node controls the first stream node to synchronize the first media stream from the second address via a dedicated line; the first stream node represents the stream node connected to the first control node.
[0160] Here, in order to push the first media stream to the streaming node in at least one region (region A and / or region B) to achieve "one-to-many" transmission, the second control node needs to first assign the second streaming node as the streaming node to the access streaming device, so that the streaming device pushes the first media stream to the streaming node, and then return the address of the streaming node (i.e. the second address) to the first control node. The media node composed of the first control node and the streaming node can be located in region A. At the same time, another set of media nodes can be deployed in region B to achieve simultaneous streaming in different regions.
[0161] The first control node controls the pull node to synchronize the first media stream from the address of the push node via a dedicated line, thereby achieving synchronization of the first media stream between the push node and the pull node. This allows the pull device to pull the first media stream from the pull node in real time via the address of the pull node. Furthermore, since the synchronization between the pull node and the push node is achieved via a dedicated line, secure and efficient transmission can be realized.
[0162] The above method assigns a push node to each push device and a pull node to each pull device, enabling the push device to push the first media stream to the corresponding pull node and synchronize the first media stream to the push node via a dedicated line. This allows the pull device to pull the first media stream through the pull node. Since the transmission between the first media streams is carried out by the corresponding push and pull nodes, there is no central node, which can alleviate the load pressure under high concurrency.
[0163] In some embodiments, instructing the second device to push the first media stream to the second streaming node includes:
[0164] Step 60211: Instruct the second device to push the first media stream to the second stream node that meets the third set condition; wherein,
[0165] The third setting condition includes at least one of the following:
[0166] The second device and the second stream node are located in the same area;
[0167] The second stream node is the stream node with the smallest distance to the second device;
[0168] The second flow node is the flow node with the smallest load among the flow nodes connected to the second control node.
[0169] Here, when the second control node instructs the streaming device to push the first media stream to the second streaming node, it needs to first determine the second streaming node (i.e., the streaming node). When determining the streaming node, at least one of the following conditions should be considered:
[0170] The flow propulsion equipment and the flow propulsion nodes are located in the same area;
[0171] The streaming node is the streaming node with the smallest distance from the streaming device;
[0172] The push node is the stream node with the smallest load among the stream nodes connected to the second control node.
[0173] When a streaming node meets all three conditions, it is the optimal streaming node. When the second control node allocates a streaming node as a streaming node, it will give priority to allocating the optimal streaming node.
[0174] See Figure 3 The media node consisting of control node 4401, stream nodes 4402 and 4403 is located in region B; the media node consisting of control node 4501, stream nodes 4502 and 4503 is located in region C; and the media node consisting of control node 4601, stream nodes 4602 and 4603 is located in region A. The streaming device 1001 is located in region B, the streaming device 1002 is located in region C, and the streaming device 200 is located in region A.
[0175] A streamer is broadcasting live in region A. Viewer b or viewer group b' is watching the live stream in region B through streaming device 1001, and viewer c or viewer group c' is watching the live stream in region C through streaming device 1002. At this time, the streaming device 1001 located in region B first connects to the optimal first control node (i.e., control node 4401) and sends a first call request to control node 4401. Control node 4401 receives the first call request, assigns a streaming node 4402 that meets the first set condition as a streaming node to the streaming device 1001, and forwards the first call request to the second control node (i.e., control node 4601) to which the streaming device 200 is connected. Control node 4601 assigns a streaming node 4602 that meets the third set condition as a streaming node to the streaming device 200. Then, control node 4601 instructs the streaming device 200 to push the first media stream to the streaming node 4602 connected to control node 4601. After that, the streaming node 4402 synchronizes the first media stream to the streaming node 4602 via a dedicated line. Control node 4401 returns the address of the streaming node 4402 to the streaming device, and the streaming device 1001 can pull the first media stream through the address of the streaming node 4402.
[0176] For the streaming device 1002 located in region C, it first connects to the optimal first control node (i.e., control node 4501) and sends a first call request to control node 4501. Control node 4501 receives the first call request, assigns a streaming node 4502 that meets the first set condition as a streaming node for the streaming device 1002, and forwards the first call request to the second control node (i.e., control node 4601) connected to the streaming device 200. Control node 4601 assigns a streaming node 4602 that meets the third set condition as a streaming node for the streaming device 200. Control node 4601 instructs the streaming device 200 to push the first media stream to the streaming node 4602 connected to control node 4601. After that, the streaming node 4502 synchronizes the first media stream to the streaming node 4602 via a dedicated line. Control node 4501 returns the address of the streaming node 4502 to the streaming device, and the streaming device 1002 can pull the first media stream through the address of the streaming node 4502.
[0177] The above approach achieves decentralization of the cloud service platform, makes full use of edge device resources, and distributes the load pressure of each region to the edge devices of each region, thereby dispersing the load pressure and reducing the load pressure when multiple regions pull traffic simultaneously.
[0178] Scenario 2: Monitoring scenario.
[0179] As an example of a monitoring scenario, the second control node instructs the second device to push the first media stream to the first device.
[0180] In some embodiments, the method further includes:
[0181] Step 901: Return a first address to the first control node; the first address represents the address of the second device, so that the first control node instructs the first device to pull the first media stream from the first address.
[0182] Here, since the first call request is directed to a specific monitoring device (streaming device), and the requesting side is usually a single streaming device (e.g., a mobile phone or a computer), the transmission load on the first media stream is relatively low, and the requirements for connection efficiency are higher. Therefore, the second control node no longer allocates a second stream node for data transmission, but directly sends the address of the streaming device to the first control node. The first control node returns the address of the streaming device to the streaming device, and the streaming device can directly pull the first media stream from the streaming device based on the address of the streaming device.
[0183] See Figure 3 The streaming device 200 is one of several monitoring devices located in region A. The streaming device 1003 is located in region B. The streaming device 1003 first connects to the optimal first control node (i.e., control node 4401) and sends a first call request to control node 4401. Control node 4401 receives the first call request and forwards it to the second control node (i.e., control node 4601) to which the streaming device 200 is connected. Control node 4601 sends the address of the streaming device 200 to control node 4401. The streaming device 1003 can directly pull the first media stream through the address of the streaming device 200.
[0184] The above method provides a transmission approach for data transmission in scenarios with low load and high connection efficiency. Since the load is not high, the address of the push device can be directly provided to the pull device, allowing the pull device to directly pull the first media stream from the push device, thus improving connection efficiency. Furthermore, since the data transmission is "one-to-one", the low load means that directly pulling data from the pull device will not affect the smoothness of data transmission.
[0185] In this application, a first control node receives a first call request from a first device, which requests to retrieve a first media stream. The first control node represents the control node to which the first device is connected, and forwards the first call request to a second control node, enabling the second control node to push the first media stream to the second device. The second control node represents the control node to which the second device collecting the first media stream is connected. This provides control nodes for both the first and second devices, decoupling the control plane from the data plane and providing a decentralized architecture. Based on this scheme, the first device can retrieve the first media stream collected by the second device through a first address returned by the first control node, thus reducing the load pressure in high-concurrency scenarios.
[0186] To implement the method of the embodiments of this application, the embodiments of this application also provide a data transmission device. Figure 5 A schematic diagram of the data transmission apparatus provided in the embodiments of this application is shown below. Figure 5 As shown, the device includes:
[0187] The request receiving module 510 receives a first call request from the first device; the first call request is used to request the retrieval of a first media stream; the first control node represents the control node accessed by the first device.
[0188] The request forwarding module 520 is used to forward the first call request to the second control node, so that the second control node instructs the second device to push the first media stream; the second control node represents the control node accessed by the second device that collects the first media stream.
[0189] The result return module 530 is used to return a first address to the first device so that the first device can retrieve the first media stream collected by the second device from the first address.
[0190] In one embodiment, the request receiving module 510 is further configured to receive a second address returned by the second control node based on the first call request; the second address represents the address of a second stream node accessing the second control node; and the second control node instructs the second device to push the first media stream to the second stream node.
[0191] In some embodiments, the result return module 530 is further configured to control the first streaming node to synchronize the first media stream from the second address via a dedicated line.
[0192] In some embodiments, the result return module 530 is further configured to return the address of the first stream node that satisfies the first set condition to the first device; wherein,
[0193] The first setting condition includes at least one of the following:
[0194] The first device and the first stream node are located in the same region;
[0195] The first stream node is the stream node with the smallest distance to the first device;
[0196] The first flow node is the flow node with the smallest load among the flow nodes connected to the first control node.
[0197] In some embodiments, the result return module 530 is further configured to receive the address of the second device returned by the second control node based on the first call request.
[0198] In some embodiments, the request receiving module 510 is further configured to access the first device when a second preset condition is met, wherein the second preset condition includes at least one of the following:
[0199] The first device and the first control node are located in the same area;
[0200] The first control node is the control node with the smallest distance from the first device;
[0201] The first control node is the control node with the smallest load among the control nodes that the first device can access.
[0202] This application also provides a data transmission device. Figure 6 A schematic diagram of another data transmission device provided in the embodiments of this application, such as... Figure 6 As shown, the device includes:
[0203] The request transfer module 610 is used to receive a first call request forwarded by a first control node; the first control node represents the control node accessed by the first device that initiated the first call request; the first call request is used to request the retrieval of a first media stream.
[0204] The control module 620 is used to instruct the second device to push the first media stream; the second device represents a device that is connected to the second control node and collects the first media stream.
[0205] In some embodiments, the control module 620 is further configured to instruct the second device to push the first media stream to a second stream node; the second stream node represents a stream node connected to the second control node.
[0206] In some embodiments, the request transfer module 610 is further configured to return a second address to the first control node; the second address represents the address of the second stream node, so that the first control node controls the first stream node to synchronize the first media stream from the second address via a dedicated line; the first stream node represents a stream node that has accessed the first control node.
[0207] In some embodiments, the control module 620 is further configured to instruct the second device to push the first media stream to the second stream node that meets a third preset condition; wherein,
[0208] The third setting condition includes at least one of the following:
[0209] The second device and the second stream node are located in the same area;
[0210] The second stream node is the stream node with the smallest distance to the second device;
[0211] The second flow node is the flow node with the smallest load among the flow nodes connected to the second control node.
[0212] In some embodiments, the request transfer module 610 is further configured to return a first address to the first control node; the first address represents the address of the second device, so that the first control node instructs the first device to pull the first media stream from the first address.
[0213] In some embodiments, the control module 620 is further configured to connect to the second device when a fourth preset condition is met, wherein the fourth preset condition includes at least one of the following:
[0214] The second device and the second control node are located in the same area;
[0215] The second control node is the control node with the smallest distance from the second device;
[0216] The second control node is the control node with the smallest load among the control nodes that the second device can access.
[0217] In practical applications, the request receiving module 510, request forwarding module 520, result returning module 530, request switching module 610, and control module 620 can be implemented by processors in the terminal, such as central processing units (CPUs), digital signal processors (DSPs), microcontroller units (MCUs), or field-programmable gate arrays (FPGAs).
[0218] It should be noted that the data transmission device provided in the above embodiments is only illustrated by the division of the above program modules when displaying information. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device can be divided into different program modules to complete all or part of the processing described above. In addition, the data transmission device and data transmission method embodiments provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.
[0219] Based on the hardware implementation of the above program modules, and in order to implement the method of the embodiments of this application, the embodiments of this application also provide an electronic device. Figure 7 This is a schematic diagram of the hardware composition structure of the electronic device provided in the embodiments of this application, such as... Figure 7 As shown, the electronic device includes:
[0220] The communication interface 701 enables information exchange with other devices, such as network devices.
[0221] The processor 702 is connected to the communication interface 701 to enable information interaction with other devices and, when running a computer program, executes one or more of the above-described technical solutions to provide data transmission methods. The computer program is stored in the memory 703.
[0222] Of course, in practical applications, the various components in an electronic device are coupled together through a bus system 704. It can be understood that the bus system 704 is used to realize the connection and communication between these components. In addition to a data bus, the bus system 704 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, in... Figure 7 The general designated all buses as Bus System 704.
[0223] The memory 703 in this embodiment is used to store various types of data to support the operation of the electronic device. Examples of such data include any computer program used to operate on the electronic device.
[0224] It is understood that memory 703 can be volatile memory or non-volatile memory, or both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), ferromagnetic random access memory (FRAM), flash memory, magnetic surface memory, optical disc, or compact disc read-only memory (CD-ROM); magnetic surface memory can be disk storage or magnetic tape storage. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), SyncLink Dynamic Random Access Memory (SLDRAM), and Direct Rambus Random Access Memory (DRRAM).The memory 803 described in the embodiments of this application is intended to include, but is not limited to, these and any other suitable types of memory.
[0225] The methods disclosed in the embodiments of this application can be applied to or implemented by processor 702. Processor 702 may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the hardware of processor 702 or by instructions in software form. Processor 702 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Processor 702 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in the embodiments of this application can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules may be located in a storage medium, specifically memory 703. Processor 702 reads the program from memory 703 and, in conjunction with its hardware, completes the steps of the aforementioned method.
[0226] When processor 702 executes the program, it implements the corresponding processes in the various methods of the embodiments of this application.
[0227] In an exemplary embodiment, this application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, such as a memory 703 storing a computer program, which can be executed by a processor 702 to complete the steps described in the aforementioned method. The computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0228] In the several embodiments provided in this application, it should be understood that the disclosed apparatus, terminal, and method can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0229] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0230] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0231] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0232] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0233] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data transmission method, characterized in that, Applied to the first control node, the method includes: Receives a first call request from a first device; the first call request is used to request the retrieval of a first media stream; the first control node represents the control node to which the first device is connected. The first call request is forwarded to the second control node, so that the second control node instructs the second device to push the first media stream; the second control node represents the control node accessed by the second device that collects the first media stream, and the first control node and the second control node belong to the control plane; The second control node receives a second address returned by the second control node based on the first call request; the second address represents the address of the second stream node accessing the second control node; the second control node instructs the second device to push the first media stream to the second stream node; The first address is returned to the first device so that the first device can pull the first media stream collected by the second device from the first address. The first address is represented as the address of the first stream node, wherein the first stream node represents the stream node connected to the first control node and the first stream node belongs to the data plane. The first streaming node is controlled to synchronize the first media stream from the second address via a dedicated line.
2. The method according to claim 1, characterized in that, The step of returning the first address to the first device includes: Return the address of the first stream node that meets the first set condition to the first device; wherein, The first setting condition includes at least one of the following: The first device and the first stream node are located in the same region; The first stream node is the stream node with the smallest distance to the first device; The first flow node is the flow node with the smallest load among the flow nodes connected to the first control node.
3. The method according to claim 1, characterized in that, Before receiving the first user call request from the first device, the method further includes: When a second preset condition is met, the first device is connected, wherein the second preset condition includes at least one of the following: The first device and the first control node are located in the same area; The first control node is the control node with the smallest distance from the first device; The first control node is the control node with the smallest load among the control nodes that the first device can access.
4. A data transmission method, characterized in that, Applied to a second control node, the method includes: Receives a first call request forwarded by a first control node; the first control node represents the control node accessed by the first device that initiated the first call request; the first call request is used to request the retrieval of a first media stream; The second device is instructed to push the first media stream to the second stream node; the second stream node represents a stream node connected to the second control node; the second device represents a device connected to the second control node and collecting the first media stream; the first control node and the second control node belong to the control plane. The first control node returns a second address; the second address represents the address of the second stream node, so that the first control node controls the first stream node to synchronize the first media stream from the second address via a dedicated line; the first stream node represents the stream node connected to the first control node. The first control node is used to return a first address to the first device so that the first device can pull the first media stream collected by the second device from the first address. The first address is represented as the address of a first stream node, wherein the first stream node represents a stream node connected to the first control node and belongs to the data plane.
5. The method according to claim 4, characterized in that, The instruction to the second device to push the first media stream to the second stream node includes: The second device is instructed to push the first media stream to the second stream node that meets the third set condition; wherein, The third setting condition includes at least one of the following: The second device and the second stream node are located in the same area; The second stream node is the stream node with the smallest distance to the second device; The second flow node is the flow node with the smallest load among the flow nodes connected to the second control node.
6. The method according to claim 4, characterized in that, Before receiving the first call request forwarded by the first control node, the method further includes: When a fourth preset condition is met, the second device is connected, wherein the fourth preset condition includes at least one of the following: The second device and the second control node are located in the same area; The second control node is the control node with the smallest distance from the second device; The second control node is the control node with the smallest load among the control nodes that the second device can access.
7. A data transmission device, characterized in that, The data transmission device is a first control node, and the device includes: The request receiving module is used to receive a first call request from the first device; the first call request is used to request the retrieval of a first media stream; the first control node represents the control node accessed by the first device; The request forwarding module is used to forward the first call request to the second control node, so that the second control node instructs the second device to push the first media stream; the second control node represents the control node accessed by the second device that collects the first media stream, and the first control node and the second control node belong to the control plane; The address receiving module is used to receive a second address returned by the second control node based on the first call request; the second address represents the address of the second stream node accessing the second control node; the second control node instructs the second device to push the first media stream to the second stream node; The result return module is used to return a first address to the first device so that the first device can pull the first media stream collected by the second device from the first address. The first address is characterized as the address of the first stream node, wherein the first stream node is characterized as the stream node connected to the first control node, and the first stream node belongs to the data plane. The first control module is used to control the first streaming node to synchronize the first media stream from the second address via a dedicated line.
8. A data transmission device, characterized in that, The data transmission device is a second control node, and the device includes: The request transfer module is used to receive a first call request forwarded by a first control node; the first control node represents the control node accessed by the first device that initiated the first call request; the first call request is used to request the retrieval of a first media stream; The second control module is used to instruct the second device to push the first media stream to the second stream node; the second stream node represents a stream node connected to the second control node; the second device represents a device connected to the second control node and collecting the first media stream; the first control node and the second control node belong to the control plane. The first address return module is used to return a second address to the first control node; the second address represents the address of the second stream node, so that the first control node controls the first stream node to synchronize the first media stream from the second address via a dedicated line; the first stream node represents the stream node that is connected to the first control node. The first control node is used to return a first address to the first device so that the first device can pull the first media stream collected by the second device from the first address. The first address is represented as the address of a first stream node, wherein the first stream node represents a stream node connected to the first control node and belongs to the data plane.
9. A data transmission device, characterized in that, The data transmission device includes: Memory, used to store executable instructions; The processor, when executing executable instructions stored in the memory, implements the data transmission method according to any one of claims 1 to 3, or implements the data transmission method according to any one of claims 4 to 6.
10. A computer-readable storage medium storing executable instructions, characterized in that, When the executable instructions are executed by the processor, they implement the data transmission method according to any one of claims 1 to 3, or the data transmission method according to any one of claims 4 to 6.
Citation Information
Patent Citations
Stream service node scheduling method and device, and scheduling node
CN108307198A
Video stream pushing method, device and equipment and storage medium
CN111726646A
