CN105100253A - Data transmission system and method - Google Patents

Data transmission system and method Download PDF

Info

Publication number
CN105100253A
CN105100253A CN201510475286.3A CN201510475286A CN105100253A CN 105100253 A CN105100253 A CN 105100253A CN 201510475286 A CN201510475286 A CN 201510475286A CN 105100253 A CN105100253 A CN 105100253A
Authority
CN
China
Prior art keywords
client
server
attendance device
time attendance
data
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.)
Pending
Application number
CN201510475286.3A
Other languages
Chinese (zh)
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.)
DONGGUAN ZK ELECTRONIC TECHNOLOGY Co Ltd
Original Assignee
DONGGUAN ZK ELECTRONIC 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 DONGGUAN ZK ELECTRONIC TECHNOLOGY Co Ltd filed Critical DONGGUAN ZK ELECTRONIC TECHNOLOGY Co Ltd
Priority to CN201510475286.3A priority Critical patent/CN105100253A/en
Publication of CN105100253A publication Critical patent/CN105100253A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/25Mapping addresses of the same type
    • H04L61/2503Translation of Internet protocol [IP] addresses
    • H04L61/256NAT traversal
    • H04L61/2575NAT traversal using address mapping retrieval, e.g. simple traversal of user datagram protocol through session traversal utilities for NAT [STUN]

Abstract

The embodiment of the invention discloses a data transmission system, which comprises a server, a client side and work attendance equipment; wherein the work attendance equipment is used for establishing a communication connection with the server and sending the information of the work attendance equipment to the server; the client side is used for establishing a communication connection with the server and sending a connection request to the server; the server is used for sending the received information of the work attendance equipment to the client side and sending the client side information to the work attendance equipment according to the connection request; and the attendance equipment is also used for operating the network address translation (NAT) traversal according to the client side information and operating the data transmission with the client side. The embodiment of the invention also provides a data transmission method. The system and method can effectively use the idle resources of a large number of nodes spreading in the internet, and the P2P technology is adopted for automatic calculation, the human intervention is greatly reduced so that the deployment cost and the possibility of man-made configuration errors are reduced.

Description

