CN112118273B - Data interaction method, system and first client - Google Patents

Data interaction method, system and first client Download PDF

Info

Publication number
CN112118273B
CN112118273B CN201910532982.1A CN201910532982A CN112118273B CN 112118273 B CN112118273 B CN 112118273B CN 201910532982 A CN201910532982 A CN 201910532982A CN 112118273 B CN112118273 B CN 112118273B
Authority
CN
China
Prior art keywords
link
client
identification information
relay
server
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
CN201910532982.1A
Other languages
Chinese (zh)
Other versions
CN112118273A (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 Ezviz Software Co Ltd
Original Assignee
Hangzhou Ezviz Software 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 Ezviz Software Co Ltd filed Critical Hangzhou Ezviz Software Co Ltd
Priority to CN201910532982.1A priority Critical patent/CN112118273B/en
Publication of CN112118273A publication Critical patent/CN112118273A/en
Application granted granted Critical
Publication of CN112118273B publication Critical patent/CN112118273B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

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 invention provides a data interaction method, a data interaction system and a first client. The method comprises the following steps: sending a P2P link request to the P2P server, where the P2P link request carries first address information of the first client, relay address information of the relay server, the second identification information, and link identification information; receiving the second address information fed back by the P2P server; establishing a P2P link identified by the link identification information with the second client according to the second address information; sending a first relay link request to the relay server by using the link identification information; and performing data interaction with the second client through the link represented by the link identification information. The method and the system can realize end-to-end overall data interaction between the first client and the second client, do not need to care about business logic of P2P link and relay link, have strong expansibility and improve access experience.

Description

Data interaction method, system and first client
Technical Field
The present invention relates to the field of data transmission technologies, and in particular, to a data interaction method, a data interaction system, and a first client.
Background
The P2P (Peer to Peer) is a centerless server, and can realize Peer-to-Peer direct link between users depending on the internet system of user group interaction information. The relay service is a service for assisting users to realize indirect point-to-point communication through a relay service end.
In the related art, P2P and relay services are often implemented through different modules, so that a P2P link and a relay link are two relatively independent links, and corresponding service logics need to be set for the P2P link and the relay link respectively, which results in more complex service logics for data interaction between clients, poorer expansibility and low access experience.
Disclosure of Invention
The embodiment of the invention aims to provide a data interaction method, a data interaction system and a first client, so as to realize end-to-end overall data interaction between clients and improve the expansibility of a network. The specific technical scheme is as follows:
in a first aspect of the embodiments of the present invention, a data interaction method is provided, which is applied to a first client of a data interaction system, where the data interaction system further includes a second client, a P2P server and a relay server, the P2P server correspondingly stores second identification information and second address information of the second client, the P2P server establishes communication connections with the first client and the second client, and the relay server establishes communication connections with the first client and the second client, where the method includes:
sending a P2P link request to the P2P server, wherein the P2P link request carries first address information of the first client, relay address information of the relay server, the second identification information and link identification information, the P2P server transmits the P2P link request to the second client according to the second identification information, feeds back the second address information to the first client, and the second client sends a second relay link request to the relay server by using the link identification information;
receiving the second address information fed back by the P2P server;
establishing a P2P link identified by the link identification information with the second client according to the second address information;
sending a first relay link request to the relay server by using the link identification information, matching the first relay link request and the second relay link request by the relay server, and establishing a relay link identified by the link identification information;
and performing data interaction with the second client through the link represented by the link identification information.
In a possible embodiment, the data interaction with the second client through the link represented by the link identification information includes:
determining whether the P2P link represented by the link identification information is normal;
if the P2P link represented by the link identification information is normal, performing data interaction with the second client through the P2P link represented by the link identification information;
and if the P2P link represented by the link identification information is abnormal, performing data interaction with the second client through the relay link represented by the link identification information.
In a possible embodiment, the data interaction with the second client through the link represented by the link identification information includes:
determining whether a first link is normal, wherein the first link is a link currently used in the P2P link and the relay link represented by the link identification information;
if the first link is normal, continuing to use the first link to perform data interaction with the second client;
and if the first link is abnormal, performing data interaction with the second client through a second link, wherein the second link is a link which is not the first link in the P2P link and the relay link represented by the link identification information.
In a possible embodiment, the data interaction with the second client through the second link includes:
determining a data packet which is received by the second client most recently according to the latest packet receiving confirmation information received before the first link is abnormal, wherein the latest data packet is used as the latest data packet, and the packet receiving confirmation information is information which is fed back by the second client after receiving the data packet sent by the first client and is used for identifying the received data packet;
and continuing data interaction with the second client from the latest data packet through a second link.
In a possible embodiment, the data interaction with the second client through the link represented by the link identification information includes:
if the data interaction is carried out with the second client through the relay link represented by the link identification information, after a speed reduction instruction sent by the relay server is received, the interaction rate of the data interaction with the second client is reduced according to the speed reduction instruction, wherein the speed reduction instruction is sent when the relay server detects that the interaction rate is higher than a preset rate threshold value.
In a second aspect of the embodiments of the present invention, a data interaction method is provided, which is applied to a second client of a data interaction system, where the data interaction system further includes a first client, a P2P server and a relay server, where the P2P server establishes communication connections with the first client and the second client, and the relay server establishes communication connections with the first client and the second client, and the method includes:
sending a registration message to the P2P server, where the registration message carries second address information and second identifier information of the second client, and the P2P server correspondingly stores the second address information and the second identifier information;
receiving a P2P link request, wherein the P2P link request carries first address information of the first client, relay address information of the relay server, the second identification information and link identification information, the P2P link request is sent to the P2P server by the first client, the P2P server transmits the second identification information to the second client, the P2P server feeds back the second address information to the first client according to the second identification information, and the first client sends a first relay link request to the relay server by using the link identification information;
establishing a P2P link identified by the link identification information with the first client according to the first address information;
sending a second relay link request to the relay server by using the link identification information, matching the first relay link request and the second relay link request by the relay server, and establishing a relay link identified by the link identification information;
and performing data interaction with the first client through the link represented by the link identification information.
In a possible embodiment, the data interaction with the first client through the link represented by the link identification information includes:
after receiving the data packet sent by the first client, feeding back packet receiving confirmation information to the first client, where the packet receiving confirmation information is used to identify the received data packet, and after the first client switches the link for performing data interaction with the second client, continuing to perform data interaction with the second client from the data packet indicated by the packet receiving confirmation information.
In a third aspect of the embodiments of the present invention, a data interaction apparatus is provided, which is applied to a first client of a data interaction system, where the data interaction system further includes a second client, a P2P server and a relay server, where the P2P server stores second identification information and second address information of the second client, the P2P server establishes communication connections with the first client and the second client, and the relay server establishes communication connections with the first client and the second client, and the apparatus includes:
a P2P request module, configured to send a P2P link request to the P2P server, where the P2P link request carries first address information of the first client, relay address information of the relay server, the second identifier information, and link identifier information, and the P2P server transmits the P2P link request to the second client according to the second identifier information, feeds back the second address information to the first client, and sends a second relay link request to the relay server by using the link identifier information;
a first receiving module, configured to receive the second address information fed back by the P2P server;
the first P2P link module is used for establishing a P2P link identified by the link identification information with the second client according to the second address information;
a first relay request module, configured to send a first relay link request to the relay server by using the link identification information, match the first relay link request and the second relay link request by the relay server, and establish a relay link identified by the link identification information;
and the first data interaction module is used for performing data interaction with the second client through the link represented by the link identification information.
In a possible embodiment, the first data interaction module is specifically configured to determine whether a P2P link indicated by the link identification information is normal;
if the P2P link represented by the link identification information is normal, performing data interaction with the second client through the P2P link represented by the link identification information;
and if the P2P link represented by the link identification information is abnormal, performing data interaction with the second client through the relay link represented by the link identification information.
In a possible embodiment, the first data interaction module is specifically configured to determine whether a first link is normal, where the first link is a link currently used in a P2P link and a relay link indicated by the link identification information;
if the first link is normal, continuing to use the first link to perform data interaction with the second client;
and if the first link is abnormal, performing data interaction with the second client through a second link, wherein the second link is a link which is not the first link in the P2P link and the relay link represented by the link identification information.
In a possible embodiment, the first data interaction module is specifically configured to determine, according to latest packet receiving acknowledgement information received before the first link is abnormal, a data packet that is latest received by the second client, as a latest data packet, where the packet receiving acknowledgement information is information that is fed back by the second client after receiving the data packet sent by the first client and is used for identifying the received data packet;
and continuing data interaction with the second client from the latest data packet through a second link.
In a possible embodiment, the first data interaction module is specifically configured to, if data interaction is performed with the second client through the relay link indicated by the link identification information, after a speed reduction instruction sent by the relay server is received, reduce an interaction rate of the data interaction with the second client according to the speed reduction instruction, where the speed reduction instruction is sent by the relay server when it is detected that the interaction rate is higher than a preset rate threshold.
In a fourth aspect of the embodiments of the present invention, a data interaction apparatus is provided, which is applied to a second client of a data interaction system, where the data interaction system further includes a first client, a P2P server and a relay server, where the P2P server establishes communication connections with the first client and the second client, and the relay server establishes communication connections with the first client and the second client, and the apparatus includes:
sending a registration message to the P2P server, where the registration message carries second address information and second identifier information of the second client, and the P2P server correspondingly stores the second address information and the second identifier information;
a second receiving module, configured to receive a P2P link request, where the P2P link request carries first address information of the first client, relay address information of the relay server, the second identification information, and link identification information, the P2P link request is sent to the P2P server by the first client, and is transmitted to the second client by the P2P server according to the second identification information, and the P2P server feeds back the second address information to the first client according to the second identification information, and the first client sends a first relay link request to the relay server by using the link identification information;
a second P2P link module, configured to establish, according to the first address information, a P2P link identified by the link identification information with the first client;
a second relay request module, configured to send a second relay link request to the relay server by using the link identification information, match the first relay link request and the second relay link request by the relay server, and establish a relay link identified by the link identification information;
and the second data interaction module is specifically used for performing data interaction with the first client through the link represented by the link identification information.
In a possible embodiment, the second data interaction module is specifically configured to, after receiving a data packet sent by the first client, feed back packet receiving acknowledgement information to the first client, where the packet receiving acknowledgement information is used to identify the received data packet, and after the first client switches a link for performing data interaction with the second client, the first client continues to perform data interaction with the second client from the data packet indicated by the packet receiving acknowledgement information.
In a fifth aspect of the embodiments of the present invention, a data interaction system is provided, where the data interaction system includes a first client, a second client, a P2P server, and a relay server;
the second client is used for sending a registration message to the P2P server, where the registration message carries second address information and second identification information of the second client;
the P2P server is configured to correspondingly store the second address information and the second identifier information;
the first client is configured to send a P2P link request to the P2P server, where the P2P link request carries first address information of the first client, relay address information of the relay server, second identification information of the second client, and link identification information;
the P2P server is used for transmitting the P2P link request to the second client according to the second identification information and feeding back the second address information to the first client;
the second client is further used for receiving the P2P link request; sending a second relay link request to the relay server by using the link identification information;
the first client is further configured to receive the second address information fed back by the P2P server; establishing a P2P link identified by the link identification information with the second client according to the second address information;
the first client is further used for sending a first relay link request to the relay server by using the link identification information;
the relay server is used for matching the first relay link request and the second relay link request; establishing a relay link identified by the link identification information between the first client and the second client;
the first client is further used for performing data interaction with the second client through the link represented by the link identification information.
In a possible embodiment, the first client is specifically configured to determine whether the P2P link indicated by the link identification information is normal;
if the P2P link represented by the link identification information is normal, performing data interaction with the second client through the P2P link represented by the link identification information;
and if the P2P link represented by the link identification information is abnormal, performing data interaction with the second client through the relay link represented by the link identification information.
In a possible embodiment, the first client is specifically configured to determine whether a first link is normal, where the first link is a link currently in use in the P2P link and the relay link indicated by the link identification information;
if the first link is normal, continuing to use the first link to perform data interaction with the second client;
and if the first link is abnormal, performing data interaction with the second client through a second link, wherein the second link is a link which is not the first link in the P2P link and the relay link represented by the link identification information.
In a possible implementation, the second client is specifically configured to, after receiving a data packet sent by the first client, feed back packet receiving acknowledgement information to the first client, where the packet receiving acknowledgement information is used to identify the received data packet;
the first client is specifically configured to determine, according to the latest packet reception acknowledgement information received before the first link is abnormal, a data packet that is latest received by the second client as a latest data packet; and continuing data interaction with the second client from the latest data packet through a second link.
In a possible embodiment, the relay server is further configured to detect an interaction rate of the first client and the second client performing data interaction through the relay link; when the interaction rate is higher than a preset rate threshold value, sending a speed reduction instruction to the first client and the second client;
and the first client is specifically used for reducing the interaction rate of data interaction with the second client according to the speed reduction instruction after receiving the speed reduction instruction sent by the relay server.
In a sixth aspect of the embodiments of the present invention, a first client is provided, which is applied to a data interaction system, where the data interaction system further includes a second client, a P2P server, and a relay server, where the P2P server stores second identification information and second address information of the second client, the P2P server establishes communication connections with the first client and the second client, and the relay server establishes communication connections with the first client and the second client, and the first client includes:
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a seventh aspect provided in an embodiment of the present invention, a second client is provided, which is applied to a data interaction system, where the data interaction system further includes a first client, a P2P server, and a relay server, where the P2P server establishes communication connections with the first client and the second client, and the relay server establishes communication connections with the first client and the second client, and the second client includes:
a memory for storing a computer program;
a processor for implementing the method steps of the second aspect when executing the program stored in the memory.
In an eighth aspect provided by the embodiments of the present invention, there is provided a computer program stored in the computer-readable storage medium, where the computer program, when executed by a processor, implements the method steps of any one of the first aspect.
In a ninth aspect provided by the embodiments of the present invention, there is provided a computer program stored in the computer readable storage medium, wherein the computer program, when executed by a processor, implements the method steps of any one of the second aspects.
The data interaction method, the data interaction system and the first client provided by the embodiment of the invention can realize data interaction between the first client and the second client through the unique logical link represented by the link identification information in the data interaction system, so that end-to-end overall data interaction between the first client and the second client is realized, the business logic of the P2P link and the relay link does not need to be concerned, the expansibility is strong, and the access experience is improved. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a data interaction system according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a data interaction method according to an embodiment of the present invention;
fig. 3 is another schematic flowchart of a data interaction method according to an embodiment of the present invention;
fig. 4 is another schematic flow chart of a data interaction method according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of a data interaction apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a data interaction apparatus according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a client according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a possible structure of a data interaction system according to an embodiment of the present invention, which may include: the system comprises a first client 110, a second client 120, a P2P server 130 and a relay server 140, wherein the P2P server 130 establishes a communication connection with the first client 110 and a communication connection with the second client 120, and the relay server 140 establishes a communication connection with the first client 110 and a communication connection with the second client 120. The P2P server 130 and the relay server 140 may be an entity server or a virtual server, and the first client 110 and the second client 120 may be different according to different application scenarios, for example, in one possible embodiment, the first client 110 may be a web client running on a user terminal, and the second client may be a device client running on a monitoring device, which is not limited in this embodiment.
Referring to fig. 2, fig. 2 is a schematic flow chart of a data interaction method provided in an embodiment of the present invention, where the method may be applied to a first client, and in the embodiment, a P2P server stores second address information and second identification information of a second client, and the method includes:
s201, sending a P2P link request to a P2P server.
The P2P link request carries first address information of the first client, relay address information of the relay server, second identification information, and link identification information. After receiving the P2P link request, the P2P server may transmit the P2P link request to the second client according to the second identification information, and feed back the second address information to the first client. After receiving the P2P link request transparently transmitted by the P2P server, the second client may send a second relay link request to the relay server using the link identification information.
S202, receiving second address information fed back by the P2P server.
It can be understood that, since the P2P link request carries the second identification information, the P2P server may match the second address information according to the second identification information, and feed back the second address information to the first client.
And S203, establishing a P2P link identified by the link identification information with the second client according to the second address information.
In S201, the P2P link request is transmitted to the second client through the P2P server, so that the second client already acquires the first address information of the first client, and in S202, the first client acquires the second address information fed back by the P2P server, that is, the first client and the second client already acquire the address information of the other party, so that the first client can establish the P2P link with the second client.
S204, the first relay link request is sent to the relay server by using the link identification information.
It is understood that fig. 2 is only one possible embodiment of the data interaction method provided by the embodiment of the present invention, and in other possible embodiments, S204 may be executed before S201, S202, or S203, may be executed in parallel with S201, S202, or S203, or may be executed alternately with S201, S202, or S203, which is not limited in this embodiment.
After receiving the P2P connection request, the second client may send a second relay link request to the relay server by using the link identifier information carried in the P2P connection. For the relay server, the received second relay link request and the first relay link request use the same link identification information, so the relay server may match the first relay link request with the second relay link request to establish a relay link between the first client and the second client.
And S205, performing data interaction with the second client through the link represented by the link identification information.
Under the condition that the P2P link between the first client and the second client is not considered to be failed to establish, the link represented by the link identification information comprises the P2P link and the relay link, and the two physical links are represented by the same link identification information, so that the two links can be regarded as two physical links in the same logical link to the outside, namely in the data interaction system, the first client and the second client perform data interaction through the unique logical link represented by the link identification information, the end-to-end whole data interaction between the first client and the second client is realized, the service logics of the P2P link and the relay link are not required to be concerned, the expansibility is high, and the access experience is improved.
In order to more clearly describe the data interaction method provided by the embodiment of the present invention, the following description is given with reference to a first client, a second client, a P2P server, and a relay server in a data interaction system. See fig. 3, including:
s301, after the second client side is on line, the second client side sends a registration message to the P2P server side.
The registration message carries second address information and second identification information of the second client.
And S302, after receiving the registration message, the P2P server correspondingly stores the carried second address information and second identification information.
For example, the second address information and the second identification information may be stored in a form of a binary set, and the second identification information may be used as an index of the binary set.
S303, the first client sends a P2P link request to the P2P server.
For the P2P link request, reference may be made to the relevant description in S101, which is not described herein again.
S304, after the P2P server receives the P2P link request, the P2P server analyzes second identification information carried by the P2P request.
S305, the P2P server matches the second address information stored locally according to the analyzed second identification information.
For the P2P server, the address information stored corresponding to the second identification information is the second address information, so according to the parsed second identification information, the matched address information is the second address information.
S306, the P2P server feeds back the second address information to the first client.
And S307, the P2P server transmits the P2P link request to the second client according to the matched second address information.
In other possible embodiments, S307 may also be executed before S306, or may also be executed in parallel with S306 or executed alternately, which is not limited in this embodiment.
And S308, after receiving the P2P link request, the second client establishes a P2P link with the first client according to the carried first address information.
And S309, the second client sends a second relay link request to the relay server by using the link identification information according to the relay address information and the link identification information carried by the P2P link request.
S310, the first client sends a first relay link request to the relay server using the link identification information.
In other possible embodiments, S310 may also be executed before any step in S301 to S309, or may also be executed in parallel with or alternatively executed by any step in S301 to S309, which is not limited in this embodiment.
And S311, after receiving the first relay link request and the second relay link request, the relay server assists in establishing the relay link between the first client and the second client.
Since the link identification information used by the first relay link request and the second relay link request is the same, the relay server may match the first relay link request with the second relay link request, thereby assisting in establishing the relay link between the first client and the second client. It is to be understood that the successfully established relay link may be represented by link identification information.
And S312, the first client and the second client perform data interaction through the link represented by the link identification information.
In the following, a description will be given of the execution logic of the packet/request by the P2P server, the relay server, and the second client in a possible embodiment.
For the P2P server, a P2P link request sent by the first client may be received. After receiving the P2P link request, the identification information and the address information carried in the P2P link request may be analyzed to obtain the first address information and the second identification information, and the second address information is obtained by matching the locally stored address information with the second identification information. And sending second address information to the first client according to the first address information. And transmitting the P2P link request to the second client according to the second address information.
For the P2P server, a registration packet sent by the second client may also be received. After receiving the registration message, the identifier information and the address information carried in the registration message may be analyzed to obtain second identifier information and second address information, and the second identifier information and the second address information are correspondingly stored.
For the relay server, a relay link request sent by the first client and the second client may be received. After receiving the relay link request, the relay server may analyze link identification information carried by the relay link request, and determine whether there is another relay link request having the same link identification information, and assist in establishing a relay link between the client that sends the relay link request and the client that sends the another relay link request if there is another relay link request having the same link identification information.
For the second client, a P2P link request transparently transmitted by the P2P server may be received. After receiving the P2P link request, the first address information, the relay address information and the link identification information carried in the P2P link request can be obtained through analysis, the P2P link request is established with the first client according to the first address information, and the link identification information is used for sending a second relay link request to the relay server according to the relay address information.
It can be understood that, if the first client and the second client perform data interaction through the relay link indicated by the link identification information, a certain bandwidth of the relay server needs to be occupied. In a possible embodiment, in consideration of reducing bandwidth consumption of the relay server, when the P2P link indicated by the link identification information is normal, the first client and the second client may perform data interaction preferentially through the P2P link.
For example, when a first client sends a packet to a second client, it may be determined whether a P2P link indicated by the link identification information is normal, and if the P2P link is normal, the packet is sent to the second client through the P2P link, and if the P2P link is abnormal, the packet is sent to the second client through the relay link. Similarly, when the second client sends a message to the first client, it may be determined whether the P2P link indicated by the link identification information is normal, and if the P2P link is normal, the message is sent to the first client through the P2P link, and if the P2P link is abnormal, the message is sent to the first client through the relay link
Since the first client and the second client may be regarded as two peer clients, hereinafter, the data interaction between the first client and the second client is described by taking only the case where the first client sends a packet to the second client as an example, and the principle of sending a packet to the first client by the second client is the same, which is not described again.
P2P links and relay links may be abnormal during use for some special reasons. For convenience of description, a link currently in use when the first client and the second client perform data interaction is referred to as a first link, and a link not in use is referred to as a second link. For example, assuming that a first client is performing data interaction with a second client using a P2P link, the P2P link is a first link, and the relay link is a second link.
In one possible embodiment, when the first link is abnormal, the data interaction may continue through the second link. However, during the process of switching from the first link to the second link, data loss may be caused, for example, the first client needs to send the data packets 1 to 10 to the second client, and has sent the data packets 1 to 6, but the data packet 6 has not been received by the second client, at this time, the first link is abnormal, and the first client and the second client continue to perform data interaction through the second link, and the first client may continue to send from the data packet 7, so that the second client does not successfully receive the data packet 6.
In view of this, in a possible embodiment, after receiving the data packet sent by the first client, the second client feeds back packet receiving acknowledgement information used for indicating the data packet to the first client, and after the first link of the first client is abnormal, the first client determines the data packet indicated by the latest received packet receiving acknowledgement information as the latest data packet, and continues to send the data packet to the second client from the latest data packet through the second link.
For example, for convenience of description, it is assumed that the first link is a P2P link and the second link is a relay link, and the first client needs to send data packets 1 to 5 to the second client. Then, see fig. 4, including:
s401, the first client sends data packets 1-5 to the second client through the P2P link.
It is assumed that due to the anomaly of the first link, the second client receives only packets 1-3 therein via the first link.
S402, the second client feeds back packet receiving confirmation information to the first client, where the packet receiving confirmation information carries the identification information of the data packet 3.
The second client feeds back the packet receiving acknowledgement information, which may be executed after receiving each data packet, or executed after receiving a preset number of data packets, or executed after feeding back the packet receiving acknowledgement information at the last time interval for a preset time, and then receiving the data packets again.
For example, the second client may feed back the packet receiving acknowledgement information carrying the identification information of the data packet 1 after receiving the data packet 1. And after receiving the data packet 2, feeding back the packet receiving confirmation information carrying the identification information of the data packet 2. After receiving the data packet 3, feeding back the packet receiving confirmation information carrying the identification information of the data packet 3.
For another example, the second client may feed back the packet receiving acknowledgement information after receiving every 3 data packets. The second client does not feed back the packet receiving acknowledgement information after receiving the data packet 1 and the data packet 2, and feeds back the packet receiving acknowledgement information carrying the identification information of the data packet 3 after receiving the data packet 3.
For another example, the minimum interval for the second client to feed back the packet reception acknowledgement information may be 10ms, and it is assumed that t =0ms is used when the second client receives the data packet 1 and feeds back the packet reception acknowledgement information carrying the identification information of the data packet 1, t =6ms is used when the second client receives the data packet 2, the second client does not feed back the packet reception acknowledgement information, t =12ms is used when the second client receives the data packet 3, and at this time, since the distance from the last time of feeding back the packet reception acknowledgement information exceeds 10ms, the second client feeds back the packet reception acknowledgement information carrying the identification information of the data packet 3.
And S403, after the first client detects that the P2P link is abnormal, determining the data packet 3 as a target data packet according to the packet receiving confirmation information fed back by the second client.
S404, the first client continues to send the data packets 4 and 5 to the second client from the data packet 3 through the relay link.
It is understood that in this embodiment, starting with packet 3 may mean excluding packet 3. In other possible embodiments, due to the different logic of the second client feeding back the packet reception acknowledgement information, the data packet indicated by the packet reception acknowledgement information received by the first client last may not be the data packet received by the second client last, and in these application scenarios, the first client may be caused to send a duplicate data packet to the second client. In view of this, in some application scenarios, the second client may filter the received data packets to avoid receiving duplicate data.
For example, assuming that the first link is abnormal after the first client successfully sends the data packets 1 to 4 to the second client through the first link, since the second client feeds back the packet reception acknowledgement information once every time the second client receives 3 data packets, the latest packet reception acknowledgement information that is newly received by the first client carries the identification information of the data packet 3, the first client may continue to send the data packets 4 and 5 to the second client through the relay link, and since the second client has already received the data packet 4, the second client may discard the data packet 4 that is received this time.
As analyzed above, the data interaction between the first client and the second client via the relay link may cause the relay server to generate a large bandwidth pressure. In view of this, in a possible embodiment, when the relay server detects that the interaction rate of the first client and the second client through the relay connection is higher than the preset rate threshold, the relay server may send a speed reduction instruction to the first client and/or the second client, and the first client and/or the second client, after receiving the speed reduction instruction, reduces the interaction rate according to the speed reduction instruction.
For example, assuming that the maximum bandwidth of the relay server is 10Mbps and the preset interaction rate threshold is 4Mbps, when the interaction rate of data interaction between the first client and the second client through the relay link is 6Mbps, a speed reduction instruction may be sent to the first client and the second client to reduce the interaction rate between the first client and the second client to below 4Mbps.
The reduction mode may be different according to different application scenarios, and for example, the current interaction rate may be adjusted to be original (preset rate threshold/maximum bandwidth of the relay server) times, and if the maximum bandwidth of the relay server is 10Mbps and the preset interaction rate threshold is 4Mbps, the interaction rate may be reduced to be original 0.4 times, that is, if the original interaction rate is 6Mbps, the reduced interaction rate is 2.4Mbps.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a data interaction device according to an embodiment of the present invention, which is applied to a first client of a data interaction system, where the data interaction system further includes a second client, a P2P server and a relay server, the P2P server correspondingly stores second identification information and second address information of the second client, the P2P server establishes communication connections with the first client and the second client, and the relay server establishes communication connections with the first client and the second client, where the device may include:
a P2P request module 501, configured to send a P2P link request to the P2P server, where the P2P link request carries first address information of the first client, relay address information of the relay server, the second identifier information, and link identifier information, and the P2P server transmits the P2P link request to the second client according to the second identifier information, feeds back the second address information to the first client, and sends a second relay link request to the relay server by using the link identifier information;
a first receiving module 502, configured to receive the second address information fed back by the P2P server;
a first P2P linking module 503, configured to establish a P2P link identified by the link identifier information with the second client according to the second address information;
a first relay request module 504, configured to send a first relay link request to the relay server by using the link identification information, match the first relay link request and the second relay link request by the relay server, and establish a relay link identified by the link identification information;
and a first data interaction module 505, configured to perform data interaction with the second client through the link represented by the link identification information.
In a possible embodiment, the first data interaction module is specifically configured to determine whether a P2P link indicated by the link identification information is normal;
if the P2P link represented by the link identification information is normal, performing data interaction with the second client through the P2P link represented by the link identification information;
and if the P2P link represented by the link identification information is abnormal, performing data interaction with the second client through the relay link represented by the link identification information.
In a possible embodiment, the first data interaction module is specifically configured to determine whether a first link is normal, where the first link is a link currently used in a P2P link and a relay link indicated by the link identification information;
if the first link is normal, continuing to use the first link to perform data interaction with the second client;
and if the first link is abnormal, performing data interaction with the second client through a second link, wherein the second link is a link which is not the first link in the P2P link and the relay link represented by the link identification information.
In a possible embodiment, the first data interaction module is specifically configured to determine, according to latest packet reception acknowledgement information received before the first link is abnormal, a data packet received latest by the second client as a latest data packet, where the packet reception acknowledgement information is information used for identifying the received data packet and fed back by the second client after receiving the data packet sent by the first client;
and continuing data interaction with the second client from the latest data packet through a second link.
In a possible embodiment, the first data interaction module is specifically configured to, if data interaction is performed with the second client through the relay link indicated by the link identification information, reduce, according to a speed reduction instruction sent by the relay server, an interaction rate of the data interaction with the second client according to the speed reduction instruction, where the speed reduction instruction is sent by the relay server when it is detected that the interaction rate is higher than a preset rate threshold.
Referring to fig. 6, fig. 6 is a schematic diagram of another possible structure of a data interaction device according to an embodiment of the present invention, which is applied to a second client of a data interaction system, where the data interaction system further includes a first client, a P2P server and a relay server, where the P2P server establishes communication connections with the first client and the second client, and the relay server establishes communication connections with the first client and the second client, and the device may include:
a message registration module 601, configured to send a registration message to the P2P server, where the registration message carries second address information and second identifier information of the second client, and the P2P server correspondingly stores the second address information and the second identifier information;
a second receiving module 602, configured to receive a P2P link request, where the P2P link request carries first address information of the first client, relay address information of the relay server, the second identification information, and link identification information, the P2P link request is sent to the P2P server by the first client, and is transmitted to the second client by the P2P server according to the second identification information, and the P2P server feeds back the second address information to the first client according to the second identification information, and the first client sends a first relay link request to the relay server by using the link identification information;
a second P2P linking module 603, configured to establish, according to the first address information, a P2P link identified by the link identifier information with the first client;
a second relay request module 604, configured to send a second relay link request to the relay server by using the link identifier information, match the first relay link request and the second relay link request by the relay server, and establish a relay link identified by the link identifier information;
the second data interaction module 605 is specifically configured to perform data interaction with the first client through the link represented by the link identification information.
In a possible application scenario, the second data interaction module is specifically configured to, after receiving a data packet sent by the first client, feed back packet receiving acknowledgement information to the first client, where the packet receiving acknowledgement information is used to identify the received data packet, and after switching a link for performing data interaction with the second client, the first client continues to perform data interaction with the second client from the data packet indicated by the packet receiving acknowledgement information.
The data interaction system provided by the embodiment of the present invention will be described in entirety below, which may refer to fig. 1, and includes a first client 110, a second client 120, a P2P server 130, and a relay server 140;
the second client 120 is configured to send a registration packet to the P2P server 130, where the registration packet carries second address information and second identifier information of the second client 120;
the P2P server 130 is configured to correspondingly store the second address information and the second identifier information;
the first client 110 is configured to send a P2P link request to the P2P server 130, where the P2P link request carries first address information of the first client 110, relay address information of the relay server 140, second identification information of the second client 120, and link identification information;
the P2P server 130 is configured to transmit the P2P link request to the second client 120 according to the second identifier information, and feed back the second address information to the first client 110;
the second client 120 is further configured to receive a P2P link request; and transmits a second relay link request to the relay server 140 using the link identification information;
the first client 110 is further configured to receive second address information fed back by the P2P server 130; and establishes a P2P link identified by the link identification information with the second client 120 according to the second address information;
the first client 110 is further configured to send a first relay link request to the relay server 140 using the link identification information;
the relay server 140 is configured to match the first relay link request with the second relay link request; and establishes a relay link identified by the link identification information between the first client 110 and the second client 120;
the first client 110 is further configured to perform data interaction with the second client 120 through the link represented by the link identification information.
In a possible embodiment, the first client 110 is specifically configured to determine whether the P2P link indicated by the link identification information is normal;
if the P2P link indicated by the link identification information is normal, performing data interaction with the second client 120 through the P2P link indicated by the link identification information;
and if the P2P link represented by the link identification information is abnormal, performing data interaction with the second client 120 through the relay link represented by the link identification information.
In a possible embodiment, the first client 110 is specifically configured to determine whether the first link is normal, where the first link is a currently used link of the P2P link and the relay link indicated by the link identification information;
if the first link is normal, continuing to use the first link to perform data interaction with the second client 120;
and if the first link is abnormal, performing data interaction with the second client 120 through a second link, where the second link is a link that is not the first link, of the P2P link and the relay link indicated by the link identification information.
In a possible embodiment, the second client 120 is specifically configured to, after receiving the data packet sent by the first client 110, feed back packet receiving acknowledgement information to the first client 110, where the packet receiving acknowledgement information is used to identify the received data packet;
the first client 110 is specifically configured to determine, according to the latest packet receiving acknowledgement information received before the first link is abnormal, a data packet that is newly received by the second client 120 as a latest data packet; data interaction with the second client 120 continues through the second link, starting from the latest data packet.
In a possible embodiment, the relay server 140 is further configured to detect an interaction rate of the first client 110 and the second client 120 for data interaction through the relay link; when the interaction rate is higher than a preset rate threshold, sending a speed reduction instruction to the first client 110 and/or the second client 120;
the first client 110 and/or the second client 120 are specifically configured to, after receiving the speed reduction instruction sent by the relay server 140, reduce an interaction rate of data interaction with the second client 120 according to the speed reduction instruction.
An embodiment of the present invention further provides a client, as shown in fig. 7, including:
a memory 701 for storing a computer program;
the processor 702, configured to execute the program stored in the memory 701, when the client is a first client, may implement the following steps:
sending a P2P link request to a P2P server, wherein the P2P link request carries first address information of a first client, relay address information of a relay server, second identification information and link identification information, the P2P server transmits the P2P link request to a second client according to the second identification information, feeds back the second address information to the first client, and the second client sends a second relay link request to the relay server by using the link identification information;
receiving second address information fed back by the P2P server;
establishing a P2P link identified by the link identification information with the second client according to the second address information;
the link identification information is used for sending a first relay link request to the relay server, the relay server matches the first relay link request with a second relay link request, and a relay link identified by the link identification information is established;
and performing data interaction with the second client through the link represented by the link identification information.
In a possible embodiment, the data interaction with the second client through the link represented by the link identification information includes:
determining whether the P2P link represented by the link identification information is normal;
if the P2P link represented by the link identification information is normal, performing data interaction with the second client through the P2P link represented by the link identification information;
and if the P2P link represented by the link identification information is abnormal, performing data interaction with the second client through the relay link represented by the link identification information.
In a possible embodiment, the data interaction with the second client through the link represented by the link identification information includes:
determining whether a first link is normal, wherein the first link is a link currently used in the P2P link and the relay link represented by the link identification information;
if the first link is normal, continuing to use the first link to perform data interaction with the second client;
and if the first link is abnormal, performing data interaction with a second client through a second link, wherein the second link is a link which is not the first link in the P2P link and the relay link represented by the link identification information.
In one possible embodiment, the data interaction with the second client through the second link includes:
determining a data packet newly received by the second client as a latest data packet according to the latest packet receiving confirmation information received before the first link is abnormal, wherein the packet receiving confirmation information is information which is fed back by the second client after receiving the data packet sent by the first client and is used for identifying the received data packet;
and continuing data interaction with the second client from the latest data packet through the second link.
In a possible embodiment, the data interaction with the second client through the link represented by the link identification information includes:
if the data interaction is carried out with the second client through the relay link represented by the link identification information, after a speed reduction instruction sent by the relay server is received, the interaction rate of the data interaction with the second client is reduced according to the speed reduction instruction, and the speed reduction instruction is sent when the relay server detects that the interaction rate is higher than a preset rate threshold value.
If the client is a second client, the following steps can be implemented:
sending a registration message to the P2P server, wherein the registration message carries second address information and second identification information of the second client, and the P2P server correspondingly stores the second address information and the second identification information;
receiving a P2P link request, wherein the P2P link request carries first address information of a first client, relay address information of a relay server, second identification information and link identification information, the P2P link request is sent to the P2P server by the first client, the P2P server transmits the second address information to a second client according to the second identification information, the P2P server feeds back the second address information to the first client according to the second identification information, and the first client sends the first relay link request to the relay server by using the link identification information;
establishing a P2P link identified by link identification information with a first client according to the first address information;
sending a second relay link request to the relay server by using the link identification information, matching the first relay link request and the second relay link request by the relay server, and establishing a relay link identified by the link identification information;
and performing data interaction with the first client through the link represented by the link identification information.
In a possible embodiment, the data interaction with the first client through the link represented by the link identification information includes:
after receiving a data packet sent by a first client, feeding back packet receiving confirmation information to the first client, wherein the packet receiving confirmation information is used for identifying the received data packet, and after switching a link for data interaction with a second client, the first client continues to perform data interaction with the second client from the data packet represented by the packet receiving confirmation information.
The Memory mentioned in the above electronic device may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment of the present invention, a computer-readable storage medium is further provided, which has instructions stored therein, and when the computer-readable storage medium runs on a computer, the computer is caused to execute any one of the data interaction methods in the above embodiments.
In yet another embodiment, a computer program product containing instructions is provided, which when run on a computer causes the computer to perform any of the above-mentioned data interaction methods.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to be performed in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It should be noted that, in this document, relational terms such as first and second, and the like are 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. Also, 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 a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on differences from other embodiments. In particular, for the apparatus, the system, the first client, the second client, the computer readable storage medium, and the computer program product embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and reference may be made to part of the description of the method embodiment for relevant points.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (16)

1. A data interaction method is applied to a first client of a data interaction system, the data interaction system further comprises a second client, a P2P server and a relay server, the P2P server correspondingly stores second identification information and second address information of the second client, the P2P server establishes communication connection with the first client and the second client, and the relay server establishes communication connection with the first client and the second client, the method comprises the following steps:
sending a P2P link request to the P2P server, wherein the P2P link request carries first address information of the first client, relay address information of the relay server, the second identification information and link identification information, the P2P server transmits the P2P link request to the second client according to the second identification information, feeds back the second address information to the first client, and the second client sends a second relay link request to the relay server by using the link identification information;
receiving the second address information fed back by the P2P server;
establishing a P2P link identified by the link identification information with the second client according to the second address information;
sending a first relay link request to the relay server by using the link identification information, matching the first relay link request and the second relay link request by the relay server, and establishing a relay link identified by the link identification information;
and performing data interaction with the second client through the link represented by the link identification information.
2. The method of claim 1, wherein the data interaction with the second client through the link represented by the link identification information comprises:
determining whether the P2P link represented by the link identification information is normal;
if the P2P link represented by the link identification information is normal, performing data interaction with the second client through the P2P link represented by the link identification information;
and if the P2P link represented by the link identification information is abnormal, performing data interaction with the second client through the relay link represented by the link identification information.
3. The method of claim 1, wherein the data interaction with the second client through the link represented by the link identification information comprises:
determining whether a first link is normal, wherein the first link is a link currently used in the P2P link and the relay link represented by the link identification information;
if the first link is normal, continuing to use the first link to perform data interaction with the second client;
and if the first link is abnormal, performing data interaction with the second client through a second link, wherein the second link is a link which is not the first link in the P2P link and the relay link represented by the link identification information.
4. The method of claim 3, wherein the data interaction with the second client through the second link comprises:
determining a data packet which is received by the second client most recently according to the latest packet receiving confirmation information received before the first link is abnormal, wherein the latest data packet is used as the latest data packet, and the packet receiving confirmation information is information which is fed back by the second client after receiving the data packet sent by the first client and is used for identifying the received data packet;
and continuing data interaction with the second client from the latest data packet through a second link.
5. The method according to claim 1, wherein the data interaction with the second client through the link represented by the link identification information includes:
if the relay link represented by the link identification information carries out data interaction with the second client, after a speed reduction instruction sent by the relay server is received, the interaction rate of the data interaction with the second client is reduced according to the speed reduction instruction, wherein the speed reduction instruction is sent by the relay server when the interaction rate is detected to be higher than a preset rate threshold.
6. A data interaction method is characterized in that the method is applied to a second client of a data interaction system, the data interaction system further comprises a first client, a P2P server and a relay server, the P2P server is in communication connection with the first client and the second client, and the relay server is in communication connection with the first client and the second client, the method comprises the following steps:
sending a registration message to the P2P server, where the registration message carries second address information and second identifier information of the second client, and the P2P server correspondingly stores the second address information and the second identifier information;
receiving a P2P link request, wherein the P2P link request carries first address information of the first client, relay address information of the relay server, the second identification information and link identification information, the P2P link request is sent to the P2P server by the first client, the P2P server transmits the second identification information to the second client, the P2P server feeds back the second address information to the first client according to the second identification information, and the first client sends a first relay link request to the relay server by using the link identification information;
establishing a P2P link identified by the link identification information with the first client according to the first address information;
sending a second relay link request to the relay server by using the link identification information, matching the first relay link request and the second relay link request by the relay server, and establishing a relay link identified by the link identification information;
and performing data interaction with the first client through the link represented by the link identification information.
7. The method of claim 6, wherein the data interaction with the first client through the link represented by the link identification information comprises:
after receiving the data packet sent by the first client, feeding back packet receiving confirmation information to the first client, where the packet receiving confirmation information is used to identify the received data packet, and after the first client switches the link for performing data interaction with the second client, continuing to perform data interaction with the second client from the data packet indicated by the packet receiving confirmation information.
8. A data interaction system is characterized by comprising a first client, a second client, a P2P server and a relay server;
the second client is used for sending a registration message to the P2P server, where the registration message carries second address information and second identification information of the second client;
the P2P server is configured to correspondingly store the second address information and the second identifier information;
the first client is configured to send a P2P link request to the P2P server, where the P2P link request carries first address information of the first client, relay address information of the relay server, second identification information of the second client, and link identification information;
the P2P server is used for transmitting the P2P link request to the second client according to the second identification information and feeding back the second address information to the first client;
the second client is further used for receiving the P2P link request; sending a second relay link request to the relay server by using the link identification information;
the first client is further configured to receive the second address information fed back by the P2P server; establishing a P2P link identified by the link identification information with the second client according to the second address information;
the first client is also used for sending a first relay link request to the relay server by using the link identification information;
the relay server is used for matching the first relay link request and the second relay link request; establishing a relay link identified by the link identification information between the first client and the second client;
the first client is further used for performing data interaction with the second client through the link represented by the link identification information.
9. The system according to claim 8, wherein the first client is specifically configured to determine whether the P2P link indicated by the link identification information is normal;
if the P2P link represented by the link identification information is normal, performing data interaction with the second client through the P2P link represented by the link identification information;
and if the P2P link represented by the link identification information is abnormal, performing data interaction with the second client through the relay link represented by the link identification information.
10. The system according to claim 8, wherein the first client is specifically configured to determine whether a first link is normal, where the first link is a currently used link of the P2P link and the relay link indicated by the link identification information;
if the first link is normal, continuing to use the first link to perform data interaction with the second client;
and if the first link is abnormal, performing data interaction with the second client through a second link, wherein the second link is a link which is not the first link in the P2P link and the relay link represented by the link identification information.
11. The system according to claim 10, wherein the second client is specifically configured to, after receiving the data packet sent by the first client, feed back packet reception acknowledgement information to the first client, where the packet reception acknowledgement information is used to identify the received data packet;
the first client is specifically configured to determine, according to the latest packet reception acknowledgement information received before the first link is abnormal, a data packet that is latest received by the second client as a latest data packet; and continuing data interaction with the second client from the latest data packet through a second link.
12. The system of claim 8, wherein the relay server is further configured to detect an interaction rate of the first client and the second client performing data interaction through the relay link; when the interaction rate is higher than a preset rate threshold value, sending a speed reduction instruction to the first client and the second client;
and the first client is specifically used for reducing the interaction rate of data interaction with the second client according to the speed reduction instruction after receiving the speed reduction instruction sent by the relay server.
13. A first client, characterized in that, applied to a data interaction system, the data interaction system further includes a second client, a P2P server and a relay server, the P2P server stores second identification information and second address information of the second client, the P2P server establishes communication connections with the first client and the second client, the relay server establishes communication connections with the first client and the second client, and the first client includes:
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
14. A second client, characterized in that, applied to a data interaction system, the data interaction system further includes a first client, a P2P server and a relay server, the P2P server establishes communication connections with the first client and the second client, the relay server establishes communication connections with the first client and the second client, and the second client includes:
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 6 to 7 when executing a program stored in the memory.
15. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
16. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 6-7.
CN201910532982.1A 2019-06-19 2019-06-19 Data interaction method, system and first client Active CN112118273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910532982.1A CN112118273B (en) 2019-06-19 2019-06-19 Data interaction method, system and first client

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910532982.1A CN112118273B (en) 2019-06-19 2019-06-19 Data interaction method, system and first client

Publications (2)

Publication Number Publication Date
CN112118273A CN112118273A (en) 2020-12-22
CN112118273B true CN112118273B (en) 2023-04-07

Family

ID=73796713

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910532982.1A Active CN112118273B (en) 2019-06-19 2019-06-19 Data interaction method, system and first client

Country Status (1)

Country Link
CN (1) CN112118273B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101437036A (en) * 2008-12-22 2009-05-20 北京中企开源信息技术有限公司 Document transmission method and system capable of supporting NAT/firewall traversing
WO2011126509A1 (en) * 2010-04-07 2011-10-13 Apple Inc. Apparatus and method for establishing and utilizing backup communication channels
CN104519414A (en) * 2013-09-27 2015-04-15 北京新媒传信科技有限公司 Method and system for streaming media transmission
US10129412B1 (en) * 2014-09-08 2018-11-13 Whatsapp Inc. Establishing and maintaining a VOIP call

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015041947A (en) * 2013-08-23 2015-03-02 ソニー株式会社 Information processing device, information processing method and program
TWI599201B (en) * 2016-02-05 2017-09-11 物聯智慧科技(深圳)有限公司 Network system and method for establishing data connection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101437036A (en) * 2008-12-22 2009-05-20 北京中企开源信息技术有限公司 Document transmission method and system capable of supporting NAT/firewall traversing
WO2011126509A1 (en) * 2010-04-07 2011-10-13 Apple Inc. Apparatus and method for establishing and utilizing backup communication channels
CN104519414A (en) * 2013-09-27 2015-04-15 北京新媒传信科技有限公司 Method and system for streaming media transmission
US10129412B1 (en) * 2014-09-08 2018-11-13 Whatsapp Inc. Establishing and maintaining a VOIP call

Also Published As

Publication number Publication date
CN112118273A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
US9872198B2 (en) Systems and methods for data transmission
US10645145B2 (en) Method and apparatus for accelerating data transmission in a network communication system
CN106612284B (en) Streaming data transmission method and device
CN106598633B (en) Configuration file updating method, client and server
WO2014166265A1 (en) Method, terminal, cache server and system for updating webpage data
CN115004673B (en) Message pushing method, device, electronic equipment and computer readable medium
WO2016127884A1 (en) Message pushing method and device
CN109040295B (en) Method and device for determining abnormal disconnection, terminal and storage medium
CN113986501A (en) Real-time database API (application program interface) uninterrupted calling method, system, storage medium and server
US20150067066A1 (en) Provisioning Communication Services using Proxy Server in a Cloud
US20120284417A1 (en) Endpoint Discriminator in Network Transport Protocol Startup Packets
US10412778B2 (en) Data transmission method and apparatus for data service
CN108124504B (en) TFO transmission method, proxy server and system
CN112118273B (en) Data interaction method, system and first client
CN108259576B (en) Software and hardware real-time information transmission system and method
CN114338477B (en) Communication link monitoring method, device, equipment and storage medium
CN113259490B (en) Multi-level node network data transmission method based on UDP transmission protocol
CN114489730A (en) Remote upgrading method, terminal equipment and computer readable storage medium
CN109688204B (en) File downloading method, node and terminal based on NDN (named data networking)
CN107465751B (en) Communication method, device, client and computer storage medium
CN111404827A (en) Data packet processing method and device, electronic equipment and storage medium
CN106992878B (en) Multicast detection method and device
CN113542324A (en) Message pushing method and device
CN110881213A (en) Method and system for transmitting network test process information
CN113271305B (en) Attack detection method and device and web application level intrusion prevention system WAF

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