LoRaWAN-based efficient wireless seismic data transmission protocol design method
Technical Field
The invention belongs to the field of wireless seismic data transmission protocol design, and particularly relates to a LoRaWAN-based efficient wireless seismic data transmission protocol design method.
Background
Seismic exploration is evolving towards large-scale and high-density acquisition. Wireless seismic exploration equipment has played an increasingly important role in the oil and gas industry in recent years due to its portability compared to conventional equipment with thick cables. Due to the large amount of seismic data, data transmission is usually limited by the bandwidth of a wireless channel, so that data transmission conflicts and transmission delay are too high, and real-time data recovery becomes a difficult task. Currently, the emerging LoRaWAN can effectively improve wireless data transmission efficiency by means of low power consumption, long-distance communication, and its unique spread spectrum technology. Therefore, the large-scale seismic data transmission work is met by improving the self-adaptive spreading factor distribution scheme of the existing hardware resources and the multi-seismograph terminal channel distribution scheme, and the design of a special high-efficiency wireless seismic data transmission protocol is a new research idea.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a LoRaWAN-based high-efficiency wireless seismic data transmission protocol design method, wherein a spread spectrum factor is adjusted in a coarse granularity mode at a seismograph terminal, and a gateway adjusts the fine granularity mode according to the initial distribution result of the seismograph terminal to realize collision weight balance of channels with different spread spectrum factors; according to built-in GPS high-precision time service of the seismograph, Hash function mapping is used for granting the seismograph to send time sequence, uncertainty collision is converted into certainty collision, and large-scale and reliable wireless seismic data transmission network construction is achieved.
The present invention is achieved in such a way that,
a LoRaWAN-based efficient wireless seismic data transmission protocol design method comprises the following steps:
A. after the gateway broadcasts the wireless signal quality test beacon, the seismograph terminal determines the available spread spectrum factor range according to the received power, and the lower the spread spectrum factor is, the higher the probability of being selected is in the available range;
B. the gateway stores the spread spectrum factor distribution condition of the seismograph terminal in NSFIn setting the blocking weight P of the communication channel with the same spreading factor1x6Spreading factor versus transmission time weight w1x6Establishing a congestion degree function of a spread spectrum factor communication channel;
C. data packet construction, namely constructing the duration T of the preamble code of the data packet according to the relative transmission time weights of different spreading factorspreambleData packet preamble length npreambleLength of bytes n of communication loadpayloadThe wireless data transmission time objective function of (1);
D. c, according to the data packet constructed in the step C, a hash function H is established through a gateway by combining the unique ID of each seismograph terminal and built-in GPS high-precision time servicei(k) Obtaining a time series slot index kindexAnd accurate time synchronization is provided for a transmission network.
Further, the step B gateway stores the spreading factor distribution condition of the seismograph terminal in NSFIn setting the blocking weight P of the communication channel with the same spreading factor1x6Spreading factor versus transmission time weight w1x6Establishing a congestion level function for a spreading factor communication channel, comprising the steps of: the spread factor distribution of the seismographs in the LoRaWAN network is stored in NSF,NSFIndicates that there is N in the networkSFThe node is using a spreading factor i]Carrying out transmission; the number of seismographs with the same minimum available spreading factor is stored at NSFIn, NSFIs represented by the ith value ofSFSeismographs use spreading factor [ i ]]Transmitting, wherein spreading factor SF is {7,8 …,12 };
definition P1x6As the weight of congestion, w1x6Is a spreading factor relative to a transmission time weight, wsThe relative transmission weight when the spreading factor is s, the congestion degree function:
P=NSF·w
wherein P represents the congestion degree of the spread spectrum factor channel as a spread spectrum factor SF;
data receiving collision weight is generated by calculating that relative transmission time of different spreading factors is the same, adjacent weights are compared according to the sequence after coarse/fine granularity adjustment, balancing is carried out based on the optimal distribution time weight balancing strategy of the pixel, after all balancing is completed, the adjusted weights are output, and the collision time weights of different spreading factors are converted into seismograph data volume of each communication channel.
Further, the step C specifically includes the steps of:
the target function of the duration of the data packet in the wireless data transmission process of the seismograph, which is the sum of the duration of the preamble and the duration of the transmitted data packet, is as follows:
wherein T ispreambleIs the duration of the preamble, npreambleIs the length of the preamble, npayloadByte length for payload:
wherein PL represents the number of bytes of the payload, when the data packet has a header, IH is 1, otherwise 0; when low rate optimization is enabled, DE 1 is otherwise 0, CR denotes the coding rate, 1 corresponds to 4/5, and 4 corresponds to 4/8.
Further, the step D includes the steps of:
each seismometer terminal uses its globally unique 32-bit address identification, or uses the equipment number connected to the terminal as key k, and uses its assigned hash function Hi(k) To obtain the slot index kindex:
kindex=Hi(k)
For a single spreading factor communication channel, there are n different addresses and m transmission slots, and α is defined as a loading factor:
the constructed hash table has less collision and alpha is close to 1 so as to reduce the data delay rate of the system, the addresses n are uniformly distributed in the slots m, and a hash function H is constructed for the address set of each spreading factor communication channel within the allowed delay range2(k):
rsh(w-r)(2r<m)
And selecting the middle 15 bytes after operation as a data packet sending sequence number, wherein w is the calculated byte length, floor is expressed as rounding-down, and rsh (w-r) is expressed as moving right (w-r) bits.
Compared with the prior art, the invention has the beneficial effects that: according to the built-in unique ID identification of the seismograph and the GPS high-precision time service, the problems of wireless channel congestion and delay when a plurality of seismographs upload seismic data at the same time are solved through spread spectrum factor distribution based on transmission weight and transmission time sequence distribution based on a hash function. Specifically, the spread spectrum factors are adjusted in a coarse-grained mode at the seismograph terminal, and fine-grained adjustment is carried out by the gateway according to the initial distribution result of the seismograph terminal to realize collision weight balance of channels with different spread spectrum factors; according to built-in GPS high-precision time service of the seismograph, Hash function mapping is used for granting the seismograph to send a time sequence, and the uncertain collision is converted into the deterministic collision. Therefore, according to the application requirement of three-dimensional wireless seismic data transmission, the invention designs a special LoRaWAN-based high-efficiency wireless seismic data transmission protocol method, thereby realizing large-scale and reliable wireless seismic data transmission network construction. The special wireless seismic data transmission protocol can effectively solve the problems of data collision and network delay in the traditional method.
Drawings
Fig. 1 is a schematic network structure diagram of an efficient wireless seismic data transmission protocol design method based on LoRaWAN according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is further described in detail with reference to the following embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, the high-efficiency wireless seismic network structure based on the LoRaWAN high-efficiency wireless seismic data transmission protocol design method comprises a plurality of gateways, wherein each gateway covers a plurality of seismographs and transmits data between a vehicle-mounted monitoring center and the gateway. The LoRaWAN-based efficient wireless seismic data transmission protocol design method comprises the following steps:
the method comprises the following steps of spreading factor distribution based on transmission weight and transmission timing distribution based on a hash function:
firstly, after the gateway sends a wireless signal quality test beacon, the seismograph terminal adjusts the spreading factor value in a coarse granularity instead of directly selecting the lowest spreading factor which can be received by the gateway, and after the gateway obtains the receiving power of all the seismograph terminals, fine-grained adjustment is carried out on the basis of initial distribution to realize collision weight balance of channels with different spreading factors.
Secondly, collision weights of different spreading factors are calculated according to the distribution condition of the spreading factors stored by the gateway, adjacent weights are compared in sequence, the adjusted weights are output in a balanced mode, and the weights are converted into the number of the seismographs of each wireless communication channel.
And finally, according to the built-in unique ID identification of the seismograph and the GPS high-precision time service, using Hash function mapping to grant the seismograph to send a time sequence, and setting a broadcast data frame through a gateway to meet the design requirement of a large-scale and reliable network transmission protocol.
The LoRaWAN-based efficient wireless seismic data transmission protocol design method is characterized in that the protocol design method comprises the steps of
The method comprises the following steps:
A. after the gateway broadcasts the wireless signal quality test beacon, the seismograph terminal determines the available spread spectrum factor range according to the received power, and the lower the spread spectrum factor is, the higher the probability of being selected is in the available range;
B. the gateway stores the spread spectrum factor distribution condition of the seismograph terminal in NSFIn setting the blocking weight P of the communication channel with the same spreading factor1x6Spreading factor versus transmission time weight w1x6Establishing a congestion degree function of a spread spectrum factor communication channel;
C. depending on the relative transmission time weights of the different spreading factors,duration T for constructing preamble of data packetpreambleData packet preamble length npreambleLength of bytes n of communication loadpayloadThe wireless data transmission time objective function of (1);
D. c, according to the data packet constructed in the step C, a hash function H is established through a gateway by combining the unique ID of each seismograph terminal and built-in GPS high-precision time servicei(k) Obtaining a time series slot index kindexThe method can provide accurate time synchronization for a transmission network, and can reduce data collision to the maximum extent;
b, the gateway stores the spread spectrum factor distribution condition of the seismograph terminal in NSFIn setting the blocking weight P of the communication channel with the same spreading factor1x6Spreading factor versus transmission time weight w1x6Establishing a congestion level function for a spreading factor communication channel, comprising the steps of:
the spread factor distribution of the seismographs in the LoRaWAN network is stored in NSF,NSFIndicates that there is N in the networkSFThe node is using a spreading factor i]Carrying out transmission; the number of seismographs with the same minimum available spreading factor is stored at NSFIn, NSFIs represented by the ith value ofSFSeismographs use spreading factor [ i ]]And transmitting the data by the spreading factor SF, wherein the spreading factor SF is {7,8 …,12 }.
Definition P1x6As the weight of congestion, w1x6Is a spreading factor relative to a transmission time weight, wsThe relative transmission weight when the spreading factor is s is as follows:
P=NSF·w
wherein P [ i ] represents the congestion degree of the channel with the spreading factor of SF [ i ].
And (3) by calculating collision weights of different spreading factors, smoothly comparing adjacent weights and balancing, outputting the adjusted weights after all balancing is finished, and converting the weights into seismograph data volume of each communication channel.
Step C, according to the relative transmission time weights of different spreading factors, constructing the duration T of the preamble of the data packetpreambleData packet preamble length npreambleLength of bytes n of communication loadpayloadThe wireless data transmission time objective function comprises the following steps:
the target function of the duration of the data packet in the wireless data transmission process of the seismograph, which is the sum of the duration of the preamble and the duration of the transmitted data packet, is as follows:
wherein T ispreambleIs the duration of the preamble, npreambleIs the length of the preamble, npayloadByte length for payload:
wherein PL represents the number of bytes of the payload, when the data packet has a header, IH is 1, otherwise 0; when low rate optimization (lowdatarateoptimization) is enabled, DE 1 is otherwise 0. CR denotes the coding rate (1 for 4/5, 4 for 4/8).
Step D, combining the unique ID of each seismograph terminal and built-in GPS high-precision time service, and formulating a hash function H through a gatewayi(k) Obtaining a time series slot index kindexThe method can reduce data collision to the maximum extent by providing accurate time synchronization for a transmission network, and comprises the following steps:
each seismometer terminal uses its globally unique 32-bit address identification or uses the device number connected to the terminal as the key k. Hash function H specified for it by the gatewayi(k) To obtain the slot index kindex:
kindex=Hi(k)
For a single spreading factor communication channel, there are n different addresses and m transmission slots. Define α as the loading factor:
the constructed hash table should be collided less and α is made as close to 1 as possible to reduce the data delay rate of the system and to distribute the addresses n as uniformly as possible in the slots m. Constructing a hash function H for each set of addresses of a spreading factor communication channel within an allowable delay range2(k):
And selecting a plurality of middle bits after operation as a data packet sending sequence number, wherein w is the calculated byte length, floor is expressed by rounding-down, rsh (w-r) is expressed by moving (w-r) bits to the right, so that the transmission conflict of the wireless seismic data packet can be reduced to the maximum extent.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.