CN104580346B - Data transmission method and device - Google Patents

Data transmission method and device Download PDF

Info

Publication number
CN104580346B
CN104580346B CN201410460728.2A CN201410460728A CN104580346B CN 104580346 B CN104580346 B CN 104580346B CN 201410460728 A CN201410460728 A CN 201410460728A CN 104580346 B CN104580346 B CN 104580346B
Authority
CN
China
Prior art keywords
node equipment
server
client
data
node
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
CN201410460728.2A
Other languages
Chinese (zh)
Other versions
CN104580346A (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.)
ULTRAPOWER INTERNATIONAL TECHNOLOGY DEVELOPMENT(BEIJING) Co Ltd
Original Assignee
ULTRAPOWER INTERNATIONAL TECHNOLOGY DEVELOPMENT(BEIJING) 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 ULTRAPOWER INTERNATIONAL TECHNOLOGY DEVELOPMENT(BEIJING) Co Ltd filed Critical ULTRAPOWER INTERNATIONAL TECHNOLOGY DEVELOPMENT(BEIJING) Co Ltd
Priority to CN201410460728.2A priority Critical patent/CN104580346B/en
Publication of CN104580346A publication Critical patent/CN104580346A/en
Application granted granted Critical
Publication of CN104580346B publication Critical patent/CN104580346B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention discloses a kind of data transmission method and device, method includes:It when intermediate equipment is activated, is established and connected by client and first node equipment, established and connected by server-side and second node equipment, client is arranged on server-side in intermediate equipment;The sending strategy object of client and server-side is initialized respectively;The forwarding strategy object of server-side is generated, and the sending strategy object's property value of client is assigned to the forwarding strategy object of server-side;The first data to be transmitted of second node equipment transmission is received by server-side;When determining that the first data to be transmitted needs to be sent to first node equipment, according to the forwarding strategy object of server-side, it is transmitted directly to first node equipment.Step when this method can simplify data transmission in intermediate equipment reduces the time of data transmission so that efficiency of transmission is improved.

Description

