[go: up one dir, main page]

CN104486247A - Data transmission method and device based on serial server - Google Patents

Data transmission method and device based on serial server Download PDF

Info

Publication number
CN104486247A
CN104486247A CN201410784390.6A CN201410784390A CN104486247A CN 104486247 A CN104486247 A CN 104486247A CN 201410784390 A CN201410784390 A CN 201410784390A CN 104486247 A CN104486247 A CN 104486247A
Authority
CN
China
Prior art keywords
packet
timer
inter
buffer memory
network devices
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
CN201410784390.6A
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.)
Kyland Technology Co Ltd
Original Assignee
Kyland 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 Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN201410784390.6A priority Critical patent/CN104486247A/en
Priority to PCT/CN2015/071529 priority patent/WO2016095323A1/en
Publication of CN104486247A publication Critical patent/CN104486247A/en
Pending legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention provides a data transmission method and a data transmission device based on a serial server. The method comprises the following steps: when the serial server receives a data packet transmitted by a serial terminal, starting a timer, judging whether another data packet transmitted by the serial terminal is received or not within the timing duration of the timer, if yes, caching the data packet and restarting the timer, otherwise, sending the cached data packet to a first far-end network device. In the embodiment of the invention, after the serial server receives the data packet from the serial terminal, the timer is started, when another data packet is received again within the timing duration of the timer, the data packet is determined to be transmitted by the serial terminal and cached, otherwise, the data transmission process of the serial terminal is over, and the cached data packet is transmitted to the far-end network device, so as to implement recombination on the cached data packet, reduce configuration requirements on the far-end network device and resource consumption, and improve the working efficiency of the far-end network device.

Description

