CN113472827B - Data transmission method, data transmission device and data transmission system - Google Patents

Data transmission method, data transmission device and data transmission system Download PDF

Info

Publication number
CN113472827B
CN113472827B CN202010238226.0A CN202010238226A CN113472827B CN 113472827 B CN113472827 B CN 113472827B CN 202010238226 A CN202010238226 A CN 202010238226A CN 113472827 B CN113472827 B CN 113472827B
Authority
CN
China
Prior art keywords
client
network camera
accessed
target
packet loss
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010238226.0A
Other languages
Chinese (zh)
Other versions
CN113472827A (en
Inventor
李昂阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN202010238226.0A priority Critical patent/CN113472827B/en
Publication of CN113472827A publication Critical patent/CN113472827A/en
Application granted granted Critical
Publication of CN113472827B publication Critical patent/CN113472827B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/54Presence management, e.g. monitoring or registration for receipt of user log-on information, or the connection status of the users
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a data transmission method, a data transmission device and a data transmission system, which relate to the technical field of electronic communication, and record network information of all clients accessed to a server by using equipment management information.

Description

Data transmission method, data transmission device and data transmission system
Technical Field
The present application relates to the field of electronic communications technologies, and in particular, to a data transmission method, a data transmission device, and a data transmission system.
Background
In recent years, with the rapid development of internet technology, the video monitoring industry has also entered the era of full networking. The video monitoring industry in the full networking era is gradually showing the characteristics of the information technology industry, and devices such as a network camera need to transmit video information through a network. In the prior art, when video monitoring data is transmitted in a network, a multicast mode is currently used for data transmission, wherein multicast is to realize point-to-multipoint network connection between a sender and each receiver, a router capable of managing multicast groups is needed in the network transmission process, the network state is not considered, and the problems of packet loss, data packet disorder and the like are easy to occur.
Disclosure of Invention
The embodiment of the application aims to provide a data transmission method, a data transmission device and a data transmission system, so as to solve the problems of packet loss, data packet disorder and the like in the prior art and improve the stability of data transmission.
The specific technical scheme is as follows:
in a first aspect of the present application, an embodiment of the present application provides a data transmission method, applied to a server, where the method includes:
Inquiring equipment management information when an access request of a target client is received, and judging whether the accessed client exists, wherein network information of each client accessed to the server is recorded in the equipment management information, and the target client is a client which is not accessed to the server yet;
when an accessed client exists and the target client does not meet a preset access condition, determining a transfer client according to the equipment management information, so that the target client and the transfer client are in communication connection, and the target client can acquire the data of the server forwarded by the transfer client.
Optionally, when the accessed client exists and the target client does not meet a preset access condition, determining, according to the device management information, a transit client, so that the target client and the transit client establish communication connection, and thus the target client obtains data of the server forwarded by the transit client, including:
when an accessed client exists and the target client does not meet a preset access condition, the device management information is sent to the target client, so that the target client selects one accessed client as a transfer client according to the network information of each client accessed to the server, and establishes communication connection with the transfer client, and the target client can acquire the data of the server forwarded by the transfer client.
Optionally, when the accessed client exists and the target client does not meet a preset access condition, determining, according to the device management information, a transit client, so that the target client and the transit client establish communication connection, and thus the target client obtains data of the server forwarded by the transit client, including:
when an accessed client exists and the target client does not meet a preset access condition, sending a packet loss rate test instruction to each client accessed to the server so that each client accessed to the server can respectively test the packet loss rate between the client and the target client according to the packet loss rate test instruction, wherein the packet loss rate test instruction comprises an identifier of the target client;
acquiring packet loss rates between the target client and each client fed back by each client accessed to the server, and obtaining test packet loss rates of each client accessed to the server;
selecting a client with the lowest test packet loss rate as a transfer client;
and sending the network information of the transfer client to the target client so that the target client establishes communication connection with the transfer client according to the network information of the transfer client, and the target client can acquire the data of the server forwarded by the transfer client.
Optionally, the method for judging that the target client does not meet the preset access condition includes:
judging whether the used bandwidth of the service end is larger than a preset bandwidth threshold value or not, judging whether the packet loss rate between the service end and the target client end is larger than a preset packet loss rate threshold value or not, wherein when the used bandwidth of the service end is not larger than the preset bandwidth threshold value and the packet loss rate between the service end and the target client end is not larger than the preset packet loss rate threshold value, judging that the target client end meets preset access conditions, otherwise, judging that the target client end does not meet the preset access conditions.
Optionally, after the step of determining, when the accessed client exists and the target client does not meet the preset access condition, a transit client according to the device management information, so that the target client establishes a communication connection with the transit client, so that the target client obtains the data of the server forwarded by the transit client, the method further includes:
and after receiving feedback information which is sent by the transfer client and indicates that the transfer client and the target client are successfully connected, adding the target client into the equipment management information.
In a second aspect of the present application, an embodiment of the present application provides a data transmission method, applied to a client, where the method includes:
sending an access request to a server under the condition that a current client is not accessed to the server;
when receiving the equipment management information sent by the server according to the access request, wherein the equipment management information records the network information of each client accessed to the server, and one accessed client is selected from each client accessed to the server to serve as a transfer client;
transmitting a forwarding application to the transfer client, wherein the forwarding application is used for applying that the transfer client forwards the data of the server to the current client;
and receiving the data of the server forwarded by the forwarding client under the condition that the forwarding client passes the authentication of the forwarding application.
Optionally, when receiving the device management information sent by the server according to the access request, selecting an accessed client from the clients accessed to the server, as a transit client, including:
When receiving the equipment management information sent by the service end according to the access request, testing the packet loss rate between the service end and each client end accessed to the service end to obtain the test packet loss rate of each client end accessed to the service end;
and selecting the client with the lowest test packet loss rate as the switching client.
Optionally, the network information of each client accessed to the server includes a network segment to which each client accessed to the server belongs, and when receiving the device management information sent by the server according to the access request, selecting one accessed client from each client accessed to the server as a transit client, where the method includes:
when receiving the equipment management information sent by the server according to the access request, selecting one client which is in the same network segment with the current client from the clients which are accessed to the server according to the network segment which the current client belongs to and the network segment which the clients which are accessed to the server belong to, and taking the client as a transfer client.
Optionally, in the case that the current client has accessed to the server, the method further includes:
When receiving forwarding applications of other clients aiming at the server, judging whether key information carried in the forwarding applications passes verification or not;
and when the key information carried in the forwarding application passes verification, forwarding the data received from the service end to the client end which sends the forwarding application.
Optionally, after the step of forwarding the data received from the server to the client that sends the forwarding application when the key information carried in the forwarding application passes the verification, the method further includes:
and sending feedback information representing successful connection with the client side sending the forwarding application to the server side, so that the server side adds the network information of the client side sending the forwarding application to the equipment management information after receiving the feedback information.
Optionally, when the key information carried in the forwarding application passes verification, forwarding, to a client that sends the forwarding application, data received from the server, including:
when the key information carried in the forwarding application passes verification, selecting a corresponding sending mode according to the data type of the data received from the server, and forwarding the data received from the server to a client for sending the forwarding application by using the selected sending mode, wherein the sending mode comprises at least two of a UDP mode, a TCP mode and a multicast mode.
Optionally, when the key information carried in the forwarding application passes verification, selecting a corresponding transmission mode according to a data type of the data received from the server, and forwarding the data received from the server to the client that sends the forwarding application by using the selected transmission mode, where the method includes:
when the key information carried in the forwarding application passes verification, acquiring the data type of the data which is received from the server and needs to be forwarded, and obtaining a target data type;
determining a priority corresponding to the target data type as a target priority, wherein the priority comprises a high priority, a medium priority and a low priority;
and forwarding the data to be forwarded to the client for forwarding the application by using the data transmission mode corresponding to the target priority, wherein the data transmission mode corresponding to the high priority is a TCP mode, the data transmission mode corresponding to the medium priority is a UDP mode, and the data transmission mode corresponding to the low priority is a multicast mode.
In a third aspect of the present application, an embodiment of the present application provides a data transmission device, applied to a server, where the device includes:
The query module is used for querying equipment management information when receiving an access request of a target client, and judging whether the accessed client exists or not, wherein the equipment management information comprises network information of all clients accessed to the server, and the target client is a client which is not accessed to the server yet;
and the processing module is used for determining a transfer client according to the equipment management information when the accessed client exists and the target client does not meet the preset access condition, so that the target client establishes communication connection with the transfer client, and the target client acquires the data of the server forwarded by the transfer client.
Optionally, the processing module is specifically configured to:
when an accessed client exists and the target client does not meet a preset access condition, the device management information is sent to the target client, so that the target client selects one accessed client as a transfer client according to the network information of each client accessed to the server, and establishes communication connection with the transfer client, and the target client can acquire the data of the server forwarded by the transfer client.
Optionally, the processing module is specifically configured to:
when an accessed client exists and the target client does not meet a preset access condition, sending a packet loss rate test instruction to each client accessed to the server so that each client accessed to the server can respectively test the packet loss rate between the client and the target client according to the packet loss rate test instruction, wherein the packet loss rate test instruction comprises an identifier of the target client;
acquiring packet loss rates between the target client and each client fed back by each client accessed to the server, and obtaining test packet loss rates of each client accessed to the server;
selecting a client with the lowest test packet loss rate as a transfer client;
and sending the network information of the transfer client to the target client so that the target client establishes communication connection with the transfer client according to the network information of the transfer client, and the target client can acquire the data of the server forwarded by the transfer client.
Optionally, the processing module includes a judging sub-module, where the judging sub-module is specifically configured to:
When an accessed client exists, judging whether the used bandwidth of the server is larger than a preset bandwidth threshold, judging whether the packet loss rate between the server and the target client is larger than a preset packet loss rate threshold, wherein when the used bandwidth of the server is not larger than the preset bandwidth threshold and the packet loss rate between the server and the target client is not larger than the preset packet loss rate threshold, judging that the target client meets preset access conditions, otherwise, judging that the target client does not meet preset access conditions.
Optionally, the apparatus further includes:
and the adding module is used for adding the target client into the equipment management information after receiving feedback information which is sent by the transfer client and indicates that the transfer client and the target client are successfully connected.
In a fourth aspect of the present application, an embodiment of the present application provides a data transmission device, applied to a client, where the device includes:
the first sending module is used for sending an access request to the server side under the condition that the current client side is not accessed to the server side;
the selecting module is used for selecting one accessed client from the clients accessed to the service end as a transfer client when receiving the equipment management information sent by the service end according to the access request, wherein the network information of the clients accessed to the service end is recorded in the equipment management information;
The second sending module is used for sending a forwarding application to the transfer client, wherein the forwarding application is used for applying the transfer client to forward the data of the server to the current client;
and the receiving module is used for receiving the data of the server forwarded by the forwarding client under the condition that the forwarding client passes the authentication of the forwarding application.
Optionally, the selecting module is specifically configured to:
when receiving the equipment management information sent by the service end according to the access request, testing the packet loss rate between the service end and each client end accessed to the service end to obtain the test packet loss rate of each client end accessed to the service end;
and selecting the client with the lowest test packet loss rate as the switching client.
Optionally, the network information of each client that has accessed to the server includes a network segment to which each client that has accessed to the server belongs, and the selection module is specifically configured to:
when receiving the equipment management information sent by the server according to the access request, selecting one client which is in the same network segment with the current client from the clients which are accessed to the server according to the network segment which the current client belongs to and the network segment which the clients which are accessed to the server belong to, and taking the client as a transfer client.
Optionally, in the case that the current client has accessed to the server, the apparatus further includes:
the judging module is used for judging whether key information carried in the forwarding application passes verification or not when receiving forwarding applications of other clients aiming at the server side;
and the third sending module is used for forwarding the data received from the server to the client for sending the forwarding application when the key information carried in the forwarding application passes the verification.
Optionally, the apparatus further includes:
and the feedback information sending module is used for sending feedback information representing successful connection with the client side sending the forwarding application to the server side, so that the server side adds the network information of the client side sending the forwarding application to the equipment management information after receiving the feedback information.
Optionally, the third sending module is specifically configured to:
when the key information carried in the forwarding application passes verification, selecting a corresponding sending mode according to the data type of the data received from the server, and forwarding the data received from the server to a client for sending the forwarding application by using the selected sending mode, wherein the sending mode comprises at least two of a UDP mode, a TCP mode and a multicast mode.
Optionally, the third sending module includes:
the processing sub-module is used for acquiring the data type of the data which is received from the server and needs to be forwarded when the key information carried in the forwarding application passes the verification, so as to acquire a target data type;
a priority determining submodule, configured to determine a priority corresponding to the target data type as a target priority, where the priority includes a high priority, a medium priority, and a low priority;
and the forwarding sub-module is used for forwarding the data to be forwarded to the client for sending the forwarding application by utilizing the data transmission mode corresponding to the target priority, wherein the data transmission mode corresponding to the high priority is a TCP mode, the data transmission mode corresponding to the medium priority is a UDP mode, and the data transmission mode corresponding to the low priority is a multicast mode.
In a fifth aspect of the present application, an embodiment of the present application provides a data transmission system, the system including:
the server side and the client side;
the server is used for inquiring equipment management information and judging whether a client accessed to the server exists or not when an access request of a target client is received, wherein network information of all clients accessed to the server is recorded in the equipment management information, and the target client is a client which is not accessed to the server yet; when an accessed client exists and the target client does not meet a preset access condition, determining a transfer client according to the equipment management information, so that the target client and the transfer client are in communication connection, and the target client can acquire the data of the server forwarded by the transfer client;
The client is used for sending an access request to the server under the condition that the server is not accessed, and after the server determines the transfer client according to the equipment management information, the client establishes communication connection with the transfer client so as to acquire the data of the server forwarded by the transfer client.
Optionally, the server is specifically configured to:
when an accessed client exists and the target client does not meet a preset access condition, sending the equipment management information to the target client;
the target client is specifically configured to select, after receiving the device management information sent by the server according to the access request, an accessed client from the clients that have accessed the server, as a transit client; transmitting a forwarding application to the transfer client, wherein the forwarding application is used for applying that the transfer client forwards the data of the server to the current client; and receiving the data of the server forwarded by the forwarding client under the condition that the forwarding client passes the authentication of the forwarding application.
Optionally, the server is specifically configured to:
When an accessed client exists and the target client does not meet a preset access condition, sending a packet loss rate test instruction to each client accessed to the server;
each client which is accessed to the server is specifically configured to test the packet loss rate with the target client according to the packet loss rate test instruction, where the packet loss rate test instruction includes an identifier of the target client, and feed back the packet loss rate with the target client to the server;
the server acquires packet loss rates between the target client and each client fed back by each client accessed to the server, and obtains test packet loss rates of each client accessed to the server; selecting a client with the lowest test packet loss rate as a transfer client; the network information of the transit client is sent to the target client;
and the target client establishes communication connection with the transfer client according to the network information of the transfer client, so as to acquire the data of the server forwarded by the transfer client.
Optionally, the server is specifically configured to:
Judging whether the used bandwidth of the service end is larger than a preset bandwidth threshold value or not, judging whether the packet loss rate between the service end and the target client end is larger than a preset packet loss rate threshold value or not, wherein when the used bandwidth of the service end is not larger than the preset bandwidth threshold value and the packet loss rate between the service end and the target client end is not larger than the preset packet loss rate threshold value, judging that the target client end meets preset access conditions, otherwise, judging that the target client end does not meet the preset access conditions.
Optionally, the server is further configured to:
and after receiving feedback information which is sent by the transfer client and indicates that the transfer client and the target client are successfully connected, adding the target client into the equipment management information.
Optionally, the network information of each client that has accessed to the server includes a network segment to which each client that has accessed to the server belongs, where the client is specifically configured to:
when receiving the equipment management information sent by the service end according to the access request, selecting one client which is in the same network segment with the current client from the clients which are accessed to the service end according to the network segment which the current client belongs to and the network segment which the clients which are accessed to the service end belong to, and taking the client as a transfer client.
Optionally, in a case that the client has accessed to the server, the client is further configured to:
when receiving forwarding applications of other clients aiming at the server, judging whether key information carried in the forwarding applications passes verification or not;
and when the key information carried in the forwarding application passes verification, forwarding the data received from the service end to the client end which sends the forwarding application.
Optionally, the client is specifically configured to:
and sending feedback information representing successful connection with the client side sending the forwarding application to the server side, so that the server side adds the network information of the client side sending the forwarding application to the equipment management information after receiving the feedback information.
Optionally, the client is specifically configured to:
when the key information carried in the forwarding application passes verification, selecting a corresponding sending mode according to the data type of the data received from the server, and forwarding the data received from the server to a client for sending the forwarding application by using the selected sending mode, wherein the sending mode comprises at least two of a UDP mode, a TCP mode and a multicast mode.
Optionally, the client is specifically configured to:
when the key information carried in the forwarding application passes verification, acquiring the data type of the data which is received from the server and needs to be forwarded, and obtaining a target data type;
determining a priority corresponding to the target data type as a target priority, wherein the priority comprises a high priority, a medium priority and a low priority;
and forwarding the data to be forwarded to the client for forwarding the application by using the data transmission mode corresponding to the target priority, wherein the data transmission mode corresponding to the high priority is a TCP mode, the data transmission mode corresponding to the medium priority is a UDP mode, and the data transmission mode corresponding to the low priority is a multicast mode.
According to the data transmission method, the data transmission device and the data transmission system, the network information of each client accessed to the server is recorded through the equipment management information, when the server receives the access request of the target client, the equipment management information is queried, the existence of the accessed client is confirmed, and when the target client does not meet the preset access condition, the transfer client is determined according to the equipment management information, so that the target client is in communication connection with the transfer client, the target client can acquire the data of the server forwarded by the transfer client, a router capable of managing a multicast group is not needed in the network transmission process, the problems of packet loss, data packet disorder and the like in the prior art are solved, and the stability of data transmission is improved. Of course, it is not necessary for any one product or method of practicing the application to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a data transmission method applied to a server according to an embodiment of the present application;
fig. 2 is a first schematic diagram illustrating interaction of a data transmission method according to an embodiment of the present application;
fig. 3 is a second schematic diagram illustrating interaction of a data transmission method according to an embodiment of the present application;
fig. 4 is a third schematic diagram illustrating interaction of a data transmission method according to an embodiment of the present application;
fig. 5 is a schematic diagram of a data transmission method applied to a client according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a data transmission system according to an embodiment of the present application;
fig. 7 is a schematic diagram of a data transmission device applied to a server according to an embodiment of the present application;
fig. 8 is a schematic diagram of a data transmission device applied to a client according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The embodiment of the application discloses a data transmission method, a data transmission device and a data transmission system, which are respectively described below.
The embodiment of the application provides a data transmission method applied to a server, referring to fig. 1, fig. 1 is a schematic diagram of the data transmission method applied to the server according to the embodiment of the application, and the method comprises the following steps:
step 110, when receiving an access request of a target client, inquiring device management information to determine whether an accessed client exists, wherein network information of each client accessed to the server is recorded in the device management information, and the target client is a client which has not been accessed to the server.
The image data transmission method of the embodiment of the application is applied to the server, and specifically, the server is the electronic equipment.
In the scenes of information sharing, remote teaching and the like of the detection system of the internet of things, data transmission is required, a server can be encoder equipment such as a network camera, a client can be hard disk video recorder equipment, data center products, equipment such as a computer and mobile phone client, and the like. For example, in a remote teaching scene, the server is a network camera of a main classroom for performing on-site teaching, the client is a hard disk video recorder device of other secondary classrooms for listening and speaking, for example, the server is a network camera for performing teaching in a classroom A, the server has a teaching video code stream of the classroom A, and personnel in the classroom B send an access request to the server through the hard disk video recorder, so that the server sends the teaching video code stream of the classroom A to the client.
When the server side obtains the access request of the target client side, the server side inquires the equipment management information so as to determine whether other client sides have accessed the server side, namely whether accessed client sides exist, wherein the equipment management information records network information of all the client sides accessed to the server side, and the accessed client sides can directly send data to the client sides of the client sides for the server side or can forward the data of the server side to the client sides of the client sides for other accessed client sides. The network information of each client accessed to the server includes a unique identification of a device of the accessed client, specifically, the unique identification may be a device code, a device name, etc. of the accessed client, and the network information of the accessed client may be a network IP (Internet Protocol, an interconnected protocol between networks) network segment, a network packet loss rate, etc.
And 120, determining a transfer client according to the device management information when the accessed client exists and the target client does not meet the preset access condition, so that the target client establishes communication connection with the transfer client, and the target client acquires the data of the server forwarded by the transfer client.
When the accessed client exists and the target client does not meet the preset access condition, the transfer client can be determined according to the equipment management information, and after the transfer client is confirmed, the transfer client is enabled to transfer the data of the server to the target client. Of course, when the target client meets the preset access condition, the server and the target client directly establish communication connection, so that data is sent to the target client, the flexibility of data interaction is improved, and the situations of packet loss and disordered data packets in the data interaction process are greatly reduced.
The preset access condition may be a condition set according to a network state of the server, where the network state may be a used bandwidth, or a current network packet loss rate, etc. The manner of determining the transit client according to the device management information may be determined for the server itself or may be determined by the target client. The manner in which the communications establish a connection may be wired or wireless, or may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies. For example, the client may access a wireless network based on a communication standard, such as WiFi (Wireless Fidelity, wireless network), an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof, and the like.
The network information of each client accessed to the server is recorded by using the equipment management information, when the server receives an access request of a target client, and when the target client does not meet a preset access condition, the equipment management information is queried to confirm that the accessed client exists, and the transfer client is determined according to the equipment management information, so that the target client establishes communication connection with the transfer client, the target client acquires the data of the server forwarded by the transfer client, a router capable of managing a multicast group is not needed in a network transmission process, the problems of packet loss, data packet disorder and the like in the prior art are solved in the scenes of information sharing, remote teaching and the like of an Internet of things detection system, and the stability of data transmission is improved.
In a possible implementation manner, when the accessed client exists and the target client does not meet a preset access condition, determining a transit client according to the device management information, so that the target client establishes a communication connection with the transit client, and the target client obtains the data of the server forwarded by the transit client, where the method includes:
When an accessed client exists and the target client does not meet a preset access condition, the device management information is sent to the target client, so that the target client selects one accessed client as a transfer client according to the network information of each client accessed to the server, and establishes communication connection with the transfer client, thereby enabling the target client to acquire the data of the server forwarded by the transfer client.
The method for determining the transfer client according to the device management information is determined by a target client, that is, the server sends the device management information to the target client, and the target client selects an accessed client as the transfer client according to the network information of each client accessed to the server.
Referring to fig. 2, fig. 2 is a first schematic diagram of interaction of a data transmission method in an embodiment of the present application, in a network teaching scene, the server is a network camera 210 in a classroom, the network camera 210 establishes a communication connection with a client 231 in a slave classroom 1 through a first router 221, the network camera 210 establishes a communication connection with a client 232 in a slave classroom 2 through the first router 221, network information of a client in a slave classroom 1 and network information of a client in a slave classroom 2 are recorded in device management information, an access request is sent from the client in a slave classroom 3 to the network camera, the network camera 210 queries the device management information, it is determined that the accessed client has a client 231 in a slave classroom 1 and a client 232 in a slave classroom 2, a packet loss ratio of the network camera 210 to the client 233 in a slave classroom 3 is greater than a preset packet loss ratio preset threshold, that is when the client 233 in a slave classroom 3 does not meet preset access conditions, the network camera 210 sends the device management information to the client 233 in a slave classroom 3, the client in a slave classroom 3 is switched from the client 1 and the client 232 in a slave classroom 2, a packet loss ratio of the client 1 is determined by switching the client 1 and the client 231 in a packet loss ratio of the slave classroom 2, the network camera 210 is switched from the client 1 to the client 1, the client 1 is switched to the client 1, and the client 231 is switched from the client 1 is switched to the client 1 according to the packet loss ratio of the client 1, and the packet loss ratio is determined by the network loss ratio of the client 1 is switched to the client 1, and the client 1 is switched to the client 1 and the client in the client 1 and the client has a packet loss ratio). The client 233 of the slave classroom 3 establishes a communication connection with the client 231 of the slave classroom 1, and after the communication connection is established, the client 231 of the slave classroom 1 forwards the data of the network camera 210 to the client 233 of the slave classroom 3.
After the transfer client confirms, the target client sends a forwarding application for the data of the server to the transfer client, wherein the forwarding application comprises verification information of the server, specifically, the verification information of the server comprises a user name of the server and a verification password of the server, and when the transfer client passes through verification according to the verification information of the server, the transfer client establishes communication connection with the target client and forwards the data of the server to the target client.
Referring to fig. 3, fig. 3 is a second schematic diagram of interaction of the data transmission method according to the embodiment of the present application, specifically, a forwarding application for the data of the server is sent from the client 233 of the classroom 3 to the client 231 of the secondary classroom 1, the forwarding application includes the authentication information of the webcam 210, specifically, the authentication information includes the authentication user name and the authentication password of the webcam 210, and when the authentication passes, the client 231 of the secondary classroom 1 and the client 233 of the secondary classroom 3 establish a connection through the second router 222, and the client 231 of the secondary classroom 1 forwards the data to the client 233 of the secondary classroom 3. The second router 222 and the first router 221 may be the same device or different devices.
In a possible implementation manner, when the accessed client exists and the target client does not meet a preset access condition, determining a transit client according to the device management information, so that the target client establishes a communication connection with the transit client, and the target client obtains the data of the server forwarded by the transit client, where the method includes:
when an accessed client exists and the target client does not meet a preset access condition, sending a packet loss rate test instruction to each client accessed to the server so that each client accessed to the server respectively tests the packet loss rate with the target client according to the packet loss rate test instruction, wherein the packet loss rate test instruction comprises the identification of the target client;
acquiring packet loss rates between the target clients and the respective clients fed back by the clients accessed to the server, and obtaining test packet loss rates of the clients accessed to the server;
selecting a client with the lowest test packet loss rate as a transfer client;
and sending the network information of the transfer client to the target client so that the target client establishes communication connection with the transfer client according to the network information of the transfer client, and the target client can acquire the data of the server forwarded by the transfer client.
The method for determining the transfer client according to the equipment management information includes that the method is determined through the server, namely, each client of the server, which is accessed to the server, sends a packet loss rate test instruction, so that each client of the server, which is accessed to the server, tests the packet loss rate with the target client according to the packet loss rate test instruction, the server can obtain the test packet loss rate of each client of the server, the server selects the client with the lowest test packet loss rate as the transfer client, and after the determination of the transfer client, the server sends the network information of the transfer client to the target client, so that the target client establishes communication connection with the transfer client according to the network information of the transfer client, and the target client can acquire the data of the server, which is forwarded by the transfer client.
In a possible implementation manner, the method for determining that the target client does not meet the preset access condition includes:
judging whether the used bandwidth of the service end is larger than a preset bandwidth threshold value or not, judging whether the packet loss rate between the service end and the target client end is larger than a preset packet loss rate threshold value or not, wherein when the used bandwidth of the service end is not larger than the preset bandwidth threshold value and the packet loss rate between the service end and the target client end is not larger than the preset packet loss rate threshold value, judging that the target client end meets preset access conditions, otherwise, judging that the target client end does not meet the preset access conditions.
The preset access condition may be a condition set according to a network state of the server, where the network state may be a used bandwidth or a current network packet loss rate. For example, the server obtains that the current network packet loss rate with the target client is greater than a preset threshold in a PING manner, and the target client does not meet a preset access condition, or when the used bandwidth of the server exceeds the preset bandwidth threshold, the target client does not meet the preset access condition, and the preset access condition can be set according to actual needs and is not described herein.
In one possible implementation manner, after the step of determining, when the accessed client exists and the target client does not meet the preset access condition, a transit client according to the device management information, so that the target client establishes a communication connection with the transit client, so that the target client obtains the data of the server forwarded by the transit client, the method further includes:
and after receiving feedback information which is sent by the transfer client and indicates that the transfer client and the target client are successfully connected, adding the target client into the equipment management information.
For example, when the client 233 in the slave classroom 3 establishes a connection with the client 231 in the slave classroom 1 and the client 231 in the slave classroom 1 feeds back information that the client 233 in the slave classroom 3 has successfully connected to the network camera 210, the network camera 210 records the network information of the client 233 in the slave classroom 3 in the device management information. Furthermore, after the network information of the client 233 in the slave classroom 3 is recorded in the device management information, the client 233 in the slave classroom 3 can be used as a transfer client to establish connection with other devices, so as to forward and process data, thereby improving the flexibility of data interaction, and greatly reducing the situations of packet loss and disordered data packets in the data interaction process.
Referring to fig. 4, fig. 4 is a third schematic diagram illustrating interaction of a data transmission method according to an embodiment of the present application. An access request is sent from a client of classroom 1 to a network camera, the client of classroom 1 meets a preset access condition, the network camera agrees to the access request from the client of classroom 1, a connection is established between the client of classroom 1 and the network camera, and the network camera adds network information from the client of classroom 1 to the device management information. The method comprises the steps that an access request is sent from a client of a classroom 3 to a network camera, the network camera searches equipment management information to judge whether the accessed client exists, when the accessed client exists and the client of the classroom 3 does not meet preset access conditions, the network camera sends the equipment management information to the client of the secondary classroom 1, the client of the classroom 3 searches the equipment management information to determine that the client of the secondary classroom 1 is a transfer client, the client of the classroom 3 sends a forwarding application for data of the server to the client of the secondary classroom 1, after verification is passed, connection is established between the client of the secondary classroom 1 and the client of the secondary classroom 3, so that the client of the secondary classroom 1 sends the data of the network camera to the client of the secondary classroom 3, information successfully connected with the client of the secondary classroom 3 is fed back to the network camera, and the information of the client of the secondary classroom 3 is added to the equipment management information.
The embodiment of the application provides a data transmission method applied to a client, referring to fig. 5, fig. 5 is a schematic diagram of the data transmission method applied to the client in the embodiment of the application, and the method comprises the following steps:
step 310, in the case that the current client does not access the server, an access request is sent to the server.
The image data transmission method of the embodiment of the application is applied to the client, and specifically, the client is the electronic equipment.
In the scenes of information sharing, remote teaching and the like of the detection system of the internet of things, data transmission is required, a server can be encoder equipment such as a network camera, a client can be hard disk video recorder equipment, data center products, equipment such as a computer and mobile phone client, and the like. When the current client is not connected to the server, the current client sends an access request to the server, and after the server receives the access request of the current client, the server can firstly judge whether the target client meets the preset access condition, and when the target client does not meet the preset access condition, query the equipment management information to judge whether the accessed client exists, wherein the network information of each client accessed to the server is recorded in the equipment management information. When an accessed client exists, the device management information is sent to the current client, so that the current client selects one accessed client as a transfer client according to the network information of each client accessed to the server, and communication connection with the transfer client is established, and the current client acquires the data of the server forwarded by the transfer client.
Step 320, when receiving the device management information sent by the server according to the access request, where the device management information records network information of each client that has accessed the server, selecting one accessed client from each client that has accessed the server as a transit client.
When receiving the device management information sent by the server according to the access request, the client selects one accessed client from the clients accessed to the server as a transfer client, and obtains the data of the server through the transfer client.
And 330, sending a forwarding application to the transit client, where the forwarding application is used to apply that the transit client forwards the data of the server to the current client.
After the transfer client confirms, the current client sends a forwarding application to the transfer client so as to apply the transfer client to forward the data of the server to the current client. The forwarding application includes the authentication information of the server, and specifically, the authentication information of the server includes a user name of the server and an authentication password of the server.
Step 340, receiving the data of the server forwarded by the forwarding client when the forwarding client passes the authentication of the forwarding application.
When the transfer client passes the authentication according to the authentication information of the server, the transfer client establishes communication connection with the target client and forwards the data of the server to the current client.
The method comprises the steps of recording network information of each client accessed to the server by using equipment management information, sending an access request to the server when the current client is not accessed to the server, selecting one accessed client from the clients accessed to the server as a transfer client when the equipment management information sent by the server according to the access request is received, sending a forwarding application to the transfer client, and receiving data of the server forwarded by the transfer client when the transfer client passes authentication of the forwarding application. The router capable of managing the multicast group is not needed in the network transmission process, the problems that packet loss, data packet disorder and the like are easy to occur in the prior art in the scenes of information sharing, remote teaching and the like of the detection system of the internet of things are solved, and the stability of data transmission is improved.
In one possible implementation manner, when the device management information sent by the server according to the access request is received, one of the clients that has accessed the server is selected as an accessed client, and the method includes:
when receiving the equipment management information sent by the server according to the access request, testing the packet loss rate between the equipment management information and each client accessed to the server to obtain the tested packet loss rate of each client accessed to the server;
and selecting the client with the lowest test packet loss rate as the switching client.
And selecting the client with the lowest test packet loss rate as a transfer client, so that the data of the server forwarded by the transfer client can be received. Therefore, the problems of packet loss, disordered data packets and the like in the prior art can be solved, and the stability of data transmission is improved.
In one possible embodiment, the network information of each client accessed to the server includes a network segment to which each client accessed to the server belongs, and when receiving the device management information sent by the server according to the access request, selecting one accessed client from each client accessed to the server as a transit client includes:
When receiving the device management information sent by the server according to the access request, selecting one client which is in the same network segment with the current client from the clients which are accessed to the server according to the network segment which the current client belongs to and the network segment which the clients which are accessed to the server belong to, and taking the client as a transfer client.
And selecting a client which is in the same network segment with the current client as a transfer client, so that the data of the server forwarded by the transfer client can be received. Therefore, the problems of packet loss, disordered data packets and the like in the prior art can be solved, and the stability of data transmission is improved.
In one possible implementation manner, in a case that the current client has access to the server, the method further includes:
when receiving forwarding applications of other clients aiming at the server side, judging whether key information carried in the forwarding applications passes verification or not;
and when the key information carried in the forwarding application passes verification, forwarding the data received from the service end to the client end which sends the forwarding application.
The key information carried in the forwarding application can be the user name of the server and the verification password of the server, and the data security can be improved by verifying the key information to perform authentication.
In one possible implementation manner, after the step of forwarding the data received from the server to the client that sends the forwarding application when the key information carried in the forwarding application passes the verification, the method further includes:
and sending feedback information representing successful connection with the client for sending the forwarding application to the server, so that the server adds the network information of the client for sending the forwarding application to the equipment management information after receiving the feedback information.
And after receiving the feedback information, the server adds the network information of the client for sending the forwarding application into the equipment management information so that the client for forwarding the application can be used as a switching client subsequently, thereby solving the problems of packet loss, disordered data packets and the like in the prior art and improving the stability of data transmission.
In one possible implementation manner, when the key information carried in the forwarding application passes verification, forwarding, to a client that sends the forwarding application, data received from the server, includes:
When the key information carried in the forwarding application passes verification, selecting a corresponding sending mode according to the data type of the data received from the server, and forwarding the data received from the server to a client for sending the forwarding application by using the selected sending mode, wherein the sending mode comprises at least two of a UDP (User Datagram Protocol ) mode, a TCP (Transmission Control Protocol, transmission control protocol) mode and a multicast mode.
The forwarding mode can be flexibly realized by selecting a UDP mode, a TCP mode or a multicast mode because the forwarding client forwards the data, so that the flexibility of data interaction is improved, and the situations of packet loss and data packet disorder in the data interaction process are greatly reduced. In addition, the forwarding of the data of the server is carried out through the transfer client, and according to the network condition, the network load of the transmission medium is reduced in a targeted manner and the total bandwidth consumption is reduced, so that the load balancing under the network environment is achieved.
In one possible implementation manner, when the key information carried in the forwarding application passes verification, selecting a corresponding transmission mode according to a data type of the data received from the server, and forwarding the data received from the server to the client that sends the forwarding application by using the selected transmission mode, where the method includes:
When the key information carried in the forwarding application passes verification, acquiring the data type of the data which is received from the server and needs to be forwarded, and obtaining a target data type;
determining a priority corresponding to the target data type as a target priority, wherein the priority comprises a high priority, a medium priority and a low priority;
and forwarding the data to be forwarded to the client for forwarding the application by using the data transmission mode corresponding to the target priority, wherein the data transmission mode corresponding to the high priority is a TCP mode, the data transmission mode corresponding to the medium priority is a UDP mode, and the data transmission mode corresponding to the low priority is a multicast mode.
For example, the priority corresponding to the alarm data is high priority, and the priority corresponding to the parameter data is not low priority, when the forwarded data is the alarm data, the data is forwarded in a TCP mode, so that the reliability of the data is ensured, the forwarded data is the parameter data, and the data is processed in a multicast mode, so that the flexibility of data interaction is improved, and the situations of packet loss and disordered data packets in the data interaction process are greatly reduced.
Referring to fig. 6, fig. 6 is a schematic diagram of a data transmission system according to an embodiment of the present application, including:
a server 610 and a client 620;
the server 610 is configured to query device management information when receiving an access request of a target client 620, and determine whether there is a client 620 that has accessed the server 610, where network information of each client 620 that has accessed the server 610 is recorded in the device management information, and the target client 620 is a client that has not accessed the server 610; when there is an accessed client 620 and the target client 620 does not meet a preset access condition, determining a transfer client 620 according to the device management information, so that the target client 620 and the transfer client 620 establish a communication connection, and the target client 620 obtains data of the server 610 forwarded by the transfer client 620;
the client 620 is configured to send an access request to the server 610 when the server 610 is not accessed, and when the server 610 determines to transfer the client 620 according to the device management information, establish a communication connection with the transfer client 620, thereby obtaining data of the server 610 forwarded by the transfer client 620.
In one possible implementation, the server 610 is specifically configured to:
when there is an accessed client 620 and the target client 620 does not meet a preset access condition, the device management information is transmitted to the target client 620;
the target client 620 is specifically configured to, after receiving the device management information sent by the server 610 according to the access request, select one accessed client 620 from the clients 620 accessed to the server 610, as a transit client 620; transmitting a forwarding application to the transit client 620, where the forwarding application is used to apply that the transit client 620 forwards the data of the server 610 to the current client 620; in the case that the transit client 620 passes the authentication of the forwarding application, the data of the server 610 forwarded by the transit client 620 is received.
In one possible implementation, the server 610 is specifically configured to:
when there is an accessed client 620 and the target client 620 does not meet a preset access condition, sending a packet loss rate test instruction to each client 620 that has accessed the server 610;
Each client 620 that has been accessed to the server 610 is specifically configured to test a packet loss rate with the target client 620 according to the packet loss rate test instruction, where the packet loss rate test instruction includes an identifier of the target client 620, and feed back the packet loss rate with the target client 620 to the server 610;
the server 610 obtains the packet loss rate between each client 620 that is fed back by each client 620 that has accessed the server 610 and the target client 620, and obtains the test packet loss rate of each client 620 that has accessed the server 610; selecting the client 620 with the lowest test packet loss rate as the transfer client 620; transmitting the network information of the transit client 620 to the target client 620;
the target client 620 establishes a communication connection with the transit client 620 according to the network information of the transit client 620, so as to obtain the data of the server 610 forwarded by the transit client 620.
In one possible implementation, the server 610 is specifically configured to:
judging whether the used bandwidth of the service end 610 is greater than a preset bandwidth threshold, judging whether the packet loss rate between the service end 610 and the target client 620 is greater than a preset packet loss rate threshold, wherein when the used bandwidth of the service end 610 is not greater than the preset bandwidth threshold and the packet loss rate between the service end 610 and the target client 620 is not greater than the preset packet loss rate threshold, judging that the target client 620 meets a preset access condition, otherwise, judging that the target client 620 does not meet the preset access condition.
In one possible implementation, the server 610 is further configured to:
when receiving feedback information sent by the transit client 620 and indicating that the transit client 620 is successfully connected to the target client 620, the target client 620 is added to the device management information.
In one possible implementation, the network information of each client 620 that has accessed the server 610 includes a network segment to which each client 620 that has accessed the server 610 belongs, where the client 620 is specifically configured to:
when receiving the device management information sent by the server 610 according to the access request, one client 620 in the same network segment as the current client 620 is selected from the clients 620 accessed to the server 610 as the transit client 620 according to the network segment to which the current client 620 belongs and the network segment to which each client 620 accessed to the server 610 belongs.
In a possible implementation manner, in a case where the client 620 has accessed the server 610, the client 620 is further configured to:
when receiving a forwarding application of the other client 620 for the server 610, determining whether the key information carried in the forwarding application passes verification;
When the key information carried in the forwarding application passes the verification, the data received from the server 610 is forwarded to the client 620 that sends the forwarding application.
In one possible implementation, the client 620 is specifically configured to:
and transmitting feedback information indicating that the connection with the client 620 transmitting the forwarding application is successful to the server 610, so that the server 610 adds the network information of the client 620 transmitting the forwarding application to the device management information after receiving the feedback information.
In one possible implementation, the client 620 is specifically configured to:
when the key information carried in the forwarding application passes the verification, a corresponding transmission mode is selected according to the data type of the data received from the server 610, and the data received from the server 610 is forwarded to the client 620 that sends the forwarding application by using the selected transmission mode, where the transmission mode includes at least two modes of a UDP mode, a TCP mode and a multicast mode.
In one possible implementation, the client 620 is specifically configured to:
when the key information carried in the forwarding application passes the verification, the data type of the data to be forwarded, which is received from the server 610, is obtained, and a target data type is obtained;
Determining a priority corresponding to the target data type as a target priority, wherein the priority comprises a high priority, a medium priority and a low priority;
and forwarding the data to be forwarded to the client 620 that sends the forwarding request by using the data transmission mode corresponding to the target priority, where the data transmission mode corresponding to the high priority is a TCP mode, the data transmission mode corresponding to the medium priority is a UDP mode, and the data transmission mode corresponding to the low priority is a multicast mode.
The specific manner in which the various modules perform the operations in relation to the systems of the above embodiments have been described in detail in relation to the embodiments of the method and will not be described in detail herein.
An embodiment of the present application provides a data transmission device applied to a server, referring to fig. 7, fig. 7 is a schematic diagram of the data transmission device applied to the server according to the embodiment of the present application, where the device includes:
the query module 710 is configured to query device management information when an access request of a target client is received, and determine whether an accessed client exists, where the device management information includes network information of clients that have accessed the server, and the target client is a client that has not accessed the server;
And a processing module 720, configured to determine, when there is an accessed client and the target client does not meet a preset access condition, a transit client according to the device management information, so that the target client establishes a communication connection with the transit client, and thus the target client obtains data of the server forwarded by the transit client.
In one possible implementation, the processing module 720 is specifically configured to:
when an accessed client exists and the target client does not meet a preset access condition, the device management information is sent to the target client, so that the target client selects one accessed client as a transfer client according to the network information of each client accessed to the server, and establishes communication connection with the transfer client, thereby enabling the target client to acquire the data of the server forwarded by the transfer client.
In one possible implementation, the processing module 720 is specifically configured to:
when an accessed client exists and the target client does not meet a preset access condition, sending a packet loss rate test instruction to each client accessed to the server so that each client accessed to the server respectively tests the packet loss rate with the target client according to the packet loss rate test instruction, wherein the packet loss rate test instruction comprises the identification of the target client;
Acquiring packet loss rates between the target clients and the respective clients fed back by the clients accessed to the server, and obtaining test packet loss rates of the clients accessed to the server;
selecting a client with the lowest test packet loss rate as a transfer client;
and sending the network information of the transfer client to the target client so that the target client establishes communication connection with the transfer client according to the network information of the transfer client, and the target client can acquire the data of the server forwarded by the transfer client.
In one possible implementation manner, the processing module 720 includes a determining sub-module, where the determining sub-module is specifically configured to:
when an accessed client exists, judging whether the used bandwidth of the server is larger than a preset bandwidth threshold, judging whether the packet loss rate between the server and the target client is larger than a preset packet loss rate threshold, wherein when the used bandwidth of the server is not larger than the preset bandwidth threshold and the packet loss rate between the server and the target client is not larger than the preset packet loss rate threshold, judging that the target client meets preset access conditions, otherwise, judging that the target client does not meet preset access conditions.
In one possible embodiment, the apparatus further includes:
and the adding module is used for adding the target client into the equipment management information after receiving feedback information which is sent by the transfer client and indicates that the transfer client and the target client are successfully connected.
An embodiment of the present application provides a data transmission device applied to a client, referring to fig. 8, fig. 8 is a schematic diagram of the data transmission device applied to the client according to the embodiment of the present application, where the device includes:
a first sending module 810, configured to send an access request to a server when the current client is not accessed to the server;
a selection module 820, configured to, when receiving device management information sent by the server according to the access request, record network information of each client that has accessed the server in the device management information, and select one accessed client as a transit client from each client that has accessed the server;
a second sending module 830, configured to send a forwarding application to the transit client, where the forwarding application is used to apply that the transit client forwards the data of the server to a current client;
And a receiving module 840, configured to receive the data of the server forwarded by the forwarding client when the forwarding client passes the authentication of the forwarding application.
In one possible implementation, the selecting module 820 is specifically configured to:
when receiving the equipment management information sent by the server according to the access request, testing the packet loss rate between the equipment management information and each client accessed to the server to obtain the tested packet loss rate of each client accessed to the server;
and selecting the client with the lowest test packet loss rate as the switching client.
In one possible implementation manner, the network information of each client that has accessed the server includes a network segment to which each client that has accessed the server belongs, and the selection module 820 is specifically configured to:
when receiving the device management information sent by the server according to the access request, selecting one client which is in the same network segment with the current client from the clients which are accessed to the server according to the network segment which the current client belongs to and the network segment which the clients which are accessed to the server belong to, and taking the client as a transfer client.
In one possible implementation manner, in a case that the current client has access to the server, the apparatus further includes:
the judging module is used for judging whether key information carried in the forwarding application passes verification or not when receiving forwarding applications of other clients aiming at the server side;
and the third sending module is used for forwarding the data received from the server to the client for sending the forwarding application when the key information carried in the forwarding application passes the verification.
In one possible embodiment, the apparatus further includes:
and the feedback information sending module is used for sending feedback information representing successful connection with the client for sending the forwarding application to the server, so that the server adds the network information of the client for sending the forwarding application to the equipment management information after receiving the feedback information.
In one possible implementation manner, the third sending module is specifically configured to:
when the key information carried in the forwarding application passes verification, selecting a corresponding sending mode according to the data type of the data received from the server, and forwarding the data received from the server to a client for sending the forwarding application by using the selected sending mode, wherein the sending mode comprises at least two of a UDP mode, a TCP mode and a multicast mode.
In one possible implementation manner, the third sending module includes:
the processing sub-module is used for acquiring the data type of the data which is received from the server and needs to be forwarded when the key information carried in the forwarding application passes the verification, so as to acquire the target data type;
a priority determining sub-module, configured to determine a priority corresponding to the target data type as a target priority, where the priority includes a high priority, a medium priority, and a low priority;
and a forwarding sub-module, configured to forward the data to be forwarded to a client that sends the forwarding application by using a data transmission mode corresponding to the target priority, where the data transmission mode corresponding to the high priority is a TCP mode, the data transmission mode corresponding to the medium priority is a UDP mode, and the data transmission mode corresponding to the low priority is a multicast mode.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
It should be noted that, in this document, the technical features in each alternative may be combined to form a solution, so long as they are not contradictory, and all such solutions are within the scope of the disclosure of the present application. Relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for embodiments of the apparatus, electronic device and storage medium, the description is relatively simple as it is substantially similar to the method embodiments, where relevant see the section description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (10)