Data transmission method and device
Technical field
The present invention relates to field of communication technology, more particularly to a kind of data transmission method and device.
Background technology
The communication that usual TCP (Transmission Control Protocol transmission control protocols) communication protocol is related to Both sides are server-side/client mode, i.e., when communicating pair communicates, one end is server-side, and one end is client, between the two It is communicated by TCP communication agreement, transmits data.But when communication equipment is related to tripartite, it usually needs one centre of setting Equipment is as third party, and the intermediate equipment needs to include client corresponding with first party, and further include and second party Corresponding server-side.As shown in Figure 1, in figure first party be first node equipment 1, second party be second node equipment 2, third party It is 3 for intermediate equipment, and client 4 and server-side 5 is provided in intermediate equipment 3, from figure 1 it will be seen that first node Equipment 1 is connected with client 4, and second node equipment 2 is connected with server-side 5.
When being communicated, when needing to transmit data between first node equipment 1 and second node equipment 2, for example, the Two node devices 2 send the data to first node equipment 1, then the server-side 5 of intermediate equipment 3 receives second node equipment 2 data sent, and when confirming that the data will be sent to first node equipment 1, the server-side 5 of intermediate equipment 3 needs first should Data are transferred to the client 4 of intermediate equipment 3, and data are parsed and are found by the client 4 of intermediate equipment 3 and are sent to The communication link of first node equipment 2 sends the data to first node equipment by the communication link found.
The process not only very complicated, transmission efficiency is low, and every time transmission when be required for repeating the above process, equipment Work load is heavier.
Invention content
To overcome the problems in correlation technique, a kind of data transmission method and dress are provided in the embodiment of the present invention It puts, step very complicated when having solved the problems, such as existing intermediate equipment forwarding data, transmission efficiency is low.
In order to solve the above-mentioned technical problem, the embodiment of the invention discloses following technical solutions:
A kind of data transmission method, the method includes:
When intermediate equipment is activated, is established and connected by client and first node equipment, pass through server-side and second Node device establishes connection, and the client is set on the intermediate device with the server-side;
The sending strategy object of the client and the server-side, the hair of the client of initialization are initialized respectively Policy object is sent to indicate communication link of the client to the first node equipment transmission data, the server-side of initialization Sending strategy object indicates communication link of the server-side to the second node equipment transmission data;
Generate the forwarding strategy object of the server-side, and by the sending strategy object's property value assignment of the client To the forwarding strategy object of the server-side;
The first data to be transmitted of the second node equipment transmission is received by the server-side;
When determining that first data to be transmitted needs to be sent to first node equipment, according to the forwarding of the server-side Policy object is transmitted directly to the first node equipment.
Optionally, it is described to initialize the client respectively with after the sending strategy object of the server-side, further including:
Generate the forwarding strategy object of the client, and by the sending strategy object's property value assignment of the server-side To the forwarding strategy object of the client;
The method further includes:
The second data to be transmitted of the first node equipment transmission is received by the client;
When determining that second data to be transmitted needs to be sent to second node equipment, according to the forwarding of the client Policy object is transmitted directly to the second node equipment.
Optionally, the forwarding strategy object according to the server-side, be transmitted directly to the first node equipment it Before, it further includes:
Described second is parsed in the first data to be transmitted sent from the second node equipment that the server-side receives The IP address of node device;
IP address list is deactivated according to preset legitimate ip address list and temporarily, confirms that the IP address parsed is No is illegal IP address or deactivated IP address;
If so, stop that first data to be transmitted is sent to the first node equipment and is alarmed;
If it is not, the first node equipment is then transmitted directly to according to the forwarding strategy object of the server-side.
Optionally, described established after connection with second node equipment by server-side further includes:
The heartbeat message of the second node device periodically transmission is received by the server-side;
If the heartbeat message receives exception, the server-side and the second node communication between devices link are confirmed It is abnormal, and the communication link between the server-side and the second node equipment is disconnected, and the second node is waited for set The communication link between the server-side and the second node equipment is re-established after standby retransmission connection request.
Optionally, described established after connection with first node equipment by client further includes:
Heartbeat message is sent, and receive the first node to the first node device periodically by the client The response message that equipment is returned according to the heartbeat message;
If the response message receives exception, the communication link between the client and the first node equipment is determined It is abnormal, and the communication link between the client and the first node equipment is disconnected, and by the client again The communication link between the client and the first node equipment is re-established to the first node equipment.
A kind of data transmission device, described device include:
Unit is established, for when intermediate equipment is activated, establishing and connecting by client and first node equipment, pass through Server-side is established with second node equipment and is connected, and the client is set on the intermediate device with the server-side;
Initialization unit, for initializing the sending strategy object of the client and the server-side respectively, initialization The client sending strategy object instruction communication link of the client to the first node equipment transmission data, initially The sending strategy object for the server-side changed indicates communication chain of the server-side to the second node equipment transmission data Road;
First generation unit, for generating the forwarding strategy object of the server-side, and by the transmission plan of the client Slightly object's property value is assigned to the forwarding strategy object of the server-side;
First receiving unit, for receiving the first number to be transmitted of the second node equipment transmission by the server-side According to;
First retransmission unit, for when determining that first data to be transmitted needs to be sent to first node equipment, root According to the forwarding strategy object of the server-side, it is transmitted directly to the first node equipment.
Optionally, described device further includes:
Second generation unit, after initializing the sending strategy object of the client and the server-side respectively, The forwarding strategy object of the client is generated, and the sending strategy object's property value of the server-side is assigned to the visitor The forwarding strategy object at family end;
Second receiving unit, for receiving the second number to be transmitted of the first node equipment transmission by the client According to;
Second retransmission unit, for when determining that second data to be transmitted needs to be sent to second node equipment, root According to the forwarding strategy object of the client, it is transmitted directly to the second node equipment.
Optionally, described device further includes:
Resolution unit, for being solved from the first data to be transmitted that the second node equipment that the server-side receives is sent The IP address of the second node equipment is precipitated;
Determination unit, for deactivating IP address list according to preset legitimate ip address list and temporarily, confirmation is parsed Whether obtained IP address is illegal IP address or deactivated IP address;
Alert process unit, for when the IP address parsed is illegal IP address or deactivated IP address, stopping First data to be transmitted is sent to the first node equipment and is alarmed;
First retransmission unit is additionally operable to when the IP address parsed is legitimate ip address, according to the clothes The forwarding strategy object at business end, is transmitted directly to the first node equipment.
Optionally, described device further includes:
Heartbeat message receiving unit, for receiving the heart of the second node device periodically transmission by the server-side Jump message;
Heartbeat message judging unit, for judging whether the heartbeat message receives exception;
First reconnection unit, for when the heartbeat message receives abnormal, then confirming the server-side and described second Communication link is abnormal between node device, and the communication link between the server-side and the second node equipment is disconnected, And the second node equipment is waited for re-establish the server-side and the second node equipment after retransmitting connection request Between communication link.
Optionally, described device further includes:
Heartbeat message transmitting element disappears for sending heartbeat to the first node device periodically by the client Breath;
Response message receiving unit disappears for receiving the first node equipment according to the response that the heartbeat message returns Breath;
Response message judging unit, for judging whether the response message receives exception;
Second reconnection unit, for when the response message receives abnormal, determining the client and the first segment Communication link between point device is abnormal, and the communication link between the client and the first node equipment is disconnected, And by the client again to the first node equipment re-establish the client and the first node equipment it Between communication link.
By above technical scheme as it can be seen that the embodiment of the present application provides the advantageous effect packet of the data transmission method and device It includes:
This method provided by the embodiments of the present application, when carrying out data transmission, for intermediate equipment, when service terminates Receive the first data to be transmitted that the second node equipment is sent, it is possible to the first data to be transmitted be analyzed, and profit With pre-stored business need, determine whether the first data to be transmitted needs to be sent to first node equipment.If really Fixed first data to be transmitted needs to be sent to first node equipment, then can utilize forwarding plan corresponding with server-side Slightly object, is directly sent to the first node equipment by the first data to be transmitted.
Compared with the relevant technologies, this method by the first data to be transmitted without being first sent to client, then by client The first data to be transmitted is sent to first node equipment further according to corresponding sending strategy object.And then data biography can be simplified Step when defeated in intermediate equipment reduces the time of data transmission so that efficiency of transmission is improved.
Description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, to embodiment or will show below There is attached drawing needed in technology description to be briefly described, it should be apparent that, for those of ordinary skill in the art Speech, without having to pay creative labor, can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is the schematic diagram of a scenario that communication equipment is related to tripartite;
Fig. 2 is a kind of flow diagram of data transmission method provided by the embodiments of the present application;
Fig. 3 is the flow diagram of another data transmission method provided by the embodiments of the present application;
Fig. 4 is the flow diagram of step S104 in Fig. 3;
Fig. 5 is the flow diagram of another data transmission method provided by the embodiments of the present application;
Fig. 6 is the flow diagram of another data transmission method provided by the embodiments of the present application;
Fig. 7 is a kind of structure diagram of data transmission device provided by the embodiments of the present application;
Fig. 8 is the structure diagram of another data transmission device provided by the embodiments of the present application;
Fig. 9 is the structure diagram of the second retransmission unit in Fig. 8;
Figure 10 is a kind of structure diagram of data transmission device provided by the embodiments of the present application;
Figure 11 is a kind of structure diagram of data transmission device provided by the embodiments of the present application.
Specific embodiment
In order to make those skilled in the art better understand the technical solutions in the application, below in conjunction with the application reality The attached drawing in example is applied, the technical solution in the embodiment of the present application is clearly and completely described, it is clear that described implementation Example is merely a part but not all of the embodiments of the present application.Based on the embodiment in the application, this field is common Technical staff's all other embodiments obtained without making creative work should all belong to the application protection Range.
Fig. 2 is referred to, shows a kind of flow diagram of data transmission method of the embodiment of the present application.The embodiment of the present application This method of offer is applied in system shown in FIG. 1, as shown in Fig. 2, this method may comprise steps of:
Step S101:When intermediate equipment is activated, is established and connected by client and first node equipment, pass through service End is established with second node equipment and is connected.
Wherein, as shown in Figure 1, client 4 is all disposed with server-side 5 in intermediate equipment 3.
In the embodiment of the present application, when system shown in FIG. 1 acquires for mine data, after intermediate equipment 3 can be Platform server, first node equipment 1 can be data acquisition equipment, and second node equipment 2 can be monitoring system, such as:It is logical Cross addressable monitoring system of browser etc..
In a particular application, in mine can with layout data cable, and using data cable with positioned at underground and setting It puts the wireless terminal on personnel or equipment and carries out data interaction, it is collected in data cable with data acquisition process Data can converge to the collecting device being arranged in data cable, then be passed by the network controller being connected with collecting device Background server is defeated by, last background server can be selectively by collected data forwarding to second node equipment 2, with reality Now specific data is monitored.
In the embodiments of the present disclosure, established by client and first node equipment connect when, client is to first segment Point device sends connection request, and first node equipment can return to connection response message after connection request is received to client, After client receives connection response message, it is possible to directly establish the communication link between client and first node equipment.
And when establishing connection by server-side and second node equipment, it sends and connects from second node equipment to server-side Request, server-side after connection request is received, to second node equipment send connection response message, then establish server-side with Communication link between second node equipment.
In addition, during wireless terminal use, the operation in the wireless terminal on the personnel that are arranged on or equipment When system needs upgrading, corresponding upgrade file can be transmitted to first node by background server and set by second node equipment 2 Standby 1, then by upgrade file is sent to corresponding wireless terminal with the data cable that first node equipment 1 is connected.
No matter which kind of above-mentioned situation, background server realize function be all to forward the data to specific equipment.
Step S102:The sending strategy object of the client and the server-side is initialized respectively.
For the client 4 and server-side 5 in intermediate equipment 3, all it is connected by communication link with external device.At this Apply in embodiment, the sending strategy object of the client of initialization is indicated for client to the first node The communication link of equipment transmission data, the sending strategy object of the server-side of initialization, is indicated for the server-side To the communication link of the second node equipment transmission data.
In the embodiment of the present application, the sending strategy object of client 4 and server-side 5 can be in the form of configuration file It preserves, in other embodiments, sending strategy object can be preserved with cured program.
Although being both provided with multiple communication links in client 4, server-side 5, after the completion of the step, client can be with By its corresponding sending strategy object, the accurate communication link determined with first node equipment transmission data, and server-side can To pass through its corresponding sending strategy object, the accurate communication link determined with second node equipment transmission data.
Step S103:Generate the forwarding strategy object of the server-side, and by the sending strategy object of the client Property value is assigned to the forwarding strategy object of the server-side.
In the embodiment of the present application, the forwarding strategy object after assignment is used to indicate to first node equipment transmission data Communication link.
In addition, referring to the description in above-mentioned steps S102, the sending strategy object's property value of the client can be With some particular values in the corresponding configuration file of client sending strategy object, then in the step, when by the client When the sending strategy object's property value at end is assigned to the forwarding strategy object of the server-side, plan can will be sent with client Particular value slightly in the corresponding configuration file of object is added to the forwarding strategy object of the server-side, alternatively, using with visitor Particular value in the corresponding configuration file of family end sending strategy object is to corresponding in the forwarding strategy object of the server-side Property value is changed.
No matter which kind of mode, by the forwarding strategy object of the server-side after assignment, server-side can be indicated to The communication link of one node device transmission data.
Step S104:The first data to be transmitted of the second node equipment transmission is received by the server-side.
Step S105:When determining that first data to be transmitted needs to be sent to first node equipment, according to the clothes The forwarding strategy object at business end, is transmitted directly to the first node equipment.
For server-side or client, after the data for receiving node device transmission, which can be carried out Analysis, then in conjunction with pre-stored business need, the object forwarded so that the data is determined to need.Such as:Still with data under ore deposit For acquisition, for being arranged on the gathered data that wireless terminal is sent in equipment, background service can be stored directly in after acquisition In device, without forwarding, as long as record.
But the gathered data that the wireless terminal for being arranged on personnel is sent, passes through these and the relevant acquisition number of personnel According to the situation that can understand personnel in the pit at any time, such as:Positioned at the region of underground, position, into time of underground etc., therefore, this It needs to be forwarded in monitoring system according to design requirement (or business need) with the relevant gathered data of personnel a bit, i.e. second node Equipment, in order to which monitoring personnel understands the situation of personnel in the pit at any time.
In this step, server-side receives the first data to be transmitted that the second node equipment is sent, it is possible to right First data to be transmitted is analyzed, and utilizes pre-stored business need, determines whether the first data to be transmitted is desirable It is sent to first node equipment.
Once it is determined that the first data to be transmitted needs to be sent to first node equipment, then referring to above-mentioned steps S103 Description, it is possible to the first data to be transmitted is directly directly sent to by institute according to corresponding forwarding strategy object by server-side State first node equipment.Without the first data to be transmitted is first sent to client, then by client further according to corresponding First data to be transmitted is sent to first node equipment by sending strategy object.
This method provided by the embodiments of the present application, when carrying out data transmission, for intermediate equipment, when service terminates Receive the first data to be transmitted that the second node equipment is sent, it is possible to the first data to be transmitted be analyzed, and profit With pre-stored business need, determine whether the first data to be transmitted needs to be sent to first node equipment.If really Fixed first data to be transmitted needs to be sent to first node equipment, then can utilize forwarding plan corresponding with server-side Slightly object, is directly sent to the first node equipment by the first data to be transmitted.
Compared with the relevant technologies, this method by the first data to be transmitted without being first sent to client, then by client The first data to be transmitted is sent to first node equipment further according to corresponding sending strategy object.And then data biography can be simplified Step when defeated in intermediate equipment reduces the time of data transmission so that efficiency of transmission is improved.
Fig. 3 is the flow diagram of another data transmission method provided by the embodiments of the present application.Embodiment shown in Fig. 1 On the basis of, as shown in figure 3, after above-mentioned steps S102, this method includes the following steps:
Step S106:Generate the forwarding strategy object of the client, and by the sending strategy object of the server-side Property value is assigned to the forwarding strategy object of the client.
The description as described in the step can be found in the detailed description of above-mentioned steps S103 in detail, and details are not described herein.With step S103's differs only in, and in step s 103, the sending strategy object's property value of the client is assigned to the clothes The forwarding strategy object at business end, and in this step, it is that the sending strategy object's property value of the server-side is assigned to institute State the forwarding strategy object of client.
Step S107:The second data to be transmitted of the first node equipment transmission is received by the client.
Step S108:When determining that second data to be transmitted needs to be sent to second node equipment, according to the visitor The forwarding strategy object at family end is transmitted directly to the second node equipment.
In this step, for intermediate equipment, in can also prestore business need about client, In this way when client receives the second data to be transmitted, directly the second data to be transmitted can be analyzed, and utilize phase The business need answered, determines whether the second data to be transmitted needs to be sent to second node equipment, when the second transmission data need When being sent to second node equipment, it can be transmitted directly to described according to the sending strategy object's property value of the server-side Second node equipment.
This method provided by the embodiments of the present application can not only realize the data for sending second node equipment in server-side First node equipment is directly forwarded to, but also can realize that the data for sending first node equipment in client directly forward Second node equipment is given, in this way when carrying out bi-directional data forwarding using intermediate equipment, when can simplify data transmission in Between step in equipment, therefore, the time of data transmission can be further reduced, improve data transmission efficiency.
In practical application, both sides are connected separately with multiple first node equipment in intermediate equipment and multiple second nodes are set It is standby, then when carrying out data forwarding, number that intermediate equipment will not will be received from the side where all first node equipment It, similarly, will not will be from one where all second node equipment according to the side being forwarded to where all second node equipment The data forwarding that side joint receives gives the side where all first node equipment.It is right in order to control effectively to data transmission For node device, preset legitimate ip address list is also provided in intermediate equipment and deactivates IP address temporarily List, wherein the corresponding node device of all IP address in default legitimate ip address list, intermediate equipment are required for being turned Hair, and for deactivate temporarily the corresponding node device of IP address in IP lists and, not in preset legitimate ip address The corresponding node device of all IP address, intermediate equipment all will not be forwarded.
For this purpose, in the another embodiment of the application, as shown in figure 4, in above-mentioned embodiment illustrated in fig. 2, this method is above-mentioned It can also include the following steps before step S105:
Step S110:It is parsed in the first data to be transmitted sent from the second node equipment that the server-side receives The IP address of the second node equipment.
, can be according to the communication protocol made an appointment when parsing IP address, the data where the first data to be transmitted Specific position in packet extracts the IP address entrained by the data packet.
Step S120:According to preset legitimate ip address list and deactivated IP address list, confirmation temporarily parses to obtain IP address whether be illegal IP address or deactivated IP address.
Preset legitimate ip address list and interim deactivated IP address list can be in advance with configuration file or other files Form be stored in intermediate equipment.
If so, carry out step S130.If not, carry out step S105.
Step S130:First data to be transmitted is sent to the first node equipment and alarmed by stopping.
In the embodiment of the present application, alarm may be used the modes such as sound, word, light and alarm.
When it is legitimate ip address to confirm the IP address parsed, above-mentioned steps S105 is performed.
This method provided by the embodiments of the present application, can also by the IP to data sender when carrying out data forwarding Location is filtered, only for the data that the corresponding node device of IP address in preset legitimate ip address list is sent into Row forwarding, and the data sent for illegal IP or the corresponding node devices of deactivated IP then stop forwarding process.It can carry in this way The safety of height forwarding data, avoids the number sent to some node devices without permission or some malicious node equipment According to being forwarded.
Similarly, before the step S108 in above-mentioned embodiment illustrated in fig. 3, for client, can also equally carry out with Similar IP address filtering scheme shown in above-mentioned Fig. 4, to improve the safety of forwarding data.
When node device and intermediate equipment carry out data transmission, it usually will appear the situation of communication link disconnection, if It handles not in time, it will lead to data congestion, influence the efficiency of data transmission.To solve the above-mentioned problems, it is another in the application In embodiment, process is established about communication link referring in above-mentioned Fig. 2 embodiments, as shown in figure 5, by taking server-side as an example, it should Method is further comprising the steps of:
Step S201:The heartbeat message of the second node device periodically transmission is received by the server-side.
Heartbeat message can be the message for carrying certain information, or an empty message, in second node equipment While transmitting data to server-side and when non-transmission data, periodically the heartbeat can be sent to server-side and disappeared Breath, and the period of second node equipment transmission heartbeat message can be understood in advance in server-side.Server-side is allowed in this way to lead to The reception to heartbeat message is crossed, the situation of the communication link between current second node equipment and server-side is understood, especially exists When data are not transmitted between second node equipment and server-side, using periodicity sending heartbeat message, can to communication link into Row is safeguarded.
Step S202:Judge whether the heartbeat message receives exception;
When the heartbeat message receives abnormal, progress step S203, otherwise, end flow.
Step S203:Confirm that the server-side is abnormal with the second node communication between devices link.
Since second node equipment periodically ceaselessly can send heartbeat message to server-side end, so in communication link just In the case of often, server-side should also be periodically received the heartbeat message.Once receive abnormal, then communication therebetween Link is likely to occur problem.
Step S204:Communication link between the server-side and the second node equipment is disconnected, and described in waiting The communication between the server-side and the second node equipment is re-established after second node equipment retransmission connection request Link.
In the case where determining communication link exception, original communication link can first be disconnected, then re-establish service Communication link between end and the second node equipment.
This method provided by the embodiments of the present application, in use, second node equipment can be according to specific time interval Continue to send heartbeat message to server-side, then server-side can judge current service end according to heartbeat message reception condition It is whether abnormal with the communication link of second node equipment, and carry out in exception the communication to server-side and second node equipment Link is rebuild, to ensure that the data transmission procedure between server-side and second node equipment is stablized.
In order to solve to disconnect due to communication link, and the problem of lead to data congestion, influence the efficiency of data transmission.Such as figure Shown in 6, process is established about communication link referring in above-mentioned Fig. 2 embodiments, by taking client as an example, this method further includes following Step:
Step S301:Heartbeat message is sent to the first node device periodically by the client;
Step S302:Receive the response message that the first node equipment is returned according to the heartbeat message;
Step S303:Judge whether the response message receives exception;
If the response message receives abnormal, progress step S304;Otherwise, terminate flow.
Step S304:Determine that the communication link between the client and the first node equipment is abnormal.
Step S305:Communication link between the client and the first node equipment is disconnected, and by described Client re-establishes the communication chain between the client and the first node equipment to the first node equipment again Road.
This method provided by the embodiments of the present application, in use, may determine that active client and first node equipment Whether communication link is abnormal, and in exception rebuild the communication link of client and first node equipment, with Ensure that the data transmission procedure between client and first node equipment is stablized.
Fig. 7 is a kind of data transmission device provided by the embodiments of the present application, applied in intermediate equipment shown in FIG. 1, such as Shown in Fig. 7, described device includes:Establish unit 11, initialization unit 12, the first generation unit 13,14 and of the first receiving unit First retransmission unit 15.
Unit 11 is established, for when intermediate equipment is activated, establishing and connecting by client and first node equipment, lead to It crosses server-side and establishes connection with second node equipment, the client is set on the intermediate device with the server-side;
Initialization unit 12, for initializing the sending strategy object of the client and the server-side respectively, initially Sending strategy object instruction communication link of the client to the first node equipment transmission data for the client changed, just The sending strategy object of the server-side of beginningization indicates communication of the server-side to the second node equipment transmission data Link;
First generation unit 13, for generating the forwarding strategy object of the server-side, and by the transmission of the client The property value of policy object is assigned to the forwarding strategy object of the server-side;
First receiving unit 14, it is first to be transmitted for receive that the second node equipment sends by the server-side Data;
First retransmission unit 15, for when determining that first data to be transmitted needs to be sent to first node equipment, According to the forwarding strategy object of the server-side, it is transmitted directly to the first node equipment.
Device provided by the embodiments of the present application, when carrying out data transmission, for intermediate equipment, when service terminates Receive the first data to be transmitted that the second node equipment is sent, it is possible to the first data to be transmitted be analyzed, and profit With pre-stored business need, determine whether the first data to be transmitted needs to be sent to first node equipment.If really Fixed first data to be transmitted needs to be sent to first node equipment, then can utilize forwarding plan corresponding with server-side Slightly object, is directly sent to the first node equipment by the first data to be transmitted.
Compared with the relevant technologies, the device by the first data to be transmitted without being first sent to client, then by client The first data to be transmitted is sent to first node equipment further according to corresponding sending strategy object.And then data biography can be simplified Step when defeated in intermediate equipment reduces the time of data transmission so that efficiency of transmission is improved.
On the basis of embodiment shown in Fig. 7, as shown in figure 8, the device can also include:Second generation unit 16, Two receiving units 17 and the second retransmission unit 18.
Second generation unit 16, for initialize respectively the sending strategy object of the client and the server-side it Afterwards, the forwarding strategy object of the client is generated, and the sending strategy object's property value of the server-side is assigned to institute State the forwarding strategy object of client;
Second receiving unit 17, it is second to be transmitted for receive that the first node equipment sends by the client Data;
Second retransmission unit 18, for when determining that second data to be transmitted needs to be sent to second node equipment, According to the forwarding strategy object of the client, it is transmitted directly to the second node equipment.
As shown in figure 9, the device can also include:Resolution unit 101, determination unit 102 and alert process unit 103.
Resolution unit 101, the first data to be transmitted that the second node equipment for being received from the server-side is sent In parse the IP address of the second node equipment;
Determination unit 102, for deactivating IP address list according to preset legitimate ip address list and temporarily, confirmation is solved Analyse whether obtained IP address is illegal IP address or deactivated IP address;
Alert process unit 103, for when the IP address parsed is illegal IP address or deactivated IP address, stopping First data to be transmitted is only sent to the first node equipment and is alarmed;
Above-mentioned first retransmission unit 15 is additionally operable to when the IP address parsed is legitimate ip address, according to described The forwarding strategy object of server-side is transmitted directly to the first node equipment.
The device provided by the embodiments of the present application can not only realize the data for sending second node equipment in server-side First node equipment is directly forwarded to, but also can realize that the data for sending first node equipment in client directly forward Second node equipment is given, in this way when carrying out bi-directional data forwarding using intermediate equipment, when can simplify data transmission in Between step in equipment, therefore, the time of data transmission can be further reduced, improve data transmission efficiency.
As shown in Figure 10, on the basis of device shown in Fig. 7, which can also include:Heartbeat message receiving unit 21, 22 and first reconnection unit 23 of heartbeat message judging unit.
Heartbeat message receiving unit 21, for receiving what the second node device periodically was sent by the server-side Heartbeat message;
Heartbeat message judging unit 22, for judging whether the heartbeat message receives exception;
First reconnection unit 23, for when the heartbeat message receives abnormal, then confirming the server-side and described the Communication link is abnormal between two node devices, and the communication link between the server-side and the second node equipment is broken It opens, and re-establishes the server-side after the waiting second node equipment retransmission connection request and set with the second node Communication link between standby.
Device provided by the embodiments of the present application, in use, second node equipment can be according to specific time interval Continue to send heartbeat message to server-side, then server-side can judge current service end according to heartbeat message reception condition It is whether abnormal with the communication link of second node equipment, and carry out in exception the communication to server-side and second node equipment Link is rebuild, to ensure that the data transmission procedure between server-side and second node equipment is stablized.
As shown in figure 11, on the basis of device shown in Fig. 6, which can also include:Heartbeat message transmitting element 31, Response message receiving unit 32,33 and second reconnection unit 34 of response message judging unit.
Heartbeat message transmitting element 31, for sending heartbeat to the first node device periodically by the client Message;
Response message receiving unit 32, for receiving the response that the first node equipment is returned according to the heartbeat message Message;
Response message judging unit 33, for judging whether the response message receives exception;
Second reconnection unit 34, for when the response message receives abnormal, determining the client and described first Communication link between node device is abnormal, and the communication link between the client and the first node equipment is broken It opens, and the client and the first node equipment is re-established to the first node equipment by the client again Between communication link.
Device provided by the embodiments of the present application, in use, may determine that active client and first node equipment Whether communication link is abnormal, and in exception rebuild the communication link of client and first node equipment, with Ensure that the data transmission procedure between client and first node equipment is stablized
Each embodiment in this specification is described by the way of progressive, identical similar portion between each embodiment Point just to refer each other, and the highlights of each of the examples are difference from other examples.Especially for device or For system embodiment, since it is substantially similar to embodiment of the method, so describing fairly simple, related part is referring to method The part explanation of embodiment.Apparatus and system embodiment described above is only schematical, wherein the conduct The unit that separating component illustrates may or may not be it is physically separate, the component shown as unit can be or Person may not be physical unit, you can be located at a place or can also be distributed in multiple network element.It can root Factually border needs to select some or all of module therein realize the purpose of this embodiment scheme.Ordinary skill Personnel are without creative efforts, you can to understand and implement.
It should be noted that herein, the relational terms of such as " first " and " second " or the like are used merely to one A entity or operation with another entity or operate distinguish, without necessarily requiring or implying these entities or operation it Between there are any actual relationship or orders.Moreover, term " comprising ", "comprising" or its any other variant are intended to Cover non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only include those Element, but also including other elements that are not explicitly listed or further include as this process, method, article or set Standby intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that Also there are other identical elements in the process, method, article or apparatus that includes the element.
The above is only the specific embodiment of the present invention, is made skilled artisans appreciate that or realizing this hair It is bright.A variety of modifications of these embodiments will be apparent to one skilled in the art, it is as defined herein General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, it is of the invention The embodiments shown herein is not intended to be limited to, and is to fit to and the principles and novel features disclosed herein phase one The most wide range caused.