A kind of data transmission method based on serial server and device
Technical field
The present invention relates to network communication technology field, particularly relate to a kind of data transmission method based on serial server and device.
Background technology
Serial server is remote network devices in Ethernet and the server between serial port terminal, and Fig. 1 is the syndeton schematic diagram between serial server, remote network devices and serial port terminal.Serial server is connected first serial terminal and second serial terminal by serial ports 1 respectively with serial ports 2, and the mode adopting TCP to connect connects remote network devices, merely illustrate a remote network devices in Fig. 1, serial server can be connected by many TCP, connects multiple remote network devices.Serial server completes the protocol conversion between Ethernet data and serial data by the mode of software, has both been extended the layout scope of equipment by serial server, makes again the management of serial data more flexible and convenient.
Serial server can realize the conversion between serial ports and network interface, it can realize the conversion of RS-232, RS-485 and RS-422 serial ports and TCP/IP network interface, thus realizes the two-way transparent transmission of RS-232, RS-485, RS-422 serial data and TCP/IP network interface data.
In addition, serial server can at TCP/UDP MODE of operation, in this mode, serial server is held as server, remote network devices is held as client, is connected between the two by IP address and port numbers, thus realizes the two-way transparent transmission of data.
When communicating based on serial server, the remote network devices be connected with serial server is uncertain, when serial port terminal is passive equipment, and do not comprise initial sum in the data that serial equipment sends and stop mark, when remote network devices communicates with serial port terminal, serial server can be divided into multiple IP bag to send to remote network devices the multiple continuous print responses received, remote network devices needs multiple IP bag to recombinate, when remote network devices is the low side network equipment, the possibly the plurality of IP that cannot recombinate of this low side network equipment wraps, namely allow to recombinate and also will consume the ample resources of remote network devices, thus affect the operating efficiency of remote network devices.
Summary of the invention
In view of the above problems, the present invention is proposed to provide a kind of overcoming the problems referred to above or a kind of data transmission method based on serial server solved the problem at least in part and device.
Embodiments provide a kind of data transmission method based on serial server, the method comprises:
Serial server receives the packet that serial port terminal sends, and packet described in buffer memory also starts timer;
Judge in the timing length of timer, whether receive other packets that this serial port terminal sends;
When receiving other packets, other packets described in buffer memory also restart timer, otherwise, send to the first remote network devices by after each packet restructuring of buffer memory.
In order to effectively improve the precision of transfer of data, described each packet by buffer memory sends to the first remote network devices to comprise after recombinating in embodiments of the present invention:
When described serial server is determined not receive other packets in the timing length of timer, generate overtime interrupt;
According to overtime interrupt, send to the first remote network devices by after each packet restructuring of buffer memory.
In order to effectively improve the accuracy of transfer of data, reduce the configuration requirement of remote network devices, after described each packet by buffer memory sends to the first remote network devices after recombinating, described method also comprises:
Serial server generating identification message, whether the packet in mark buffer memory recombinates, and identification message is sent to the first remote network devices.
In order to effectively ensure the accuracy of transfer of data, determine that the timing length of described timer comprises in embodiments of the present invention:
Each packet that serial server sends according to the described serial port terminal received, determines two adjacent Inter-packet gap durations;
Judge that whether described two adjacent Inter-packet gap durations are equal;
When adjacent two Inter-packet gap durations are equal, the timing length of described timer is defined as be greater than described Inter-packet gap duration;
When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is greater than second Inter-packet gap duration, determine that the timing length of described timer is greater than second Inter-packet gap duration and is less than first Inter-packet gap duration;
When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is less than second Inter-packet gap duration, determine that the timing length of described timer is greater than first Inter-packet gap duration and is less than second Inter-packet gap duration.
In order to effectively ensure the accuracy of transfer of data, determine that the timing length of described timer comprises in embodiments of the present invention:
Described serial server receives the response message that the first remote network devices returns, when comprising redundant information in the packet after the restructuring of this response message mark, the timing length of timer is adjusted to and is less than current timing length, when the information that the packet after the restructuring of this response message mark comprises is imperfect, the timing length of timer is adjusted to and is greater than current timing length.
In order to effectively ensure the accuracy of transfer of data, described method also comprises:
Described serial server receives the packet that described serial port terminal sends, and judges that whether current described timer is overtime;
When current described timer expiry, described Packet Generation is given each remote network devices be connected with its TCP.
In order to effectively ensure the accuracy of transfer of data, described method also comprises:
Described serial server receives the request that the second remote network devices sends, when judgement is currently located in the timing length of the timer corresponding with described first remote network devices, and buffer memory described request.
Embodiments provide a kind of data transmission device based on serial server, described device comprises:
Receive cache module, for receiving the packet that serial port terminal sends, packet described in buffer memory also starts timer;
Whether judge module, for judging in the timing length of timer, receive other packets that this serial port terminal sends;
Buffer memory sending module, during for judging to receive other packets when judge module, other packets described in buffer memory also restart timer, otherwise, send to the first remote network devices by after each packet restructuring of buffer memory.
In order to effectively improve the precision of transfer of data, described buffer memory sending module in embodiments of the present invention, during specifically for determining not receive other packets in the timing length of timer, generates overtime interrupt; According to overtime interrupt, send to the first remote network devices by after each packet restructuring in buffer memory.
In order to effectively improve the accuracy of transfer of data, reduce the configuration requirement of remote network devices, described buffer memory sending module, also for generating identification message, whether the packet in mark buffer memory recombinates, and identification message is sent to the first remote network devices.
In order to effectively ensure the accuracy of transfer of data, described device also comprises in embodiments of the present invention:
Determination module, for each packet sent according to the described serial port terminal received, determines two adjacent Inter-packet gap durations; Judge that whether described two adjacent Inter-packet gap durations are equal; When adjacent two Inter-packet gap durations are equal, the timing length of described timer is defined as be greater than described Inter-packet gap duration; When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is greater than second Inter-packet gap duration, determine that the timing length of described timer is greater than second Inter-packet gap duration and is less than first Inter-packet gap duration; When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is less than second Inter-packet gap duration, determine that the timing length of described timer is greater than first Inter-packet gap duration and is less than second Inter-packet gap duration.
In order to effectively ensure the accuracy of transfer of data, described device also comprises in embodiments of the present invention:
Described serial server receives the response message that the first remote network devices returns, when comprising redundant information in the packet after the restructuring of this response message mark, the timing length of timer is adjusted to and is less than current timing length, when the information that the packet after the restructuring of this response message mark comprises is imperfect, the timing length of timer is adjusted to and is greater than current timing length.
In order to effectively ensure the accuracy of transfer of data, described judge module, also for when the packet receiving the transmission of described serial port terminal, judges that whether current described timer is overtime;
Described buffer memory sending module, also for when judge module judges current described timer expiry, gives each remote network devices be connected with its TCP by described Packet Generation.
In order to effectively ensure the accuracy of transfer of data, described buffer memory receiver module, also for receiving the request that the second remote network devices sends;
Described judge module, also for judging whether to be currently located in the timing length of the timer corresponding with described first remote network devices;
Described buffer memory sending module, also for when described judge module judgement is currently located in the timing length of the timer corresponding with described first remote network devices, buffer memory described request.
Embodiments provide a kind of data transmission method based on serial server and device, in the method after serial server receives the packet of serial port terminal transmission, start timer, judge in the timing length of this timer, whether receive other packets that this serial port terminal sends, when receiving other packets, this packet of buffer memory also restarts timer, otherwise, send to the first remote network devices by after each packet restructuring of buffer memory.After serial server receives the packet of serial port terminal in embodiments of the present invention, start timer, when again receiving packet within the scope of timer duration, think that this packet is that this serial port terminal sends, by this data pack buffer, otherwise think that the data transmission procedure of this serial port terminal terminates, thus send to remote network devices after being recombinated by the packet of buffer memory, realize the restructuring to packet in buffer memory, reduce the configuration requirement to remote network devices and resource consumption, improve the operating efficiency of remote network devices.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of specification, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Syndeton schematic diagram between the serial server that Fig. 1 provides for prior art, remote network devices and serial port terminal;
A kind of data transmission procedure based on serial server that Fig. 2 provides for the embodiment of the present invention;
The detailed process of a kind of transfer of data based on serial server that Fig. 3 provides for the embodiment of the present invention:
A kind of data transmission device structural representation based on serial server that Fig. 4 provides for the embodiment of the present invention.
Embodiment
In order to reduce configuration requirement to remote network devices and resource consumption, improving the operating efficiency of remote network devices, embodiments providing a kind of data transmission method based on serial server and device.
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
Below in conjunction with explanation accompanying drawing, the embodiment of the present invention is described.
A kind of data transmission procedure based on serial server that Fig. 2 provides for the embodiment of the present invention, this process comprises the following steps:
S201: serial server receives the packet that serial port terminal sends, and packet described in buffer memory also starts timer.
In the embodiment of the present invention, serial port terminal is passive terminal, and remote network devices is sent request to serial port terminal by serial server, after serial port terminal receives request, and distally network equipment return data bag.For this request, serial port terminal distally can return a packet by the network equipment, also distally can return several packet by the network equipment.
When serial server receives the packet of serial port terminal transmission, in order to ensure that the packet sent by this serial port terminal sends to remote network devices after recombinating, this packet of serial server buffer memory also starts timer.This timer can realize with software mode, also can realize in hardware.
Whether S202: judge in the timing length of timer, receiving other packets that this serial port terminal sends, when judged result is for being, carrying out step S203, otherwise, carry out step S204.
The each serial ports of serial server connects corresponding serial port terminal, and therefore serial server is according to the mark of the serial ports of reception packet, can determine it is the packet which serial port terminal sends.
S203: other packets described in buffer memory also restart timer, carry out step S202 afterwards.
After serial server receives other packets of this serial port terminal transmission, return after guaranteeing each packet restructuring by the first remote network devices request, after serial server receives other packets, restart timer, judge other packets that whether can also receive the transmission of this serial port terminal in the timing length of this timer.Serial server is in order to guarantee each packet restructuring of this time being replied by serial port terminal, and the timing length of the timer of setting should be greater than the Inter-packet gap length that serial port terminal sends packet.
S204: send to the first remote network devices by after each packet restructuring of buffer memory.
When not receiving the packet of this serial port terminal transmission in the timing length of timer, can think that the Recovery Process of this serial port terminal terminates, send to the first remote network devices by after each packet restructuring in buffer memory.
After serial server receives the packet of serial port terminal in embodiments of the present invention, start timer, when again receiving packet within the scope of the timing length of timer, think that this packet is that this serial port terminal sends, by this data pack buffer, otherwise think that the data transmission procedure of this serial port terminal terminates, thus by the Packet Generation of buffer memory to remote network devices, realize the restructuring to packet in buffer memory, reduce the configuration requirement to remote network devices and resource consumption, improve the operating efficiency of remote network devices.
Concrete, in embodiments of the present invention after serial server receives the packet of a certain serial port terminal transmission, this packet of buffer memory also starts timer, and this timer can be T3 timer, and the timing length of T3 timer can be arranged as required.Serial server judges other packets whether receiving the transmission of this serial port terminal in the timing length of this T3 timer, when receiving other packets that this serial port terminal sends, these other packets of buffer memory also restart timer, and continuation judges other packets whether receiving the transmission of this serial port terminal in the timing length of this timer; When not receiving other packets that serial port terminal sends in the timing length of timer, send to the first remote network devices by after each packet restructuring of buffer memory.
In embodiments of the present invention in order to ensure the integrality that data send and accuracy, described serial server receives the request that the second remote network devices sends, when judgement is currently located in the timing length of the timer corresponding with described first remote network devices, buffer memory described request.Or when this serial server receives other requests of the first remote network devices transmission, when judgement is currently located in the timing length of the timer corresponding with described first remote network devices, buffer memory these other is asked.
In order to effectively improve the precision of transfer of data, based on the integrated serial ports controller of the cpu chip of serial server, overtime interrupt can be generated, thus realize the combination of software restraint in embodiments of the present invention, realizing high accuracy data transmitting-receiving and controlling.Described by the Packet Generation of buffer memory give the first remote network devices comprise:
When described serial server is determined not receive other packets in the timing length of timer, generate overtime interrupt;
According to overtime interrupt, give the first remote network devices by the Packet Generation in buffer memory.
Serial server is when detecting that the timing length of timer arrives, but when not receiving other packets of this serial port terminal transmission in this timing length, serial server generates and interrupts, to inform that driver frame end need carry out the restructuring of packet.Concrete, in the operating system of serial server, after serial ports hardware (hardware) receives packet, by this data pack buffer in the buffer memory of hardware, serial port drive (serialdriver) reads this packet from the buffer memory of hardware, dumps in internal memory by this packet, when having no progeny in generation, the application program (application) on upper strata read data packet recombinating from internal memory, and by network interface, the Packet Generation after restructuring is gone out.
Because serial server provides an overtime interrupt mechanism, when producing overtime interrupt, serial port drive is read data packet from serial ports hardware buffer, and this packet is stamped identification field, identifying this packet is data to be reorganized, and this packet is dumped to internal memory, and the application program on upper strata is had no progeny in receiving, from internal memory, read this packet according to this identification field, and send after the restructuring of this packet.
Concrete, serial port drive reads this packet from hardware buffer, and adds an identification field at the data header part of this packet, is dumped in internal memory by this packet afterwards.The data head adding this packet after identification field comprises two parts, a part is identification field, this identification field can be such as a byte, it can be such as " # ", another part is data length, this data length can take two bytes, to identify the physical length of the data of this packet after data head.When application program reads this packet from internal memory, first read data header part, the information comprised according to data head can parse the length of subsequent data, thus can obtain corresponding data content, thus realizes the restructuring of data.
The form of the packet of serial server encapsulation can be as shown in table 1:
Flag Length Data
Table 1
Containing identifier flag in the data head of this packet, this identifier identifies its start bit being packet, this identifier can adopt any value, this identifier takies a byte, length part takies two bytes, show the length of the actual data content from the 4th byte, data is the data content after restructuring.
For the ease of each packet of remote network devices identification, determine that whether this packet is restructuring packet, in embodiments of the present invention described give the first remote network devices by the Packet Generation of buffer memory after, described method also comprises:
Serial server generating identification message, whether the packet in mark buffer memory recombinates, and identification message is sent to the first remote network devices.
Concrete, the form of this identification message is as shown in table 2:
Flag Data Time
Table 2
Flag is the identifier comprised in the heading of this identification message, to identify the start bit that it is this identification message, data is the actual data content of this identification message, this data content can only be 0 or 1,0 identification data packet is reorganized, 1 identification data packet is not reorganized, and time is the time of this identification message of serial server current encapsulation, is mainly used in general data bag and this identification message of distinguishing serial server.
In order to effectively ensure the accuracy of transfer of data, determine that the timing length of described timer comprises in embodiments of the present invention:
Each packet that serial server sends according to the described serial port terminal received, determines two adjacent Inter-packet gap durations;
Judge that whether described two adjacent Inter-packet gap durations are equal;
When adjacent two Inter-packet gap durations are equal, the timing length of described timer is defined as be greater than described Inter-packet gap duration;
When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is greater than second Inter-packet gap duration, determine that the timing length of described timer is greater than second Inter-packet gap duration and is less than first Inter-packet gap duration.
Serial server can according to the characteristic of each serial port terminal, the Inter-packet gap duration of its correspondence is set for each serial port terminal flexibly, concrete, serial server is when arranging the Inter-packet gap duration of its correspondence for each serial port terminal, according to each packet that this serial port terminal sends, determine the Inter-packet gap length that this serial port terminal two is adjacent.The packet that such as serial port terminal sends is A, B, C in order ... the time interval then between packet A and packet B is first Inter-packet gap length, the time interval between packet B and packet C is second Inter-packet gap length, and two adjacent Inter-packet gap length are first Inter-packet gap length and second Inter-packet gap length.
After obtaining two adjacent Inter-packet gap length, judge that whether these two Inter-packet gap length are equal, when two Inter-packet gap length are equal, illustrate that these two Inter-packet gap length are Inter-packet gap length corresponding to packet that this serial port terminal sends, the timing length of timer is set to be greater than this Inter-packet gap length.Here thinking that two Inter-packet gap length are equal, can be that the absolute value of the difference of two Inter-packet gap length is positioned at certain threshold range.When two Inter-packet gap length are different, and first Inter-packet gap length is when being greater than second Inter-packet gap length, illustrate that first Inter-packet gap is the Inter-packet gap after reply first request terminates, second Inter-packet gap is the Inter-packet gap of reply second request, now the timing length of timer can be set to be greater than second Inter-packet gap duration, but be less than first Inter-packet gap duration.Same, when two Inter-packet gap length are different, and first Inter-packet gap length is when being less than second Inter-packet gap length, illustrate that first Inter-packet gap is the Inter-packet gap of reply first request, second Inter-packet gap is the Inter-packet gap after reply first request terminates, another request will be replied afterwards, now the timing length of timer can be set to be greater than first Inter-packet gap duration, but be less than second Inter-packet gap duration.
In embodiments of the present invention when remote network devices has the function judging data integrity, determine that the timing length of described timer comprises:
Described serial server receives the response message that the first remote network devices returns, when the packet after the restructuring of this response message mark comprises redundant information, the timing length of timer is adjusted to and is less than current timing length, when the information that the packet after the restructuring of this response message mark comprises is imperfect, the timing length of timer is adjusted to and is greater than current timing length.
Concrete, when remote network devices has the function judging data integrity, after the packet after receiving serial server restructuring, can be whether complete according to packet, return response message to serial server.Now in serial server, the timing length of timer can be arranged arbitrarily, according to the timing length of the timer arranged, determines, to this remote network devices return data bag, recombinate and send.After this remote network devices receives the packet after restructuring, judge the integrality of data, this integrity information is included in response message and is sent to serial server.
Serial server is according to the information comprised in this response message, determine to comprise redundant information in the packet after recombinating, when the data of comparatively these remote network devices needs of the data that comprise of packet namely after restructuring are many, determine that the timing length of current timer is longer, now need the timing length of timer to turn down; When according to this response message, when determining that the information that the packet after recombinating comprises is imperfect, determine that the timing length of current timer is shorter, complete data can not be obtained, now need the timing length of timer to tune up.
Adopt aforesaid way, mutual several times by serial server and remote network devices, the timing length of the timer that the serial port terminal of correspondence is corresponding can be determined more accurately.
In order to effectively ensure the accuracy of transfer of data in the embodiment of the present invention, described method also comprises:
Described serial server receives the packet that described serial port terminal sends, and judges that whether current described timer is overtime;
When current described timer expiry, described Packet Generation is given each remote network devices be connected with its TCP.
The detailed process of a kind of transfer of data based on serial server that Fig. 3 provides for the embodiment of the present invention, this process comprises the following steps:
S301: serial server receives the request that the first remote network devices sends, and described request is sent to first serial terminal.
S302: serial server receives the packet that first serial terminal returns, and packet described in buffer memory also starts timer.
Whether S303: judge in the timing length of timer, receive other packets that this first serial terminal returns, and when judged result is for being, carries out step S304, otherwise, carry out step S305.
S304: other packets described in buffer memory also restart timer, carry out step S303 afterwards.
S305: give the first remote network devices by the Packet Generation of buffer memory.
S306: serial server receives other packets that this first serial terminal sends.
S307: serial server judges that whether current timer is overtime, when judged result is for being, carries out step S308, otherwise, carry out step S304.
S308: described Packet Generation is given each remote network devices be connected with its TCP.
Concrete, serial server and the first remote network devices are set up a TCP and are connected, the request receiving this first remote network devices and send is connected by this TCP, wherein carry the identification information of the serial port terminal communicated with in this request, this identification information can be the link address information of serial port terminal.After serial server receives this request, this request is sent to corresponding serial port terminal.Serial port terminal is according to this request to serial server return data bag, and after serial server receives this packet, this packet of buffer memory also starts timer.Judge whether other packets receiving the transmission of this serial port terminal in the timing length of this timer, when receiving other packets that this serial port terminal sends in this timing length, these other packets of buffer memory also restart timer, other packets whether monitoring receives the transmission of this serial port terminal are continued in the timing length of timer, when not receiving the packet that this serial port terminal returns in a certain timing length of timer, when namely not receiving the packet that this serial port terminal returns during timer expiry, determine that the Recovery Process of this serial port terminal terminates, packet in buffer memory is recombinated, be reassembled as an IP packet, and give corresponding remote network devices by the Packet Generation after restructuring.
Serial server is within a reply cycle in embodiments of the present invention, each packet of non-for serial port terminal overtime return can be saved bit by bit, when time-out, the packet saved bit by bit be reassembled as an IP packet and send, thus avoid the restructuring that remote network devices carries out packet, reduce the configuration requirement to remote network devices and resource consumption, improve the operating efficiency of remote network devices.
In addition, when timer is overtime, when namely current timer is non-starting state, serial server receives other packets that this serial port terminal sends, and this Packet Generation is given each remote network devices be connected with its TCP by serial server.
After serial server receives the packet of serial port terminal in embodiments of the present invention, start timer, when again receiving packet within the scope of timer duration, think that this packet is that this serial port terminal sends, by this data pack buffer, otherwise think that the data transmission procedure of this serial port terminal terminates, thus by the Packet Generation of buffer memory to remote network devices, realize the restructuring to packet in buffer memory, reduce the configuration requirement to remote network devices and resource consumption, improve the operating efficiency of remote network devices.
Fig. 4 embodiments provides a kind of data transmission device structural representation based on serial server, and described device comprises:
Receive cache module 41, for receiving the packet that serial port terminal sends, packet described in buffer memory also starts timer;
Whether judge module 42, for judging in the timing length of timer, receive other packets that this serial port terminal sends;
Buffer memory sending module 43, during for judging to receive other packets when judge module, other packets described in buffer memory also restart timer, otherwise, give the first remote network devices by the Packet Generation of buffer memory.
In order to effectively improve the precision of transfer of data, described buffer memory sending module 43 in embodiments of the present invention, during specifically for determining not receive other packets in the timing length of timer, generates overtime interrupt; According to overtime interrupt, give the first remote network devices by the Packet Generation in buffer memory.
In order to effectively improve the accuracy of transfer of data, reduce the configuration requirement of remote network devices, described buffer memory sending module 43, also for generating identification message, whether the packet in mark buffer memory recombinates, and identification message is sent to the first remote network devices.
In order to effectively ensure the accuracy of transfer of data, described device also comprises in embodiments of the present invention:
Determination module 44, for each packet sent according to the described serial port terminal received, determines two adjacent Inter-packet gap durations; Judge that whether described two adjacent Inter-packet gap durations are equal; When adjacent two Inter-packet gap durations are equal, the timing length of described timer is defined as be greater than described Inter-packet gap duration; When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is greater than second Inter-packet gap duration, determine that the timing length of described timer is greater than second Inter-packet gap duration and is less than first Inter-packet gap duration; When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is less than second Inter-packet gap duration, determine that the timing length of described timer is greater than first Inter-packet gap duration and is less than second Inter-packet gap duration.
Described device also comprises:
Determination module 44, for receiving the response message that the first remote network devices returns, when the packet after the restructuring of this response message mark comprises redundant information, the timing length of timer is adjusted to and is less than current timing length, when the information that the packet after the restructuring of this response message mark comprises is imperfect, the timing length of timer is adjusted to and is greater than current timing length.
In order to effectively ensure the accuracy of transfer of data, described judge module 42, also for when the packet receiving the transmission of described serial port terminal, judges that whether current described timer is overtime;
Described buffer memory sending module 43, also for when judge module judges current described timer expiry, gives each remote network devices be connected with its TCP by described Packet Generation.
In order to effectively ensure the accuracy of transfer of data, described buffer memory receiver module 41, also for receiving the request that the second remote network devices sends;
Described judge module 42, also for judging whether to be currently located in the timing length of the timer corresponding with described first remote network devices;
Described buffer memory sending module 43, also for when described judge module judgement is currently located in the timing length of the timer corresponding with described first remote network devices, buffer memory described request.
Embodiments provide a kind of data transmission method based on serial server and device, in the method after serial server receives the packet of serial port terminal transmission, start timer, judge in the timing length of this timer, whether receive other packets that this serial port terminal sends, when receiving other packets, this packet of buffer memory also restarts timer, otherwise, send to the first remote network devices by after each packet restructuring of buffer memory.After serial server receives the packet of serial port terminal in embodiments of the present invention, start timer, when again receiving packet within the scope of timer duration, think that this packet is that this serial port terminal sends, by this data pack buffer, otherwise think that the data transmission procedure of this serial port terminal terminates, thus by the Packet Generation of buffer memory to remote network devices, realize the restructuring to packet in buffer memory, reduce the configuration requirement to remote network devices and resource consumption, improve the operating efficiency of remote network devices.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In specification provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this specification (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this specification (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary compound mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions based on the some or all parts in the data transmission device of serial server that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computer of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.

Claims (14)

1. based on a data transmission method for serial server, it is characterized in that, the method comprises:
Serial server receives the packet that serial port terminal sends, and packet described in buffer memory also starts timer;
Judge in the timing length of timer, whether receive other packets that this serial port terminal sends;
When receiving other packets, other packets described in buffer memory also restart timer, otherwise, send to the first remote network devices by after each packet restructuring of buffer memory.
2. the method for claim 1, is characterized in that, described each packet by buffer memory sends to the first remote network devices to comprise after recombinating:
When described serial server is determined not receive other packets in the timing length of timer, generate overtime interrupt;
According to overtime interrupt, send to the first remote network devices by after each packet restructuring of buffer memory.
3. method as claimed in claim 1 or 2, is characterized in that, after described each packet by buffer memory sends to the first remote network devices after recombinating, described method also comprises:
Serial server generating identification message, whether the packet in mark buffer memory recombinates, and identification message is sent to the first remote network devices.
4. the method for claim 1, is characterized in that, determines that the timing length of described timer comprises:
Each packet that serial server sends according to the described serial port terminal received, determines two adjacent Inter-packet gap durations;
Judge that whether described two adjacent Inter-packet gap durations are equal;
When adjacent two Inter-packet gap durations are equal, the timing length of described timer is defined as be greater than described Inter-packet gap duration;
When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is greater than second Inter-packet gap duration, determine that the timing length of described timer is greater than second Inter-packet gap duration and is less than first Inter-packet gap duration;
When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is less than second Inter-packet gap duration, determine that the timing length of described timer is greater than first Inter-packet gap duration and is less than second Inter-packet gap duration.
5. the method for claim 1, is characterized in that, determines that the timing length of described timer comprises:
Described serial server receives the response message that the first remote network devices returns, when comprising redundant information in the packet after the restructuring of this response message mark, the timing length of timer is adjusted to and is less than current timing length, when the information that the packet after the restructuring of this response message mark comprises is imperfect, the timing length of timer is adjusted to and is greater than current timing length.
6. the method for claim 1, is characterized in that, described method also comprises:
Described serial server receives the packet that described serial port terminal sends, and judges that whether current timer is overtime;
When current described timer expiry, described Packet Generation is given each remote network devices be connected with its TCP.
7. the method for claim 1, is characterized in that, described method also comprises:
Described serial server receives the request that the second remote network devices sends, when judgement is currently located in the timing length of the timer corresponding with described first remote network devices, and buffer memory described request.
8. based on a data transmission device for serial server, it is characterized in that, described device comprises:
Receive cache module, for receiving the packet that serial port terminal sends, packet described in buffer memory also starts timer;
Whether judge module, for judging in the timing length of timer, receive other packets that this serial port terminal sends;
Buffer memory sending module, during for judging to receive other packets when judge module, other packets described in buffer memory also restart timer, otherwise, send to the first remote network devices by after each packet restructuring of buffer memory.
9. device as claimed in claim 8, is characterized in that, described buffer memory sending module, during specifically for determining not receive other packets in the timing length of timer, generates overtime interrupt; According to overtime interrupt, send to the first remote network devices by after each packet restructuring of buffer memory.
10. device as claimed in claim 8 or 9, is characterized in that, described buffer memory sending module, and also for generating identification message, whether the packet in mark buffer memory recombinates, and identification message is sent to the first remote network devices.
11. devices as claimed in claim 8, it is characterized in that, described device also comprises:
Determination module, for each packet sent according to the described serial port terminal received, determines two adjacent Inter-packet gap durations; Judge that whether described two adjacent Inter-packet gap durations are equal; When adjacent two Inter-packet gap durations are equal, the timing length of described timer is defined as be greater than described Inter-packet gap duration; When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is greater than second Inter-packet gap duration, determine that the timing length of described timer is greater than second Inter-packet gap duration and is less than first Inter-packet gap duration; When two Inter-packet gap durations are unequal, and when first Inter-packet gap duration is less than second Inter-packet gap duration, determine that the timing length of described timer is greater than first Inter-packet gap duration and is less than second Inter-packet gap duration.
12. devices as claimed in claim 8, it is characterized in that, described device also comprises:
Determination module, for receiving the response message that the first remote network devices returns, when comprising redundant information in the packet after the restructuring of this response message mark, the timing length of timer is adjusted to and is less than current timing length, when the information that the packet after the restructuring of this response message mark comprises is imperfect, the timing length of timer is adjusted to and is greater than current timing length.
13. devices as claimed in claim 8, is characterized in that, described judge module, also for when the packet receiving the transmission of described serial port terminal, judge that whether current timer is overtime;
Described buffer memory sending module, also for when judge module judges current described timer expiry, gives each remote network devices be connected with its TCP by described Packet Generation.
14. devices as claimed in claim 8, is characterized in that, described buffer memory receiver module, also for receiving the request that the second remote network devices sends;
Described judge module, also for judging whether to be currently located in the timing length of the timer corresponding with described first remote network devices;
Described buffer memory sending module, also for when described judge module judgement is currently located in the timing length of the timer corresponding with described first remote network devices, buffer memory described request.
CN201410784390.6A 2014-12-16 2014-12-16 Data transmission method and device based on serial server Pending CN104486247A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410784390.6A CN104486247A (en) 2014-12-16 2014-12-16 Data transmission method and device based on serial server
PCT/CN2015/071529 WO2016095323A1 (en) 2014-12-16 2015-01-26 Data transmission method and apparatus based on serial server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410784390.6A CN104486247A (en) 2014-12-16 2014-12-16 Data transmission method and device based on serial server

Publications (1)

Publication Number Publication Date
CN104486247A true CN104486247A (en) 2015-04-01

Family

ID=52760752

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410784390.6A Pending CN104486247A (en) 2014-12-16 2014-12-16 Data transmission method and device based on serial server

Country Status (2)

Country Link
CN (1) CN104486247A (en)
WO (1) WO2016095323A1 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106850713A (en) * 2015-12-04 2017-06-13 北京东土科技股份有限公司 Data transmission method and device based on serial server, serial server
CN108304335A (en) * 2018-02-07 2018-07-20 南京南瑞继保电气有限公司 A method of the indefinite long message of serial ports is received by DMA
CN113741718A (en) * 2020-05-29 2021-12-03 杭州海康威视数字技术股份有限公司 Control data conversion method and device and master control equipment
CN114465966A (en) * 2022-01-23 2022-05-10 山东云海国创云计算装备产业创新中心有限公司 Data packet recombination control system and data packet recombination method

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110113707B (en) * 2018-01-30 2024-03-22 四川中电昆辰科技有限公司 Multi-frequency point positioning data return system, positioning system and method thereof

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1235303A (en) * 1998-02-24 1999-11-17 佳能株式会社 Data communication system, method, device and digital interface
US20030145142A1 (en) * 2002-01-28 2003-07-31 Dell Products, L.P. Computer system with improved data capture system
CN101699298A (en) * 2009-11-12 2010-04-28 安徽鑫龙电器股份有限公司 One-phase digital current/voltage measuring instrument and measuring method thereof
CN101800652A (en) * 2010-02-04 2010-08-11 深圳市金宏威实业发展有限公司 Mode switching method and system of serial port and Ethernet and industrial Ethernet switch
CN101841542A (en) * 2010-05-07 2010-09-22 北京鼎实创新科技有限公司 Method for realizing PROFIBUS master station communication protocol based on FPGA (Field Programmable Gate Array) technology
CN101908031A (en) * 2010-07-23 2010-12-08 四川九洲电器集团有限责任公司 FPGA-based enhanced serial port
CN102724122A (en) * 2012-06-21 2012-10-10 广东威创视讯科技股份有限公司 Reliable serial port transmission method and device based on hardware system
CN103078871A (en) * 2013-01-18 2013-05-01 武汉迈威实达软件有限公司 Serial port Ethernet protocol conversion method
CN104155905A (en) * 2014-08-22 2014-11-19 南京领先环保技术有限公司 Control system for remotely monitoring brushless motor, and control method thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6076181A (en) * 1998-03-03 2000-06-13 Nokia Mobile Phones Limited Method and apparatus for controlling a retransmission/abort timer in a telecommunications system
CN101030943A (en) * 2007-04-03 2007-09-05 华为技术有限公司 Method for transmitting message and route
CN102624738B (en) * 2012-03-28 2014-08-27 瑞斯康达科技发展股份有限公司 Serial port server, protocol conversion chip and data transmission method

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1235303A (en) * 1998-02-24 1999-11-17 佳能株式会社 Data communication system, method, device and digital interface
US20030145142A1 (en) * 2002-01-28 2003-07-31 Dell Products, L.P. Computer system with improved data capture system
CN101699298A (en) * 2009-11-12 2010-04-28 安徽鑫龙电器股份有限公司 One-phase digital current/voltage measuring instrument and measuring method thereof
CN101800652A (en) * 2010-02-04 2010-08-11 深圳市金宏威实业发展有限公司 Mode switching method and system of serial port and Ethernet and industrial Ethernet switch
CN101841542A (en) * 2010-05-07 2010-09-22 北京鼎实创新科技有限公司 Method for realizing PROFIBUS master station communication protocol based on FPGA (Field Programmable Gate Array) technology
CN101908031A (en) * 2010-07-23 2010-12-08 四川九洲电器集团有限责任公司 FPGA-based enhanced serial port
CN102724122A (en) * 2012-06-21 2012-10-10 广东威创视讯科技股份有限公司 Reliable serial port transmission method and device based on hardware system
CN103078871A (en) * 2013-01-18 2013-05-01 武汉迈威实达软件有限公司 Serial port Ethernet protocol conversion method
CN104155905A (en) * 2014-08-22 2014-11-19 南京领先环保技术有限公司 Control system for remotely monitoring brushless motor, and control method thereof

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106850713A (en) * 2015-12-04 2017-06-13 北京东土科技股份有限公司 Data transmission method and device based on serial server, serial server
CN106850713B (en) * 2015-12-04 2020-01-21 北京东土科技股份有限公司 Data transmission method and device based on serial server and serial server
CN108304335A (en) * 2018-02-07 2018-07-20 南京南瑞继保电气有限公司 A method of the indefinite long message of serial ports is received by DMA
CN113741718A (en) * 2020-05-29 2021-12-03 杭州海康威视数字技术股份有限公司 Control data conversion method and device and master control equipment
CN113741718B (en) * 2020-05-29 2024-06-04 杭州海康威视数字技术股份有限公司 Control data conversion method and device and main control equipment
CN114465966A (en) * 2022-01-23 2022-05-10 山东云海国创云计算装备产业创新中心有限公司 Data packet recombination control system and data packet recombination method
CN114465966B (en) * 2022-01-23 2024-05-28 山东云海国创云计算装备产业创新中心有限公司 Data packet reorganization control system and data packet reorganization method

Also Published As

Publication number Publication date
WO2016095323A1 (en) 2016-06-23

Similar Documents

Publication Publication Date Title
CN104486247A (en) Data transmission method and device based on serial server
CN111083161A (en) Data transmission processing method and device and Internet of things equipment
CN105024861B (en) A kind of reliable remote communication means and its communicator based on big-dipper satellite
CN105120439A (en) Beidou long message communication method
CN103973421A (en) File transmitting method and device
CN105989539A (en) Financial trading condition acquisition system and method
CN111740847B (en) High-speed network data transmission system and method based on FPGA
CN113852445B (en) Method, system, equipment and storage medium for improving data transmission reliability
CN101222443A (en) Method and network appliance for processing packet
US20200007651A1 (en) Methods and devices for signalling in a communication network
CN114362885A (en) Internet of things data transmission method, device, equipment and medium
CN109889312A (en) Multilink data transmission method, device and computer readable storage medium
CN112737995A (en) Method, device and equipment for processing Ethernet frame and storage medium
CN101777037B (en) Method and system for searching data transmission in engine real-time system
EP3672189A1 (en) Data transmission method, device and system
CN101951327A (en) iSCSI network system and network fault detection method
CN117061072B (en) Message transmission method, device, equipment and storage medium
CN109067503B (en) A data retransmission method and device
CN101656639B (en) Empty identifying method, device and receiving equipment for MLPPP link
CN115941127B (en) Message protocol timeout retransmission management method based on hash table
CN115988110A (en) Inter-chip communication method and storage medium
CN105634692A (en) Data packet transmitting method and receiving method based on UDP protocol
CN110990313A (en) Method, equipment and storage medium for processing clock stretching of I3C bus
JP7074826B2 (en) Methods and devices for signaling in communication networks
CN109842465A (en) Data transmission method, data end equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150401