A kind of system of transfer of data and method
Technical field
The embodiment of the present invention relates to internet arena, particularly relates to a kind of system and method for transfer of data.
Background technology
Along with increasing enterprise starts to adopt system of attendance, the use of attendance recorder is also more and more extensive, usually installs an attendance recorder on company doorway, when employee is on and off duty, all need to confirm the turnover time by the checking of attendance recorder, supervise the operating time of employee in enterprise with this.
Existing attendance recorder adopts user terminal and server architecture (C/S, Client/ServerStructs), attendance recorder carries out data interaction as user terminal and server, server stores and calculate attendance recorder send data, according to attendance recorder send data make corresponding feedback.
But, when too much as the attendance recorder quantity of user terminal, the burden of server will increase the weight of, be easy to the bottleneck causing network, simultaneously, due to the storage capacity of server and computing capability limited, be often difficult to make corresponding feedback to each attendance recorder in time, thus cause resource utilization low.
Summary of the invention
Embodiments provide a kind of system and method for transfer of data, adopt P2P technology can effectively utilize the idling-resource of the great deal of nodes scattered in the Internet on the one hand in systems in which, P2P technology is adopted automatically to calculate on the other hand, greatly reduce human intervention, thus minimizing lower deployment cost, and reduce the possibility of artificial configuration error.
In view of this, first aspect present invention provides a kind of system of transfer of data, comprising: server, client and Time Attendance Device;
Described Time Attendance Device is used for establishing a communications link with described server, and Time Attendance Device information is sent to described server;
Described client is used for establishing a communications link with described server, and connection request is sent to described server;
Described server is used for the described Time Attendance Device information received to be sent to described client, and according to described connection request, client-side information is sent to described Time Attendance Device;
Described Time Attendance Device also penetrates for carrying out network address translation NAT according to described client-side information, carries out transfer of data with described client.
In conjunction with the first aspect of the embodiment of the present invention, in the implementation that the first is possible,
Described client, also for when described client and described Time Attendance Device carry out direct communication, directly carries out transfer of data with described Time Attendance Device.
In conjunction with the first aspect of the embodiment of the present invention, in the implementation that the second is possible,
Described Time Attendance Device is also for after establishing a communications link with described server, and to described server transmission packet in preset time, described message bag is used for described server and obtains the described Time Attendance Device that can network.
In conjunction with the first aspect of the embodiment of the present invention, in the implementation that the third is possible, described client comprises signaling protocol Switching Module, wherein:
Described signaling protocol Switching Module be used for establish a communications link with described server after, obtain the customer identification information in described server by signaling protocol.
In conjunction with the first aspect of the embodiment of the present invention, in the 4th kind of possible implementation, described Time Attendance Device comprises and penetrates module, wherein:
The described module that penetrates, for according to described client-side information, adopts the first agreement to carry out described NAT and penetrates.
In conjunction with the 4th kind of possibility implementation of the first aspect of the embodiment of the present invention, in the 5th kind of possible implementation, described client comprises protocol communication module, wherein:
Described protocol communication module is used for by second protocol, carries out transfer of data with described Time Attendance Device.
A kind of method that second aspect present invention provides data to pass, comprising:
Time Attendance Device and server establish a communications link, and Time Attendance Device information is sent to described server;
Client and described server establish a communications link, and connection request is sent to described server;
The described Time Attendance Device information received is sent to described client by described server, and according to described connection request, client-side information is sent to described Time Attendance Device;
Described Time Attendance Device carries out network address translation NAT according to described client-side information and penetrates, and carries out transfer of data with described client.
In conjunction with the second aspect of the embodiment of the present invention, in the implementation that the first is possible, described method also comprises:
When described client and described Time Attendance Device carry out direct communication, described client directly carries out transfer of data with described Time Attendance Device.
In conjunction with the second aspect of the embodiment of the present invention, in the implementation that the second is possible, described Time Attendance Device and server establish a communications link, and Time Attendance Device information is sent to described server, comprising:
After described Time Attendance Device and server establish a communications link, to described server transmission packet in preset time, described message bag is used for described server and obtains the described Time Attendance Device that can network.
In conjunction with the second aspect of the embodiment of the present invention, in the implementation that the third is possible, described client and described server establish a communications link, and client-side information is sent to described server, comprising:
After described client and described server establish a communications link, obtain the customer identification information in described server by signaling protocol.
In conjunction with the second aspect of the embodiment of the present invention, in the 4th kind of possible implementation, described Time Attendance Device carries out network address translation NAT according to described client-side information and penetrates, and comprising:
Described Time Attendance Device, according to described client-side information, adopts the first agreement to carry out described NAT and penetrates.
In conjunction with the 4th kind of possibility implementation of the second aspect of the embodiment of the present invention, in the 5th kind of possible implementation, described Time Attendance Device and described client carry out transfer of data, comprising:
Described client, by second protocol, carries out transfer of data with described Time Attendance Device.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages:
In the embodiment of the present invention, provide a kind of system for transfer of data, this system includes server, client and Time Attendance Device, user end to server sends request, server response request also forwards client-side information to Time Attendance Device, and Time Attendance Device carries out penetrating and announcement server according to client-side information, and server informs that client can communicate after penetrating, so far, P2P communication is completed.Adopt P2P technology can effectively utilize the idling-resource of the great deal of nodes scattered in the Internet on the one hand in systems in which, P2P technology is adopted automatically to calculate on the other hand, greatly reduce human intervention, thus reduce lower deployment cost, and reduce the possibility of artificial configuration error.
Accompanying drawing explanation
Fig. 1 is system embodiment schematic diagram of transfer of data in the embodiment of the present invention;
Fig. 2 is the structural representation of the system embodiment of transfer of data in the present invention;
Fig. 3 is method embodiment schematic diagram of transfer of data in the embodiment of the present invention;
Fig. 4 is the system flow schematic diagram of transfer of data in the embodiment of the present invention.
Embodiment
Embodiments provide a kind of system of transfer of data, adopt P2P technology for effectively utilizing the idling-resource of the great deal of nodes scattered in the Internet in systems in which, greatly reduce human intervention, thus reduce lower deployment cost, and reduce the possibility of artificial configuration error.
Be described in detail the system of the transfer of data in the present invention below, refer to Fig. 1, the system of a kind of transfer of data that the embodiment of the present invention provides comprises:
101, Time Attendance Device is used for establishing a communications link with server, and Time Attendance Device information is sent to server;
In the present embodiment, comprise server, client and Time Attendance Device in the system of a transfer of data, first start server and Time Attendance Device, make to set up communication connection between server and Time Attendance Device, now, Time Attendance Device information can be sent to server side by Time Attendance Device.
102, client is used for establishing a communications link with server, and connection request is sent to server;
In the present embodiment, client is after startup of server, establish a communications link with server, and the connection request of the preparation of client access Time Attendance Device is sent to server side, if when connection request is not passed through, then client is determined directly to communicate with Time Attendance Device, now adopts peer-to-peer network (P2P, PeertoPeer) technology to communicate.
Peer-to-peer network is also known as working group, each terminal online has identical function, without master-slave, each station terminal both can as server, setting shared resource, for other terminal institute in the Internet, does not have the server of centralization, does not have special work station yet, therefore can not there is bottleneck in systems in which, the pressure of server can not be increased along with increasing of terminal.
103, server is used for the Time Attendance Device information received to be sent to client, and according to described connection request, client-side information is sent to Time Attendance Device;
In the present embodiment, after client is determined directly can not to communicate with Time Attendance Device, the Time Attendance Device information received is forwarded to client by server, simultaneously, according to the connection request that client sends, client-side information is forwarded to Time Attendance Device, wherein, the internet protocol address (IP, InternetProtocol) of client, port numbers can be comprised in this client-side information and connect the connection request of Time Attendance Device.
104, Time Attendance Device also penetrates for carrying out network address translation NAT according to client-side information, carries out transfer of data with client.
In the present embodiment, after client and Time Attendance Device both sides obtain the information of the other side, network address translation (NAT, NetworkAddressTranslation) through-transmission technique can be used to communicate.Particularly, first Time Attendance Device carries out NAT according to client-side information and penetrates, and then client adopts respective protocol to communicate again.
Wherein, NAT through-transmission technique can be known as again Network address translators, and current the Internet faces two large problems, i.e. the shortage of available IP-addresses and the continuous increase of routing table, and this makes the access of numerous user encounter difficulties.Use NAT through-transmission technique that in-house all user can be made by limited or 1 legal access the Internet, IP address, thus the legitimate ip address on saving the Internet, on the other hand, the real IP address of main frame on in-house network can be hidden by address transition, thus improve the fail safe of network.
Refer to Fig. 2, Fig. 2 is the structural representation of the system embodiment of transfer of data in the present invention, wherein Time Attendance Device can be multiple, loop between client and Time Attendance Device also can have multiple, in figure, a Time Attendance Device and a loop between client and Time Attendance Device are only a signal, should not be construed as limitation of the present invention.
As can be seen from the figure, server, communicated by the Internet between client with Time Attendance Device, client and Time Attendance Device join cloud connecting platform (IOTC by thing, InternetofThingsCloud) application programming interface (API, ApplicationProgrammingInterface) communicate to connect with server, the client-side information that server receives client sends, and the Time Attendance Device information that Time Attendance Device sends, and respectively client-side information is sent to Time Attendance Device, Time Attendance Device information is sent to client, make Time Attendance Device carry out NAT to penetrate, with set up P2P between client and be connected, so far, server just plays one and sends message and preserve the function of Time Attendance Device information for client's side link needs, do not store the valid data of Time Attendance Device.
It should be noted that, a station server manages at most the Time Attendance Device of 60,000, can increase or reduce the quantity of server according to actual needs, so place does not limit the quantity of server.
Be understandable that, client connects by selecting to connect any Time Attendance Device after associated verification, is very easy to the collection of remote data management and uniform data.
In the embodiment of the present invention, provide a kind of system for transfer of data, this system includes server, client and Time Attendance Device, user end to server sends request, server response request also forwards client-side information to Time Attendance Device, and Time Attendance Device carries out penetrating and announcement server according to client-side information, and server informs that client can communicate after penetrating, so far, P2P communication is completed.Adopt P2P technology can effectively utilize the idling-resource of the great deal of nodes scattered in the Internet on the one hand in systems in which, P2P technology is adopted automatically to calculate on the other hand, greatly reduce human intervention, thus reduce lower deployment cost, and reduce the possibility of artificial configuration error.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 1, in system first embodiment of the transfer of data that the embodiment of the present invention provides, client is also for when client and Time Attendance Device carry out direct communication, and direct and Time Attendance Device carries out transfer of data.
In the present embodiment, user end to server sends connection request, server feeds back the protocol information of a Time Attendance Device according to the connection request that client sends, by client parses connected mode, if determine to realize direct communication according to protocol information, then client and Time Attendance Device adopt common communication mode to be connected, such as transmission control protocol (TCP, TransmissionControlProtocol), IP agreement or User Datagram Protoco (UDP) (UDP, UserDatagramProtocol).After client and Time Attendance Device carry out direct communication, client and Time Attendance Device start the transmission of attendance data and user data.
Secondly, in the embodiment of the present invention, when client and Time Attendance Device can carry out direct communication, then do not need to adopt P2P technology, attendance data and the transmission of user data between client and Time Attendance Device can be completed neatly, the practicality of lifting scheme and operability like this according to actual conditions.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 1, in system second embodiment of the transfer of data that the embodiment of the present invention provides, Time Attendance Device is also for after establishing a communications link with server, to server transmission packet in preset time, message bag is used for server and obtains the Time Attendance Device that can network.
In the present embodiment, Time Attendance Device is empty bag to the message bag that server sends, and object is the address information in order to make server obtain Time Attendance Device, and the local transmission address that message Packet forwarding Time Attendance Device can be networked, server can be addressed to corresponding Time Attendance Device.
It should be noted that, Time Attendance Device can interval 40 seconds to server transmission packet, also can be 30 seconds, or other the time interval, so place is not construed as limiting the concrete time interval.
Again, in the embodiment of the present invention, the attendance data that Time Attendance Device receives in one section of preset time and user data, the local transmission address receiving all Time Attendance Devices of data during this period of time corresponding can send to server with the form of message bag, and message bag is empty bag, thus the message bag of transmission is very little, and then save transfer resource.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 1, in system the 3rd embodiment of the transfer of data that the embodiment of the present invention provides, client comprises signaling protocol Switching Module, wherein, after signaling protocol Switching Module is used for establishing a communications link with server, obtained the customer identification information in server by signaling protocol.
In the present embodiment, client comprises signaling protocol Switching Module, this module mainly obtains the customer identification information in server by signaling protocol, and customer identification information includes registration username and password on the server, and client just can use after logging on server.
Different with the UDP simple traversal (STUN, SimpleTraversalofUDPoverNATs) of traditional NAT, in the present embodiment, client adopts signaling protocol to obtain the customer identification information of server.
Particularly, signaling protocol mainly comprises four kinds of agreements, SS7, session initiation protocol (SIP respectively, SessionInitiationProtocol) agreement (SIGTRAN of SS7 signaling, is H.248 transmitted in agreement and IP network, SignalingTransport), respectively these four kinds of agreements are introduced below:
SS7 signaling is divided into two parts, Message Transfer Part and User Part, Message Transfer Part is for providing the reliable delivery of signaling message between each user function, User Part is the functional entity using Message Transfer Part transmission capacity, be positioned at the high level of SS7 signaling, for realizing miscellaneous service and application; Session Initiation Protocol be one for setting up, changing and stop the application layer control protocol of Multimedia session, sip message transmission relies on the UDP message bag be carried on broadband IP network; H.248 protocol application is in distributed gateway structural system, realizes the controlling functions of Media Gateway Controller to media gateway; SIGTRAN is functionally divided into adaptive and transmission two large classes, the first kind is Generic Signaling Transport agreement, Generic Signaling Transport protocol realization Signaling System Number 7 on IP efficiently and transmit reliably, Equations of The Second Kind is Signaling System Number 7 adapting protocol, this quasi-protocol is mainly for Circuit Switching Network (SCN, SwitchedCircuitNetwork).
It should be noted that, signaling protocol used herein can be above-mentioned any one agreement mentioned, or selects suitable signaling protocol according to actual conditions, does not limit so secondary.
Further, in the embodiment of the present invention, traditional Simple Traversal of UDP Through Network Address Translators is replaced by using signaling protocol, traditional Simple Traversal of UDP Through Network Address Translators can run into firewall problem in the process of media delivery, and signaling protocol can avoid the crossing problem of media delivery, by using various protocols to make it to work in optimal situation, make up with this inherent shortcoming being used alone wherein any one agreement and bringing, the actual application ability of lifting scheme.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 1, in system the 4th embodiment of the transfer of data that the embodiment of the present invention provides, Time Attendance Device comprises and penetrates module, wherein, penetrate module for according to client-side information, adopt the first agreement to carry out NAT and penetrate.
In the present embodiment, Time Attendance Device can also comprise and penetrates module, particularly, first agreement can penetrate agreement (TURN for junction network, TraversalUsingRelayNAT), Time Attendance Device penetrate module according to client-side information, adopt TURN agreement to carry out NAT and penetrate.
TURN agreement allows NAT to pass through or fire compartment wall object below can receive data by TCP or UDP, TURN agreement solves the thinking of NAT crossing problem and the similar of Simple Traversal of UDP Through Network Address Translators, be obtain its private address correspondence in advance in the address of public network based on private network access user by a kind of mechanism, the address information then described in message load directly fills in the mode of this public network address.
But the limitation of TURN agreement is that all messages all have to pass through TURN protocol server and forward, and increases the delay of bag and the possibility of packet loss.
Further, in the embodiment of the present invention, use TURN agreement to carry out NAT and penetrate the problem that can solve NAT and the fire compartment wall run in media delivery process, meanwhile, use TURN agreement to also solve the shortcoming that Simple Traversal of UDP Through Network Address Translators cannot pass through Symmetric NAT and similar firewall box.
Alternatively, on the basis of the 4th embodiment corresponding to above-mentioned Fig. 1, in system the 5th embodiment of the transfer of data that the embodiment of the present invention provides, client also comprises protocol communication module, wherein, protocol communication module is used for by second protocol, carries out transfer of data with Time Attendance Device.
In the present embodiment, second protocol can be Simple Traversal of UDP Through Network Address Translators, and after Time Attendance Device receives client-side information, and adopt TURN agreement to carry out NAT to penetrate, the protocol communication module then in client carries out transfer of data by Simple Traversal of UDP Through Network Address Translators and Time Attendance Device.
Simple Traversal of UDP Through Network Address Translators is defined as the instrument that is assisted passing through NAT, the solution of passing through independently is not provided, the principle of Simple Traversal of UDP Through Network Address Translators is roughly, client sends request Simple Traversal of UDP Through Network Address Translators message to the Simple Traversal of UDP Through Network Address Translators server outside NAT by UDP, Simple Traversal of UDP Through Network Address Translators server receives message and produces response message, wherein, in response message, carry the source port of message, the outside port that namely Simple Traversal of UDP Through Network Address Translators client is corresponding on NAT.Then response message sends to Simple Traversal of UDP Through Network Address Translators client by NAT, Simple Traversal of UDP Through Network Address Translators client learns the external address on its NAT by the content in response message, and after being inserted hello protocol UDP load in, inform opposite end, RTP (RTP, the Real-timeTransportProtocol) receiver address of local terminal and port numbers are address and the port numbers of NAT outside.Owing to having been set up the NAT mapping item of Media Stream on NAT in advance by Simple Traversal of UDP Through Network Address Translators, therefore Media Stream can pass through smoothly.
Again further, in the embodiment of the present invention, client adopts Simple Traversal of UDP Through Network Address Translators to carry out communicating without the need to doing any change to existing NAT or firewall box, due in practical application, existing a large amount of NAT or firewall box do not support analog signal figure, thus adopt Simple Traversal of UDP Through Network Address Translators communication can avoid a large amount of change NAT or firewall box, realize more summary.
Be described in detail the method for the transfer of data in the present invention below, refer to Fig. 4, the method for a transfer of data in the embodiment of the present invention comprises:
201, Time Attendance Device and server establish a communications link, and Time Attendance Device information is sent to server;
In the present embodiment, after starting server and Time Attendance Device, Time Attendance Device and server establish a communications link, and then Time Attendance Device information is sent to server by Time Attendance Device.
202, client and server establish a communications link, and connection request is sent to server;
In the present embodiment, client also establishes a communications link with server after startup of server, and connection request is sent to server.
IP is the abbreviation of IP address, and IP address is a kind of unified address format that IP agreement provides, and it is that each network on the Internet and each main body distribute a logical address, shields the difference of physical address with this.
In network technology, port (Port) comprises logic port and physical port two type, physical port refers to the port that physics exists, and logic port refers to the port for Differentiated Services on logical meaning, the scope of port numbers is from 0 to 65535, such as 80 ports of browsing page service, for 21 ports etc. of file transfer.Due to physical port and logical port number more, in order to distinguish port, each port is numbered, i.e. port numbers.
203, the Time Attendance Device information received is sent to client by server, and according to connection request, client-side information is sent to Time Attendance Device;
In the present embodiment, when client and Time Attendance Device can not between communicate time, then need to be connected by P2P technology.Server needs the Time Attendance Device information received to be sent to client, and client-side information is sent to Time Attendance Device, wherein, can carry the IP of client, port numbers and connect the connection request of Time Attendance Device in client-side information.
Time Attendance Device information can comprise the Time Attendance Device receiving data IP address, receive the Time Attendance Device of data port numbers and connect the connection request of client.
204, Time Attendance Device carries out network address translation NAT according to client-side information and penetrates, and carries out transfer of data with client.
In the present embodiment, after Time Attendance Device and client both sides obtain the information of the other side, NAT through-transmission technique can be used to communicate, Time Attendance Device penetrates and announcement server after obtaining client-side information, and server informs that client has penetrated, and can communicate.
Refer to Fig. 4, Fig. 4 is the system flow schematic diagram of transfer of data in the embodiment of the present invention, and flow process shown in figure is only a kind of possibility implementation in embodiment, and do not form restriction to the present invention program, specific implementation flow process is as follows:
Step S1, before carrying out P2P communication, first must start server;
Step S2, then starts Time Attendance Device, and multiple Time Attendance Device can be had to be distributed in each place;
Step S3, according to preset setting, Time Attendance Device is every 40 seconds to server transmission packet, and message bag is an empty bag, can obtain the IP address that data need the Time Attendance Device of transmission after server receives message bag;
Step S4, server judges whether the connection request that client sends, if there is the connection request that client sends, continue step S5, if there is no connection request, then illustrate that Time Attendance Device does not have the request of transfer of data, also just do not need and client's side link, now jump procedure S3, continues in preset time, detect Time Attendance Device and whether receives data;
Whether step S5, when judging to obtain needing between client with Time Attendance Device to be connected according to step S4, then can directly connect both judging, if can with direct connection, then continue step S6, if can not directly connect, then jump to step S9, and then adopt P2P technology to communicate;
Step S6, meets above-mentioned steps S5, when client can directly be connected with Time Attendance Device, then starts generic connectivity, and such as TCP connects or UDP connects;
Step S7, after client is connected with Time Attendance Device, carries out the transmission of attendance data and user data between Time Attendance Device and client;
Step S8, so far, terminates one and takes turns the communication directly connected, so jump to the transfer of data that step S3 opens next round;
Step S9, when judging that obtaining client can not directly be connected with Time Attendance Device, then the technology of P2P can be adopted to complete transfer of data, server forwards client-side information to Time Attendance Device, wherein, client-side information carries connection request, client ip and port numbers;
Step S10, Time Attendance Device carries out NAT and penetrates, announcement server after completing, then informs that client has penetrated by server, and namely Time Attendance Device is connected with client;
Step S11, after client is connected with Time Attendance Device, carries out the transmission of attendance data and user data between Time Attendance Device and client;
Step S12, so far, terminates the communication that one takes turns P2P connection, so jump to the transfer of data that step S3 opens next round.
In the embodiment of the present invention, provide a kind of system for transfer of data, this system includes server, client and Time Attendance Device, user end to server sends request, server response request also forwards client-side information to Time Attendance Device, and Time Attendance Device carries out penetrating and announcement server according to client-side information, and server informs that client can communicate after penetrating, so far, P2P communication is completed.Adopt P2P technology can effectively utilize the idling-resource of the great deal of nodes scattered in the Internet on the one hand in systems in which, P2P technology is adopted automatically to calculate on the other hand, greatly reduce human intervention, thus reduce lower deployment cost, and reduce the possibility of artificial configuration error.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 3, in system first embodiment of the transfer of data that the embodiment of the present invention provides, can also comprise:
When client and Time Attendance Device carry out direct communication, client directly and Time Attendance Device carry out transfer of data.
In the present embodiment, between client with Time Attendance Device directly can be connected communication time, then adopt common communication mode to connect, such as TCP, IP or UDP communicate.
Secondly, in the embodiment of the present invention, when client and Time Attendance Device can carry out direct communication, then do not need to adopt P2P technology, attendance data and the transmission of user data between client and Time Attendance Device can be completed neatly, the practicality of lifting scheme and operability like this according to actual conditions.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 3, in system second embodiment of the transfer of data that the embodiment of the present invention provides, Time Attendance Device and server establish a communications link, and Time Attendance Device information is sent to described server, can comprise:
After Time Attendance Device and server establish a communications link, to server transmission packet in preset time, message bag is used for server and obtains the Time Attendance Device that can network.
In the present embodiment, Time Attendance Device is empty bag to the message bag that server sends, and object is the address information in order to make server obtain Time Attendance Device, and the local transmission address that message Packet forwarding Time Attendance Device can be networked, server can be addressed to corresponding Time Attendance Device.
Again, in the embodiment of the present invention, the attendance data that Time Attendance Device receives in one section of preset time and user data, the local transmission address receiving all Time Attendance Devices of data during this period of time corresponding can send to server with the form of message bag, and message bag is empty bag, thus the message bag of transmission is very little, and then save transfer resource.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 3, in system the 3rd embodiment of the transfer of data that the embodiment of the present invention provides, client and server establish a communications link, and client-side information is sent to server, can comprise:
After client and server establish a communications link, obtain the customer identification information in server by signaling protocol.
In the present embodiment, client comprises signaling protocol Switching Module, this module mainly obtains the customer identification information in server by signaling protocol, and customer identification information includes registration username and password on the server, and client just can use after logging on server.
Further, in the embodiment of the present invention, traditional Simple Traversal of UDP Through Network Address Translators is replaced by using signaling protocol, traditional Simple Traversal of UDP Through Network Address Translators can run into firewall problem in the process of media delivery, and signaling protocol can avoid the crossing problem of media delivery, by using various protocols to make it to work in optimal situation, make up with this inherent shortcoming being used alone wherein any one agreement and bringing, the actual application ability of lifting scheme.
Alternatively, on the basis of embodiment corresponding to above-mentioned Fig. 3, in system the 4th embodiment of the transfer of data that the embodiment of the present invention provides, Time Attendance Device carries out network address translation NAT according to client-side information and penetrates, and can comprise:
Time Attendance Device, according to client-side information, adopts the first agreement to carry out NAT and penetrates.
In the present embodiment, Time Attendance Device can also comprise and penetrates module, and particularly, the first agreement can be TURN agreement, Time Attendance Device penetrate module according to client-side information, adopt TURN agreement to carry out NAT and penetrate.
TURN agreement allows NAT to pass through or fire compartment wall object below can receive data by TCP or UDP, TURN agreement solves the thinking of NAT crossing problem and the similar of Simple Traversal of UDP Through Network Address Translators, be obtain its private address correspondence in advance in the address of public network based on private network access user by a kind of mechanism, the address information then described in message load directly fills in the mode of this public network address.
Further, in the embodiment of the present invention, use TURN agreement to carry out NAT and penetrate the problem that can solve NAT and the fire compartment wall run in media delivery process, meanwhile, use TURN agreement to also solve the shortcoming that Simple Traversal of UDP Through Network Address Translators cannot pass through Symmetric NAT and similar firewall box.
Alternatively, on the basis of the 4th embodiment corresponding to above-mentioned Fig. 1, in system the 5th embodiment of the transfer of data that the embodiment of the present invention provides, Time Attendance Device and client carry out transfer of data, can comprise:
Client, by second protocol, carries out transfer of data with Time Attendance Device.
In the present embodiment, second protocol can be SUN agreement, and when Time Attendance Device receives client-side information, and adopt TURN agreement to carry out NAT to penetrate, the protocol communication module then in client carries out transfer of data by Simple Traversal of UDP Through Network Address Translators and Time Attendance Device.
Simple Traversal of UDP Through Network Address Translators is defined as the instrument that is assisted passing through NAT, the solution of passing through independently is not provided, the principle of Simple Traversal of UDP Through Network Address Translators is roughly, Simple Traversal of UDP Through Network Address Translators client sends request Simple Traversal of UDP Through Network Address Translators message to the Simple Traversal of UDP Through Network Address Translators server outside NAT by UDP, STUN server receives message and produces response message, wherein, in response message, carry the source port of message, the outside port that namely Simple Traversal of UDP Through Network Address Translators client is corresponding on NAT.Then response message sends to Simple Traversal of UDP Through Network Address Translators client by NAT, Simple Traversal of UDP Through Network Address Translators client learns the external address on its NAT by the content in response message, and after being inserted hello protocol UDP load in, inform opposite end, the RTP receiver address of local terminal and port numbers are address and the port numbers of NAT outside.Owing to having been set up the NAT mapping item of Media Stream on NAT in advance by Simple Traversal of UDP Through Network Address Translators, therefore Media Stream can pass through smoothly.
Again further, in the embodiment of the present invention, client adopts Simple Traversal of UDP Through Network Address Translators to carry out communicating without the need to doing any change to existing NAT or firewall box, due in practical application, existing a large amount of NAT or firewall box do not support analog signal figure, thus adopt Simple Traversal of UDP Through Network Address Translators communication can avoid a large amount of change NAT or firewall box, realize more summary.
For ease of understanding, being described in detail with the method for an embody rule scene to transfer of data a kind of in the present invention below, being specially:
First region has a large amount of enterprises, wherein just has 100 fingerprint attendance equipment, and all enterprises all have employed system of attendance and carry out work attendance to employee.
In the morning in 9: 1 nine o'clock sharps to morning, the fingerprint of several employee that had 10 fingerprint attendance equipment to collect, at this moment, the IP address that above-mentioned 10 fingerprint attendance equipment are corresponding will send to same station server, wherein, can by IP address called after " address 1 " corresponding for 10 fingerprint attendance equipment, " address 2 ", " address 3 " ... " address 10 ".Under server record, these comprise the IP address of the fingerprint attendance machine of customer identification information.Fingerprint attendance equipment sends access request to the client of correspondence, and for accessing corresponding client, wherein, the IP address of corresponding client can called after " address A " and " address B ".
Client judges whether can directly connect fingerprint attendance equipment, when judging to obtain directly connecting fingerprint attendance equipment, the IP address of fingerprint attendance equipment is sent to client, also send the IP address of client to fingerprint attendance equipment simultaneously, corresponding 5 the fingerprint attendance equipment of client of one here " address A ", client also corresponding 5 fingerprint attendance equipment of " address B ".After both sides obtain the IP address of the other side, fingerprint attendance equipment adopts TURN agreement to carry out penetrating of NAT, announcement server after completing, and server will be informed that client penetrates and be completed, now, point-to-point attendance data transmission can be carried out between client and fingerprint attendance equipment.
Those skilled in the art can be well understood to, and for convenience and simplicity of description, the system of foregoing description, the specific works process of device and unit, with reference to the corresponding process in preceding method embodiment, can not repeat them here.
In several embodiments that the application provides, should be understood that, disclosed system, apparatus and method, can realize by another way.Such as, device embodiment described above is only schematic, such as, the division of described unit, be only a kind of logic function to divide, actual can have other dividing mode when realizing, such as multiple unit or assembly can in conjunction with or another system can be integrated into, or some features can be ignored, or do not perform.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, and the indirect coupling of device or unit or communication connection can be electrical, machinery or other form.
The described unit illustrated as separating component or can may not be and physically separates, and the parts as unit display can be or may not be physical location, namely can be positioned at a place, or also can be distributed in multiple network element.Some or all of unit wherein can be selected according to the actual needs to realize the object of the present embodiment scheme.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, also can be that the independent physics of unit exists, also can two or more unit in a unit integrated.Above-mentioned integrated unit both can adopt the form of hardware to realize, and the form of SFU software functional unit also can be adopted to realize.
If described integrated unit using the form of SFU software functional unit realize and as independently production marketing or use time, can be stored in a computer read/write memory medium.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words or all or part of of this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium comprises: USB flash disk, portable hard drive, read-only memory (ROM, Read-OnlyMemory), random access memory (RAM, RandomAccessMemory), magnetic disc or CD etc. various can be program code stored medium.
The above, above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (12)