Claims (10)

1. a kind of data transmission method, which is characterized in that the method includes:
When intermediate equipment is activated, is established and connected by client and first node equipment, pass through server-side and second node Equipment establishes connection, and the client is set on the intermediate device with the server-side;
The sending strategy object of the client and the server-side, the transmission plan of the client of initialization are initialized respectively Slightly object instruction communication link of the client to the first node equipment transmission data, the transmission of the server-side of initialization Policy object indicates communication link of the server-side to the second node equipment transmission data;
The forwarding strategy object of the server-side is generated, and the sending strategy object's property value of the client is assigned to institute State the forwarding strategy object of server-side;
The first data to be transmitted of the second node equipment transmission is received by the server-side;
First data to be transmitted is analyzed, and utilizes pre-stored business need, whether determines the first data to be transmitted It is to need to be sent to first node equipment;
When determining that first data to be transmitted needs to be sent to first node equipment, according to the forwarding strategy of the server-side Object is transmitted directly to the first node equipment.
2. the method as described in claim 1, which is characterized in that described to initialize the client and the server-side respectively After sending strategy object, further include:
The forwarding strategy object of the client is generated, and the sending strategy object's property value of the server-side is assigned to institute State the forwarding strategy object of client;
The method further includes:
The second data to be transmitted of the first node equipment transmission is received by the client;
When determining that second data to be transmitted needs to be sent to second node equipment, according to the forwarding strategy of the client Object is transmitted directly to the second node equipment.
3. the method as described in claim 1, which is characterized in that the forwarding strategy object according to the server-side, directly It is sent to before the first node equipment, further includes:
The second node is parsed in the first data to be transmitted sent from the second node equipment that the server-side receives The IP address of equipment;
Deactivate IP address list according to preset legitimate ip address list and temporarily, confirm the IP address parsed whether be Illegal IP address or deactivated IP address;
If so, stop that first data to be transmitted is sent to the first node equipment and is alarmed;
If it is not, the first node equipment is then transmitted directly to according to the forwarding strategy object of the server-side.
4. the method as described in claim 1, which is characterized in that described that connection is established by server-side and second node equipment After further include:
The heartbeat message of the second node device periodically transmission is received by the server-side;
If the heartbeat message receives exception, confirm that the server-side and the second node communication between devices link are different Often, and by the communication link between the server-side and the second node equipment it disconnects, and waits for the second node equipment The communication link between the server-side and the second node equipment is re-established after retransmission connection request.
5. the method as described in claim 1, which is characterized in that described that connection is established by client and first node equipment After further include:
Heartbeat message is sent, and receive the first node equipment to the first node device periodically by the client The response message returned according to the heartbeat message;
If the response message receives exception, determine that the communication link between the client and the first node equipment is different Often, and by between the client and the first node equipment communication link disconnect, and by the client again to The first node equipment re-establishes the communication link between the client and the first node equipment.
6. a kind of data transmission device, which is characterized in that described device includes:
Unit is established, for when intermediate equipment is activated, establishing and connecting by client and first node equipment, pass through service End is established with second node equipment and is connected, and the client is set on the intermediate device with the server-side;
Initialization unit, for initializing the sending strategy object of the client and the server-side, the institute of initialization respectively Sending strategy object instruction communication link of the client to the first node equipment transmission data of client is stated, initialization The sending strategy object of the server-side indicates communication link of the server-side to the second node equipment transmission data;
First generation unit, for generating the forwarding strategy object of the server-side, and by the sending strategy pair of the client The property value of elephant is assigned to the forwarding strategy object of the server-side;
First receiving unit, for receiving the first data to be transmitted of the second node equipment transmission by the server-side; First data to be transmitted is analyzed, and utilizes pre-stored business need, determines whether the first data to be transmitted is to need It is sent to first node equipment;
First retransmission unit, for when determining that first data to be transmitted needs to be sent to first node equipment, according to institute The forwarding strategy object of server-side is stated, is transmitted directly to the first node equipment.
7. device as claimed in claim 6, which is characterized in that described device further includes:
Second generation unit, for initializing the client respectively with after the sending strategy object of the server-side, generating The forwarding strategy object of the client, and the sending strategy object's property value of the server-side is assigned to the client Forwarding strategy object;
Second receiving unit, for receiving the second data to be transmitted of the first node equipment transmission by the client;
Second retransmission unit, for when determining that second data to be transmitted needs to be sent to second node equipment, according to institute The forwarding strategy object of client is stated, is transmitted directly to the second node equipment.
8. device as claimed in claim 6, which is characterized in that described device further includes:
Resolution unit, for being parsed from the first data to be transmitted that the second node equipment that the server-side receives is sent The IP address of the second node equipment;
Determination unit, for deactivating IP address list according to preset legitimate ip address list and temporarily, confirmation parses to obtain IP whether be illegal IP address or deactivated IP address;
Alert process unit, for when the IP address parsed is illegal IP address or deactivated IP address, stopping institute The first data to be transmitted is stated to be sent to the first node equipment and alarm;
First retransmission unit is additionally operable to when the IP address parsed is legitimate ip address, according to the server-side Forwarding strategy object, be transmitted directly to the first node equipment.
9. device as claimed in claim 6, which is characterized in that described device further includes:
Heartbeat message receiving unit, the heartbeat for receiving the second node device periodically transmission by the server-side disappear Breath;
Heartbeat message judging unit, for judging whether the heartbeat message receives exception;
First reconnection unit, for when the heartbeat message receives abnormal, then confirming the server-side and the second node Communication between devices link is abnormal, and the communication link between the server-side and the second node equipment is disconnected, and waits It is re-established between the server-side and the second node equipment after the second node equipment retransmits connection request Communication link.
10. device as claimed in claim 6, which is characterized in that described device further includes:
Heartbeat message transmitting element, for sending heartbeat message to the first node device periodically by the client;
Response message receiving unit, for receiving the response message that the first node equipment is returned according to the heartbeat message;
Response message judging unit, for judging whether the response message receives exception;
Second reconnection unit, for when the response message receives abnormal, determining that the client is set with the first node Communication link between standby is abnormal, and the communication link between the client and the first node equipment is disconnected, and logical The client is crossed to re-establish between the client and the first node equipment to the first node equipment again Communication link.
CN201410460728.2A 2014-09-11 2014-09-11 Data transmission method and device Active CN104580346B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410460728.2A CN104580346B (en) 2014-09-11 2014-09-11 Data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410460728.2A CN104580346B (en) 2014-09-11 2014-09-11 Data transmission method and device

