CN109889545B - Data communication method and device - Google Patents

Data communication method and device Download PDF

Info

Publication number
CN109889545B
CN109889545B CN201910239316.9A CN201910239316A CN109889545B CN 109889545 B CN109889545 B CN 109889545B CN 201910239316 A CN201910239316 A CN 201910239316A CN 109889545 B CN109889545 B CN 109889545B
Authority
CN
China
Prior art keywords
server
streaming media
network
parameter
network delay
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
CN201910239316.9A
Other languages
Chinese (zh)
Other versions
CN109889545A (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.)
Beijing Yunzhong Rongxin Network Technology Co ltd
Original Assignee
Beijing Yunzhong Rongxin Network 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 Beijing Yunzhong Rongxin Network Technology Co ltd filed Critical Beijing Yunzhong Rongxin Network Technology Co ltd
Priority to CN201910239316.9A priority Critical patent/CN109889545B/en
Publication of CN109889545A publication Critical patent/CN109889545A/en
Application granted granted Critical
Publication of CN109889545B publication Critical patent/CN109889545B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The embodiment of the invention provides a data communication method and a device, which are applied to a signaling server in a session system, wherein the data communication method comprises the steps of acquiring first network parameters between a first client and each streaming media server when the signaling server receives a session request of the first client for joining the current session; acquiring second network parameters when data communication is realized between each streaming media server and other streaming media servers in a session system; selecting a streaming media server meeting a first preset condition as a target server according to the first network parameter and the second network parameter; and informing the first client to take the target server as an access node and adding the target server into the current session. The invention can effectively improve the data communication quality among the clients participating in the current session in the session system.

Description