1. a system for transfer of data, is characterized in that, comprising: server, client and Time Attendance Device;
Described Time Attendance Device is used for establishing a communications link with described server, and Time Attendance Device information is sent to described server;
Described client is used for establishing a communications link with described server, and connection request is sent to described server;
Described server is used for the described Time Attendance Device information received to be sent to described client, and according to described connection request, client-side information is sent to described Time Attendance Device;
Described Time Attendance Device also penetrates for carrying out network address translation NAT according to described client-side information, carries out transfer of data with described client.
2. system according to claim 1, is characterized in that,
Described client, also for when described client and described Time Attendance Device carry out direct communication, directly carries out transfer of data with described Time Attendance Device.
3. system according to claim 1, is characterized in that,
Described Time Attendance Device is also for after establishing a communications link with described server, and to described server transmission packet in preset time, described message bag is used for described server and obtains the described Time Attendance Device that can network.
4. system according to claim 1, is characterized in that, described client comprises signaling protocol Switching Module, wherein:
Described signaling protocol Switching Module be used for establish a communications link with described server after, obtain the customer identification information in described server by signaling protocol.
5. system according to claim 1, is characterized in that, described Time Attendance Device comprises and penetrates module, wherein:
The described module that penetrates, for according to described client-side information, adopts the first agreement to carry out described NAT and penetrates.
6. system according to claim 5, is characterized in that, described client comprises protocol communication module, wherein:
Described protocol communication module is used for by second protocol, carries out transfer of data with described Time Attendance Device.
7. a method for transfer of data, is characterized in that, comprising:
Time Attendance Device and server establish a communications link, and Time Attendance Device information is sent to described server;
Client and described server establish a communications link, and connection request is sent to described server;
The described Time Attendance Device information received is sent to described client by described server, and according to described connection request, client-side information is sent to described Time Attendance Device;
Described Time Attendance Device carries out network address translation NAT according to described client-side information and penetrates, and carries out transfer of data with described client.
8. method according to claim 7, is characterized in that, described method also comprises:
When described client and described Time Attendance Device carry out direct communication, described client directly carries out transfer of data with described Time Attendance Device.
9. method according to claim 7, is characterized in that, described Time Attendance Device and server establish a communications link, and Time Attendance Device information is sent to described server, comprising:
After described Time Attendance Device and server establish a communications link, to described server transmission packet in preset time, described message bag is used for described server and obtains the described Time Attendance Device that can network.
10. method according to claim 7, is characterized in that, described client and described server establish a communications link, and client-side information is sent to described server, comprising:
After described client and described server establish a communications link, obtain the customer identification information in described server by signaling protocol.
11. methods according to claim 7, is characterized in that, described Time Attendance Device carries out network address translation NAT according to described client-side information and penetrates, and comprising:
Described Time Attendance Device, according to described client-side information, adopts the first agreement to carry out described NAT and penetrates.
12. methods according to claim 11, is characterized in that, described Time Attendance Device and described client carry out transfer of data, comprising:
Described client, by second protocol, carries out transfer of data with described Time Attendance Device.
CN201510475286.3A 2015-08-05 2015-08-05 Data transmission system and method Pending CN105100253A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510475286.3A CN105100253A (en) 2015-08-05 2015-08-05 Data transmission system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510475286.3A CN105100253A (en) 2015-08-05 2015-08-05 Data transmission system and method

