CN107769901A - A kind of method and apparatus of field inspection data transfer - Google Patents

A kind of method and apparatus of field inspection data transfer Download PDF

Info

Publication number
CN107769901A
CN107769901A CN201710979907.0A CN201710979907A CN107769901A CN 107769901 A CN107769901 A CN 107769901A CN 201710979907 A CN201710979907 A CN 201710979907A CN 107769901 A CN107769901 A CN 107769901A
Authority
CN
China
Prior art keywords
data
frame
serial ports
radio station
transmission
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
CN201710979907.0A
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.)
Cold and Arid Regions Environmental and Engineering Research Institute of CAS
Original Assignee
Cold and Arid Regions Environmental and Engineering Research Institute of CAS
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 Cold and Arid Regions Environmental and Engineering Research Institute of CAS filed Critical Cold and Arid Regions Environmental and Engineering Research Institute of CAS
Priority to CN201710979907.0A priority Critical patent/CN107769901A/en
Publication of CN107769901A publication Critical patent/CN107769901A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1809Selective-repeat protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1832Details of sliding window management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1848Time-out mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • H04L1/187Details of sliding window management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • H04L1/188Time-out mechanisms

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a kind of method and apparatus of field inspection data transfer, including the data transmission device of transmitting terminal and receiving terminal, the data transmission device of the transmitting terminal and receiving terminal all conducts electricity platen card two parts including protocol boards sum;Transmission method includes improving acknowledgement mechanism, timeout mechanism and the windowing mechanism of Sr-ARQ;Extract observation data for presentation data receiver main frame;Power management function and working time management function are integrated with final agreement plate.The advantage of the invention is that:After analyzing various reliability protocols implementation process, low power dissipation design is incorporated in agreement improvement, then the power management in terms of auxiliary hardware system, transmission power consumption, small size can be effectively reduced when transmitting data in the wild, cost is low.

Description