Data communication method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a data communication method and apparatus.
Background
With the rapid development of communication technology, the communication network environment is also more and more complex, but how to ensure the stability of the communication link and the quality of communication data, such as the data communication quality of streaming media data and the like generated in the real-time audio and video communication process, and reduce network delay, so that the communication data can be smoothly transmitted from one client to another corresponding client becomes a technical problem that needs to be solved by technical personnel in the field.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a data communication method and apparatus to effectively solve the above problems.
In one aspect, an embodiment of the present invention provides a data communication method, which is applied to a signaling server in a session system, where the data communication method includes:
when a session request of a first client for joining a current session is received, acquiring first network parameters between the first client and each streaming media server;
acquiring second network parameters when data communication is realized between each streaming media server and other streaming media servers except the streaming media server in the session system;
selecting a streaming media server meeting a first preset condition as a target server according to the first network parameter and the second network parameter;
and informing the first client to take the target server as an access node and adding the target server into the current session.
In an option of the embodiment of the present invention, the first network parameter and the second network parameter respectively include one or more of a network delay parameter, a link throughput, a link stability, a network status, and a data transmission rate.
In the selection of the embodiment of the present invention, the first network parameter includes a first network delay parameter, and the second network parameter includes a second network delay parameter; selecting a streaming media server meeting a first preset condition as a target server according to the first network parameter and the second network parameter, wherein the step comprises the following steps:
for each streaming media server in the session system, respectively calculating the sum of network delay amounts when the first client realizes data communication with each second client related in the current session based on the streaming media server according to the first network delay parameter and the second network delay parameter;
and selecting a streaming media server meeting preset requirements from a plurality of streaming media servers included in the session system as a target server according to the calculated sum of the network delay amount.
In the selection of the embodiment of the present invention, the step of selecting a streaming media server satisfying a preset requirement from a plurality of streaming media servers included in the session system as a target server according to the sum of the network delay amounts obtained by calculation includes:
selecting a streaming media server with the minimum network delay amount sum from a plurality of streaming media servers in the session system as a first server to be compared according to the calculated network delay amount sum;
judging whether the first server to be compared is the streaming media server related to the current session, if not, selecting the streaming media server with the minimum sum of network delay amount from the streaming media servers related to the current session as a second server to be compared according to the sum of the network delay amount obtained by calculation;
and calculating a difference value between the sum of the network delay amounts corresponding to the first server to be compared and the sum of the network delay amounts corresponding to the second server to be compared, and taking the first server to be compared as the target server when the difference value is greater than a first preset value.
In the selection of the embodiment of the present invention, the first network parameter includes a first network delay parameter, and the second network parameter includes a second network delay parameter; selecting a streaming media server meeting a first preset condition as a target server according to the first network parameter and the second network parameter, wherein the step comprises the following steps:
based on each streaming media server involved in the current session, respectively calculating the sum of network delay amount when the first client realizes data communication with each second client involved in the current session based on the streaming media server according to the first network delay parameter and the second network delay parameter;
and selecting a streaming media server meeting preset requirements from the streaming media servers related to the current session as a target server according to the calculated sum of the network delay amount.
In the selection of the embodiment of the present invention, the step of selecting a streaming media server meeting a preset requirement from streaming media servers involved in a current session as a target server according to the calculated total network delay amount includes:
and selecting the streaming media server with the minimum network delay amount sum from the streaming media servers involved in the current session as a target server according to the calculated network delay amount sum.
In the selection of the embodiment of the present invention, the step of selecting, from a plurality of preset streaming media servers, a streaming media server that satisfies a first preset condition as a target server according to the first network parameter and the second network parameter further includes:
and judging whether the number of the streaming media servers involved in the current session reaches a second preset value, and when the number of the streaming media servers involved in the current session does not reach the second preset value, then executing a step of calculating the sum of network delay amount when the first client realizes data communication with each second client involved in the current session based on the streaming media server according to the first network delay parameter and the second network delay parameter respectively for each streaming media server in the session system.
In the selection of the embodiment of the present invention, the step of selecting, from a plurality of preset streaming media servers, a streaming media server that satisfies a first preset condition as a target server according to the first network parameter and the second network parameter further includes:
and when the number of the streaming media servers involved in the current session reaches a second preset value, executing the step of calculating the sum of the network delay amounts of the first client and the second clients involved in the current session when the first client realizes data communication with the second clients based on the streaming media servers according to the first network delay parameter and the second network delay parameter.
On the other hand, an embodiment of the present invention further provides a data communication method, which is applied to a client in a session system, and the data communication method includes:
acquiring an address list storing address information of each streaming media server in a session system;
aiming at each address information in the address list, respectively detecting the network state between the address information and the streaming media server corresponding to the address information to obtain a first network parameter;
and sending the first network parameter to a signaling server so that the signaling server selects a streaming media server meeting a second preset condition as a target server communicated with the client according to the first network parameter.
In another aspect, an embodiment of the present invention further provides a data communication apparatus, which is applied to a signaling server in a session system, where the data communication apparatus includes:
the first parameter acquisition module is used for acquiring first network parameters between the first client and each streaming media server when receiving a session request for the first client to join the current session;
the second parameter acquisition module is used for acquiring second network parameters when data communication is realized between each streaming media server related to the current session and other streaming media servers except the current session;
the target selection module is used for selecting the streaming media server meeting a first preset condition as a target server according to the first network parameter and the second network parameter;
and the communication establishing module is used for informing the first client to take the target server as an access node and add the target server into the current session.
Compared with the prior art, the data communication method and the data communication device provided by the embodiment of the invention have the advantages that the selection of the access node is carried out based on the network parameters between the client and the streaming media server and the network parameters between the streaming media servers, the network communication quality of the client after the client joins the current session through the selected access node can be effectively ensured, the stability of a data communication link is high, and the audio and video communication requirements of users under different network environments can be met.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic block structure diagram of a signaling server according to an embodiment of the present invention.
Fig. 2 is a flowchart illustrating a data communication method applied to a signaling server according to an embodiment of the present invention.
Fig. 3 is a schematic flow chart illustrating a first network parameter between the client and each streaming media server.
Fig. 4 is a schematic flow chart illustrating mutual probing of the second network parameters among the streaming media servers.
Fig. 5 is a sub-flowchart of step S13 shown in fig. 2.
Fig. 6 is a network topology diagram when data communication is implemented between a first client and a second client.
Fig. 7 is another network topology diagram for data communication between a first client and a second client.
Fig. 8 is a sub-flowchart of step S131 shown in fig. 5.
Fig. 9 is another sub-flowchart of step S13 shown in fig. 2.
Fig. 10 is a flowchart illustrating a data communication method applied to a client according to an embodiment of the present invention.
Fig. 11 is a block diagram of a data communication device according to an embodiment of the present invention.
Icon: 10-a signaling server; 100-a data communication device; 110-a first parameter acquisition module; 120-a second parameter acquisition module; 130-target selection module; 140-a communication establishment module; 200-a memory; 300-a memory controller; 400-processor.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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 some, but not all, embodiments of the present invention. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. 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.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
Fig. 1 is a schematic block diagram of a signaling server 10 to which the data communication method and apparatus provided by the embodiment of the present invention are applied. The signaling server 10 includes a data communication device 100, a memory 200, a memory controller 300, and a processor 400. The signaling server 10 may be, but not limited to, an electronic device with a processing function, such as a computer, a Mobile Internet Device (MID), and the like.
Optionally, the elements of the memory 200, the memory controller 300 and the processor 400 are directly or indirectly electrically connected to each other to realize data transmission or interaction. For example, the components are electrically connected to each other through one or more communication buses or signal lines. The data communication device 100 includes at least one software functional module which can be stored in the memory 200 in the form of software or firmware or solidified in the operating system of the signaling server 10. The processor 400 accesses the memory 200 under the control of the memory controller 300 for executing executable modules stored in the memory 200, such as software functional modules and computer programs included in the data communication apparatus 100.
It will be appreciated that the architecture shown in fig. 1 is merely illustrative and that the signaling server 10 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof. In addition, in order to implement data communication between the client and the client, in this embodiment, the signaling server 10 may further be capable of communicating with the client and a preset streaming server in the session system, so that when a new client joins the current session, a streaming server meeting requirements may be selected from a plurality of streaming servers preset in the session system as an access node to implement data communication between the clients, where the preset streaming servers may be streaming servers related to the current session, may also be preset streaming servers in the session system but not belonging to the current session, and may also be all streaming servers included in the session system, and the like, which is not limited herein.
Optionally, the actual types of the client and the streaming media server may be selected according to requirements, for example, the client may be, but is not limited to, a mobile phone, a computer, an IPAD, or other electronic devices with a data processing function, and for example, the streaming media server may also be, but is not limited to, an electronic device with a processing function, such as a computer, a mobile internet access device, and the like.
Further, please refer to fig. 2 in combination, an embodiment of the present invention further provides a data communication method applicable to the signaling server 10. It should be noted that the data communication method of the present invention is not limited by the specific sequence shown in fig. 2 and described below. It should be understood that the order of some steps in the data communication method according to the present invention may be interchanged according to actual needs, or some steps may be omitted or deleted.
Step S11, when receiving a session request for joining the first client to the current session, acquiring a first network parameter between the first client and each streaming media server;
step S12, obtaining a second network parameter when data communication is realized between each streaming media server in the session system and other streaming media servers except the streaming media server;
step S13, selecting a streaming media server meeting a first preset condition as a target server according to the first network parameter and the second network parameter;
step S14, notifying the first client to add the target server as an access node to the current session;
compared with the prior art, in the data communication method provided in the above steps S11-S14, when a new client (first client) received by the signaling server 10 joins the session request of the current session, the streaming media server with the best performance can be selected as the access node according to the network parameters (such as the first network parameters) when the client and each streaming media server in the session system realize data communication and the network parameters (such as the second network parameters) when each streaming media server in the session system and other streaming media servers realize data communication, and the client is notified to join the current session based on the access node, so as to ensure the reliability of the data communication link formed between the client and the streaming media server in the current session, and greatly improve the network communication quality, especially the multimedia communication such as audio and video, to adapt to complex network environments. It should be noted that the current session refers to a communication unit in which some or all of the clients and the streaming media server involved in the session system are participating and performing instant communication, and the session system refers to a client and a streaming media server including but not limited to a client and a streaming media server participating in the current session.
In detail, the first network parameter in step S11 and the second network parameter in step S12 may be, but not limited to, a "pin + IP address" manner, and the like, and for example, the first network parameter may be that the first client obtains the IP address of the streaming media server corresponding to the pin + and sends the obtained IP address to the signaling server 10. The first network parameter and the second network parameter in step S12 may be, but not limited to, one or more of a network delay parameter, a link throughput, a link stability, a network status, and a data transmission rate, which is not limited herein. It should be noted that "the first" and "the second" of the first client and the second client in this embodiment are only to distinguish clients in different states, and have no practical meaning, for example, the first client refers to a client that requests to join a current session, and the second client refers to a client that has already participated in the current session.
Please refer to fig. 3, before the signaling server 10 performs step S11, the first client may first obtain an address list storing address information of each streaming media server in the session system from the signaling server 10, and then sequentially detect a first network parameter between itself and each streaming media server (e.g., the streaming media server M1, the streaming media server M2) based on the address information in the address list and send the first network parameter to the signaling server 10 for selecting a target server.
In step S12, the second network parameter may be obtained by actively obtaining from a streaming media server when the signaling server 10 receives a session request for the first client to join the current session, or may be actively reported to the signaling server 10 by each streaming media server according to a preset time interval. Referring to fig. 4, in order to ensure the accuracy of the second network parameter and improve the selection efficiency of the target server in the embodiment, the acquisition of the second network parameter may be detected by each streaming media server (e.g., the streaming media server M1, the streaming media server M2, and the streaming media server M3 shown in fig. 4) at a preset time interval (e.g., 5s, 10s, etc.), and then each detected second network parameter is sent to the signaling server 10 for storage, so as to be used for selecting the target server.
Further, in step S13, the manner of selecting the target server by the signaling server 10 is different according to the difference between the first network parameter and the second network parameter, and in this embodiment, it is considered that in an actual data communication link, the smaller the network delay amount is, the shortest path between the clients communicating with each other can be determined, that is, the better the stability of the communication link between the two clients is, so in this embodiment, the network delay amount can be used as the selection criterion when selecting the target server. Specifically, as shown in fig. 5, when the first network parameter includes a first network delay parameter and the second network parameter includes a second network delay parameter, the step S13 may be implemented by the following step S130 and step S131, which is specifically described below.
Step S130, aiming at each streaming media server in the session system, respectively calculating the sum of network delay amount when the first client realizes data communication with each second client related in the current session based on the streaming media server according to the first network delay parameter and the second network delay parameter;
step S131, selecting a streaming media server meeting a preset requirement from a plurality of streaming media servers included in the session system as a target server according to the calculated sum of the network delay amount.
In detail, in step S130, since there may be one or more second clients involved in the current session, the actual implementation procedure of step S130 may be different according to the number of the second clients.
For example, when the second client is one, assuming that the second client is C2, if there is a request from the first client C1 to join the current session, since there is a streaming server M1 connected to the second client C2 already in the current session, if the data transmission between the first client C1 and the second client C2 is desired to reach the minimum amount of network delay, the signaling server 10 needs to find the shortest path from the first client C1 to the streaming server M1 (or the second client C2) (i.e., the minimum amount of network delay) from a plurality of streaming servers preset in the session system. The actual selection result can be divided into two cases, one is that the first client C1 is directly connected to the streaming server M1, and the other is that the first client C1 reaches the streaming server M1 through the relay of the streaming server M2.
As an embodiment, as shown in fig. 6, assuming that the delay from the first client C1 to the streaming server M1 is 200ms, the delay from the first client C1 to the streaming server M2 is 30ms, and the delay between the streaming server M1 and the streaming server M2 is 50ms, the best path is that the first client C1 connects to the streaming server M2, and then the streaming server M2 connects to the streaming server M1 as the shortest path, i.e. the streaming server M2 can be the target server.
For another example, when there are a plurality of second clients, a sum of network delay amounts when data communication is implemented between the first client and each of the second clients may be calculated according to the first network delay parameter and the second network delay parameter for each preset streaming media server, and the sum is used as the network delay amount corresponding to the streaming media server. As an embodiment, as shown in fig. 7, assuming that there are two second clients, e.g. C2, C3, if there is a first client C1 joining the current session, then for each streaming server, if the streaming server M1, the streaming server M2, and the streaming server M3 respectively calculate a total sum of network delay amounts D1 when the first client C1 realizes data communication with the second client C2 and the second client C3 when the streaming server M1 is used as an access node, a total sum of network delay amounts D2 when the streaming server M2 is used as an access node and data communication is realized with the second client C2 and the second client C3, and a total sum of network delay amounts D3 when the streaming server M3 is used as an access node and data communication is realized with the second client C2 and the second client C3, and assuming that D2 is the smallest, the streaming server corresponding to the total sum of network delay amounts D2 is used as a target server.
Further, in step S131, since each time a new streaming media server is added to the current session (a new streaming media server is started), a certain server resource is consumed, so as to increase the session cost, in this embodiment, in order to make the performance of the session system better, as shown in fig. 8, step S131 may be implemented by following steps S1310 to S1313, which are specifically described below.
Step 1310, selecting a streaming media server with the minimum network delay amount sum from a plurality of streaming media servers included in the session system as a first server to be compared according to the calculated network delay amount sum;
step S1311, determining whether the first server to be compared is the streaming media server involved in the current session, if so, taking the first server to be compared as the target server, otherwise, executing step S1312-step S1313;
step S1312, selecting the streaming media server with the minimum network delay amount sum from the streaming media servers related to the current session according to the calculated network delay amount sum as a second server to be compared;
step 1313, calculating a difference between a sum of network delay amounts corresponding to the first server to be compared and a sum of network delay amounts corresponding to the second server to be compared, and when the difference is greater than a first preset value, taking the first server to be compared as the target server;
in the above steps S1310 to S1313, the streaming server involved in the current session refers to a streaming server that is already participating in the session and is capable of data communication with the second client involved in the current session. The first preset value may be set according to the requirement of the actual communication link, for example, but not limited to, 80ms, 100ms, and the like.
In detail, as an embodiment, the actual implementation process of the above steps S1310 to S1313 may include: if the first preset value is 100ms and there are already 3 streaming media servers in a running state in the current session system, i.e. M1, M2, and M3, then, when the target server selected when the first client requests to join the current session system is exactly one of M1, M2, or M3, the first client can be directly connected to the target server. Otherwise, a new streaming media server M4 may need to be started, and then the streaming media server M4 needs to be used as the first server to be compared, and one of the streaming media servers M1, M2, and M3 involved in the current session with the smallest network delay amount is selected as the second server to be compared, and the sum of the network delay amounts when the first client and the second clients perform data communication based on the first server to be compared and the second server to be compared is compared, when the sum of the network delay amounts corresponding to the first server to be compared is at least 100ms less than the sum of the network delay amounts corresponding to the second server to be compared, the first server to be compared may be used as the target server and connected to the first client, otherwise, the second server to be compared may be used as the target server and connected to the first client.
It can be understood that, when the difference is greater than the first preset value, it may be determined that a new streaming media server is started, rather than being started, although a certain amount of server resources may be consumed, which increases the session cost, the network communication quality may be greatly improved, and the consumption of server resources is worth while the network performance is improved. In addition, in addition to the step S1313, when the difference is not greater than the first preset value, the second server to be compared may be used as the target server to implement data communication between the first client and the second client.
Further, according to actual requirements, before performing the above step S130 to step S131, in order to reduce the complexity of the data communication method and the overhead of the overall server in the session system in the data communication process, the present embodiment may determine the number of streaming media servers involved in the current session, and further select a target server according to the actual number of streaming media servers involved in the current session, where the specific process may include: the signaling server 10 determines whether the number of the streaming media servers involved in the current session reaches a second preset value, and if the number of the streaming media servers in the running state in the session system does not reach the second preset value, executes step S140-step S141 to select a target server; on the contrary, if the number of the streaming media servers involved in the current session reaches the second preset value, as shown in fig. 9, steps S132 to S133 may be executed, which is specifically described as follows.
Step S132, based on each streaming media server involved in the current session, respectively calculating a sum of network delay amounts when data communication between the first client and each second client involved in the current session is realized according to the first network delay parameter and the second network delay parameter;
step S133, selecting a streaming media server meeting a preset requirement from the streaming media servers related to the current session as a target server according to the calculated total network delay amount.
In detail, the second preset value can be flexibly set according to actual requirements, and is adapted to different network conditions and different user groups, for example, the second preset value may be, but is not limited to, 4, 8, and the like. In addition, as an embodiment, the actual implementation process of the above steps S132 to S133 may include: if the second preset value is 4, that is, when there are 4 streaming media servers involved in the current session (e.g., M1, M2, M3, M4), then, when selecting a target server, the target server may be selected directly based on the streaming media servers M1, M2, M3, M4, or based on each streaming media server preset in the session system, when the selected streaming media server meeting the requirement is not the streaming media server M1, M2, M3, M4 involved in the current session, if the streaming media server meeting the requirement is M5, it may be determined whether M5 can be the target server based on steps S1310-S1313, if so, one of the streaming media servers M1, M2, M3, M4 in a running state may be replaced with M5, and if not, one of the streaming media servers M1, M2 may be directly selected from the streaming media servers M1, M2, And selecting one of the M3 and the M4 with the minimum network delay amount as a target server.
It should be noted that, when the signaling server 10 receives a session request for a first client to join in a current session, if a second client is not involved in the current session, a streaming media server meeting a second preset condition may be directly selected from multiple streaming media servers included in a session system according to the first network parameter as a target server, and the target server is joined in the session system, and a communication connection between the first client and the target server is established.
As an implementation manner, when there is no second client in the current session, it may be determined that the first client is the first client joining the current session, and therefore, the signaling server 10 only needs to select, according to the first network parameter sent by the first client, a streaming media server meeting a first preset condition from streaming media servers preset in the session system as a target server, for example, assuming that the first network parameter is a network delay parameter, the streaming media server with the smallest network delay amount may be selected as an access node to be connected with the first client, so as to join the current session.
It should be noted that, in the data communication method, in order to further improve the selection efficiency of the target server and reduce the complexity of the selection process, in this embodiment, it may further be determined whether there is a server with a downtime, a fault, or a network delay exceeding a preset value in each streaming media server preset in the session system according to the first network parameter and the second network parameter, and if there is a server, the server may be removed from a preset streaming media server list, so that the server may not participate in the election of the target server.
Compared with the prior art, the data communication method provided by the embodiment of the invention also has the following advantages.
(1) Compared with the existing peer-to-peer (P2P) communication mode, the data communication among the clients is realized based on the streaming media server, the stability of the communication network can be effectively ensured, and particularly in a session scene with participation of multiple clients, if the clients need to send multiple data, the data communication mode provided by the invention can greatly reduce the performance pressure and bandwidth consumption of the clients.
(2) Compared with the existing single server mode, the invention adopts a plurality of columns of servers as access nodes to realize data communication between the clients, thereby avoiding the problem that the single server mode cannot ensure the data communication quality of the audio and video due to poor link stability between the clients and the streaming media server in the conversation scene of cross-country regions and cross-operators.
Further, based on the description of the data communication method applied to the signaling server 10, as shown in fig. 10, the present embodiment also provides a data communication method applied to the client, and the data communication method includes the following steps S21-S23, which are specifically as follows.
Step S21, obtaining address list of address information of each flow media server in conversation system;
step S22, aiming at each address information in the address list, respectively detecting the network state between itself and the streaming media server corresponding to the address information to obtain a first network parameter;
step S23, sending the first network parameter to the signaling server 10, so that the signaling server 10 selects a streaming media server meeting a second preset condition as a target server communicating with the client according to the first network parameter.
It is to be understood that, since the data communication method given in the above step S21-step S23 has the same or corresponding technical features as the data communication method given in the above step S11-step S14, the detailed description about the above step S21-step S23 may refer to the detailed description about the above step S11-step S14, and the detailed description of the embodiment is omitted here.
Further, referring to fig. 11, an embodiment of the invention further provides a data communication apparatus 100 including a first parameter obtaining module 110, a second parameter obtaining module 120, a target selecting module 130, and a communication establishing module 140.
The first parameter obtaining module 110 is configured to, when receiving a session request for a first client to join a current session, obtain a first network parameter between the first client and each streaming media server; in this embodiment, the step S11 can be executed by the first parameter obtaining module 110, and please refer to the step S11 for details, which are not described herein again.
The second parameter obtaining module 120 is configured to obtain a second network parameter when data communication is implemented between each streaming media server in the session system and other streaming media servers except the streaming media server; in this embodiment, the step S12 can be executed by the second parameter obtaining module 120, and please refer to the step S12 for details, which are not described herein again.
The target selecting module 130 is configured to select, according to the first network parameter and the second network parameter, a streaming media server that meets a first preset condition as a target server; in this embodiment, the step S13 can be executed by the target selecting module 130, and please refer to the step S13 for details, which are not described herein again.
The communication establishing module 140 is configured to notify the first client to join the target server in the current session as an access node. In this embodiment, the step S14 can be executed by the communication establishing module 140, and please refer to the step S14 for a specific process, which is not described herein again.
In summary, the data communication method and apparatus provided in the embodiments of the present invention perform communication routing selection between clients based on network parameters between the clients and the streaming media servers and network parameters between the streaming media servers, so as to effectively ensure stability of a data communication link, greatly improve network communication quality, and meet audio/video communication requirements in different network environments.
In the description of the present invention, the terms "disposed", "connected" and "connected" should be interpreted broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In the embodiments provided in the embodiments of the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus and method embodiments described above are illustrative only, as the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to a predetermined number of embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code. The module, segment, or portion of code, comprises one or a predetermined number of elements designed to implement a specified logical function.
It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. A data communication method, applied to a signaling server in a session system, the data communication method comprising:
when a session request of a first client for joining a current session is received, acquiring first network parameters between the first client and each streaming media server;
acquiring second network parameters when data communication is realized between each streaming media server related in the session system and other streaming media servers except the streaming media server;
selecting a streaming media server meeting a first preset condition as a target server according to the first network parameter and the second network parameter;
informing the first client to take the target server as an access node and adding the target server into the current session;
the first network parameter comprises a first network delay parameter, and the second network parameter comprises a second network delay parameter; selecting a streaming media server meeting a first preset condition as a target server according to the first network parameter and the second network parameter, wherein the step comprises the following steps:
for each streaming media server in the session system, respectively calculating the sum of network delay amounts when the first client realizes data communication with each second client related in the current session based on the streaming media server according to the first network delay parameter and the second network delay parameter;
selecting a streaming media server with the minimum network delay amount sum from a plurality of streaming media servers in the session system as a first server to be compared according to the calculated network delay amount sum;
judging whether the first server to be compared is the streaming media server related to the current session, if not, selecting the streaming media server with the minimum sum of network delay amount from the streaming media servers related to the current session as a second server to be compared according to the sum of the network delay amount obtained by calculation;
calculating a difference value between the sum of the network delay amounts corresponding to the second server to be compared and the sum of the network delay amounts corresponding to the first server to be compared, and taking the first server to be compared as the target server when the difference value is greater than a first preset value; and the sum of the network delay amounts corresponding to the second servers to be compared is greater than the sum of the network delay amounts corresponding to the first servers to be compared.
2. The data communication method of claim 1, wherein the first network parameter and the second network parameter respectively comprise one or more of a network delay parameter, a link throughput, a link stability, and a data transmission rate.
3. The data communication method according to claim 1, wherein the first network parameter comprises a first network latency parameter and the second network parameter comprises a second network latency parameter; selecting a streaming media server meeting a first preset condition as a target server according to the first network parameter and the second network parameter, wherein the step comprises the following steps:
based on each streaming media server involved in the current session, respectively calculating the sum of network delay amount when the first client realizes data communication with each second client involved in the current session based on the streaming media server according to the first network delay parameter and the second network delay parameter;
and selecting a streaming media server meeting preset requirements from the streaming media servers related to the current session as a target server according to the calculated sum of the network delay amount.
4. The data communication method according to claim 3, wherein the step of selecting a streaming media server satisfying a preset requirement from the streaming media servers involved in the current session as a target server according to the calculated sum of the network delay amounts comprises:
and selecting the streaming media server with the minimum network delay amount sum from the streaming media servers involved in the current session as a target server according to the calculated network delay amount sum.
5. The data communication method according to claim 1, wherein the step of selecting a streaming server satisfying a first preset condition from a plurality of preset streaming servers as a target server according to the first network parameter and the second network parameter further comprises:
and judging whether the number of the streaming media servers involved in the current session reaches a second preset value, and when the number of the streaming media servers involved in the current session does not reach the second preset value, then executing a step of calculating the sum of network delay amount when the first client realizes data communication with each second client involved in the current session based on the streaming media server according to the first network delay parameter and the second network delay parameter respectively for each streaming media server in the session system.
6. The data communication method according to claim 5, wherein the step of selecting a streaming server satisfying a first preset condition from a plurality of preset streaming servers as a target server according to the first network parameter and the second network parameter further comprises:
and when the number of the streaming media servers involved in the current session reaches a second preset value, executing the steps of calculating the sum of network delay amounts when the first client side realizes data communication with the second client sides involved in the current session based on the streaming media servers according to the first network delay parameter and the second network delay parameter, and selecting the streaming media server meeting preset requirements from the streaming media servers involved in the current session as a target server according to the calculated sum of the network delay amounts.
7. A data communication method, applied to a client in a session system, the data communication method comprising:
acquiring an address list storing address information of each streaming media server in a session system;
aiming at each address information in the address list, respectively detecting the network state between the address information and the streaming media server corresponding to the address information to obtain a first network parameter;
sending the first network parameter to a signaling server so that the signaling server selects a streaming media server meeting a second preset condition as a target server communicating with the client according to the first network parameter;
the first network parameter comprises a first network delay parameter, and the signaling server selects a streaming media server meeting a second preset condition as a target server communicating with the client according to the first network parameter, wherein the signaling server comprises:
the signaling server calculates, for each streaming media server in the session system, a sum of network delay amounts when a first client implements data communication with each second client involved in a current session based on the streaming media server according to the first network delay parameter and the second network delay parameter, respectively, where the second network delay parameter is a second network parameter acquired by the signaling server when data communication is implemented between each streaming media server involved in the session system and other streaming media servers except the signaling server, and the second network parameter includes the second network delay parameter;
selecting a streaming media server with the minimum network delay amount sum from a plurality of streaming media servers in the session system as a first server to be compared according to the calculated network delay amount sum;
judging whether the first server to be compared is the streaming media server related to the current session, if not, selecting the streaming media server with the minimum sum of network delay amount from the streaming media servers related to the current session as a second server to be compared according to the sum of the network delay amount obtained by calculation;
calculating a difference value between the sum of the network delay amounts corresponding to the second server to be compared and the sum of the network delay amounts corresponding to the first server to be compared, and taking the first server to be compared as the target server when the difference value is greater than a first preset value; and the sum of the network delay amounts corresponding to the second servers to be compared is greater than the sum of the network delay amounts corresponding to the first servers to be compared.
8. A data communication apparatus, applied to a signaling server in a session system, the data communication apparatus comprising:
the first parameter acquisition module is used for acquiring first network parameters between the first client and each streaming media server when receiving a session request for the first client to join the current session;
the second parameter acquisition module is used for acquiring second network parameters when data communication is realized between each streaming media server related to the current session and other streaming media servers except the current session;
the target selection module is used for selecting the streaming media server meeting a first preset condition as a target server according to the first network parameter and the second network parameter;
a communication establishing module, configured to notify the first client to add the target server as an access node to a current session;
the first network parameter comprises a first network delay parameter, and the second network parameter comprises a second network delay parameter;
the target selection module is specifically configured to calculate, for each streaming media server in the session system, a sum of network delay amounts when the first client implements data communication with each second client related to the current session based on the streaming media server according to the first network delay parameter and the second network delay parameter, respectively;
selecting a streaming media server with the minimum network delay amount sum from a plurality of streaming media servers in the session system as a first server to be compared according to the calculated network delay amount sum;
judging whether the first server to be compared is the streaming media server related to the current session, if not, selecting the streaming media server with the minimum sum of network delay amount from the streaming media servers related to the current session as a second server to be compared according to the sum of the network delay amount obtained by calculation;
calculating a difference value between the sum of the network delay amounts corresponding to the second server to be compared and the sum of the network delay amounts corresponding to the first server to be compared, and taking the first server to be compared as the target server when the difference value is greater than a first preset value; and the sum of the network delay amounts corresponding to the second servers to be compared is greater than the sum of the network delay amounts corresponding to the first servers to be compared.
CN201910239316.9A 2019-03-27 2019-03-27 Data communication method and device Active CN109889545B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910239316.9A CN109889545B (en) 2019-03-27 2019-03-27 Data communication method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910239316.9A CN109889545B (en) 2019-03-27 2019-03-27 Data communication method and device