Publications (1)

Publication Number Publication Date
CN105100253A true CN105100253A (en) 2015-11-25

Family

ID=54579769

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510475286.3A Pending CN105100253A (en) 2015-08-05 2015-08-05 Data transmission system and method

Country Status (1)

Country Link
CN (1) CN105100253A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109618254A (en) * 2018-11-19 2019-04-12 安徽咪鼠科技有限公司 A kind of intelligent microphone based on P2P data transmission technology
CN114423098A (en) * 2020-10-10 2022-04-29 海能达通信股份有限公司 Multi-base-station networking method, communication method of multi-base-station network and related device thereof

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102036349A (en) * 2009-09-29 2011-04-27 联想(北京)有限公司 Method for maintaining connection of terminal and network server, terminal and network server
CN102231763A (en) * 2011-06-20 2011-11-02 北京思创银联科技股份有限公司 Sharing method based on NAT (Network Address Translation) penetration
CN103957287A (en) * 2014-04-25 2014-07-30 浙江大学城市学院 Internet of things device P2P connection method based on NAT penetration adapter
CN104408777A (en) * 2014-11-27 2015-03-11 凯拔(中国)科技有限公司 Internet attendance management system and method based on P2P communication realized by NAT traversal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102036349A (en) * 2009-09-29 2011-04-27 联想(北京)有限公司 Method for maintaining connection of terminal and network server, terminal and network server
CN102231763A (en) * 2011-06-20 2011-11-02 北京思创银联科技股份有限公司 Sharing method based on NAT (Network Address Translation) penetration
CN103957287A (en) * 2014-04-25 2014-07-30 浙江大学城市学院 Internet of things device P2P connection method based on NAT penetration adapter
CN104408777A (en) * 2014-11-27 2015-03-11 凯拔(中国)科技有限公司 Internet attendance management system and method based on P2P communication realized by NAT traversal

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109618254A (en) * 2018-11-19 2019-04-12 安徽咪鼠科技有限公司 A kind of intelligent microphone based on P2P data transmission technology
CN114423098A (en) * 2020-10-10 2022-04-29 海能达通信股份有限公司 Multi-base-station networking method, communication method of multi-base-station network and related device thereof
CN114423098B (en) * 2020-10-10 2024-02-06 海能达通信股份有限公司 Multi-base station networking method, multi-base station network communication method and related devices thereof