1. A data transmission method, characterized by being applied to a network camera, the method comprising:
inquiring equipment management information when an access request of a target client is received, and judging whether the accessed client exists, wherein the equipment management information records network information of all clients accessed to the network camera, and the target client is a client which is not accessed to the network camera; the network information of each client accessed to the network camera comprises a unique identification of equipment accessed to the client; the unique identification of the accessed client is the equipment code and the equipment name of the accessed client;
When an accessed client exists and the target client does not meet a preset access condition, determining a transfer client according to the equipment management information, so that the target client and the transfer client are in communication connection, and the target client can acquire the data of the network camera forwarded by the transfer client;
after receiving feedback information which is sent by the transfer client and indicates that the transfer client and the target client are successfully connected, adding the target client into the equipment management information;
the method for judging that the target client does not meet the preset access condition comprises the following steps:
judging whether the used bandwidth of the network camera is larger than a preset bandwidth threshold value or not, judging whether the packet loss rate between the network camera and the target client is larger than a preset packet loss rate threshold value or not, wherein when the used bandwidth of the network camera is not larger than the preset bandwidth threshold value and the packet loss rate between the network camera and the target client is not larger than the preset packet loss rate threshold value, judging that the target client meets a preset access condition, otherwise, judging that the target client does not meet the preset access condition;
When an accessed client exists and the target client does not meet a preset access condition, determining a transfer client according to the equipment management information, so that the target client and the transfer client establish communication connection, and the target client obtains the data of the network camera forwarded by the transfer client, wherein the method comprises the following steps:
when an accessed client exists and the target client does not meet a preset access condition, sending a packet loss rate test instruction to each client accessed to the network camera so that each client accessed to the network camera respectively tests the packet loss rate between the client and the target client according to the packet loss rate test instruction, wherein the packet loss rate test instruction comprises an identifier of the target client;
acquiring packet loss rates between the target clients and the respective clients fed back by the clients accessed to the network camera, and obtaining test packet loss rates of the clients accessed to the network camera;
selecting a client with the lowest test packet loss rate as a transfer client;
and sending the network information of the transfer client to the target client so that the target client establishes communication connection with the transfer client according to the network information of the transfer client, and the target client can acquire the data of the network camera forwarded by the transfer client.
2. The method according to claim 1, wherein when there is an accessed client and the target client does not meet a preset access condition, determining a transit client according to the device management information, so that the target client establishes a communication connection with the transit client, and thus the target client obtains data of the network camera forwarded by the transit client, including:
when an accessed client exists and the target client does not meet a preset access condition, the device management information is sent to the target client, so that the target client selects one accessed client as a transfer client according to the network information of each client accessed to the network camera, and establishes communication connection with the transfer client, and the target client can acquire the data of the network camera forwarded by the transfer client.
3. A data transmission method, applied to a client, the method comprising:
sending an access request to the network camera under the condition that the current client is not accessed to the network camera;
When receiving the equipment management information sent by the network camera according to the access request, wherein the equipment management information records the network information of all the clients accessed to the network camera, and one accessed client is selected from all the clients accessed to the network camera to serve as a transfer client; the switching client is determined when the current client does not meet the preset access condition, and the judging method for the current client not meeting the preset access condition comprises the following steps: judging whether the used bandwidth of the network camera is larger than a preset bandwidth threshold value or not, judging whether the packet loss rate between the network camera and the current client is larger than a preset packet loss rate threshold value or not, wherein when the used bandwidth of the network camera is not larger than the preset bandwidth threshold value and the packet loss rate between the network camera and the current client is not larger than the preset packet loss rate threshold value, judging that the current client meets preset access conditions, otherwise, judging that the current client does not meet preset access conditions; the network information of each client accessed to the network camera comprises a unique identification of equipment accessed to the client; the unique identification of the accessed client is the equipment code and the equipment name of the accessed client;
Transmitting a forwarding application to the transit client, wherein the forwarding application is used for applying that the transit client forwards the data of the network camera to a current client;
receiving data of the network camera forwarded by the forwarding client under the condition that the forwarding client passes through the authentication of the forwarding application, and sending feedback information representing that the connection with the client sending the forwarding application is successful to the network camera, so that the network camera adds the network information of the client sending the forwarding application into the equipment management information after receiving the feedback information;
when receiving the device management information sent by the network camera according to the access request, selecting an accessed client from the clients accessed to the network camera as a transfer client, wherein the method comprises the following steps:
when receiving the equipment management information sent by the network camera according to the access request, testing the packet loss rate between the network camera and each client accessed to the network camera to obtain the tested packet loss rate of each client accessed to the network camera;
And selecting the client with the lowest test packet loss rate as the switching client.
4. The method according to claim 3, wherein the network information of each client that has accessed the network camera includes a network segment to which each client that has accessed the network camera belongs, and when receiving the device management information sent by the network camera according to the access request, selecting one of the clients that has accessed the network camera as a transit client includes:
when receiving the device management information sent by the network camera according to the access request, selecting one client which is in the same network segment with the current client from the clients accessed to the network camera according to the network segment to which the current client belongs and the network segment to which the clients accessed to the network camera belong as a transfer client.
5. A method according to claim 3, wherein in case the current client has access to the webcam, the method further comprises:
when receiving forwarding applications of other clients aiming at the network camera, judging whether key information carried in the forwarding applications passes verification or not;
And when the key information carried in the forwarding application passes verification, forwarding the data received from the network camera to a client side which sends the forwarding application.
6. The method according to claim 5, wherein forwarding the data received from the network camera to the client that sent the forwarding application when the key information carried in the forwarding application is verified, includes:
when the key information carried in the forwarding application passes verification, selecting a corresponding sending mode according to the data type of the data received from the network camera, and forwarding the data received from the network camera to a client for sending the forwarding application by using the selected sending mode, wherein the sending mode comprises at least two of a UDP mode, a TCP mode and a multicast mode.
7. The method according to claim 6, wherein when the key information carried in the forwarding application passes verification, selecting a corresponding transmission mode according to a data type of the data received from the network camera, and forwarding the data received from the network camera to the client that transmits the forwarding application by using the selected transmission mode, includes:
When the key information carried in the forwarding application passes verification, acquiring the data type of the data which is received from the network camera and needs to be forwarded, and obtaining a target data type;
determining a priority corresponding to the target data type as a target priority, wherein the priority comprises a high priority, a medium priority and a low priority;
and forwarding the data to be forwarded to the client for forwarding the application by using the data transmission mode corresponding to the target priority, wherein the data transmission mode corresponding to the high priority is a TCP mode, the data transmission mode corresponding to the medium priority is a UDP mode, and the data transmission mode corresponding to the low priority is a multicast mode.
8. A data transmission apparatus, characterized by being applied to a network camera, comprising:
the query module is used for querying equipment management information when receiving an access request of a target client, and judging whether the accessed client exists or not, wherein the equipment management information comprises network information of all clients accessed to the network camera, and the target client is a client which is not accessed to the network camera yet; the network information of each client accessed to the network camera comprises a unique identification of equipment accessed to the client; the unique identification of the accessed client is the equipment code and the equipment name of the accessed client;
The processing module is used for determining a transfer client according to the equipment management information when the accessed client exists and the target client does not meet the preset access condition, so that the target client and the transfer client are in communication connection, and the target client can acquire the data of the network camera forwarded by the transfer client;
the adding module is used for adding the target client into the equipment management information after receiving feedback information which is sent by the transfer client and indicates that the transfer client and the target client are successfully connected;
the processing module comprises a judging sub-module, and the judging sub-module is specifically used for:
when an accessed client exists, judging whether the used bandwidth of the network camera is larger than a preset bandwidth threshold, judging whether the packet loss rate between the network camera and the target client is larger than a preset packet loss rate threshold, wherein when the used bandwidth of the network camera is not larger than the preset bandwidth threshold and the packet loss rate between the network camera and the target client is not larger than the preset packet loss rate threshold, judging that the target client meets preset access conditions, otherwise, judging that the target client does not meet preset access conditions;
The processing module is specifically configured to:
when an accessed client exists and the target client does not meet a preset access condition, sending a packet loss rate test instruction to each client accessed to the network camera so that each client accessed to the network camera respectively tests the packet loss rate between the client and the target client according to the packet loss rate test instruction, wherein the packet loss rate test instruction comprises an identifier of the target client;
acquiring packet loss rates between the target clients and the respective clients fed back by the clients accessed to the network camera, and obtaining test packet loss rates of the clients accessed to the network camera;
selecting a client with the lowest test packet loss rate as a transfer client;
and sending the network information of the transfer client to the target client so that the target client establishes communication connection with the transfer client according to the network information of the transfer client, and the target client can acquire the data of the network camera forwarded by the transfer client.
9. A data transmission apparatus for use with a client, the apparatus comprising:
The first sending module is used for sending an access request to the network camera under the condition that the current client is not accessed to the network camera;
the selecting module is used for selecting one accessed client from the clients accessed to the network camera as a transfer client when receiving the equipment management information sent by the network camera according to the access request, wherein the network information of the clients accessed to the network camera is recorded in the equipment management information; the switching client is determined when the current client does not meet the preset access condition, and the judging method for the current client not meeting the preset access condition comprises the following steps: judging whether the used bandwidth of the network camera is larger than a preset bandwidth threshold value or not, judging whether the packet loss rate between the network camera and the current client is larger than a preset packet loss rate threshold value or not, wherein when the used bandwidth of the network camera is not larger than the preset bandwidth threshold value and the packet loss rate between the network camera and the current client is not larger than the preset packet loss rate threshold value, judging that the current client meets preset access conditions, otherwise, judging that the current client does not meet preset access conditions; the network information of each client accessed to the network camera comprises a unique identification of equipment accessed to the client; the unique identification of the accessed client is the equipment code and the equipment name of the accessed client;
The second sending module is used for sending a forwarding application to the transfer client, wherein the forwarding application is used for applying the transfer client to forward the data of the network camera to the current client;
the receiving module is used for receiving the data of the network camera forwarded by the forwarding client under the condition that the forwarding client passes the authentication of the forwarding application;
the feedback information sending module is used for sending feedback information representing that the connection with the client side sending the forwarding application is successful to the network camera, so that the network camera adds the network information of the client side sending the forwarding application to the equipment management information after receiving the feedback information;
the selecting module is specifically configured to:
when receiving the equipment management information sent by the network camera according to the access request, testing the packet loss rate between the network camera and each client accessed to the network camera to obtain the tested packet loss rate of each client accessed to the network camera;
and selecting the client with the lowest test packet loss rate as the switching client.
10. A data transmission system, the system comprising:
A network camera, a client;
the network camera is used for inquiring equipment management information and judging whether a client accessed to the network camera exists or not when an access request of a target client is received, wherein the equipment management information records network information of all clients accessed to the network camera, and the target client is a client which is not accessed to the network camera yet; when an accessed client exists and the target client does not meet a preset access condition, determining a transfer client according to the equipment management information, so that the target client and the transfer client are in communication connection, and the target client can acquire the data of the network camera forwarded by the transfer client; the method for judging that the target client does not meet the preset access condition comprises the following steps: judging whether the used bandwidth of the network camera is larger than a preset bandwidth threshold value or not, judging whether the packet loss rate between the network camera and the target client is larger than a preset packet loss rate threshold value or not, wherein when the used bandwidth of the network camera is not larger than the preset bandwidth threshold value and the packet loss rate between the network camera and the target client is not larger than the preset packet loss rate threshold value, judging that the target client meets a preset access condition, otherwise, judging that the target client does not meet the preset access condition; the network information of each client accessed to the network camera comprises a unique identification of equipment accessed to the client; the unique identification of the accessed client is the equipment code and the equipment name of the accessed client;
The client is used for sending an access request to the network camera under the condition that the network camera is not accessed, and when the network camera determines a transfer client according to the equipment management information, the network camera establishes communication connection with the transfer client so as to acquire the data of the network camera forwarded by the transfer client; the transfer client sends feedback information representing successful connection with the client sending the forwarding application to the network camera, so that the network camera adds the network information of the client sending the forwarding application to the equipment management information after receiving the feedback information; the forwarding application is that the client sends the forwarding application to the forwarding client, and the forwarding application is used for applying the forwarding client to forward the data of the network camera to the current client;
the network camera is specifically used for:
when an accessed client exists and the target client does not meet a preset access condition, sending a packet loss rate test instruction to each client accessed to the network camera;
each client which is accessed to the network camera is specifically configured to test the packet loss rate with the target client according to the packet loss rate test instruction, where the packet loss rate test instruction includes an identifier of the target client, and feed back the packet loss rate with the target client to the network camera;
The network camera obtains packet loss rates between the target client and each client fed back by each client accessed to the network camera, and test packet loss rates of each client accessed to the network camera are obtained; selecting a client with the lowest test packet loss rate as a transfer client; the network information of the transit client is sent to the target client;
and the target client establishes communication connection with the transfer client according to the network information of the transfer client, so as to acquire the data of the network camera forwarded by the transfer client.
CN202010238226.0A 2020-03-30 2020-03-30 Data transmission method, data transmission device and data transmission system Active CN113472827B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010238226.0A CN113472827B (en) 2020-03-30 2020-03-30 Data transmission method, data transmission device and data transmission system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010238226.0A CN113472827B (en) 2020-03-30 2020-03-30 Data transmission method, data transmission device and data transmission system

