Summary of the invention
Goal of the invention: being directed to the above-mentioned prior art, proposes a kind of RTU reliable data transmission control of narrowband nonsymmetric channelMethod guarantees the efficiency of transmission and reliability of narrowband nonsymmetric channel in RTU data transmission procedure.
Technical solution: a kind of RTU reliable data transmission control method of narrowband nonsymmetric channel includes the following steps:
Step (1), configuration data sending strategy parameter: storing data for sending in buffer area, setting, which executes, sends behaviourMake the trigger condition on opportunity, the trigger condition includes that definite value storage transmission and timing storage are sent;
The definite value storage is sent are as follows: the first counter of setting, count value are the message of hydrographic water resource measured dataNumber, the message number come from single or multiple data acquisition units, and the threshold value of first counter is big according to buffer areaIt is small to be configured, it is executed when count value reaches the preset threshold of the first counter and sends operation;
The timing storage is sent are as follows: the second counter of setting is timer, is wanted when reaching hydrographic water resource monitoring businessIt is executed when the real-time report time asked and sends operation;Wherein, the real-time report time of business need is monitored according to hydrographic water resource,The threshold value of second counter is one or more;
Step (2), the priority and its correlation that setting sending strategy executes: the environment being arranged according to RTU works as dataWhen data are reached transmission buffer area according to the preset time interval by acquisition unit, pre-selects individual data message and send mouldFormula or definite value storage are sent and timing storage sends matching model;
The individual data message sending mode are as follows: just sent immediately when there is data to reach transmission buffer area;
Definite value storage is sent and timing storage sends matching model are as follows: when there is the data message of multiple acquisition units sameWhen reach send buffer area when, if second counter reach threshold value if immediately by buffer area data all send, if instituteIt states the second counter and does not reach threshold value, when temporal data message number reaches first counter threshold in pending buffer area,Transmission operation is executed again;
Step (3) sets and has sent the delay waiting time: defining response threshold value over time limit as Tout, sent delay and waitedTime restriction threshold value is Twai;When having sent a data, start response timer, as practical response time tr<Tout, expression system be normally received other side feedback it is correct confirm or error confirmation information;As practical response time tr≥Tout, indicate response time-out, then log-on data mends biography automatically;
Delay waiting time T' is sentwaiDynamic is adjusted to T'wai=Twai+2αTout, α is adjustment factor, is taken as the following formulaValue:
Wherein, k indicates that response timeout datum is mended automatically and passes number, if response timeout datum mends biography automatically, number is more than 3 timesThen α value is taken by 3 times;ToutValue using TCP self-contained time window adjustment algorithm adjustment;
Step (4), data mend transmission control system automatically: data are transferred to after sending and repay buffer area by single data, if systemThe error confirmation information or response time-out for receiving other side's feedback, then sent delay waiting time T' describedwaiAfter arrival againSend data;Setting data are mended automatically passes frequency threshold value, stops retransmission Data Concurrent after reaching threshold value and goes out warning message;System removes the data repaid in buffer area after receiving the correct confirmation message that other side feeds back.
The utility model has the advantages that the present invention is by " definite value storage is sent ", adjustment sends packet size;It " is periodically deposited by settingStorage is sent " and change " having sent the delay waiting time ", it adjusts and sends interval, control transmission rate, " data are mended automatically for cooperationPass " mechanism, guarantee the efficiency of transmission and reliability of narrowband nonsymmetric channel.In this method, higher uplink bit rate is according to realityWhen situation change, may be implemented specific data it is timely send, specific data is not regularly sent, to adapt to regimen variationWhen business rule.Since the bandwidth of RTU Transmission system arranged at present is limited, in data loading error occurring, this methodBy adjusting the interval time of each autonomous retransmission reduction transmission rate, situations such as blocking with this adaptive channel;In addition, may be used alsoWith by adjusting packet size, transmission interval and sending times, i.e. communication module can be according to the communication condition dynamic at sceneData Transmission Controlling parameter is adjusted to control transmission rate, so as to support the asymmetrical communication environment in scene.With the partyMethod can be successfully transmitted data by control RTU in the case where the message that happens suddenly increases, enhance the control ability of RTU communication protocol.
Specific embodiment
Further explanation is done to the present invention with reference to the accompanying drawing.
A kind of RTU reliable data transmission control method of narrowband nonsymmetric channel, narrowband nonsymmetric channel can be commonShortwave, ultrashort wave, GPRS and PSTN, the specific steps are as follows:
Step (1), configuration data sending strategy parameter: storing data for sending in buffer area, setting, which executes, sends behaviourMake the trigger condition on opportunity, trigger condition includes that definite value storage transmission and timing storage are sent.The business of data is acquired according to RTUIt is required that a kind of strategy can be specified when initiation parameter configures.
Definite value storage is sent are as follows: and the first counter of setting, count value are the message number of hydrographic water resource measured data,Message number comes from single or multiple data acquisition units.Hydrographic water resource message format is referring to professional standard, for multipurposeRTU needs the needs of meeting a variety of hydrographic water resource data while reaching, transmitting together.The present invention and character type control protocolIt is consistent, is used as counter using a byte (8), virtual value is 1~255;The threshold value of first counter is according to bufferingArea's size is configured, and is executed when count value reaches the preset threshold of the first counter and is sent operation.
Timing storage is sent are as follows: the second counter of setting is timer indicator, is matched with system clock, when arrival waterIt is executed when the real-time report time of Wenshui monitoring resource business need and sends operation, such as report, least bit report and encryption on schedule per hourReport etc., encryption report are to increase in flood season to observe and predict concentration, such as every 10 minutes.Wherein, business need is monitored according to hydrographic water resourceThe real-time report time, the threshold value of the second counter is one or more, the present invention using one byte (8) as counting whenDevice, virtual value are 1~255, and unit is minute.High two instructions: 00- not timing, 01- are reported on schedule per hour, 10- least bit report,11- encryption report;Low 6 instructions encryption report relative spacing minute value.
Step (2), the priority and its correlation that setting sending strategy executes: the environment being arranged according to RTU works as dataWhen data are reached transmission buffer area according to the preset time interval by acquisition unit, pre-selects individual data message and send mouldFormula or definite value storage are sent and timing storage sends matching model.
Individual data message sending mode are as follows: just sent immediately when there is data to reach transmission buffer area.This mode is simpleIt is easy, but do not adapt to early warning, a RTU to a multisensor simultaneously data report and submit situations such as.
Definite value storage is sent and timing storage sends matching model are as follows: when the data message for having multiple acquisition units while being arrivedUp to when sending buffer area, data in buffer area are all sent immediately if the second counter reaches threshold value, if the second counterThreshold value is not reached, when temporal data message number reaches first counter threshold in pending buffer area, then executes transmission behaviourMake, i.e., arrives first the principle starting first carried out according to " definite value " and " timing " threshold value and send.
Step (3), for reliable data transmission, using the connection-oriented transmission control technology of TCP, in a dataBlock will wait the confirmation message of recipient after sending.Since narrowband wireless signal-path band width is low, RTU is allowed for according to actual channelBandwidth adjustment transmission rate.The size of usual transmission rate can be controlled by means of sending the size at interval, i.e., between transmission dataLonger every the time, average transmission rate is lower.The present invention has sent the delay waiting time by setting, adjusts transmission rate, toolBody are as follows:
Definition response threshold value over time limit is Tout, having sent delay waiting time threshold limit is Twai.A number is sentAccording to when, start response timer, as practical response time tr<Tout, expression system be normally received other side feedback justConfirmation or error confirmation information;As practical response time tr≥Tout, indicate response time-out, do not receive other side's feedbackAny confirmation message, then log-on data mends biography automatically.
Delay waiting time T' is sentwaiDynamic is adjusted to T'wai=Twai+2αTout, α is adjustment factor, is taken as the following formulaValue:
Wherein, k indicates that response timeout datum is mended automatically and passes number, if response timeout datum mends biography automatically, number is more than 3 timesThen α value is taken by 3 times.T'waiAnd ToutIt is relative time, in seconds;The timer threshold T that timing storage is sentperIt is absoluteTime, when shaped like xx: xx points, making for 24 hours.ToutIt can also be adjusted according to the case where response message, TCP can be used certainly in valueThe time window adjustment algorithm adjustment for including.
Step (4), data mend transmission control system automatically: data are transferred to after sending and repay buffer area by single data, if systemThe error confirmation information or response time-out for receiving other side's feedback, then sending delay waiting time T'waiIt is retransmitted after arrivalData.It is not all that can be solved by weight method, as channel-failures, recipient are soft in view of causing the reason of sending failure very muchPart or equipment fault etc., therefore set data and mend biography frequency threshold value automatically, stop retransmission Data Concurrent after reaching threshold value and goes outWarning message, report upper layer software (applications) processing.System removes the number repaid in buffer area after receiving the correct confirmation message that other side feeds backAccording to.
Fig. 1 is basic step schematic diagram of the invention, is sent by the configuration of data sending strategy, data and executes, sends stateThe data determine, adjusted in the case of having sent delay waiting time and failure mend the part such as biography composition automatically.
Data sending strategy configuration module receives the buffer-stored number of " definite value storage is sent " counter of initializing setAccording to the time value T of message number N and " timing storage is sent "per, and/timing is started counting according to system boot operating instruction, oneDenier reaches threshold value and issues corresponding processing request.Data send execution module and are responsible for receiving the sending of data sending strategy configuration moduleProcessing request signal determine this data area sent and according to preset dominance relation, call data transmission program,Buffer data is sent, and data will have been sent moves to and repaid buffer area.It has sent delay waiting time adjustment module and has received " weightNew calculate sends waiting time T'wai" instruction, it carries out new value and calculates.Data mend transmission module automatically and receive " retransmission data " instruction,Wait T'waiAfter duration, data transmission program is called, retransmits the data for repaying buffer area, once correct send, removes and mendsThe data for reporting buffer area, otherwise report an error to upper-layer protocol software.
In addition, the threshold value of all counters in this law, response threshold value over time limit, and sent delay waiting time limitThreshold processed can carry out real time modifying according to downlink control command in control, realize that resource telemetry system in Wenshui is ordered according to downlinkIt enables dynamic configuration call together and surveys the parameters such as element, time.
Fig. 2 is transmission control logic relational graph of the invention, and wherein solid line is control line, and dotted line is data line.The present inventionThe comprehensive transmission controlling mechanism combined using data, Time And Event, by adjusting buffering message number, timed sending time,Waiting time to transmission rate and continuously transmits message number and controls.In not specified sending time, using individual dataMessage sending mode is sent, i.e., certain types of data (such as water quality data) reach RTU, is just sent immediately;Time trigger is sent,Refer to that specific timer reaches preset time value Tper, starting transmission;Event triggering is sent, and refers to that buffering message number reaches presetWhen " definite value storage is sent " value N, starting is sent.Time And Event control is also embodied in response time-out and receives transmission error checkAfter information, the adjustment of waiting delay time is carried out, and start re-transmission." definite value storage is sent " and " timing storage is sent " is according to correspondingEvent and time first come first served basis execute transmission.
The program developed according to the present invention is curable in the data transmission unit of hydrographic water resource acquisition RTU, with complete machineThe units such as shared power supply, CPU and memory.System initialization is carried out first, and data sending strategy parameter, including buffering message are setNumber N, " timing storage is sent " time value Tper, sent delay waiting time threshold limit Twai, response timeout value Tout;SoAfterwards, activation system waits sensor or data to be sent to reach to operational mode;Once certain types of data, time or thingPart handles signal arrival, triggers corresponding control program work, is automatically performed data and sends and the adjustment of subsequent control parameter.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the artFor member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answeredIt is considered as protection scope of the present invention.