Publications (2)

Publication Number Publication Date
CN109889545A CN109889545A (en) 2019-06-14
CN109889545B true CN109889545B (en) 2021-08-27

Family

ID=66934628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910239316.9A Active CN109889545B (en) 2019-03-27 2019-03-27 Data communication method and device

Country Status (1)

Country Link
CN (1) CN109889545B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112788053A (en) * 2021-01-25 2021-05-11 深圳市欢太科技有限公司 Real-time communication method, device, server, system and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101635831A (en) * 2009-08-24 2010-01-27 成都市华为赛门铁克科技有限公司 Method, device and agent system for sharing node data of P2P live video
CN101924678A (en) * 2009-06-09 2010-12-22 华为技术有限公司 Flow localizing method and device in P2P (Point-to-Point) direct broadcasting system
CN102571584A (en) * 2012-01-12 2012-07-11 李禾禾 Method for accelerating distributed network
CN107026793A (en) * 2017-03-31 2017-08-08 腾讯科技(深圳)有限公司 Method for routing, apparatus and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5598688B2 (en) * 2011-01-26 2014-10-01 日本電気株式会社 Network system, control device, and optimum route control method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101924678A (en) * 2009-06-09 2010-12-22 华为技术有限公司 Flow localizing method and device in P2P (Point-to-Point) direct broadcasting system
CN101635831A (en) * 2009-08-24 2010-01-27 成都市华为赛门铁克科技有限公司 Method, device and agent system for sharing node data of P2P live video
CN102571584A (en) * 2012-01-12 2012-07-11 李禾禾 Method for accelerating distributed network
CN107026793A (en) * 2017-03-31 2017-08-08 腾讯科技(深圳)有限公司 Method for routing, apparatus and system