A kind of method and apparatus of field inspection data transfer
Technical field
The present invention relates to technical field of data transmission, more particularly to a kind of method and apparatus of field inspection data transfer.
Background technology
Data radio station refers to paste by Digital Signal Processing, Error Correction of Coding, software radio, digital modulation and demodulation and surface The technologies such as face integrated design realize the radio station of high-performance data transmission, and it is as a kind of low cost, long range, installation maintenance side Just data transfer solution has more in the industry that oil, coal, environment etc. have field condition data transfer demands Universal application, its transmitting procedure can be made up of using one field inspection equipment, data radio station board, data receiver main frame Simplified model describe, as shown in Figure 1.
Because the communication process of data radio station is to be realized by data through radio propagation, and field transmitting procedure is easily by greatly certainly Various noise jammings in so and cause the bit error rate to increase, while also easily caused to communicate by adverse weather conditions such as heavy rain, sand and dust Temporary interruption, therefore the reliability of guarantee data transfer is key link of the data radio station in the system integration and application.Though Right existing data radio station has Error Control and retransmission mechanism in itself, but it ensures that zero defect receives, and does not ensure reliability Transmission, i.e., only consider " mistake " but do not consider " to lose ", so needing badly wild based on a kind of host-host protocol satisfaction of data radio station design The demand of outer data transmission credibility.Simultaneously, it is contemplated that field is applied on the spot, radio transmitting device can only lean on it is solar powered, So low-power consumption is the actual demand that field deployment proposes.Device low power dissipation design can not only extend the fortune of transmitting device The row time, moreover it is possible to choose less rechargeable battery and solar panels, so as to save the acquisition cost of material and carry it is artificial into This.
Therefore, for field data radio station wireless transmission channel it is second-rate the problem of, it is necessary to based on data radio station design One kind needs Embedded MCU, can ensure data transmission credibility, while the data transfer for taking into account low cost and low-power consumption is assisted Negotiation device.
The technical scheme of prior art is exemplified below;
The technical scheme of prior art one is to introduce the stop-wait ARQ agreements that can realize reliable transmission of data, such as Li Xiao is bravely waited《Wireless data transmission module application level reliability designs》It is middle to be carried, because field inspection equipment and data radio station are mostly Import equipment, it is difficult to require customization or secondary development, current common method is to develop an agreement by core of embedded MCU Plate, then it is integrated into a set of transmitting device with data radio station.Protocol boards function can be sketched:In transmitting terminal, set from field inspection It is standby to receive observation data, sent by data radio station board is passed to after stop-wait ARQ protocol encapsulations;In receiving terminal, passed from number Data are read in radio station, and will observe data transfer after removing protocol encapsulation gives data receiver main frame, and whole process realizes wait-weight The coupling of ARQ agreements and data radio station is passed, its communication reduction model is as shown in Figure 2.
Transmitting device specific embodiment based on stop-wait ARQ and data radio station is:
(1) data that field inspection instrument uploads are cut into data segment in transmitting terminal protocol boards, assign frame head mark, frame is compiled Number with check code post package into data frame, data frame is passed to data radio station;
(2) data are read from data radio station in receiving terminal protocol boards, is identified according to frame head and data are cut into data frame, Confirm to send acknowledgement frame after frame number and check code are errorless, otherwise send and deny frame;
(3) transmitting terminal has to wait for receiving terminal confirmation after sending a frame data, is retransmited after receiving acknowledgement frame next Frame data.At the same time transmitting terminal opens an overtime timer, if overtime timer overflows transmitting terminal still without being connected to response Frame, resend the data frame of last time transmission.System flow is as shown in Figure 3.
The defects of prior art one, which is off-waited ARQ agreements, can ensure data transmission credibility, also real with function The advantages that now simple, algorithm Space-time Complexity is very low, and suitable embedded device uses, but transmitting terminal often sends out one in transfer process Frame data will wait to be answered, and utilization rate of communication channel is not high, and message transmission rate is very low, therefore stopping variable is only suitable for Used in the application scenario insensitive to communication efficiency.With increasing for field inspection key element, the increase of observing frequency, field Scope produces data volume also increasing, and stop-wait protocol shortcoming in actual field application shows that transmission is same The data volume of sample size is time-consuming longer, adds the system power dissipation of transmitting device, is contradicted with field low-power consumption demand.
The technical scheme of prior art two is to be directed to the problem of stop-wait ARQ protocol channels utilization rates are low, and one easily The improvement means expected are that selection-re-transmission ARQ agreements are introduced into the data transfer based on data radio station.Selection-re-transmission ARQ is with stopping Only-wait ARQ to compare, it is not to stop to wait acknowledgement frame after difference is that transmitting terminal has sent a data frame, but continuous hair Send some data frames.If it at this moment have received the acknowledgement frame sent, then can also then send data frame.Receiving terminal inspection is received Whether the frame number to data frame is continuous, is submitted upwards if continuous, otherwise first preserves discontinuous sequence number frame, accused in acknowledgement frame Know the frame number of transmitting terminal missing, transmitting terminal only will confirm that the data frame of the missing frame mentioned in frame or timer expired retransmits. Such as transmitting terminal continuously transmits 0 to No. 15 frames, receive receiving terminal agreement and continuously receive but find No. 2 frame missings, then accused by ACK Know that No. 2 frames of sender do not receive also;Transmission only retransmits No. 2 frames after terminating to ACK.Above-mentioned Working Examples are as shown in Figure 4.
In addition to above-mentioned mechanism, selection-re-transmission ARQ has also merged sliding window mechanism, that is, limits and have been sent from but not The number for the data frame being identified.Sliding window sliding process is as shown in Figure 5.It is the frame for allowing to send to send the frame in window. If the frame allowed all sends and is over, but without receiving any confirmation, then any frame cannot be sent, at this moment send and just enter Enter wait state.The confirmation of a frame is often received, sends window with regard to forward slip.Sliding window can avoid sender from losing one Frame is not stopped paying out also and send new frame, and recipient does not stop to store out of order frame, the problem of eventually causing recipient's cache overflow.
The shortcomings that prior art two, has been selection-re-transmission ARQ protocol realizations data frame continuously transmits, while can avoid weight Multiple transmission already correctly reaches the data frame of receiving terminal, compared with stop-wait ARQ, adds data throughout, improves Utilization rate of communication channel.Although selection-re-transmission ARQ agreements ensure transmission reliability, it is difficult to directly apply to field data In transmission, its reason is that field transmission is limited the often temporary interruption of appearance transmission by natural conditions, continues extreme day if running into Gas, such as heavy rain, snowfall, sandstorm, the break period can last for hours, and selection-re-transmission ARQ ACK mechanism, sliding window Mechanism and retransmission time out mechanism are drastically reduced due to its efficiency of transmission, and the analysis of causes is as follows:
(1) often occur continuous frame number loss in the same window, but now recipient when transmission is because of temporary interruption Can duplicate acknowledgment last data frame for sequentially reaching, for this, sender can only be the data frame for repeating sequentially arrival recipient That data frame afterwards.Such as shown in Fig. 6, transmitting terminal window size is 8, is sent sequence number as 0,1,2,3,4,5,6,7,8,9 Totally ten data frames are to recipient, and sequence number 0,1 data frame send and confirm success in transmitting procedure, sequence number 2,3,4,5,6 five Admission control, receiving terminal can only be to 1 number frame acknowledgment, i.e. transmission confirmation after receiving the frame of sequence number 7,8,9 in this case Number be 2 ACK.After transmitting terminal receives ACK, 2 number frames can only be retransmitted, are receiving the acknowledgement frame front window of 2 number frames It is irremovable, example procedure signal is as shown in Figure 6.Sender often retransmits a lost data frames, and recipient is it is confirmed that one Individual, then window moves forward one, and selection-re-transmission ARQ deteriorates to stop-wait ARQ.If now there is confirmation LOF Sender's Retransmission timeout is triggered, situation may be further worsened.Whole process can be continued until that sender obtains 2,3,4,5,6 five The response ACK of individual frame, it is clear that select-retransmit ARQ data throughouts can reduce in this case, message transmission rate can decline.
(2) assuming that persistent heavy rainfall weather occurs in field, send sequence number 2 to 9 frame of transmitting terminal is all lost in Fig. 6, due to Selection-re-transmission ARQ is not timed-out update mechanism, so that each frame retransmitted timing as 5 minutes as an example, every mistake just occurs 5 minutes, will Transmitting terminal all retransmits the frame of sequence number 2 to 9 in window.If heavy rain continues 2 hours, transmitting terminal just retransmits the frame of sequence number 2 to 9 24 times, 192 frames are transmitted altogether, and this results in a large amount of unnecessary frames and retransmitted, and adds the unnecessary power consumption of data radio station.
In summary, External Observation data transmission out of office, prior art are to integrate stop-wait based on data radio station ARQ agreements, but there is the problem of data throughout is small, and channel utilization is low;The corrective measure being readily apparent that is conducted electricity based on number Platform integrated selection-re-transmission ARQ agreements, although improving efficiency of transmission, it can go out under continuation extreme weather conditions in the wild Existing data throughout is die-offed, and a large amount of unnecessary frames retransmit, the problem of so as to reduce data transmission efficiency.As can be seen here, although two Kind agreement can ensure reliable transmission of data, but all be difficult to be directly applied in the natural conditions complicated and changeable of field.
The content of the invention
The defects of present invention is directed to prior art, there is provided a kind of method and apparatus of field inspection data transfer, can have Solution the above-mentioned problems of the prior art of effect.
In order to realize above goal of the invention, the technical scheme that the present invention takes is as follows:
A kind of device of field inspection data transfer, including the data transmission device of transmitting terminal and receiving terminal, the transmission The data transmission device of end and receiving terminal all conducts electricity platen card two parts including protocol boards sum, protocol boards using STM32L151 as Main control MCU, including electric resistance partial pressure, hysteresis comparator, RTC chip and electronic switch, use in main control MCU D/A converter module, External interrupt module, IIC interfaces, serial ports 1, serial ports 2 and I/O port;Wherein electric resistance partial pressure is connected with analog-to-digital conversion can survey supplying cell Electricity;The connected detectable battery of electric resistance partial pressure, hysteresis comparator, external interrupt module crosses the state of putting, and I/O port correlates with electronic cutting Connect, data radio station board is connected with serial ports 2 and electronic switch respectively, and the RTC is connected with IIC interfaces, the transmission end data The serial ports 1 of transmitting device is connected with field inspection equipment, and serial ports 1 and the data of the receiving terminal data transmission device receive main frame Connection.
A kind of data transmission method based on said apparatus, step are as follows:
Selection-re-transmission ARQ acknowledgement mechanism, timeout mechanism and windowing mechanism is improved first, makes agreement that there is low space-time to answer The characteristics of miscellaneous degree, high-transmission efficiency, and reduce the re-transmission of unnecessary frame under event of data loss, in the wild the biography of long period There is more preferable low-power consumption performance in defeated interruption.
Then design the protocol boards using STM32 chips as core MCU, by selection-retransmission protocol after improvement on MCU it is real It is existing, realize the coupling with data radio station.Field inspection equipment is connected with serial ports in transmitting terminal protocol boards one end, one end is connected with serial ports Connect data radio station, by field equipment upload data transmitted after protocol encapsulation by data radio station, receiving terminal protocol boards one end with Serial ports connects data radio station one end and connects data receiver main frame with serial ports, and protocol boards extracts sight after reading data from data radio station Survey data for presentation data receiver main frame.
Power management function and working time management function are integrated with final agreement plate, can be realized in the operating condition Transmission, all peripheral hardware power supplies are cut off in the dormant state.Low power operation under the conditions of reinforcement transmitting device field unattended Stability.
Further, it is to use SACK thinkings, receiving terminal response that the acknowledgement mechanism of the improvement selection-re-transmission ARQ, which is improved, There is paid-in frame number in information entrained by frame in addition to having and expecting frame number;To shorten frame length, receiving terminal will receive It is divided into some continuous blocks to out of order frame, first frame number and the tail frame numbering of each continuous blocks is only recorded in SACK frames, transmission terminates to The frame between a continuous blocks is only sent after this acknowledgement frame.
The timeout mechanism of the improvement selection-re-transmission ARQ, which improves, to be referred to substitute former agreement using variable overtime duration mechanism Fixed-timeouts duration mechanism, overtime duration sets 0,1,2,3 four grade, and time-out time corresponding to each grade is respectively 5 minutes, 10 minutes, 30 minutes and 60 minutes, a length of 0 grade during protocol initializing time-out.If reaching time-out time in some grade, Then overtime grade improves therewith, and time-out time also extends therewith, if occurring being successfully received 4 responses in non-zero overtime grade Frame, overtime grade return to 0 grade.
The windowing mechanism of the improvement selection-re-transmission ARQ, which is improved, to be referred to substitute determining for former agreement using variable window mechanism Long windowing mechanism, design window initial size are 16, and when Retransmission timeout occurs, length of window die-offs as 1;It is in length of window A confirmation acknowledgement frame to new message segment, length of window+1, until returning to initial length are often received in the case of 1.
The integrated power management function of the protocol boards refer to using hysteresis comparator, electronic switch, MCU digital-to-analogue conversions and MCU external interrupts realize the control to data radio station power supply;Specially battery power voltage accesses sluggishness after utilizing electric resistance partial pressure Comparator and digital-to-analogue conversion;When battery electric quantity discharges and magnitude of voltage is less than hysteresis comparator lower threshold, hysteresis comparator MCU can be notified in the form of trailing edge, MCU Programmable detections to this trailing edge then control the power supply of electronic switch shut-off data radio station, Cut off communication link;When battery makes voltage be higher than hysteresis comparator upper limit threshold because of solar recharging, hysteresis comparator MCU can be notified in the form of rising edge, MCU Programmable detections then control electronic switch to open data radio station power supply to this rising;
The protocol boards integrates transmission time management function and refers to integrated clock chip, the special time period in every day Work;Current time is provided for single-chip microcomputer, be set in the RTC chip morning 10:00 produces interruption, and main control chip is in dormancy by this It is disconnected to wake up, open peripheral hardware and prepare transmission.Be set in the RTC chip afternoon 17:00 produces interruption, and main control chip is connected in this at work Disconnected, whether judgement is being transmitted now, is waited if in the transmission and is transmitted rear secondary dormancy;The dormancy immediately if without transmission.
The field inspection data transmission device workflow is as follows:
Battery electric quantity is all first detected on receiving terminal, transmitting terminal after electricity, current time is detected, if battery electric quantity is more than lower limit threshold Value and current time at work between 10:00 to 17:Within 00, then the environmental variance of initializtion protocol, is then opened in serial ports It is disconnected, into the wake-up to be interrupted such as sleep pattern;Transmitting terminal etc. it is to be interrupted including hysteresis loop comparator external interrupt, RTC chip then Alarm external interrupt, serial ports interruption, DMA interruptions, timer interruption, observation data receiver Interruption, radio station data receiver are determined When interrupt and send totally 8 kinds of overtime interrupt, receiving terminal etc. is to be interrupted including hysteresis loop comparator external interrupt, RTC chip to Times Alert external interrupt, serial ports interruption, timer interruption, totally 5 kinds of radio station data receiver Interruption.
Further, the receiving terminal, transmitting terminal external interrupt flow are as follows:
If the external interrupt of RTC chip triggering, show to have arrived or gone out operation window, the time reads and judged in master Flow is realized, is interrupted service function and is not done any operation, simply wakes up MCU;
If the external interrupt of comparator triggering, shows that the state of now battery changes, in order to detect battery Change is, it is necessary to overturn triggering mode in next step;
It is as follows that the transmitting terminal serial ports interrupts flow:
The serial ports 1 that field inspection equipment reported data can trigger transmitting terminal protocol boards interrupts, and it is first that serial ports 1 interrupts service function The interrupt start DMA of serial ports 1 is closed to receive field inspection data, then starts observation data receiver timer, regularly per 200ms Interrupt once, finally start and send overtime timer, be regularly delayed 5 minutes for the 1st grade;
The SACK frames that the order to field inspection equipment or receiving terminal that the data receiver main frame is sent are sent can be by Data radio station transmits, and the serial ports 2 of triggering transmitting terminal protocol boards interrupts, and serial ports 2, which interrupts service function, first closes the interrupt start of serial ports 2 DMA receives data radio station forward data, then activates to open data radio station data receiver timer, is regularly interrupted per 500ms Once;
The transmitting terminal timer interruption flow is as follows:
Observation data receiver timer then triggers interruption, if there is data in order caching, by every 255 bytes by number According to adding frame head and verification after segment and being packaged into data frame, open DMA and be sent to data radio station, remain less than 255 bytes Part wouldn't seal frame, but be also placed in frame buffer queue and be used as " incomplete frame ", wait new-comer after timer interruption next time Data fill up framing transmission again after 255 bytes, if not having data in order caching, show that this time no observation data have needed to pass It is defeated, then data receiver timer is first closed, serial ports 1 is opened and interrupts, presumable incomplete frame in frame buffer queue is sent, It will check whether retransmission queue is empty, if retransmission queue is not sky, first sends and retransmits team when sending data frame each time The data frame pointed in row;
Radio station data receiver timer then triggers interruption, if there is data in order caching, is split out using frame head SACK frames, the expectation frame number of SACK frames is taken out, will transmit failed frame if second of appearance of SACK is put into retransmission queue In retransmitted, according to SACK it is expected frame number renewal overtime timer value, renewal rule be:
It is corresponding that overtime timing value=current time in system (timer)-expectation numbered frame sends time+current overtime rank Time;
Frame number sliding window it is expected according to SACK and updates window size;
Send overtime timer and then trigger interruption, window size puts 1, up-regulation delay rank;
The transmitting terminal DMA interrupts flow and is described as follows:
If there are data in retransmission queue, DMA is transferred to send by first in first out data in retransmission queue, if retransmitting There is the frame do not sent out in queue no data and window, then send the frame;Particularly, if the frame do not sent out in window is incomplete frame, There are two kinds of possibility:First, scope also has data to transmit, should by observation next time data receiver timer interruption processing data Frame is filled;Another kind is that scope data transfer has been completed, the data frame that the remaining data segment less than 255 bytes is formed;Pin Incomplete frame is judged to observe whether data receiver timer closes, just representative observation data is closed and has passed, now can is straight Receive and send, otherwise just do not do any operation, wait the frame polishing.
It is as follows that the receiving terminal serial ports interrupts flow:
If there are data to send with the serial ports that data receiver main frame is connected, show data receiver main frame to field inspection equipment institute The order assigned, data length is shorter, directly data radio station can be transferred to send.
If the serial ports being connected with data radio station there are data to send, show that field inspection equipment is sending observation data, then The interruption of this serial ports is closed, DMA is opened and receives, and open data radio station data receiver timer;
The receiving terminal timer interruption flow is as follows:
If receiving queue is sky, then it is assumed that this transmission has terminated, Off Timer, opens the string being connected with data radio station Mouth interrupts;
If receiving queue is not sky, the data in queue are split out into data frame using frame head, taken out after verifying correctly Data frame number, if data frame number, which is less than, it is expected frame number, it is retransmitting data frame to illustrate this data frame, is lost after sending SACK frames Abandon the data frame;If data frame number, which is more than, it is expected frame number, illustrate that there is admission control centre, count this after sending SACK frames Buffer queue is inserted by number according to frame;If data frame number, which is equal to, it is expected frame number, DMA is transferred to send this frame data part Data receiver main frame is given, frame number it is expected in renewal.If there is the frame number stripping equal with frame number it is expected after renewal in buffer queue DMA, which is put into, from frame head is sent to data receiver main frame.
Further, data frame includes frame head, data and verification and three parts;Frame head includes frame identification, destination address, number According to length, frame type and the part of frame number five.Frame head mark uses 2 bytes, is 0xEE 0xEE.1 byte of destination address, From 0x00 to 0xFF.1 byte of data length, from 0x00-0xFF, represent 0-255 byte.The byte of frame type two, 01 represents Frame is data frame, and 10 expression frames are SACK frames, and 11 expression data receiver main frames issue the command frame of field inspection equipment.Frame number 14byte, 0-16383 frame number can be represented.
Further, transmitting terminal, receiving terminal are using circular linked list as buffer queue, and transmitting terminal have also been devised in addition Array is circulated as frame retransmission queue, wherein each item is the head pointer of frame for needing to retransmit in frame buffer queue.
Compared with prior art the advantage of the invention is that:Prior art only considers the low-power consumption of hardware system aspect not Together, the present invention after various reliability protocols implementation process are carefully analyzed, by low power dissipation design incorporate agreement improve in, then it is auxiliary it Power management in terms of hardware system, its advantage are that more can effectively reduce transmission power consumption than existing various schemes.
Compared with prior art stop-wait ARQ, the present invention uses cumulative acknowledgements in selection-re-transmission ARQ using data frame Mode significantly improves data throughout, improves communication efficiency.And compared with traditional selection-re-transmission ARQ agreements, the present invention is first led to Cross introducing SACK frames and replace former ACK frames, negatively direct affirmation mechanism changes into negative selection affirmation mechanism by its agreement, avoids It is continuous caused by LOF the problem of handling capacity rapid drawdown in window;The fixation overtime of former agreement is retransmitted again, fixed sliding window Mouth mechanism is changed to variable overtime re-transmission, varying glide window, can effectively reduce the number that data frame is sent when there is channel interruption Amount, so as to reach the purpose for saving power consumption.
In the software and hardware implementation process of agreement, devise the data structure to match with agreement and make full use of chip DMA technology, allow agreement functional using 24M clock frequencies completion institute.
Transmitting device daytime that the present invention is developed keeps work, and night enters dormancy, through surveying, device power consumption during dormancy Less than 200ua.Launch power consumption 750ma in data radio station, transmit daily under 10M data cases, 30ah batteries, the 10w sun can be used Energy plate realizes unattended automatic transmission, meets that field data transmits low-power consumption, small size, inexpensive demand.
Brief description of the drawings
Fig. 1 is prior art field inspection data data radio station communication reduction model structure schematic diagram of the present invention;
Fig. 2 is the communication reduction model that the integrated selection of prior art one of the present invention retransmits ARQ and data radio station transmitting device Structural representation;
Fig. 3 is the system flow chart of prior art one of the present invention;
Fig. 4 is that prior art two of the present invention selects-retransmitted ARQ agreement Working Examples figures;
Fig. 5 is that prior art two of the present invention selects-retransmitted ARQ agreement sliding window process schematics;
Fig. 6 is that prior art two of the present invention selects-retransmitted ARQ agreement serial number LOF process schematics;
Fig. 7 is SACK frame schematic diagrames of the embodiment of the present invention;
Fig. 8 is timeout mechanism flow chart of the embodiment of the present invention;
Fig. 9 is window change mechanism flow chart of the embodiment of the present invention;
Figure 10 is agreement workflow schematic diagram of the embodiment of the present invention;
Figure 11 is receiving terminal transmitting device functional frame composition of the embodiment of the present invention;
Figure 12 is transmitting terminal transmitting device functional frame composition of the embodiment of the present invention;
Figure 13 is data transmission device data frame design drawing of the embodiment of the present invention;
Figure 14 is frame data structure design drawing of the embodiment of the present invention;
Figure 15 is the main flow chart of transmitting terminal data transmission device of the embodiment of the present invention;
Figure 16 is the main flow chart of receiving terminal data transmission device of the embodiment of the present invention;
Figure 17 is receiving terminal of the embodiment of the present invention and transmitting terminal external interrupt flow chart;
Figure 18 is that transmitting terminal of embodiment of the present invention serial ports interrupts flow chart;
Figure 19 is transmitting terminal Interruption flow chart of the embodiment of the present invention;
Figure 20 is that transmitting terminal of embodiment of the present invention DMA interrupts flow chart;
Figure 21 is that receiving terminal of embodiment of the present invention serial ports interrupts flow chart;
Figure 22 is receiving terminal timer interruption flow chart of the embodiment of the present invention.
Embodiment
For the objects, technical solutions and advantages of the present invention are more clearly understood, develop simultaneously embodiment referring to the drawings, right The present invention is described in further details.
A kind of method of field inspection data transfer, step are as follows:
Selection-re-transmission ARQ acknowledgement mechanism, timeout mechanism and windowing mechanism is improved first, makes agreement that there is low space-time to answer The characteristics of miscellaneous degree, high-transmission efficiency, and reduce the re-transmission of unnecessary frame under event of data loss, in the wild the biography of long period There is more preferable low-power consumption performance in defeated interruption.
Then design the protocol boards using STM32 chips as core MCU, by selection-retransmission protocol after improvement on MCU it is real It is existing, realize and the coupling with data radio station.Field inspection equipment is connected with serial ports in transmitting terminal protocol boards one end, one end is with serial ports Data radio station is connected, field equipment upload data are transmitted after protocol encapsulation by data radio station, receiving terminal protocol boards one end Data radio station one end is connected with serial ports data receiver main frame is connected with serial ports, protocol boards extracts after reading data from data radio station Observe data for presentation data receiver main frame.
Power management function and working time management function are integrated with final agreement plate, can be realized in the operating condition Transmission, all peripheral hardware power supplies are cut off in the dormant state.Low power operation under the conditions of reinforcement transmitting device field unattended Stability.
The acknowledgement mechanism improvement of the improvement selection-re-transmission ARQ refers to that the present invention draws and designed and Implemented based on SACK's Response retransmission mechanism substitutes the ACK mechanism of former agreement.SACK (Selective Acknowledgment) is one of Transmission Control Protocol Expanded function option, it can make receiving terminal tell which message segment of transmitting terminal to lose, and which message segment retransmits, which message segment The information such as receive in advance, the message segment which really loses only is retransmitted according to these information transmitting terminal cans.The present invention uses SACK thinkings, also paid-in frame number is expected outside frame number except having in information entrained by receiving terminal acknowledgement frame.To shorten frame Length, receiving terminal will have been received by out of order frame and be divided into some continuous blocks, only recorded in SACK frames each continuous blocks first frame number and Tail frame is numbered, and schematic diagram is as shown in fig. 7, send the frame for terminating to after this acknowledgement frame and only sending between a continuous blocks.
The timeout mechanism of the improvement selection-re-transmission ARQ, which improves, refers to that the present invention is substituted using variable overtime duration mechanism The fixed-timeouts duration mechanism of former agreement.The present invention sets 0,1,2,3 four grade for overtime duration, corresponding to each grade Time-out time is respectively 5 minutes, 10 minutes, 30 minutes and 60 minutes, a length of 0 grade during protocol initializing time-out.If some etc. Level reach time-out time, then overtime grade improves therewith, and time-out time also extends therewith, if in non-zero overtime grade occur into Work(receives 4 acknowledgement frames, and overtime grade returns to 0 grade.Timeout mechanism flow chart is as shown in Figure 8.
The windowing mechanism of the improvement selection-re-transmission ARQ, which is improved, refers to that the present invention substitutes former association using variable window mechanism The fixed length windowing mechanism of view.In the present invention, design window initial size is 16, and when Retransmission timeout occurs, length of window die-offs For 1.A confirmation acknowledgement frame to new message segment, length of window+1, until recovering often are received in the case where length of window is 1 To initial length.Window change mechanism flow is as shown in Figure 9.
The integrated power management function of the protocol boards refer to using hysteresis comparator, electronic switch, MCU digital-to-analogue conversions and MCU external interrupts realize the control to data radio station power supply.Specific practice is to be accessed after battery power voltage utilizes electric resistance partial pressure Hysteresis comparator and digital-to-analogue conversion.When battery electric quantity discharges and magnitude of voltage is less than hysteresis comparator lower threshold, sluggish ratio MCU can be notified in the form of trailing edge compared with device, MCU Programmable detections to this trailing edge then control the confession of electronic switch shut-off data radio station Electricity, that is, cut off communication link.When battery makes voltage be higher than hysteresis comparator upper limit threshold because of solar recharging, sluggishness is relatively Device can notify MCU in the form of rising edge, and MCU Programmable detections then control electronic switch to open data radio station power supply to this rising.This Kind design can effectively manage battery charging and discharging, improve battery charge efficiency, while avoid battery from being brought because of over-discharge Battery capacity loss problem.The stability and reliability to be worked automatically in the case of intensifier field unattended.It is above-mentioned to set It is to prevent battery from being shaken at a certain threshold value to determine bound threshold value, is the common technology hand in current solar charging/discharging field Section.
The protocol boards integrates transmission time management function and refers to integrated clock chip, the special time period in every day Work.The present invention integrates DS3231 clock RTC chips on protocol boards, and current time is provided for single-chip microcomputer.Set on RTC chip Noon 10:00 produces interruption, and main control chip is waken up in dormancy by this interruption, opens peripheral hardware and prepares transmission.RTC chip afternoon is set 17:00 produces interruption, and main control chip is connected to this interruption at work, and whether judgement is being transmitted now, if in the transmission etc. Secondary dormancy after the completion of to be transmitted;The dormancy immediately if without transmission.
As shown in Figure 11,12, a kind of device of field inspection data transfer, including the data transfer of transmitting terminal and receiving terminal Device, the data transmission device of the transmitting terminal and receiving terminal all conduct electricity platen card two parts including protocol boards sum, protocol boards Using STM32L151 as main control MCU, including electric resistance partial pressure, hysteresis comparator, RTC chip and electronic switch etc., main control MCU is interior to be used To peripheral resources such as D/A converter module, external interrupt module, IIC interfaces, serial ports and I/O ports.Wherein electric resistance partial pressure turns with modulus Commutation even can survey supplying cell electricity.The connected detectable battery of electric resistance partial pressure, hysteresis comparator, external interrupt module, which is crossed, puts shape State, I/O port are connected with electronic switch, and data radio station board is connected with serial ports 2 and electronic switch respectively, the RTC and IIC interfaces Connection, the serial ports 1 of the transmitting terminal data transmission device are connected with field inspection equipment, the receiving terminal data transmission device Serial ports 1 receives main frame with data and is connected.
Frame design of the present invention is as shown in figure 13.Data frame includes frame head, data and verification and three parts.Frame head includes frame mark Know, destination address, data length, frame type and the part of frame number five.Frame head mark uses 2 bytes, is 0xEE 0xEE.Mesh The byte of address 1 is marked, from 0x00 to 0xFF.1 byte of data length, from 0x00-0xFF, represent 0-255 byte.Frame type Two byte, 01 expression frame are data frame, and 10 expression frames are SACK frames, and 11 expression data receiver main frames issue field inspection equipment Command frame.Frame number 14byte, 0-16383 frame number can be represented.
Frame buffer data structure of the present invention is as shown in figure 14.Transmitting terminal, receiving terminal are using circular linked list as caching Queue.In addition transmitting terminal have also been devised circulation array as frame retransmission queue, wherein each item is that weight is needed in frame buffer queue The head pointer of the frame of biography.
As shown in Figure 15,16, the workflow based on said apparatus is as follows:
Battery electric quantity is all first detected on receiving terminal, transmitting terminal after electricity, detects current time.If battery electric quantity is more than lower limit threshold Value and current time at work between 10:00 to 17:Within 00, then the environmental variance of initializtion protocol, including the machine address, this Machine address mask etc., then open serial ports and interrupt, into the wake-up to be interrupted such as sleep pattern.Transmitting terminal etc. is to be interrupted including hysteresis Comparator external interrupt, RTC chip to alarm external interrupt, serial ports interruption, DMA interruptions, timer interruption, observation data connect Receive Interruption, radio station data receiver Interruption and send totally 8 kinds of overtime interrupt.Receiving terminal etc. is to be interrupted to be compared including hysteresis Device external interrupt, RTC chip to alarm external interrupt, serial ports interruption, timer interruption, radio station data receiver Interruption are total to 5 kinds.
As shown in figure 17, receiving terminal, transmitting terminal external interrupt flow are described as follows:
(1) if the external interrupt of RTC chip triggering, show to have arrived or gone out operation window, the time reads and judged Realized in main flow, interrupt service function and do not do any operation, simply wake up MCU.
(2) if the external interrupt of comparator triggering, shows that the state of now battery changes, in order to detect battery Next step change, it is necessary to overturn triggering mode.
As shown in figure 18, transmitting terminal serial ports interrupts flow and is described as follows:
(1) field inspection equipment reported data can trigger the serial ports 1 of transmitting terminal protocol boards and interrupt.Serial ports 1 interrupts service letter Number first closes the interrupt start DMA of serial ports 1 to receive field inspection data.Then observation data receiver timer is started, regularly often 200ms is interrupted once.Finally start and send overtime timer, be regularly delayed 5 minutes for the 1st grade.
(2) the SACK frames that the order to field inspection equipment or receiving terminal that data receiver main frame is sent are sent can be by counting The platform that conducts electricity transmits, and the serial ports 2 of triggering transmitting terminal protocol boards interrupts.Serial ports 2, which interrupts service function, first closes the interrupt start of serial ports 2 DMA receives data radio station forward data, then activates to open data radio station data receiver timer, is regularly interrupted per 500ms Once.
As shown in figure 19, transmitting terminal timer interruption flow is described as follows:
(1) observation data receiver timer then triggers interruption, if there is data in order caching, by every 255 bytes Frame head and verification will be added after data segment and is packaged into data frame, DMA is opened and is sent to data radio station.Remain less than 255 words The part of section wouldn't seal frame, but be also placed in frame buffer queue and be used as " incomplete frame ", wait next time new after timer interruption The data come fill up framing transmission again after 255 bytes.If there is no data in order caching, show this time to have needed without observation data Transmit, then first close data receiver timer, open serial ports 1 and interrupt, presumable incomplete frame in frame buffer queue is sent Go out.It will check whether retransmission queue is empty, if retransmission queue is not sky, first sends weight when sending data frame each time Pass the data frame pointed in queue.
(2) data receiver timer in radio station then triggers interruption, if there is data in order caching, is split out using frame head SACK frames, the expectation frame number of SACK frames is taken out, will transmit failed frame if second of appearance of SACK is put into retransmission queue In retransmitted.The value of frame number renewal overtime timer it is expected according to SACK, renewal rule is:
It is corresponding that overtime timing value=current time in system (timer)-expectation numbered frame sends time+current overtime rank Time;
Frame number sliding window it is expected according to SACK and updates window size.
(3) send overtime timer and then trigger interruption, window size puts 1, up-regulation delay rank.
As shown in figure 20, transmitting terminal DMA interrupts flow and is described as follows:
If there are data in retransmission queue, DMA is transferred to send by first in first out data in retransmission queue.If retransmit There is the frame do not sent out in queue no data and window, then send the frame.Particularly, if the frame do not sent out in window is incomplete frame, There are two kinds of possibility:First, scope also has data to transmit, should by observation next time data receiver timer interruption processing data Frame is filled;Another kind is that scope data transfer has been completed, the data frame that the remaining data segment less than 255 bytes is formed.Pin Incomplete frame is judged to observe whether data receiver timer closes, just representative observation data is closed and has passed, now can is straight Receive and send, otherwise just do not do any operation, wait the frame polishing.
As shown in figure 21, receiving terminal serial ports interrupts flow and is described as follows:
(1) if there are data to send with the serial ports that data receiver main frame is connected, show that data receiver main frame is set to field inspection The standby order assigned, data length is shorter, directly data radio station can be transferred to send.
(2) if the serial ports being connected with data radio station there are data to send, show that field inspection equipment is sending observation data, The interruption of this serial ports is then closed, DMA is opened and receives, and open data radio station data receiver timer.
As shown in figure 22, receiving terminal timer interruption flow is described as follows:
(1) if receiving queue is sky, then it is assumed that this transmission has terminated, Off Timer, and opening is connected with data radio station Serial ports interrupt.
(2) if receiving queue is not sky, the data in queue are split out into data frame using frame head.Taken after verification is correct Go out data frame number, if data frame number, which is less than, it is expected frame number, it is retransmitting data frame to illustrate this data frame, after sending SACK frames Abandon the data frame.If data frame number, which is more than, it is expected frame number, illustrate among have an admission control, by this after transmission SACK frames Data frame inserts buffer queue by number.If data frame number, which is equal to, it is expected frame number, DMA is transferred to send out this frame data part Data receiver main frame is given, frame number it is expected in renewal.If there is frame number in buffer queue and it is expected that frame number is equal after renewal Stripping frame head is put into DMA and is sent to data receiver main frame.
One of ordinary skill in the art will be appreciated that embodiment described here is to aid in reader and understands this hair Bright implementation, it should be understood that protection scope of the present invention is not limited to such especially statement and embodiment.Ability The those of ordinary skill in domain can be made according to these technical inspirations disclosed by the invention it is various do not depart from essence of the invention its Its various specific deformations and combination, these deformations and combination are still within the scope of the present invention.

Claims (7)

  1. A kind of 1. device of field inspection data transfer, it is characterised in that:Data transmission device including transmitting terminal and receiving terminal; The data transmission device of the transmitting terminal and receiving terminal all conducts electricity platen card two parts including protocol boards sum, and protocol boards includes master MCU, electric resistance partial pressure, hysteresis comparator, RTC chip and electronic switch are controlled, is provided with main control MCU in D/A converter module, outside Disconnected module, IIC interfaces, serial ports 1, serial ports 2 and I/O port;Wherein electric resistance partial pressure is connected with analog-to-digital conversion can survey supplying cell electricity; The connected detectable battery of electric resistance partial pressure, hysteresis comparator, external interrupt module crosses the state of putting, and I/O port is connected with electronic switch, number The platen card that conducts electricity is connected with serial ports 2 and electronic switch respectively, and the RTC is connected with IIC interfaces, the transmitting terminal data transfer dress The serial ports 1 put is connected with field inspection equipment, and the serial ports 1 of the receiving terminal data transmission device receives main frame with data and is connected.
  2. A kind of 2. data transmission method of the device of field inspection data transfer according to claim 1, it is characterised in that Step is as follows:
    First improve selection-re-transmission ARQ acknowledgement mechanism, timeout mechanism and windowing mechanism, make agreement have low Space-time Complexity, The characteristics of high-transmission efficiency, and reduce the re-transmission of unnecessary frame under event of data loss, in the wild in the transmission of long period There is more preferable low-power consumption performance in disconnected;
    Then the protocol boards using STM32 chips as core MCU is designed, selection-retransmission protocol after improvement is realized on MCU, Realize the coupling with data radio station;Field inspection equipment is connected with serial ports in transmitting terminal protocol boards one end, one end is connected with serial ports Data radio station, field equipment upload data are transmitted after protocol encapsulation by data radio station, receiving terminal protocol boards one end is to go here and there Mouth connection data radio station one end connects data receiver main frame with serial ports, and protocol boards extracts observation after reading data from data radio station Data for presentation data receiver main frame;
    Power management function and working time management function are integrated with final agreement plate, biography can be realized in the operating condition It is defeated, all peripheral hardware power supplies are cut off in the dormant state;Low power operation is steady under the conditions of reinforcement transmitting device field unattended It is qualitative.
  3. 3. data transmission method according to claim 2, it is characterised in that:The answering machine of the improvement selection-re-transmission ARQ Improvement processed is to use SACK thinkings, also has paid-in frame to compile in addition to having and expecting frame number in information entrained by receiving terminal acknowledgement frame Number;To shorten frame length, receiving terminal will have been received by out of order frame and be divided into some continuous blocks, and each continuous blocks are only recorded in SACK frames First frame number and tail frame numbering, send the frame for terminating to after this acknowledgement frame and only sending between a continuous blocks;
    The timeout mechanism of the improvement selection-re-transmission ARQ, which improves, to be referred to substitute consolidating for former agreement using variable overtime duration mechanism Fixed overtime duration mechanism, overtime duration set 0,1,2,3 four grade, and time-out time corresponding to each grade is respectively 5 points Clock, 10 minutes, 30 minutes and 60 minutes, a length of 0 grade during protocol initializing time-out;If reaching time-out time in some grade, Overtime grade improves therewith, and time-out time also extends therewith, if occurring being successfully received 4 acknowledgement frames in non-zero overtime grade, Overtime grade returns to 0 grade;
    The windowing mechanism of the improvement selection-re-transmission ARQ improves the fixed length window for referring to that former agreement is substituted using variable window mechanism Mouth mechanism, design window initial size are 16, and when Retransmission timeout occurs, length of window die-offs as 1;It is 1 in length of window In the case of often receive a confirmation acknowledgement frame to new message segment, length of window+1, until returning to initial length;
    The integrated power management function of the protocol boards refers to utilize hysteresis comparator, electronic switch, MCU digital-to-analogue conversions and MCU External interrupt realizes the control to data radio station power supply;Specially battery power voltage accesses sluggish compare after utilizing electric resistance partial pressure Device and digital-to-analogue conversion;When battery electric quantity discharges when magnitude of voltage is less than hysteresis comparator lower threshold, hysteresis comparator can be with Trailing edge form notifies MCU, and MCU Programmable detections to this trailing edge then control the power supply of electronic switch shut-off data radio station, that is, cut Disconnected communication link;When battery makes voltage be higher than hysteresis comparator upper limit threshold because of solar recharging, hysteresis comparator can be with Rising edge form notifies MCU, and MCU Programmable detections then control electronic switch to open data radio station power supply to this rising;
    The protocol boards integrates transmission time management function and refers to integrated clock chip, the special time period work in every day Make;Current time is provided for single-chip microcomputer, be set in the RTC chip morning 10:00 produces interruption, and main control chip is interrupted in dormancy by this Wake up, open peripheral hardware and prepare transmission;Be set in the RTC chip afternoon 17:00 produces interruption, and main control chip is connected in this at work Disconnected, whether judgement is being transmitted now, is waited if in the transmission and is transmitted rear secondary dormancy;The dormancy immediately if without transmission.
  4. A kind of 4. method of work of the device of field inspection data transfer according to claim 1, it is characterised in that including Following flow:
    All first detect battery electric quantity on receiving terminal, transmitting terminal after electricity, detect current time, if battery electric quantity be more than lower threshold and Current time at work between 10:00 to 17:Within 00, then the environmental variance of initializtion protocol, then opens serial ports and interrupts, enter Entering sleep pattern waits interruption to wake up;Transmitting terminal etc. it is to be interrupted including hysteresis loop comparator external interrupt, RTC chip to alarm outside Portion's interruption, serial ports interruption, DMA interruptions, timer interruption, observation data receiver Interruption, radio station data receiver Interruption With send totally 8 kinds of overtime interrupt, receiving terminal etc. it is to be interrupted including hysteresis loop comparator external interrupt, RTC chip to alarm outside Interruption, serial ports interruption, timer interruption, totally 5 kinds of radio station data receiver Interruption.
  5. 5. method of work according to claim 4, it is characterised in that:
    The receiving terminal, transmitting terminal external interrupt flow are as follows:
    If the external interrupt of RTC chip triggering, show to have arrived or gone out operation window, the time reads and judged in main flow Realize, interrupt service function and do not do any operation, simply wake up MCU;
    If the external interrupt of comparator triggering, shows that the state of now battery changes, in order to detect the next of battery Step change is, it is necessary to overturn triggering mode;
    It is as follows that the transmitting terminal serial ports interrupts flow:
    The serial ports 1 that field inspection equipment reported data can trigger transmitting terminal protocol boards interrupts, and serial ports 1, which interrupts service function, first closes Serial ports 1 interrupt start DMA receives field inspection data, then starts observation data receiver timer, is regularly interrupted per 200ms Once, finally start and send overtime timer, be regularly delayed 5 minutes for the 1st grade;
    The SACK frames that the order to field inspection equipment or receiving terminal that the data receiver main frame is sent are sent can be passed by number Radio station is transmitted, and the serial ports 2 of triggering transmitting terminal protocol boards interrupts, and serial ports 2, which interrupts service function, first closes the interrupt start DMA of serial ports 2 To receive data radio station forward data, data radio station data receiver timer is then activated to open, one is regularly interrupted per 500ms It is secondary;
    The transmitting terminal timer interruption flow is as follows:
    Observation data receiver timer then triggers interruption, if there is data in order caching, cuts data by every 255 bytes Frame head and verification are added after section and is packaged into data frame, DMA is opened and is sent to data radio station, remain the part less than 255 bytes Frame wouldn't be sealed, but is also placed in frame buffer queue and is used as " incomplete frame ", waits new data after timer interruption next time Framing transmission again after 255 bytes is filled up, if not having data in order caching, shows that this time no observation data have needed to transmit, Data receiver timer is then first closed, serial ports 1 is opened and interrupts, presumable incomplete frame in frame buffer queue is sent, It will check whether retransmission queue is empty, if retransmission queue is not sky, first sends retransmission queue when sending data frame each time In the data frame that points to;
    Radio station data receiver timer then triggers interruption, if there is data in order caching, SACK frames are split out using frame head, The expectation frame number of SACK frames is taken out, failed frame will be transmitted if SACK second occurs and be put into retransmission queue carrying out weight Pass, the value of frame number renewal overtime timer it is expected according to SACK, renewal rule is:
    Overtime timing value=current time in system (timer)-expectation numbered frame send time+current overtime rank to it is corresponding when Between;
    Frame number sliding window it is expected according to SACK and updates window size;
    Send overtime timer and then trigger interruption, window size puts 1, up-regulation delay rank;
    The transmitting terminal DMA interrupts flow and is described as follows:
    If there are data in retransmission queue, DMA is transferred to send by first in first out data in retransmission queue, if retransmission queue There is the frame do not sent out in no data and window, then send the frame;Particularly, if the frame do not sent out in window is incomplete frame, there is two Kind may:First, scope also has data to transmit, the frame is mended by observation next time data receiver timer interruption processing data On;Another kind is that scope data transfer has been completed, the data frame that the remaining data segment less than 255 bytes is formed;For residual Lack frame to judge to observe whether data receiver timer closes, close just representative observation data and passed, now can is directly sent out Send, otherwise just do not do any operation, wait the frame polishing;
    It is as follows that the receiving terminal serial ports interrupts flow:
    If there are data to send with the serial ports that data receiver main frame is connected, show that data receiver main frame is assigned to field inspection equipment Order, data length is shorter, directly data radio station can be transferred to send;
    If the serial ports being connected with data radio station there are data to send, show that field inspection equipment is sending observation data, then close This serial ports interrupts, and opens DMA and receives, and opens data radio station data receiver timer;
    The receiving terminal timer interruption flow is as follows:
    If receiving queue is sky, then it is assumed that this transmission has terminated, Off Timer, opens in the serial ports being connected with data radio station It is disconnected;
    If receiving queue is not sky, the data in queue are split out into data frame using frame head, data are taken out after verifying correctly Frame number, if data frame number, which is less than, it is expected frame number, it is retransmitting data frame to illustrate this data frame, and discarding should after sending SACK frames Data frame;If data frame number, which is more than, it is expected frame number, illustrate among have an admission control, by this data frame after transmission SACK frames Buffer queue is inserted by number;If data frame number, which is equal to, it is expected frame number, DMA is transferred to be sent to number this frame data part According to Receiving Host, frame number it is expected in renewal;If there is the frame number stripping frame equal with frame number it is expected after renewal in buffer queue Head is put into DMA and is sent to data receiver main frame.
  6. 6. method of work according to claim 5, it is characterised in that:Data frame includes:Frame head, data and verification;Frame head Including:Frame identification, destination address, data length, frame type and the part of frame number five;Frame head mark uses 2 bytes, is 0xEE 0xEE;1 byte of destination address, from 0x00 to 0xFF;1 byte of data length, from 0x00-0xFF, represent 0-255 word Section;The byte of frame type two, 01 expression frame are data frame, and 10 expression frames are SACK frames, and 11 expression data receiver main frames issue field The command frame of scope, frame number 14byte.
  7. 7. method of work according to claim 6, it is characterised in that:Transmitting terminal, receiving terminal are made using circular linked list For buffer queue, transmitting terminal, which have also been devised, in addition circulates array as frame retransmission queue, wherein each item is in frame buffer queue Need the head pointer of frame retransmitted.
CN201710979907.0A 2017-10-19 2017-10-19 A kind of method and apparatus of field inspection data transfer Pending CN107769901A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710979907.0A CN107769901A (en) 2017-10-19 2017-10-19 A kind of method and apparatus of field inspection data transfer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710979907.0A CN107769901A (en) 2017-10-19 2017-10-19 A kind of method and apparatus of field inspection data transfer

Publications (1)

Publication Number Publication Date
CN107769901A true CN107769901A (en) 2018-03-06

Family

ID=61269067

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710979907.0A Pending CN107769901A (en) 2017-10-19 2017-10-19 A kind of method and apparatus of field inspection data transfer

Country Status (1)

Country Link
CN (1) CN107769901A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109448349A (en) * 2018-11-22 2019-03-08 广州南湾信息科技有限公司 A kind of hydrological telemetering equipment
CN110299972A (en) * 2018-03-23 2019-10-01 天地融科技股份有限公司 A kind of data transmission method for uplink and device
CN110324234A (en) * 2019-05-24 2019-10-11 四川航天燎原科技有限公司 A kind of field trial multi-party communication system and communication means
CN115292398A (en) * 2022-08-02 2022-11-04 中国自然资源航空物探遥感中心 Data format conversion method and device, electronic equipment and storage medium
CN115361103A (en) * 2022-08-18 2022-11-18 陈冠宇 Buffer management mechanism for select-repeat hybrid automatic repeat request protocol

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1797379A (en) * 2004-12-24 2006-07-05 华为技术有限公司 Method of data transmission by using mode of direct memory access
CN1920893A (en) * 2005-09-23 2007-02-28 北京经纬信息技术公司 low-power consumption earth temperature automatic detection device and method thereof
WO2009158195A2 (en) * 2008-06-25 2009-12-30 Intel Corporation Techniques using a hop-by-hop approach for automatic repeat request (arq) in wireless relay networks
CN101925160A (en) * 2009-06-11 2010-12-22 上海易狄欧电子科技有限公司 Wireless data transceiving method and system
CN102684854A (en) * 2011-03-07 2012-09-19 北京邮电大学 Self-adaptive adjustment method of ARQ (automatic repeat request) parameter of MAC (media access control) layer
CN102790913A (en) * 2012-07-03 2012-11-21 深圳市时代经纬科技有限公司 Audio/video transmission method on basis of 3G network
CN204228820U (en) * 2014-11-06 2015-03-25 南京世都科技有限公司 A kind of remote phase place real-time detection apparatus

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1797379A (en) * 2004-12-24 2006-07-05 华为技术有限公司 Method of data transmission by using mode of direct memory access
CN1920893A (en) * 2005-09-23 2007-02-28 北京经纬信息技术公司 low-power consumption earth temperature automatic detection device and method thereof
WO2009158195A2 (en) * 2008-06-25 2009-12-30 Intel Corporation Techniques using a hop-by-hop approach for automatic repeat request (arq) in wireless relay networks
CN101925160A (en) * 2009-06-11 2010-12-22 上海易狄欧电子科技有限公司 Wireless data transceiving method and system
CN102684854A (en) * 2011-03-07 2012-09-19 北京邮电大学 Self-adaptive adjustment method of ARQ (automatic repeat request) parameter of MAC (media access control) layer
CN102790913A (en) * 2012-07-03 2012-11-21 深圳市时代经纬科技有限公司 Audio/video transmission method on basis of 3G network
CN204228820U (en) * 2014-11-06 2015-03-25 南京世都科技有限公司 A kind of remote phase place real-time detection apparatus

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110299972A (en) * 2018-03-23 2019-10-01 天地融科技股份有限公司 A kind of data transmission method for uplink and device
CN109448349A (en) * 2018-11-22 2019-03-08 广州南湾信息科技有限公司 A kind of hydrological telemetering equipment
CN110324234A (en) * 2019-05-24 2019-10-11 四川航天燎原科技有限公司 A kind of field trial multi-party communication system and communication means
CN110324234B (en) * 2019-05-24 2022-01-04 四川航天燎原科技有限公司 Outfield test multiparty communication system and communication method
CN115292398A (en) * 2022-08-02 2022-11-04 中国自然资源航空物探遥感中心 Data format conversion method and device, electronic equipment and storage medium
CN115361103A (en) * 2022-08-18 2022-11-18 陈冠宇 Buffer management mechanism for select-repeat hybrid automatic repeat request protocol

Similar Documents

Publication Publication Date Title
CN107769901A (en) A kind of method and apparatus of field inspection data transfer
CN102194309B (en) Low-voltage power line broadband carrier concentrator
CN101354829B (en) Satellite telemetering data transmission method
CN101621368B (en) Method, device and system for retransmitting data packet
CN101833802B (en) Large real-time wireless networking door control system powered by dry battery
CN101047484B (en) Transmission layer retransmission method and system
CN105573810A (en) Remote upgrade method and remote upgrade device for wireless sensor network node
EP0871306A3 (en) Method and system for evaluating network performance
WO2007078156A3 (en) Transmitting data in a mobile communication system
CN101835248B (en) Device and method for turning off bluetooth module
CN107451268A (en) A kind of method that suspension towards real-time data base resumes
CN205489696U (en) High in clouds remote control electric automobile fills power plant system
CN1339131A (en) Method enabling communications between an electronic device and a battery, an apparatus comprising an electronic device and a battery, and a battery enabling communication
CN106332248B (en) Low-power-consumption meter reading method and system
CN103837197B (en) A kind of continual humiture observation system and method
CN103517318A (en) Data sending method, device and system
CN109150669B (en) Remote communication system using operation and maintenance and operation and maintenance debugging method
CN101447124B (en) Low power consumption remote wireless meter-reading module
CN103067895B (en) The repeating method of long SMS and communication terminal
CN103404204A (en) Data sending method, device and system
CN201000348Y (en) Wireless intelligent gas meter
CN104602265B (en) Measured message sending method and device in a kind of RTT measurement and positionings system
CN111600785A (en) M-BUS intelligent water meter low-power-consumption communication method
CN2739728Y (en) Automatic meter-reading system
CN201004266Y (en) Wireless IC card intelligent water meter

Legal Events

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

Application publication date: 20180306

RJ01 Rejection of invention patent application after publication