Publications (2)

Publication Number Publication Date
CN104580346A CN104580346A (en) 2015-04-29
CN104580346B true CN104580346B (en) 2018-06-08

Family

ID=53095511

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410460728.2A Active CN104580346B (en) 2014-09-11 2014-09-11 Data transmission method and device

Country Status (1)

Country Link
CN (1) CN104580346B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105657000A (en) * 2015-12-25 2016-06-08 北京奇虎科技有限公司 Message transmission method and device
WO2018137217A1 (en) * 2017-01-25 2018-08-02 华为技术有限公司 Data processing system, method, and corresponding device
CN111279729A (en) * 2019-11-12 2020-06-12 深圳市汇顶科技股份有限公司 Data transmission method and BLE equipment
CN116016140A (en) * 2020-07-10 2023-04-25 展讯半导体(成都)有限公司 Communication exception handling method, master node, indoor distribution system and storage medium
CN112653721A (en) * 2020-08-21 2021-04-13 广州市昇博电子科技有限公司 Distributed network transmission and control method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101834874A (en) * 2010-05-21 2010-09-15 四川长虹电器股份有限公司 Multimedia network communication method capable of penetrating firewall
CN102546559A (en) * 2010-12-29 2012-07-04 北京新媒传信科技有限公司 Method, equipment and system for end-to-end transmission of data in challenged network
CN102916866A (en) * 2012-09-21 2013-02-06 腾讯科技(深圳)有限公司 Data sharing method, terminal, server and system
CN103379182A (en) * 2012-04-19 2013-10-30 阿里巴巴集团控股有限公司 Data transmission method and client sides

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101834874A (en) * 2010-05-21 2010-09-15 四川长虹电器股份有限公司 Multimedia network communication method capable of penetrating firewall
CN102546559A (en) * 2010-12-29 2012-07-04 北京新媒传信科技有限公司 Method, equipment and system for end-to-end transmission of data in challenged network
CN103379182A (en) * 2012-04-19 2013-10-30 阿里巴巴集团控股有限公司 Data transmission method and client sides
CN102916866A (en) * 2012-09-21 2013-02-06 腾讯科技(深圳)有限公司 Data sharing method, terminal, server and system