Also Published As

Publication number Publication date
CN109889545A (en) 2019-06-14

Similar Documents

Publication Publication Date Title
AU2012238145B2 (en) Providing a witness service
EP3447970B1 (en) Live broadcast system in peer-to-peer network and node management method
US9173006B2 (en) Method for live broadcasting in a distributed network and apparatus for the same
EP3132567B1 (en) Event processing in a network management system
CN112272291B (en) Video storage method, device, management equipment and readable storage medium
CN103312593B (en) A kind of message distributing system and method
CN112737897B (en) Link monitoring and scheduling method, device, equipment and storage medium
CN113783775A (en) Data transmission method and device
CN108156024B (en) Method, system and storage medium for detecting availability based on distributed website
CN109889545B (en) Data communication method and device
KR101571374B1 (en) Information management method and device
CN109412890B (en) DDS-based joint test platform middleware node state detection method
CN113485842B (en) Method and device for data analysis based on device cluster
CN110868747B (en) Method for detecting delay and automatically switching multiple network modes
CN115378962A (en) High-availability communication method and system of storage cluster based on iSCSI protocol
CN115134885A (en) Transmission path optimization method, communication system and readable storage medium
CN107147867B (en) Distributed transcoding method and system
CN111949404B (en) Method, device and related equipment for adjusting server load
CN109921933B (en) Information processing method and network security equipment
CN112995057B (en) Maximum transmission rate determining method, maximum transmission rate determining device, electronic equipment and storage medium
CN114666264B (en) Multipath transmission method and device
CN109451266B (en) Remote control method and device
CN117675776A (en) Media access method and device
CN115190354A (en) Audio and video transmission method and device, electronic equipment and storage medium
CN117014998A (en) method, device and equipment for determining node state in mesh network

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