Similar Documents

Publication Publication Date Title
US7043564B1 (en) Methods and apparatus for managing network traffic using network address translation
CN1327355C (en) Address changing device, message treatment method and apparatus
CN107113342B (en) Relay optimization using software defined networks
EP2805476B1 (en) Ice based nat traversal
CN102355479B (en) Method and equipment for forwarding traffic of multi-NAT (network address translation) gateway
CN102811335B (en) Set up the method, apparatus and system of video session
US9699237B2 (en) Managed media relay selection for real-time communications
CN100454905C (en) Method for passing through network address switching
CN101651721B (en) Method and system for judging type of network address translation equipment
CN105610888A (en) Method of using socket to push message based on Android and system thereof
CN103107983B (en) Data management method of network system and related system thereof
TWI565261B (en) Network address translation traversal system and method for real-time communications
CN109660637A (en) P2P burrows transmission method and system, electronic device and computer readable storage medium
CN1917512B (en) Method for establishing direct connected peer-to-peer channel
CN109039915B (en) Method and system for establishing data connection channel
CN105577851A (en) P2P communication method, P2P server and terminal
WO2019184262A1 (en) Multi-type media data network address translation traversing method, terminal and system
CN105743852B (en) Method and system for realizing Socket connection maintaining communication across network gate through http
US9413590B2 (en) Method for management of a secured transfer session through an address translation device, corresponding server and computer program
CN100481778C (en) A method, device and system for binding the terminal with the pseudo terminal device
CN103516573B (en) Data transmission method among client terminals in restricted network and client terminals
CN105100253A (en) Data transmission system and method
CN104660728A (en) NAT (network address translator) traversal method based on intelligent home control system
CN105049543A (en) P2P communication system and method crossing asymmetric NAT between intelligent routers
CN107124478A (en) Network communication method, device and server

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 26 No. 523710 Guangdong province Dongguan city Tangxia town Pingshan Industrial Avenue 188

Applicant after: Central Intelligence Polytron Technologies Inc

Address before: 26 No. 523000 Guangdong province Dongguan city Tangxia town Pingshan Industrial Avenue 188

Applicant before: Dongguan ZK Electronic Technology Co., Ltd.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20151125

RJ01 Rejection of invention patent application after publication