Device-side data transmission method and system based on WebRTC technology
By dynamically adjusting the data transmission rate at the WebRTC device end based on network bandwidth, round-trip time, congestion window size, and packet loss rate, the WebRTC network latency and stability issues are resolved, enabling flexible and efficient data transmission suitable for various network environments.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- 广域铭岛数字科技有限公司
- Filing Date
- 2023-09-26
- Publication Date
- 2026-06-23
AI Technical Summary
WebRTC suffers from high network latency, poor stability, and high packet loss rates in scenarios such as multi-party video calls and large-scale live streaming. Existing optimization solutions, such as cloud computing and algorithm control, lead to a waste of computing resources and network bandwidth, and cannot meet the needs of real-time communication.
A device-side data transmission method based on WebRTC is adopted. By acquiring the first rate algorithm and the second rate algorithm, the data transmission rate is determined according to network bandwidth, round-trip time, congestion window size and packet loss rate. An adaptive network protocol is established, and the network status is monitored and the transmission strategy is adjusted.
It fully utilizes network bandwidth during congested conditions, reduces data latency and error rates, improves data reliability during idle conditions, reduces costs, adapts to various network environments, and has strong compatibility and scalability.
Smart Images

Figure CN117041222B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data communication technology, and in particular to a device-side data transmission method and system based on WebRTC technology. Background Technology
[0002] WebRTC (Web Real-Time Communications) technology, as an open-source project, provides a standard API that allows web applications to directly provide real-time audio and video communication capabilities without the need for any plugins. The native communication process uses a P2P protocol, with data interacting directly between browsers, theoretically requiring no server-side involvement. WebRTC's mission is to provide browsers, mobile platforms, and IoT devices with a universal protocol for developing feature-rich, high-quality real-time audio and video applications. WebRTC has a wide range of applications, including online education, online healthcare, live streaming platforms, and interactive games. It is also used as a signaling server, ICE server (Interactive Connectivity Establishment server), or client in point-to-point real-time communication solutions. However, in practical WebRTC applications, when dealing with large-scale data transmissions such as multi-party video calls and large-scale live streaming, WebRTC network data transmission often suffers from high latency, poor stability, and high packet loss rates.
[0003] To address these issues, some enterprises have adopted cloud computing, distributed computing, and big data technologies to optimize and improve WebRTC communication. However, these solutions consume significant computing resources and network bandwidth, placing high demands on real-time communication costs and hardware. Furthermore, algorithms that rely on parameters such as packet loss rate and network bandwidth to control data transmission may suffer from inflexibility, leading to significant bandwidth waste and low data efficiency. Therefore, both of these optimization methods have shortcomings and offer limited improvement to WebRTC data communication, failing to meet users' data transmission needs during real-time communication. Summary of the Invention
[0004] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.
[0005] In view of the shortcomings of the prior art described above, the present invention discloses a device-side data transmission method and system based on WebRTC technology to improve the transmission effect of WebRTC during data transmission.
[0006] This invention provides a device-side data transmission method based on WebRTC technology, applied to a device. The method includes: acquiring a first rate algorithm and a second rate algorithm, wherein the first rate algorithm includes determining the data transmission rate based on network bandwidth and round-trip time, and the second rate algorithm includes determining the data transmission rate based on congestion window size and packet loss rate; establishing a communication network for data transmission between the device and an external communication terminal based on WebRTC technology, and establishing an adaptive network protocol corresponding to the communication network based on a first correspondence between the first rate algorithm and congestion state, and a second correspondence between the second rate algorithm and idle state; monitoring the current network state of the communication network, wherein the current network state includes the congestion state or the idle state; determining a target algorithm from the first rate algorithm and the second rate algorithm based on the current network state, and performing data transmission according to the target algorithm.
[0007] Optionally, the data transmission rate is determined based on network bandwidth and round-trip time delay by: obtaining the network bandwidth and round-trip time delay of the communication network; calculating the bandwidth-delay product based on the network bandwidth and the round-trip time delay; and adjusting the data transmission rate in real time based on the bandwidth-delay product, wherein the bandwidth-delay product and the data transmission rate are positively correlated.
[0008] Optionally, the data transmission rate is determined based on the congestion window size and packet loss rate in the following manner: The congestion window size and current packet loss rate of the communication network are obtained; the congestion window size is calculated according to a preset cubic function to obtain a window adjustment range, wherein the congestion window size and the window adjustment range are positively correlated; if the current packet loss rate is greater than or equal to a preset packet loss rate threshold, the window adjustment trend is determined to be decreasing, and if the current packet loss rate is less than the preset packet loss rate threshold, the window adjustment trend is determined to be increasing; a window adjustment ratio corresponding to the congestion window size is determined based on the window adjustment range and the window adjustment trend; the congestion window size is updated according to the window adjustment ratio to adjust the data transmission rate in real time based on the updated congestion window size.
[0009] Optionally, before establishing a communication network for data transmission between the device and an external communication terminal based on WebRTC technology, the method includes: obtaining connection count information between the device and the external communication terminal; if the connection count information indicates an initial connection, sending a connection request message carrying a device identifier to the external communication terminal, and after receiving a connection confirmation message from the external communication terminal, establishing a communication network for data transmission between the device and the external communication terminal based on WebRTC technology, wherein the external communication terminal is used to send a connection confirmation message based on the received connection request message and record the device identifier to obtain a backup identifier; if the connection count information indicates a reconnection, sending a connection request message carrying a device identifier to the external communication terminal, and establishing a communication network for data transmission between the device and the external communication terminal based on WebRTC technology, wherein the external communication terminal is also used to perform a consistency test between the received device identifier and the recorded backup identifier, and after the consistency test passes, allowing the device to establish the communication network.
[0010] Optionally, a communication network for data transmission between the device and an external communication terminal is established based on WebRTC technology, comprising: the device including multiple communication nodes; each of the communication nodes is designated as a first node, and internal communication links are established between the first nodes and multiple second nodes based on WebRTC technology, wherein each second node is a communication node other than the first node; multiple third nodes are determined from the communication nodes, and external communication links are established between the external communication terminal and each of the third nodes based on WebRTC technology; and a mesh network structure is formed based on the internal communication links and the external communication links.
[0011] Optionally, a communication node is obtained through the following method: obtaining hardware requirement information, wherein the hardware requirement information includes at least one of processing chip information, computing power information, memory information, network information, and interface information; generating hardware configuration information based on target hardware that meets the hardware requirement information; performing deployment design on the target hardware to obtain a node design scheme, and constructing a node to be tested according to the node design scheme; testing the node to be tested according to hardware testing rules to obtain test results, wherein the hardware testing rules are determined based on the hardware requirement information; if the test result of the node to be tested is a pass, then the node to be tested is determined as a communication node.
[0012] Optionally, data transmission is performed by: planning multiple communication paths between the communication node and the external communication terminal, wherein each communication path consists of a portion of the internal communication link and the external communication link; determining a primary path from each of the communication paths for data transmission; and determining a new primary path from each of the communication paths if the primary path is in a communication failure state.
[0013] Optionally, data transmission via the main path includes: establishing multiple sub-paths in the main path; transmitting data with the external communication terminal based on each of the sub-paths, wherein the external communication terminal is further configured to receive data packets sent by each of the sub-paths and determine target data from the data packets.
[0014] Optionally, the device end includes industrial equipment, the external communication end includes a server end and a user terminal, and the method further includes at least one of the following: monitoring the equipment operation data of the industrial equipment and sending the monitored equipment operation data to the server end in real time through the communication network, wherein the server end is used to generate an equipment monitoring report based on the received equipment operation data and send the equipment monitoring report to the user terminal, and the user terminal is used to determine the equipment operation status of the industrial equipment based on the equipment monitoring report; acquiring the equipment operation status of the industrial equipment, and if the equipment operation status is a fault status, collecting data from the industrial equipment to obtain equipment fault data, and sending the equipment fault data to the server end in real time through the communication network, wherein the server end is used to, upon receiving the equipment fault data, provide a fault repair instruction to the device end based on the equipment fault data, and / or notify maintenance personnel to perform repairs based on the equipment fault data; responding to the equipment maintenance instruction, sending the equipment operation data of the business equipment to the user terminal in real time through the communication network, wherein the user terminal is used to determine the maintenance status of the industrial equipment based on the received equipment operation data.
[0015] This invention provides a device-side data transmission system based on WebRTC technology, applied to a device. The system includes: an acquisition module for acquiring a first rate algorithm and a second rate algorithm, wherein the first rate algorithm includes determining the data transmission rate based on network bandwidth and round-trip time, and the second rate algorithm includes determining the data transmission rate based on congestion window size and packet loss rate; an establishment module for establishing a communication network for data transmission between the device and an external communication terminal based on WebRTC technology, and establishing an adaptive network protocol corresponding to the communication network based on a first correspondence between the first rate algorithm and congestion state, and a second correspondence between the second rate algorithm and idle state; a detection module for monitoring the current network state of the communication network, wherein the current network state includes the congestion state or the idle state; and a transmission module for determining a target algorithm from the first rate algorithm and the second rate algorithm based on the current network state, and performing data transmission according to the target algorithm.
[0016] The beneficial effects of this invention are:
[0017] By establishing a communication network through WebRTC and developing a corresponding adaptive network protocol, the data transmission rate is determined based on network bandwidth and round-trip time when the network is congested, and based on the congestion window size and packet loss rate when the network is idle. This approach not only determines the data transmission rate based on network bandwidth and round-trip time (reflecting the network's data capacity) in congested conditions, rather than relying solely on packet loss rate, thus fully utilizing network bandwidth and improving data preemption capabilities, but also reduces data error rates and improves data transmission reliability in idle conditions by controlling the data transmission rate with the congestion window size and packet loss rate. This eliminates the need for technologies like cloud computing, distributed computing, and big data, which increase communication costs, thereby enhancing the flexibility of WebRTC data transmission and significantly improving data transmission performance. Furthermore, the adaptive network protocol in this method is independent of specific hardware or software platforms, offering greater compatibility and scalability, and can be widely applied to various network environments and devices. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the structure of an application environment for deploying a device-side data transmission method based on WebRTC technology in an embodiment of the present invention;
[0019] Figure 2 This is a flowchart illustrating a device-side data transmission method based on WebRTC technology in an embodiment of the present invention.
[0020] Figure 3This is a schematic diagram of a communication network structure based on a mesh network in an embodiment of the present invention;
[0021] Figure 4 This is a flowchart illustrating another device-side data transmission method based on WebRTC technology in an embodiment of the present invention;
[0022] Figure 5 This is a flowchart illustrating another device-side data transmission method based on WebRTC technology in an embodiment of the present invention;
[0023] Figure 6 This is a flowchart illustrating another device-side data transmission method based on WebRTC technology in an embodiment of the present invention;
[0024] Figure 7 This is a flowchart illustrating another device-side data transmission method based on WebRTC technology in an embodiment of the present invention;
[0025] Figure 8 This is a schematic diagram of the structure of a device-side data transmission system based on WebRTC technology in an embodiment of the present invention. Detailed Implementation
[0026] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and sub-samples in the embodiments can be combined with each other.
[0027] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0028] In the following description, numerous details are explored to provide a more thorough explanation of embodiments of the invention. However, it will be apparent to those skilled in the art that embodiments of the invention may be practiced without these specific details. In other embodiments, well-known structures and devices are shown in block diagram form rather than in detail to avoid obscuring embodiments of the invention.
[0029] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this disclosure described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion.
[0030] Unless otherwise stated, the term "multiple" means two or more.
[0031] In this embodiment of the disclosure, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.
[0032] The term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.
[0033] Before providing a further detailed description of the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention will be explained, and the nouns and terms involved in the embodiments of the present invention shall be interpreted as follows.
[0034] Network bandwidth refers to the amount of data that can be transmitted per unit of time (usually 1 second). Similar to the number of lanes on a highway, the larger the network bandwidth, the stronger its throughput capacity, and the greater the amount of data that can be processed and transmitted simultaneously.
[0035] Round-Trip Time (RTT) refers to the total time elapsed from when the sender starts sending data until the sender receives an acknowledgment from the receiver (the acknowledgment is sent immediately after the data is received). It is an important performance metric in computer networks.
[0036] Packet loss rate refers to the ratio of unreceived data packets to the total number of data packets sent per unit of time. It is a key indicator of network quality and should generally not exceed 2%, otherwise it may cause noticeable network lag. During data transmission, an excessively high packet loss rate will reduce data transmission efficiency, increase data error rate, and in severe cases, may even lead to communication interruption. The packet loss rate depends on several factors, including network conditions, data packet length, and packet transmission frequency.
[0037] The congestion window size (CWND) refers to the maximum window size that the sender can control for data transmission in a TCP / IP network. When network congestion occurs, the sender reduces its congestion window size to alleviate the congestion. Conversely, when network conditions improve, the sender gradually increases the congestion window size to fully utilize network bandwidth.
[0038] Combination Figure 1 As shown, this disclosure provides an application environment for implementing a device-side data transmission method based on WebRTC technology, including a device and an external communication terminal, wherein data transmission between the device and the external communication terminal is performed through a WebRTC communication network.
[0039] The device side includes industrial equipment and communication nodes. The device side is used to execute user instructions, which include at least one of the following: acquiring a first rate algorithm and a second rate algorithm, wherein the first rate algorithm includes determining the data transmission rate based on network bandwidth and round-trip time, and the second rate algorithm includes determining the data transmission rate based on congestion window size and packet loss rate; establishing a communication network for data transmission between the device side and an external communication terminal based on WebRTC technology, and establishing an adaptive network protocol corresponding to the communication network based on a first correspondence between the first rate algorithm and congestion state, and a second correspondence between the second rate algorithm and idle state; monitoring the current network state of the communication network, wherein the current network state includes congestion state or idle state; determining a target algorithm from the first rate algorithm and the second rate algorithm based on the current network state, and transmitting data according to the target algorithm.
[0040] External communication terminals include server-side and / or user-side terminals.
[0041] Combination Figure 2 As shown, this disclosure provides a device-side data transmission method based on WebRTC technology, applied to a device. The method includes:
[0042] Step S201: Obtain the first rate algorithm and the second rate algorithm;
[0043] The first rate algorithm includes determining the data transmission rate based on network bandwidth and round-trip time;
[0044] The second rate algorithm includes determining the data transmission rate based on the congestion window size and packet loss rate;
[0045] Step S202: Establish a communication network for data transmission between the device and an external communication terminal based on WebRTC technology, and establish an adaptive network protocol corresponding to the communication network according to the first correspondence between the first rate algorithm and the first congestion state, and the second correspondence between the second rate algorithm and the second idle state.
[0046] Step S203: Monitor the current network status of the communication network;
[0047] The current network status includes either a congested state or an idle state;
[0048] Step S204: Determine the target algorithm from the first rate algorithm and the second rate algorithm according to the current network status, and perform data transmission according to the target algorithm.
[0049] The device-side data transmission method based on WebRTC technology provided in this disclosure establishes a communication network through WebRTC and a corresponding adaptive network protocol. This allows the data transmission rate to be determined based on network bandwidth and round-trip time when the network is congested, and based on congestion window size and packet loss rate when the network is idle. This not only determines the data transmission rate based on network bandwidth and round-trip time (RTT) to reflect the network's data capacity during congestion, thus fully utilizing network bandwidth and improving data preemption capabilities, but also reduces data error rates and improves data transmission reliability during idle periods by controlling the data transmission rate with congestion window size and packet loss rate. This eliminates the need for technologies like cloud computing, distributed computing, and big data, which increase communication costs, thereby improving the flexibility of WebRTC data transmission and significantly enhancing data transmission performance. Furthermore, the adaptive network protocol in this method is independent of specific hardware or software platforms, offering stronger compatibility and scalability, and can be widely applied to various network environments and devices.
[0050] In some embodiments, monitoring the current network status of a communication network includes: acquiring network congestion parameters of the communication network, wherein the network congestion parameters include packet loss rate, latency rate, network bandwidth, etc.; and determining the current network status of the communication network based on the network congestion parameters.
[0051] Optionally, the data transmission rate can be determined based on network bandwidth and round-trip time delay by: obtaining the network bandwidth and round-trip time delay of the communication network; calculating the bandwidth-delay product based on the network bandwidth and round-trip time delay; and adjusting the data transmission rate in real time based on the bandwidth-delay product, wherein the bandwidth-delay product and the data transmission rate are positively correlated.
[0052] In some embodiments, the bandwidth-delay product is the product of network bandwidth and round-trip time, which is a total amount of data in bits (or bytes), equivalent to the maximum amount of data on the network line at any given time, i.e., data that has been sent but not yet acknowledged.
[0053] In this way, when congestion occurs, instead of determining the data transmission rate based on packet loss rate, the bandwidth-delay product is calculated based on network bandwidth and round-trip time to reflect the amount of data the network can accommodate, thereby determining the data transmission rate. This fully utilizes network bandwidth, improves data preemption capabilities, adapts to data transmission performance under congestion, and reduces data transmission latency.
[0054] In some embodiments, the BBR (Bottleneck Bandwidth and Round-trip propagationtime) algorithm is used as the first rate algorithm.
[0055] Optionally, the data transmission rate is determined based on the congestion window size and packet loss rate using the following methods: obtaining the congestion window size and current packet loss rate of the communication network; calculating the window adjustment range based on a preset cubic function, wherein the congestion window size and the window adjustment range are positively correlated; if the current packet loss rate is greater than or equal to a preset packet loss rate threshold, the window adjustment trend is determined to decrease, and if the current packet loss rate is less than the preset packet loss rate threshold, the window adjustment trend is determined to increase; determining the window adjustment ratio corresponding to the congestion window size based on the window adjustment range and the window adjustment trend; updating the congestion window size based on the window adjustment ratio, so as to adjust the data transmission rate in real time according to the updated congestion window size.
[0056] In this way, on the one hand, reducing the congestion window size to lower the data transmission rate when the packet loss rate is high, and increasing the congestion window size to increase the data transmission rate when the packet loss rate is low, can effectively improve network load and reduce packet loss rate. On the other hand, compared with determining the window adjustment range based on a linear function according to the congestion window size, using a cubic function is more efficient, maximizing the use of the remaining network bandwidth and improving network throughput. This allows the second rate algorithm to improve data transmission performance in two aspects when the network is idle.
[0057] In some embodiments, the CUBIC (Cubic Congestion Control) algorithm is used as the second rate algorithm.
[0058] Optionally, before establishing a communication network for data transmission between the device and an external communication terminal based on WebRTC technology, the method includes: obtaining connection count information between the device and the external communication terminal; if the connection count information indicates an initial connection, sending a connection request message carrying a device identifier to the external communication terminal, and after receiving a connection confirmation message from the external communication terminal, establishing a communication network for data transmission between the device and the external communication terminal based on WebRTC technology, wherein the external communication terminal is used to send a connection confirmation message based on the received connection request message and record the device identifier to obtain a backup identifier; if the connection count information indicates a reconnection, sending a connection request message carrying a device identifier to the external communication terminal, and establishing a communication network for data transmission between the device and the external communication terminal based on WebRTC technology, wherein the external communication terminal is also used to perform a consistency test between the received device identifier and the recorded backup identifier, and after the consistency test passes, allowing the device to establish the communication network.
[0059] In this way, when reconnecting between the device and the external communication terminal, the device does not need to receive the connection confirmation message from the external communication terminal, reducing the round-trip latency used for handshaking during TCP connection and lowering the connection latency of the communication network.
[0060] Optionally, a communication node is obtained through the following methods: obtaining hardware requirement information, wherein the hardware requirement information includes at least one of processing chip information, computing power information, memory information, network information, and interface information; generating hardware configuration information based on the target hardware that meets the hardware requirement information; performing deployment design on the target hardware to obtain a node design scheme, and constructing the node to be tested according to the node design scheme; testing the node to be tested according to hardware testing rules to obtain test results, wherein the hardware testing rules are determined based on the hardware requirement information; if the test result of the node to be tested is a pass, then the node to be tested is determined as a communication node.
[0061] In some embodiments, the communication node may be a communication module in an industrial device or a communication router connected to the industrial device.
[0062] In some embodiments, the processing chip information is a DSP and FPGA chip that supports encoding and decoding high-definition video. In WebRTC communication, the encoding and decoding of audio and video data is very resource-intensive. By increasing the number of processor cores and increasing the processor frequency, the processor can be optimized to improve the data processing speed and reduce latency. In addition, using hardware-accelerated codecs can also greatly improve processing efficiency.
[0063] In some embodiments, the computing power information includes support for 1080P video processing and an encoding latency of less than 100ms. The use of a dedicated video codec or a processor that supports hardware acceleration can greatly improve the speed of data processing.
[0064] In some embodiments, memory information includes high-speed DDR3 / DDR4 memory with a capacity greater than or equal to 4GB. The size and speed of the memory affect the performance of WebRTC communication. Increasing the size of the memory allows the device to process more data, and increasing the speed of the memory allows data processing to be faster. Both of these can improve the performance of WebRTC.
[0065] In some embodiments, network information includes support for gigabit Ethernet ports to provide high-speed and stable network transmission quality. The performance of the network interface directly affects the communication quality of WebRTC. Using a high-speed network interface, such as a gigabit Ethernet interface, can provide greater data transmission bandwidth and reduce data transmission latency.
[0066] In some embodiments, the interface information includes providing a standard interface for connecting peripherals such as cameras and displays.
[0067] In some embodiments, hardware configuration information includes processor, memory, network interface, etc.
[0068] In some embodiments, node design schemes include hardware circuit design, PCB (Printed Circuit Board) routing design, design of more efficient data paths, optimization of device power management and heat dissipation design, etc. Among them, the routing design principles include using low crosstalk PCB materials, prioritizing the placement of the main processing chip close to memory and network interfaces, using balanced routing for clock routing, using microstrip lines for high-speed signal lines, rationally placing the positions of noise-sensitive network components, and strengthening the power supply system to reduce power supply noise, etc.
[0069] In this way, by designing communication nodes based on users' hardware requirements and testing them, we can reduce data processing latency within the device and transmission latency at the network interface, improve the reliability of the communication nodes, and meet customers' needs for real-time data transmission.
[0070] Optionally, a communication network for data transmission between a device and an external communication terminal is established based on WebRTC technology, including: the device includes multiple communication nodes; each communication node is designated as a first node, and internal communication links are established between the first nodes and multiple second nodes based on WebRTC technology, wherein each second node is a communication node other than the first node; multiple third nodes are determined from the communication nodes, and external communication links are established between the external communication terminal and each third node based on WebRTC technology; a mesh network structure is formed based on the internal communication links and the external communication links.
[0071] Optionally, data transmission can be performed by: planning multiple communication paths between the communication node and the external communication terminal, wherein each communication path consists of a portion of an internal communication link and an external communication link; determining a primary path from among the communication paths for data transmission; and determining a new primary path from among the communication paths if the primary path is in a communication failure state.
[0072] Combination Figure 3 As shown in the figure, this disclosure provides a communication network with a mesh network structure, including communication node A, communication node B, communication node C, communication node D, communication node E and an external communication terminal. The second node of communication node A includes communication node B and communication node C, the second node of communication node B includes communication node A, communication node C, and communication node D, the second node of communication node C includes communication node A, communication node B, communication node D, and communication node E, the second node of communication node D includes communication node B, communication node C, and communication node E, the second node of communication node E includes communication node C and communication node D, and the third node includes communication node D and communication node E.
[0073] In this way, by changing the physical layout of the network or modifying the network routing strategy, each communication node in the communication network will connect to multiple communication nodes, forming a mesh structure. This optimizes the network path or adds redundant routes. When the main path is in a communication failure state due to problems such as abnormal communication nodes or network link interruption, data is transmitted through other communication paths, further reducing network latency and data packet loss, and ensuring the reliability of data transmission.
[0074] Optionally, data transmission via the main path includes: establishing multiple sub-paths within the main path; transmitting data with an external communication terminal based on each sub-path, wherein the external communication terminal is also used to receive data packets sent by each sub-path and determine the target data from the data packets.
[0075] In this way, multiple sub-paths are used for data transmission within the same main path. Even if any sub-path fails to transmit data, the data can still be transmitted completely to the external communication terminal, thereby improving the reliability and efficiency of data transmission.
[0076] Combination Figure 4 As shown, this disclosure provides a device-side data transmission method based on WebRTC technology, applied to a device. The method includes:
[0077] Step S401: Send a connection request message carrying the device identifier to the external communication terminal;
[0078] Step S402: Determine whether the connection between the device and the external communication terminal is the first one. If yes, proceed to step S403; otherwise, proceed to step S404.
[0079] Step S403: After receiving the connection confirmation message from the external communication terminal, establish a communication network for data transmission between the device and the external communication terminal based on WebRTC technology, and proceed to step S405.
[0080] Step S404: Establish a communication network based on WebRTC technology for data transmission between the device and an external communication terminal; proceed to step S405.
[0081] Step S405: Determine whether the current network status of the communication network is congested. If yes, proceed to step S406; otherwise, proceed to step S407.
[0082] Step S406: Use the first rate algorithm and proceed to step S408;
[0083] The first rate algorithm includes determining the data transmission rate based on network bandwidth and round-trip time;
[0084] Step S407: Use the second rate algorithm and proceed to step S408;
[0085] The second rate algorithm includes determining the data transmission rate based on the congestion window size and packet loss rate;
[0086] Step S408: Establish multiple sub-paths in the main path, and transmit data with the external communication terminal based on each sub-path.
[0087] The device-side data transmission method based on WebRTC technology provided in this disclosure establishes a communication network through WebRTC and establishes an adaptive network protocol corresponding to the communication network. This allows the data transmission rate to be determined based on network bandwidth and round-trip time when the current network is congested, and based on the congestion window size and packet loss rate when the current network is idle. This method has the following advantages:
[0088] First, not only in congested conditions, where the data transmission rate is determined based on network bandwidth and round-trip latency, rather than packet loss rate, thus fully utilizing network bandwidth and improving data preemption capabilities, but also in idle conditions, the congestion window size and packet loss rate control the data transmission rate, reducing data error rates and improving data transmission reliability. This eliminates the need for technologies like cloud computing, distributed computing, and big data, which increase communication costs, thus improving the flexibility of WebRTC data transmission in two ways and greatly enhancing data transmission performance.
[0089] Second, the adaptive network protocol in this method does not depend on a specific hardware or software platform, has stronger compatibility and scalability, and can be widely applied in various network environments and devices.
[0090] Thirdly, on the one hand, when the packet loss rate is high, reducing the congestion window size can reduce the data transmission rate, while when the packet loss rate is low, increasing the congestion window size can increase the data transmission rate. This can effectively improve network load and reduce packet loss. On the other hand, compared to determining the window adjustment range based on a linear function according to the congestion window size, using a cubic function is more efficient, maximizing the use of remaining network bandwidth and improving network throughput. This allows the second rate algorithm to improve data transmission performance in two aspects when the network is idle.
[0091] Fourth, when reconnecting between the device and an external communication terminal, the device does not need to receive connection confirmation messages from the external communication terminal, reducing the round-trip latency used for handshaking during TCP connection and lowering the connection latency of the communication network.
[0092] Fifth, by designing communication nodes based on users' hardware requirements and testing them, we can reduce data processing latency within the device and transmission latency at the network interface, improve the reliability of the communication nodes, and meet customers' needs for real-time data transmission.
[0093] Sixth, by changing the physical layout of the network or modifying the network routing strategy, each communication node in the communication network will connect to multiple communication nodes, forming a mesh structure. This optimizes the network path or adds redundant routes. When the main path is in a communication failure state due to problems such as abnormal communication nodes or network link interruption, data is transmitted through other communication paths, further reducing network latency and data packet loss, and ensuring the reliability of data transmission.
[0094] Seventh, using multiple sub-paths for data transmission within the same main path ensures that even if any sub-path fails, data can still be transmitted completely to the external communication terminal, thereby improving the reliability and efficiency of data transmission.
[0095] Optionally, the device end includes industrial equipment, and the external communication end includes a server and a user terminal. The method further includes at least one of the following: monitoring the equipment operation data of the industrial equipment and sending the monitored equipment operation data to the server in real time via a communication network, wherein the server is used to generate an equipment monitoring report based on the received equipment operation data and send the equipment monitoring report to the user terminal, and the user terminal is used to determine the equipment operation status of the industrial equipment based on the equipment monitoring report; obtaining the equipment operation status of the industrial equipment, and if the equipment operation status is a fault status, collecting data from the industrial equipment to obtain equipment fault data, and sending the equipment fault data to the server in real time via a communication network, wherein the server is used to, upon receiving the equipment fault data, provide feedback on fault repair instructions to the device end based on the equipment fault data, and / or notify maintenance personnel to perform repairs based on the equipment fault data; responding to the equipment maintenance instructions, sending the equipment operation data of the business equipment to the user terminal in real time via a communication network, wherein the user terminal is used to determine the maintenance status of the industrial equipment based on the received equipment operation data.
[0096] Combination Figure 5 As shown, this disclosure provides a device-side data transmission method based on WebRTC technology, including:
[0097] Step S501: Monitor the equipment operation data of industrial equipment at the device end;
[0098] In step S502, the device sends the monitored device operation data to the server in real time through the communication network;
[0099] Step S503: The server generates a device monitoring report based on the received device operation data;
[0100] Step S504: The server sends the device monitoring report to the user terminal.
[0101] Step S505: The user terminal displays the equipment monitoring report to the monitoring personnel;
[0102] Step S506: The user terminal obtains the device operating status corresponding to the device monitoring report;
[0103] Step S507: Determine whether the equipment operating status includes a fault status. If yes, proceed to step S508; otherwise, proceed to step S501.
[0104] In step S508, the user terminal performs remote diagnosis and maintenance of industrial equipment through the communication network.
[0105] In this way, factory equipment collects operational status and environmental information through sensors or cameras, and then transmits this data to the monitoring center in real time via WebRTC. Monitoring personnel can then view the equipment's operational status and environmental information in a browser using WebRTC, enabling them to promptly detect any abnormalities.
[0106] Combination Figure 6 As shown, this disclosure provides a device-side data transmission method based on WebRTC technology, including:
[0107] Step S601: The device acquires the operating status of the industrial equipment;
[0108] Step S602: Determine whether the equipment operating status includes a fault status. If yes, proceed to step S603; otherwise, proceed to step S601.
[0109] Step S603: The device acquires data from the industrial equipment to obtain equipment fault data;
[0110] Step S604: The device sends the device fault data to the server in real time through the communication network;
[0111] Step S605: The server performs data analysis on the received device fault data and obtains the analysis results;
[0112] Step S606: Determine whether remote repair is needed based on the analysis results. If yes, proceed to step S607; otherwise, proceed to step S608.
[0113] Step S607: The server sends a fault repair command to the device.
[0114] Step S608: The server notifies maintenance personnel to perform repairs.
[0115] In this way, when equipment malfunctions, maintenance personnel can connect to the equipment via WebRTC to obtain real-time operating data and fault information for remote diagnosis. If the problem can be resolved remotely, maintenance personnel can also send operation commands to the equipment via WebRTC, avoiding the time and cost of on-site repairs.
[0116] Combination Figure 7 As shown, this disclosure provides a device-side data transmission method based on WebRTC technology, including:
[0117] Step S701: The device receives the device maintenance command;
[0118] Step S702: The device establishes a communication network with the user terminal based on WebRTC technology;
[0119] Step S703: The device sends the device operation data of the service device to the user terminal in real time through the communication network;
[0120] Step S704: The user terminal displays the equipment operation data of the business equipment to the maintenance personnel;
[0121] Step S705: The user terminal obtains the device maintenance status;
[0122] Step S706: Determine whether the equipment needs maintenance based on its maintenance status. If yes, proceed to step S707; otherwise, proceed to step S708.
[0123] Step S707: The user terminal performs remote maintenance on the industrial equipment and / or notifies maintenance personnel to perform maintenance, then proceeds to step S708.
[0124] Step S708: Generate the maintenance report corresponding to the industrial equipment.
[0125] Thus, factory equipment frequently requires regular maintenance and inspection. With WebRTC, maintenance personnel can view the equipment's operating status and maintenance records in real time via a browser from their office, allowing them to plan maintenance work. During maintenance, if problems arise, they can also communicate and consult with the equipment manufacturer's technical support personnel in real time via WebRTC.
[0126] Combination Figure 8 As shown, this disclosure provides a device-side data transmission system based on WebRTC technology, applied to a device. The system includes an acquisition module 801, an establishment module 802, a detection module 803, and a transmission module 804.
[0127] The acquisition module 801 is used to acquire a first rate algorithm and a second rate algorithm. The first rate algorithm includes determining the data transmission rate based on network bandwidth and round-trip time, and the second rate algorithm includes determining the data transmission rate based on congestion window size and packet loss rate.
[0128] The module 802 is used to establish a communication network for data transmission between the device and an external communication terminal based on WebRTC technology, and to establish an adaptive network protocol corresponding to the communication network according to the first correspondence between the first rate algorithm and the first congestion state, and the second correspondence between the second rate algorithm and the second idle state.
[0129] The detection module 803 is used to monitor the current network status of the communication network, which includes congestion or idle status.
[0130] The transmission module 804 is used to determine the target algorithm from the first rate algorithm and the second rate algorithm according to the current network status, and to transmit data according to the target algorithm.
[0131] The device-side data transmission system based on WebRTC technology provided in this disclosure establishes a communication network via WebRTC and a corresponding adaptive network protocol. This allows the data transmission rate to be determined based on network bandwidth and round-trip time when the network is congested, and based on congestion window size and packet loss rate when the network is idle. This not only determines the data transmission rate based on network bandwidth and round-trip time (RTT) to reflect the network's data capacity during congestion, thus fully utilizing network bandwidth and improving data preemption capabilities, but also reduces data error rates and improves data transmission reliability during idle periods by controlling the data transmission rate with congestion window size and packet loss rate. This eliminates the need for technologies like cloud computing, distributed computing, and big data, which increase communication costs. It enhances the flexibility of WebRTC data transmission in two ways, significantly improving data transmission performance. Furthermore, the adaptive network protocol in this method is independent of specific hardware or software platforms, offering stronger compatibility and scalability, and can be widely applied to various network environments and devices.
[0132] The foregoing description and accompanying drawings fully illustrate embodiments of this disclosure to enable those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, procedural, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the terminology used in this application is for describing embodiments only and is not intended to limit the claims. As used in the description of embodiments and claims, the singular forms “a,” “an,” and “the” are intended to equally include the plural forms unless the context clearly indicates otherwise. Similarly, the term “and / or” as used herein means including one or more of the associated listed items and all possible combinations thereof. Additionally, when used in this application, the term "comprise" and its variations "comprises" and / or "comprising" refer to the presence of stated subsamples, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other subsamples, wholes, steps, operations, elements, components, and / or groups thereof. Without further limitations, an element defined by the phrase "comprising a..." does not exclude the presence of other identical elements in the process, method, or apparatus that includes the element. In this document, each embodiment may focus on the differences from other embodiments, and similar or identical parts between embodiments can be referred to mutually. For methods, products, etc., disclosed in the embodiments, if they correspond to the method section disclosed in the embodiments, the relevant parts can be referred to the description of the method section.
[0133] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the embodiments of this disclosure. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0134] The methods and products (including but not limited to devices and equipment) disclosed in the embodiments herein can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units may be merely a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some sub-samples may be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical, or other forms. Units described as separate components may or may not be physically separate, and 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 implement this embodiment according to actual needs. Furthermore, the functional units in the embodiments of this disclosure may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0135] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the blocks may occur in a different order than that shown in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks may also occur in a different order than disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. Each block in a block diagram and / or flowchart, and combinations of blocks in a block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
Claims
1. A device-side data transmission method based on WebRTC technology, characterized in that, Applied to the device side, the method includes: A first rate algorithm and a second rate algorithm are obtained. The first rate algorithm includes determining the data transmission rate based on network bandwidth and round-trip time, and the second rate algorithm includes determining the data transmission rate based on congestion window size and packet loss rate. The data transmission rate is determined based on network bandwidth and round-trip time (RTD) in the following manner: the network bandwidth and RTD of the communication network are obtained; the bandwidth-delay product is calculated based on the network bandwidth and the RTD; the data transmission rate is adjusted in real time based on the bandwidth-delay product, wherein the bandwidth-delay product and the data transmission rate are positively correlated. The data transmission rate is determined based on the congestion window size and packet loss rate of the communication network as follows: The congestion window size and current packet loss rate of the communication network are obtained; the congestion window size is calculated using a preset cubic function to obtain the window adjustment range, wherein the congestion window size and the window adjustment range are positively correlated; if the current packet loss rate is greater than or equal to a preset packet loss rate threshold, the window adjustment trend is determined to be decreasing; and if the current packet loss rate is less than the preset packet loss rate threshold, the window adjustment trend is determined to be increasing; a window adjustment ratio corresponding to the congestion window size is determined based on the window adjustment range and the window adjustment trend; the congestion window size is updated according to the window adjustment ratio to adjust the data transmission rate in real time based on the updated congestion window size. A communication network for data transmission between the device and an external communication terminal is established based on WebRTC technology, and an adaptive network protocol corresponding to the communication network is established according to the first correspondence between the first rate algorithm and the first congestion state, and the second correspondence between the second rate algorithm and the idle state. Monitor the current network status of the communication network, wherein the current network status includes the congestion state or the idle state; Based on the current network status, a target algorithm is determined from the first rate algorithm and the second rate algorithm, and data transmission is performed according to the target algorithm.
2. The method according to claim 1, characterized in that, Before establishing a communication network based on WebRTC technology for data transmission between the device and an external communication terminal, the method includes: Obtain the connection count information between the device and the external communication terminal; If the connection count information indicates an initial connection, a connection request message carrying a device identifier is sent to the external communication terminal. After receiving a connection confirmation message from the external communication terminal, a communication network for data transmission between the device and the external communication terminal is established based on WebRTC technology. The external communication terminal is used to send a connection confirmation message based on the received connection request message and record the device identifier to obtain a backup identifier. If the connection count information indicates a reconnection, a connection request message carrying a device identifier is sent to the external communication terminal, and a communication network for data transmission between the device and the external communication terminal is established based on WebRTC technology. The external communication terminal is also used to perform a consistency test between the received device identifier and the recorded backup identifier, and allows the device to establish the communication network after the consistency test is passed.
3. The method according to claim 1, characterized in that, A communication network based on WebRTC technology is established for data transmission between the device and an external communication terminal, including: The device includes multiple communication nodes; Each of the aforementioned communication nodes is designated as a first node, and an internal communication link is established between the first node and multiple second nodes based on WebRTC technology, wherein the second node is a communication node other than the first node; Multiple third nodes are determined from the communication nodes, and external communication links are established between the external communication terminal and each of the third nodes based on WebRTC technology; A communication network with a mesh network structure is formed based on each of the internal communication links and each of the external communication links.
4. The method according to claim 3, characterized in that, The communication node can be obtained using the following method: Obtain hardware requirement information, wherein the hardware requirement information includes at least one of processing chip information, computing power information, memory information, network information, and interface information; Hardware configuration information is generated based on the target hardware that meets the aforementioned hardware requirements. The target hardware is deployed and designed to obtain a node design scheme, and the node to be tested is constructed according to the node design scheme. The node to be tested is tested according to the hardware testing rules to obtain the test results, wherein the hardware testing rules are determined based on the hardware requirement information; If the test result of the node to be tested is that the test is passed, then the node to be tested is determined as a communication node.
5. The method according to claim 3, characterized in that, Data transmission can be performed using the following methods: Plan multiple communication paths between the communication node and the external communication terminal, wherein each communication path consists of a portion of the internal communication link and the external communication link; A primary path is determined from each of the communication paths, and data is transmitted through the primary path; If the primary path is in a communication failure state, a new primary path is determined from each of the communication paths.
6. The method according to claim 5, characterized in that, Data transmission via the main path includes: Create multiple sub-paths within the main path; Data transmission is performed between each of the sub-paths and the external communication terminal, wherein the external communication terminal is also used to receive data packets sent by each of the sub-paths and determine the target data from the data packets.
7. The method according to any one of claims 1 to 6, characterized in that, The device end includes industrial equipment, the external communication end includes a server end and a user terminal, and the method further includes at least one of the following: The system monitors the equipment operation data of the industrial equipment and sends the monitored equipment operation data to the server in real time through the communication network. The server generates an equipment monitoring report based on the received equipment operation data and sends the equipment monitoring report to the user terminal. The user terminal determines the equipment operation status of the industrial equipment based on the equipment monitoring report. The system acquires the operating status of the industrial equipment. If the operating status is faulty, it collects data from the industrial equipment to obtain equipment fault data and sends the equipment fault data to the server in real time through the communication network. The server is used to send a fault repair instruction to the equipment based on the equipment fault data if it receives the equipment fault data, and / or to notify maintenance personnel to carry out repairs based on the equipment fault data. In response to equipment maintenance instructions, the system transmits equipment operation data of the industrial equipment to the user terminal in real time via the communication network, wherein the user terminal is used to determine the maintenance status of the industrial equipment based on the received equipment operation data.
8. A device-side data transmission system based on WebRTC technology, characterized in that, The system, applied to the device side, includes: The acquisition module is used to acquire a first rate algorithm and a second rate algorithm. The first rate algorithm includes determining the data transmission rate based on network bandwidth and round-trip time, and the second rate algorithm includes determining the data transmission rate based on congestion window size and packet loss rate. The data transmission rate is determined based on network bandwidth and round-trip time (RTD) in the following manner: the network bandwidth and RTD of the communication network are obtained; the bandwidth-delay product is calculated based on the network bandwidth and the RTD; the data transmission rate is adjusted in real time based on the bandwidth-delay product, wherein the bandwidth-delay product and the data transmission rate are positively correlated. The data transmission rate is determined based on the congestion window size and packet loss rate of the communication network as follows: The congestion window size and current packet loss rate of the communication network are obtained; the congestion window size is calculated using a preset cubic function to obtain the window adjustment range, wherein the congestion window size and the window adjustment range are positively correlated; if the current packet loss rate is greater than or equal to a preset packet loss rate threshold, the window adjustment trend is determined to be decreasing; and if the current packet loss rate is less than the preset packet loss rate threshold, the window adjustment trend is determined to be increasing; a window adjustment ratio corresponding to the congestion window size is determined based on the window adjustment range and the window adjustment trend; the congestion window size is updated according to the window adjustment ratio to adjust the data transmission rate in real time based on the updated congestion window size. A module is established to establish a communication network for data transmission between the device and an external communication terminal based on WebRTC technology, and to establish an adaptive network protocol corresponding to the communication network according to the first correspondence between the first rate algorithm and the first congestion state, and the second correspondence between the second rate algorithm and the idle state. A detection module is used to monitor the current network status of the communication network, wherein the current network status includes the congestion state or the idle state; The transmission module is used to determine a target algorithm from the first rate algorithm and the second rate algorithm according to the current network status, and to perform data transmission according to the target algorithm.