Publications (2)

Publication Number Publication Date
CN113472827A CN113472827A (en) 2021-10-01
CN113472827B true CN113472827B (en) 2023-09-05

Family

ID=77865004

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010238226.0A Active CN113472827B (en) 2020-03-30 2020-03-30 Data transmission method, data transmission device and data transmission system

Country Status (1)

Country Link
CN (1) CN113472827B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114745437A (en) * 2022-04-28 2022-07-12 南方电网深圳数字电网研究院有限公司 Method and device for unified data access

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101001195A (en) * 2006-12-19 2007-07-18 科博技术有限公司 Data transmission system and method
CN101032427A (en) * 2007-04-27 2007-09-12 周钷 Digital-signal intelligent monitoring method and application system thereof
CN102143187A (en) * 2011-04-07 2011-08-03 北京星网锐捷网络技术有限公司 Method and system for terminal equipment to access network as well as network access proxy device
WO2016011624A1 (en) * 2014-07-23 2016-01-28 华为技术有限公司 Data packet sending and data processing devices and methods
CN108881963A (en) * 2018-05-30 2018-11-23 歌尔科技有限公司 Data capture method, server-side and client

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101001195A (en) * 2006-12-19 2007-07-18 科博技术有限公司 Data transmission system and method
CN101032427A (en) * 2007-04-27 2007-09-12 周钷 Digital-signal intelligent monitoring method and application system thereof
CN102143187A (en) * 2011-04-07 2011-08-03 北京星网锐捷网络技术有限公司 Method and system for terminal equipment to access network as well as network access proxy device
WO2016011624A1 (en) * 2014-07-23 2016-01-28 华为技术有限公司 Data packet sending and data processing devices and methods
CN108881963A (en) * 2018-05-30 2018-11-23 歌尔科技有限公司 Data capture method, server-side and client