Also Published As

Publication number Publication date
CN104580346A (en) 2015-04-29

Similar Documents

Publication Publication Date Title
CN104580346B (en) Data transmission method and device
CN102368764B (en) A kind of method, system and client communicated by multi-point login
CN102624584B (en) Chain circuit detecting method and device
CN103475655B (en) A kind of method realizing IPSecVPN main/slave link switching at runtime
CN104158733B (en) A kind of fast rerouting method and device, transmission network
CN103905579B (en) The communication means of platform and terminal room, communication system, platform and relevant device
CN104541483B (en) When for connectivity fault the method and system re-routed is enabled for home network
CN102457409B (en) Method and system for link failure detection
CN104486243B (en) Data transmission method, equipment and system
CN105407008A (en) Reconnecting method and system for interrupted TCP (Transmission Control Protocol) connection, terminal and server
US9529677B2 (en) Method and system for removing fault applied for machine to machine gateway
CN111164923A (en) Design for unidirectional data transmission
CN103414725A (en) Method and device used for detecting and filtering data message
CN107872364A (en) A kind of monitoring method of router state, apparatus and system
CN107396297A (en) Intelligent networking system and its method of controlling security based on bluetooth
CN104283716B (en) Data transmission method, equipment and system
EP2642701B1 (en) Relay server and relay communication system
CN105099805B (en) A kind of bidirectional forwarding detection (BFD) method and system
CN108173810A (en) A kind of method and device of transmitting network data
JP5357619B2 (en) Communication failure detection system
CN106656659A (en) Network path selection method and network video recorder (NVR)
JP4624443B2 (en) Network device setting method
CN102082678A (en) Processing method and equipment of port discarding OAM (Operation, Administration and Maintenance) protocol
CN101986609A (en) Method and system for realizing network flow cleaning
CN108092993A (en) A kind of network data transmission control method and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 100176 room 502-1, floor 5, building 2, courtyard 10, keguyi street, Beijing Economic and Technological Development Zone, Daxing District, Beijing

Patentee after: NEW SINGULARITY INTERNATIONAL TECHNICAL DEVELOPMENT Co.,Ltd.

Address before: 100081, Beijing, Haidian District sorghum Bridge oblique Street No. 34, building 212, room 19

Patentee before: NEW SINGULARITY INTERNATIONAL TECHNICAL DEVELOPMENT Co.,Ltd.