Also Published As

Publication number Publication date
CN113472827A (en) 2021-10-01

Similar Documents

Publication Publication Date Title
US10171959B2 (en) Distributed access point for IP based communications
US9071942B2 (en) MAC based mapping in IP based communications
CN102027711B (en) The method and apparatus of multicast fabric anomaly
US7710917B2 (en) Method communication system, radio base station, mobile terminal and delivery method
US20110138068A1 (en) Initiating an alternative communication channel for receiving streaming content
KR20090091247A (en) System and method for implementing mbms handover during download delivery
CN101227636B (en) Information sharing method
US9319226B2 (en) Method and system for downloading in ubiquitous network by means of multicast
CN107736039B (en) Video distribution method and device
US9306850B2 (en) Method for transmitting content in content centric network
CN113472827B (en) Data transmission method, data transmission device and data transmission system
CN105657040A (en) Inter-device intranet communication method and system
CN104284142A (en) Communication method, device and system
CN104519022A (en) Method and device for establishing connecting channel
CN104168302A (en) Device control realizing method, device control realizing system and proxy gateway
JP3682439B2 (en) Data communication system and method, server device, client device, and program
CN101090480A (en) Video request method, server and network added storage server
EP3515121A1 (en) Device networking method, apparatus and system
US9668238B1 (en) Multicast file delivery
KR100586564B1 (en) System and apparatus and method for efficient internet data broadcasting
CN102215240B (en) Streaming media signalling sending method and equipment as well as point-to-point streaming media system
TW201707484A (en) A system and method for controlling quality of data transmission
CN104104562B (en) Method, client, server and the system of signaling are transmitted in home network
CN108307149B (en) Video proxy system and monitoring method
CN102111848B (en) Method, system and device for wireless bearing bandwidth information notification

Legal Events

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