CN114629504B - Downhole while-drilling data compression method and system based on FPGA - Google Patents

Downhole while-drilling data compression method and system based on FPGA Download PDF

Info

Publication number
CN114629504B
CN114629504B CN202110898746.9A CN202110898746A CN114629504B CN 114629504 B CN114629504 B CN 114629504B CN 202110898746 A CN202110898746 A CN 202110898746A CN 114629504 B CN114629504 B CN 114629504B
Authority
CN
China
Prior art keywords
data
frame
measurement
drilling
fpga
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.)
Active
Application number
CN202110898746.9A
Other languages
Chinese (zh)
Other versions
CN114629504A (en
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.)
China National Petroleum Corp
CNPC Chuanqing Drilling Engineering Co Ltd
Original Assignee
China National Petroleum Corp
CNPC Chuanqing Drilling Engineering Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China National Petroleum Corp, CNPC Chuanqing Drilling Engineering Co Ltd filed Critical China National Petroleum Corp
Priority to CN202110898746.9A priority Critical patent/CN114629504B/en
Publication of CN114629504A publication Critical patent/CN114629504A/en
Application granted granted Critical
Publication of CN114629504B publication Critical patent/CN114629504B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The invention provides a method and a system for compressing underground while-drilling data based on FPGA. According to the method, the underground while-drilling data are grouped into the frame groups according to the frames, the prediction residual errors between two adjacent frames are calculated in the frame groups, and Huffman coding of a fixed probability model is carried out on the prediction residual errors. The invention has the following advantages: firstly, the data compression module based on the FPGA design has the characteristics of small volume, low power consumption and easy realization, and is suitable for underground environment; secondly, certain error codes can occur in the mud pulse transmission process, prediction between adjacent frames is carried out in the frame group by grouping according to the frames, the dependence between compressed data is reduced, and the error code resistance is improved; thirdly, when the Huffman coding uses a fixed probability model, lossless compression coding can be realized by using an addressing table look-up method, the realization is simple, and the power consumption and the size are easy to reduce.

Description

Downhole while-drilling data compression method and system based on FPGA
Technical Field
The invention belongs to the technical field of measurement while drilling of oil and gas drilling engineering, in particular relates to an FPGA-based underground data compression while drilling method and system, which can be used for realizing 1.5-4 times of lossless compression of underground data while drilling and have important significance for improving the transmission efficiency of underground data while drilling and improving the technical progress.
Background
Compared with the traditional cable logging technology, the measurement while drilling technology has the advantages that geological and engineering data are measured and acquired and transmitted to the ground workstation while the drill bit drills, so that ground constructors can know underground stratum conditions and drilling conditions in real time, and drilling operations can be timely adjusted and optimized, and therefore drilling efficiency and success rate are improved. The measurement while drilling technology is a technology capable of acquiring and transmitting underground measurement data in real time in the drilling process of a drill bit, and has very important significance in the whole petroleum exploitation process. At present, measurement while drilling technology is widely applied, and the exerted effect is more and more important.
The data transmission technology is one of core technologies of measurement while drilling, and has certain constraint on the development of measurement while drilling technology. The measurement while drilling data transmission is realized in a wired transmission mode and a wireless transmission mode. The wired transmission comprises three modes of cable, drill rod and optical fiber transmission, and the wireless transmission mode is mainly divided into three transmission modes of mud pulse, electromagnetic wave and sound wave according to the transmission channel. The transmission rate of the wired transmission mode is very high, meanwhile, the wired transmission can realize the bidirectional transmission of information, particularly, the cable transmission and the special drill rod transmission can realize the direct power supply from the ground to the underground sensor, but the wired transmission process is very complex, and meanwhile, equipment faults often occur in the drilling process to influence normal drilling operation. For technical and cost reasons, two wireless transmission modes of electromagnetic wave and mud pulse are the most used at present, wherein the electromagnetic wave mode is only used in shallower wells due to signal attenuation, the mud pulse transmission mode is the most commonly used, the application time is the longest, and the development of the technology is mature after the time passes. However, the mud pulse transmission technology still has a certain disadvantage that the data transmission rate is very low, and only small data transmission can be realized.
Disclosure of Invention
The present invention aims to address at least one of the above-mentioned deficiencies of the prior art. For example, one of the purposes of the present invention is to provide a technical solution for effectively compressing measurement while drilling data based on FPGA.
For example, one of the purposes of the invention is to provide an effective compression implementation scheme for measurement while drilling data based on FPGA aiming at the problems of low data transmission rate and small transmission data volume of the measurement while drilling mud pulse transmission technology, so that the data recorded underground can be compressed and then transmitted to the ground, and then decompressed and restored to original data, thereby being beneficial to improving the transmission efficiency of the measurement data, meeting the transmission requirements of a large amount of measurement record data and relieving the pressure of the continuously-increased measurement data on a transmission system.
In order to achieve the above objective, in one aspect, the present invention provides an FPGA-based downhole data compression system, including an input interface module, a data preprocessing module, an inter-frame prediction module having control logic, a Huffman coding module, and an output interface module, where the input interface module receives a control signal obtained from a collector of a measurement while drilling instrument and a data signal sent in a frame form, and transmits first data with the same frame format, which is remained after removing a frame header and a frame tail, of the data signal to the data preprocessing module, and transmits the control signal to the control logic; after each frame of data in the first data is received by the data preprocessing module, respectively judging the physical quantity and the bit number by adopting an asynchronous clock FIFO and using a counter to split the physical quantity and the bit number so as to obtain second data, wherein each frame of the second data comprises a plurality of different physical quantities, and each physical quantity has 7-12 bit data bits; the inter-frame prediction module is also provided with a current frame memory, a reference frame memory and an arithmetic unit, wherein the current frame memory and the reference frame memory are respectively connected with the control logic, the inter-frame prediction module can carry out inter-frame prediction by taking n frames in second data as a frame group, wherein third data transmitted to the Huffman coding module by each frame group is n-1 difference values obtained by subtracting between the first frame data of the frame group and adjacent frames in the frame group, and each difference value comprises a plurality of prediction residues; the Huffman coding module comprises a Huffman code table connected with the arithmetic unit, a counter, a data shift register and a FIFO buffer which are connected with the control logic, and can convert an indefinite length code value obtained by inquiring the Huffman code table through third data addressing into fourth data of a definite length value through the counter, the data shift register and the FIFO buffer, and a plurality of lines of code words stored in the Huffman code table respectively correspond to all values in a value range of the prediction residual; the output interface module is respectively connected with the counter, the data shift register and the control logic, can process fourth data into fifth data meeting the technical requirements of a data bus between a collector and an encoder of the measurement while drilling instrument, transmits the fifth data to the encoder of the measurement while drilling instrument, and provides required control and status signals for the control bus of the measurement while drilling instrument.
In an exemplary embodiment of the FPGA-based downhole data compression system of the present invention, the difference may be obtained by storing the i-th frame data in the reference frame memory, the i+1th frame data in the current frame memory, and subtracting the current frame data in the current frame memory and the reference frame data in the reference frame memory from each other, where the i value traverses 1 to n-1.
In one exemplary embodiment of the FPGA-based downhole data compression system of the present invention, each frame of the second data contains 6 gamma 1, near bit kick, near bit azimuth, near bit weight high, pressure 1, pressure 2, and pressure 3.
In one exemplary embodiment of the FPGA-based downhole data compression system of the present invention, the n may be 4 to 8.
In one exemplary embodiment of the FPGA-based downhole data compression system of the present invention, the Huffman code table may be generated by a fixed probability model. For example, the number of data bits in each row of the Huffman code table is 22 bits, the [21:17] is valid data bits, the [16:0] is a code value, and the code value is read from low to high according to the value of the valid data bits.
Another aspect of the present invention provides a measurement while drilling system for improving data transmission efficiency, comprising a measurement while drilling instrument having a collector, an encoder, a data bus, and a control bus, the measurement while drilling system further comprising a data compression system while drilling downhole as described above. For example, the measurement while drilling system may employ a wireless data transmission of mud pulses.
Another aspect of the invention provides an FPGA-based data compression while drilling method that may be implemented using a downhole data compression while drilling system as described above.
Another aspect of the present invention provides a measurement while drilling method for improving data transmission efficiency, the measurement while drilling method being implemented using the measurement while drilling system as described above.
Another aspect of the invention provides the use of a data compression while drilling system or a measurement while drilling system as described above in oil and gas drilling or drilling.
Compared with the prior art, the invention has the beneficial effects that at least one of the following contents is included:
Firstly, the data compression module based on the FPGA design has the characteristics of small volume, low power consumption and easy realization, and is suitable for underground environment; secondly, certain error codes can occur in the mud pulse transmission process, prediction between adjacent frames is carried out in the frame group by grouping according to the frames, the dependence between compressed data is reduced, and the error code resistance is improved; thirdly, when the Huffman coding uses a fixed probability model, lossless compression coding can be realized by using an addressing table look-up method, the realization is simple, and the power consumption and the size are easy to reduce.
Drawings
The foregoing and other objects and/or features of the invention will become more apparent from the following description taken in conjunction with the accompanying drawings in which:
FIG. 1 shows a schematic diagram of one exemplary embodiment of a measurement while drilling system of the FPGA-based downhole data compression system of the present invention.
FIG. 2 illustrates a general structural schematic of one exemplary embodiment of the FPGA-based downhole data compression system of the present invention.
Fig. 3 shows an example of raw measurement data as first data.
Fig. 4 shows the output after data preprocessing and inter prediction module processing.
Fig. 5 shows the result of a frame group processed by the Huffman coding module.
FIG. 6 shows the compression results of the measurement while drilling data file by the FPGA-based downhole data compression system of the present invention.
FIG. 7 shows a comparison of the contents of the FPGA-based downhole while-drilling data compression system of the present invention and the compression of the same file by some compression software.
Fig. 8 is a schematic flow chart of the generation of the fixed probability code table by the Huffman coding module in the present invention.
Detailed Description
Hereinafter, the FPGA-based downhole data compression system of the present invention, and its measurement-while-drilling system and measurement-while-drilling method will be described in detail with reference to exemplary embodiments.
It should be noted that the terms "first," "second," "third," "fourth," "fifth," and the like are merely for convenience of description and for convenience of distinction and are not to be construed as indicating or implying relative importance.
Aiming at the problems of low data transmission rate and small transmission data volume of the measurement while drilling mud pulse transmission technology, the invention provides an FPGA-based hardware implementation scheme for effectively compressing measurement while drilling data, which is used for realizing 1.5-4 times of lossless compression of the measurement while drilling data, has important significance for improving the data transmission efficiency and technical progress of measurement while drilling, and is very necessary for compressing the measurement data. The method for compressing the underground recorded data and then transmitting the compressed data to the ground and decompressing the compressed data to restore the original data improves the transmission efficiency of the measured data to a certain extent, meets the transmission requirement of a large amount of measured recorded data, and relieves the pressure of the continuously-increased measured data such as rotary geosteering, multi-parameter measurement while drilling and the like on a transmission system.
The implementation of the compression-while-drilling system based on the FPGA (Field Programmable GATE ARRAY ) provided by the invention requires a lossless data compression algorithm. The lossless compression algorithm mainly comprises 4 kinds of Huffman coding, arithmetic coding, dictionary coding and predictive coding. The dictionary coding method has a good compression effect on data with strong repeatability, but in the coding and transmission processes, a dictionary needs to be synchronously and dynamically built at the coding end according to the coded data and at the decoding end according to the decoded data. Lossless decoding can be achieved only if identical dictionaries at the encoding side and decoding side are ensured. Once an error occurs in the middle, the dictionary at the decoding end is necessarily different from the dictionary at the encoding end, so that a great difference occurs between the decoded data and the original data. Both Huffman coding and arithmetic coding belong to statistical coding methods, and data are compression coded by using a probability model of the data. However, arithmetic coding requires a strong computing power of an operator and requires a large number of operations, which is disadvantageous in terms of reducing power consumption and size of hardware. In addition, since arithmetic coding assigns a fixed point decimal to the whole original data body, once a bit in the decimal has an error code, decoding after the decimal has an error necessarily, so that the error code resistance of arithmetic coding is poor, and the arithmetic coding is not suitable for measuring data compression. In contrast, when using a fixed probability model, huffman coding can realize lossless compression coding by using a table look-up method, and the realization is simple, and the power consumption and the size are easy to reduce.
Under the condition of comprehensively considering important factors such as stronger inter-frame correlation of underground while-drilling data, requirement of low power consumption and small size required to be met by a data compression hardware module, adverse effect of channel error codes on compressed reconstruction data and the like, the inventor combines data analysis and compression experimental results, and prefers a Huffman coding algorithm based on packet inter-frame prediction as the underground while-drilling data compression algorithm.
FIG. 1 shows a schematic diagram of one exemplary embodiment of a measurement while drilling system of the FPGA-based downhole data compression system of the present invention.
As shown in fig. 1, a measurement-while-drilling system of an FPGA-based downhole data compression system (which may also be referred to as a measurement-while-drilling system capable of improving data transmission efficiency) may include a measurement-while-drilling instrument having a collector, an encoder, a data bus, and a control bus, and an FPGA-based downhole data compression system disposed between the collector and the encoder.
FIG. 2 illustrates a general structural schematic of one exemplary embodiment of the FPGA-based downhole data compression system of the present invention.
As shown in fig. 2, in one exemplary embodiment of the invention, an FPGA-based downhole data compression system includes an input interface module, a data preprocessing module, an inter-frame prediction module with control logic, a Huffman coding module, and an output interface module.
Specifically, the input interface module receives a control signal obtained from a collector of the measurement while drilling instrument and a data signal sent in a frame form, and transmits first data with the same frame format, which remains after the frame head and the frame tail of the data signal are removed, to the data preprocessing module, and transmits the control signal to the control logic. The control signal and the data signal may be obtained from a control bus and a data bus, respectively, connected to the collector.
After each frame of data in the first data is received by the data preprocessing module, converting 8-bit (bit) data into 1-bit data by adopting an asynchronous clock FIFO (first in first out) and outputting the 1-bit data, respectively judging physical quantity and bit by using a counter, and carrying out splitting processing to obtain second data, wherein each frame of the second data can contain a plurality of different physical quantity, each physical quantity has 7-12 data bits, and each physical quantity takes the lowest bit as a check bit. For example, each frame of second data may consist of 6 gamma 1, near bit kick, near bit azimuth, near bit weight high, pressure 1, pressure 2, and pressure 3. Here, near bit well deviation (RIN) is a measurement term of art, i.e. measuring well deviation closest to the bit. The well deviation is also called a well deviation angle, namely a tangential line passing through a certain point on the axis of the well bore and used as the axis of the well bore, the part of the tangential line extending towards the advancing direction of the well bore is called a well bore direction line, and the included angle between the well bore direction line and the gravity line is called the well deviation angle. Both the wellbore directional line and the gravity line are directional. The well inclination angle indicates the amount by which the borehole trajectory is inclined at a point. The near bit azimuth (RAZ) means the angle rotated on the well deviation azimuth line by taking the north azimuth line of a certain point as the starting edge and rotating clockwise to the point. The 6 gamma 1 s do not constitute a set of data with the physical quantity thereafter. The gamma value is measured a plurality of times in succession within a frame of data, in which the 6 gamma 1's are the same physical but the 6 measurements are different in value. The step of obtaining the second data further comprises: after the check bit of each physical quantity is removed through shifting, the data bit number is equal to 8 bits and occupies one byte, the high-order complement 0 occupies one byte after the data smaller than 8 bits are shifted, and the high-order complement 0 occupies two bytes after the data larger than 8 bits are complemented.
The inter prediction module has a current frame memory, a reference frame memory, and an operator in addition to the sub-modules having control logic. The current frame memory and the reference frame memory are respectively connected with the control logic. The inter-frame prediction module can perform inter-frame prediction by taking n frames in the second data as a frame group, wherein the third data transmitted to the Huffman coding module by each frame group is n-1 difference values obtained by subtracting the first frame data of the frame group from adjacent frames in the frame group, and each difference value comprises a plurality of prediction residues. For example, the difference is obtained by storing the i-th frame data in the reference frame memory, the i+1-th frame data in the current frame memory, and subtracting the current frame data in the current frame memory and the reference frame data in the reference frame memory to the arithmetic unit, wherein the value of i traverses 1 to n-1. For example, n may be 4 to 8.
The Huffman coding module comprises a Huffman code table connected with the arithmetic unit, a counter, a data shift register and a FIFO buffer connected with the control logic, and can convert an indefinite length code value obtained by searching the Huffman code table through third data addressing into fourth data of a definite length value through the counter, the data shift register and the FIFO buffer, and a plurality of lines of code words stored in the Huffman code table respectively correspond to all values in a value range of the prediction residual. Huffman code tables may be generated by a fixed probability model. For example, the number of data bits per row of the Huffman code table may be 22 bits, [21:17] valid data bits, [16:0] encoded values, the encoded values being read from low to high according to the values of the valid data bits. Furthermore, the counter, the data shift register and the FIFO buffer may be integrally provided.
The output interface module is respectively connected with the counter, the data shift register, the FIFO buffer memory and the control logic, and can process the fourth data into fifth data meeting the technical requirements of a data bus between a collector and an encoder of the measurement while drilling instrument, transmit the fifth data to the encoder of the measurement while drilling instrument and provide required control and status signals for a control bus of the measurement while drilling instrument.
In another exemplary embodiment of the present invention, the design of the FPGA-based downhole data compression system while drilling system based on Huffman coding of frame inter-group prediction of FPGA may be composed of five parts of an input interface module, a data preprocessing module, an inter-frame prediction module, a Huffman coding module and an output interface module. The method for compressing the underground while-drilling data of the underground while-drilling data compression system based on the FPGA can be realized through the following steps.
Step one, an input interface module receives control signals and data signals uploaded by a measurement while drilling instrument collector, the measurement data signals sent in a frame form are transmitted to a data preprocessing module after frame heads and frame tails are removed, and the control signals are transmitted to a control logic for processing and utilization.
And step two, the data signal frame formats received by the data preprocessing module are the same. For example, the data signal may contain 7 different physical quantities, 12 physical quantities in total, and the number of data bits of each physical quantity is 7 to 12 bits, as shown in table 1 or table 2. Therefore, after receiving a frame of data, an asynchronous clock FIFO is adopted to convert 8bit data into 1bit data for output, and two counters are used for respectively judging physical quantity and bit number for splitting processing. Because the lowest bit in the effective bit number of each physical quantity is a check bit, after the check bit is removed through displacement, the data bit number of the parameter is equal to 8 bits and occupies one byte, after the data smaller than 8 bits are displaced, the high-order complement 0 occupies one byte, and after the data larger than 8 bits are complemented with 0, the data smaller than 8 bits occupy two bytes. The 14 byte data structure of a frame and the number of bits occupied after preprocessing and splitting are shown in table 1. And after the data sequence splitting is completed, transmitting the data to an inter-frame prediction module. The original data in table 1 may correspond to the first data, and the preprocessed data may correspond to the second data. The total 13 physical quantities in table 2 are formed, the serial port receives 115 bits of data of one frame, and 18 bytes are obtained after the operation of checking bit removal and high bit compensation by the preprocessing module. Briefly, inter prediction is residual prediction of adjacent frames by byte subtraction of corresponding physical quantities, for example: the physical quantity of G1 in one frame of data is 1 byte after preprocessing, and the first G1 (one byte) of the current frame is subtracted from the G1 at the corresponding position of the reference frame during inter-frame prediction. The physical quantity RIN is 2 bytes after pretreatment, so that when inter-frame prediction is carried out, the first byte of RIN of the current frame is subtracted from the first byte of RIN of the corresponding position of the reference frame, the 2 nd byte of RIN of the current frame after pretreatment is subtracted from the byte of the corresponding position of the reference frame, and so on. Inter prediction is therefore said to be based on one byte.
Table 1 data frame structure example 1
In Table 1, G1 is shorthand for GMA1, and represents a natural gamma measurement 1, RIN represents near bit well deviation, RAZ represents near bit azimuth, RTF represents near bit weight height, and PRS1, 2,3 represents pressures 1,2, 3.
Table 2 data frame structure example 2
In table 2, GT gravitational acceleration, BT represents magnetic field strength, BPB represents probe, RIN represents near bit well deviation, RTF represents near bit weight height, RAZ represents near bit azimuth, PRS1, 2,3 represents pressures 1,2,3, G1, G2 are shorthand for GMA1, GMA2, and natural gamma measurement 1, natural gamma measurement 2, respectively.
And thirdly, constructing an inter-frame prediction module by the reference frame memory, the current frame memory and the arithmetic unit. And receiving the data processed by the preprocessing module, and forming a frame group every 6 frames to perform inter-frame prediction. The 1 st frame data of each frame group is transmitted to the coding module and then stored in the reference frame memory, the 2 nd frame data is stored in the current frame memory, the current frame data and the reference frame data are transmitted to the arithmetic unit for subtraction operation, and 14 prediction residues of table 1 or 18 prediction residual values of table 2 are generated for each frame and input to the coding module. The 2 nd frame is stored in the reference frame memory, the 3 rd frame is stored in the current frame memory, and the like, and the data transmitted to the coding module by each frame group is the difference value of the subtraction between the first frame original data and the 5 groups of frames.
And step four, a code table generated by a fixed probability model stored by the Huffman coding module is designed according to the statistical characteristics of typical measurement-while-drilling data, and can also be updated according to the data characteristics of the region where the well is located, wherein the stored 512 lines of code words respectively correspond to all values in the value range of the prediction residual error. The Huffman code table applied by the coding module has 22 bits of data bits of each row, the [21:17] is valid data bits, the [16:0] is a coding value, and the coding value is read from low to high according to the value of the valid data bits. And converting the addressing variable-length code value into an 8-bit variable-length value through a counter, a data shift register and an FIFO buffer memory, and transmitting the 8-bit variable-length value to a next module. In inter-frame prediction, one byte (8 bits) of the corresponding position of the adjacent frame is subtracted, the decimal difference is-255 to 255, and 511 rows, and a row of code value with the weight of 1 is added to prevent overflow, so the code table is 512 rows. The Huffman code table is generated as long as the inter-frame prediction is based on one byte, and the generated Huffman code table is 512 lines. That is, the number of lines of the Huffman code table may be determined according to the number of bytes of inter-frame prediction.
If the working condition or the measurement parameters of the measurement while drilling engineering change, the data frame structure also changes at the same time, and according to the principles of data preprocessing and inter-frame prediction (which can be called grouping inter-frame prediction) in the invention, huffman coding can be performed on all data files acquired by the measurement engineering, so as to generate a fixed probability Huffman code table for the subsequent measurement while drilling data compression under the same working condition.
The fixed probability model is also called a common probability model, which means that the same common probability model is used when performing Huffman coding on the prediction residuals of all the measured data files, i.e. the common probability model generated by statistics of all the prediction residual values in the plurality of measured data files is used for building the Huffman tree, generating the Huffman codeword and the code table.
For example, in the Huffman coding module, the flow of generating the fixed probability code table may be as shown in fig. 8, which may include the following steps:
(i) Opening N measurement while drilling data files, and reading one file data;
(ii) Carrying out inter-frame prediction on all data in the read file according to physical quantity;
(iii) Counting the frequency of all residual values in the file;
(iv) Reading the next file, and repeatedly executing the operations of the steps (ii) and (iii) until the residual numerical frequency of all measurement-while-drilling data files is counted;
(v) And generating a binary tree and a code table of fixed probability according to the conventional Huffman algorithm according to all residual values and frequencies.
And fifthly, processing the compressed data after Huffman coding through an output interface module, so that the compressed data meets the technical requirements of a data bus between a measuring instrument collector and an encoder, transmitting the compressed data to the encoder of the measuring instrument, and providing required control and status signals for a control bus.
In yet another exemplary embodiment of the present invention, the main design flow of the FPGA-based downhole data compression system while drilling and the downhole data compression method thereof includes: receiving the data signals uploaded by the measuring instrument collector for splitting pretreatment; and carrying out addressing inquiry Huffman fixed probability code table on inter-frame prediction residual data to carry out compression coding, and converting the variable-length data into fixed-length data to be output to a measuring instrument encoder after coding. The general structure block diagram can be shown in fig. 2, and consists of an input interface, data preprocessing, a current frame memory, a reference frame memory, an arithmetic unit, a Huffman code table, a counter, a data shift register, a FIFO buffer, control logic, an output interface and the like. The current frame memory, the reference frame memory, the arithmetic unit and the control logic together form an inter-frame prediction module, so that the function of inter-frame prediction residual error is realized. The Huffman code table, the counter, the data shift register and the FIFO buffer form a Huffman code module, and the function of Huffman coding the prediction residual error output by the arithmetic unit is realized under the control of the control logic.
As shown in FIG. 1, the invention adds a data compression system between the collector and the encoder of the measurement while drilling instrument. The overall structure block diagram of the measurement while drilling data compression system is shown in fig. 2, and consists of an input interface, data preprocessing, a current frame memory, a reference frame memory, an arithmetic unit, a Huffman code table, a counter, a data shift register, control logic and the like. The current frame memory, the reference frame memory, the arithmetic unit and the control logic together form an inter-frame prediction module, so that the function of inter-frame prediction residual error is realized. The Huffman code table, the counter, the data shift register and the FIFO buffer form a Huffman code module, and the function of Huffman coding the prediction residual error output by the arithmetic unit is realized under the control of the control logic.
Fig. 3 shows an example of raw measurement data as first data. Fig. 4 shows the output after data preprocessing and inter prediction module processing. Fig. 5 shows the result of a frame group processed by the Huffman coding module. Taking the example of transmitting measurement data of one frame group (e.g., 6 frames), the original measurement data is transmitted as shown in fig. 3. The receiving module receives the frame header (5A 5A) and the frame tail (A5A 5) of each frame data, which are removed by two bytes, and then sends the frame header and the frame tail (A5A 5) to the data preprocessing module for splitting, and the split frame data is sent to the inter-frame prediction module for inter-frame residual prediction. The output result is shown in fig. 4, the first frame data of each frame group is a value obtained by preprocessing and splitting original measurement data, and 2 to 6 frames are the results of subtracting frames of adjacent frames. The 84 bytes outputted by the frame subtraction are transmitted to the Huffman coding module, the code value in the code table is read according to the value of the effective data bit through addressing, the code value with an indefinite length is converted into a definite length through a counter and a shift register, and the definite length is outputted to the upper computer through the output interface module, and the output result after Huffman coding is carried out on one frame of data is shown in FIG. 5. The original input measurement data has 108 bytes in one frame group, and the output of the measurement data is 59 bytes after data compression, so that the measurement data has good compression effect.
Fig. 6 is a schematic diagram of a partial result uploaded after transmitting measurement data in a frame form to an FPGA through a serial port for data compression of measurement while drilling data files acquired and stored in an actual project. The measurement while drilling data file contains 17298 bytes and 9556 bytes after compression, and the compression multiple of the measurement while drilling data file is 1.81, so that the compression effect is good. Through multiple tests, the invention can realize 1.5-4 times of lossless compression on measurement while drilling data.
FIG. 7 shows a comparison of the contents of the FPGA-based downhole while-drilling data compression system of the present invention and the compression of the same file by some compression software. As can be seen from fig. 7, the data compressed by the FPGA-based downhole data compression system is substantially identical to the compressed content of the compression software. However, since the compression software transmits the compressed data according to 15 bytes during compression, if the last frame of data transmitted is less than 15 bytes, the data is directly discarded and is not transmitted through the serial port. However, the invention directly uploads the compressed data of each frame group, and the last compressed data is uploaded after the high order bit less than 8 bits is complemented by 0. Therefore, in fig. 7, when the comparison is performed in a binary manner, a mismatch phenomenon occurs in the last 3 bytes. In the decompression process, the decompression software decompresses all the compressed data according to the data sequence, and if the last byte of the compressed data is high-order 0, the 0-order part is automatically discarded, so that the last byte is less than 8-order 0-order, and the decompression is not affected. The accuracy of the underground data compression system while drilling based on the FPGA is verified by comparing the content of the compression software and the content of the same measurement file after data compression.
In summary, the present invention can group data into frame groups according to frames, calculate prediction residuals between two adjacent frames in the frame groups, and perform Huffman coding of a fixed probability model on the prediction residuals. The invention has the following three advantages: firstly, the data compression module based on the FPGA design has the characteristics of small volume, low power consumption and easy realization, and is suitable for underground environment; secondly, certain error codes can occur in the mud pulse transmission process, prediction between adjacent frames is carried out in the frame group by grouping according to the frames, the dependence between compressed data is reduced, and the error code resistance is improved; thirdly, when the Huffman coding uses a fixed probability model, lossless compression coding can be realized by using an addressing table look-up method, the realization is simple, and the power consumption and the size are easy to reduce.
Although the present invention has been described above with reference to the exemplary embodiments and the accompanying drawings, it should be apparent to those of ordinary skill in the art that various modifications can be made to the above-described embodiments without departing from the spirit and scope of the claims.

Claims (7)

1. An FPGA-based downhole data compression system while drilling is characterized by comprising an input interface module, a data preprocessing module, an inter-frame prediction module with control logic, a Huffman coding module and an output interface module, wherein,
The input interface module receives a control signal obtained from a downhole measurement while drilling instrument collector and a data signal sent in a frame form, and transmits first data with the same frame format, which is remained after the frame head and the frame tail of the data signal are removed, to the data preprocessing module, and transmits the control signal to the control logic;
After each frame of data in the first data is received by the data preprocessing module, respectively judging the physical quantity and the bit number by adopting an asynchronous clock FIFO and using a counter to split the physical quantity and the bit number so as to obtain second data, wherein each frame of the second data comprises a plurality of different physical quantities, and each physical quantity has 7-12 bit data bits;
Each frame of the second data comprises 6 gamma 1, near bit kick, near bit azimuth, near bit weight height, pressure 1, pressure 2, and pressure 3;
the gamma 1 represents a natural gamma measurement value 1;
The inter-frame prediction module is also provided with a current frame memory, a reference frame memory and an arithmetic unit, wherein the current frame memory and the reference frame memory are respectively connected with the control logic, the inter-frame prediction module can carry out inter-frame prediction by taking n frames in second data as a frame group, wherein third data transmitted to the Huffman coding module by each frame group is n-1 difference values obtained by subtracting between the first frame data of the frame group and adjacent frames in the frame group, and each difference value comprises a plurality of prediction residues;
The difference value is obtained by storing the ith frame data into a reference frame memory, storing the (i+1) th frame data into a current frame memory, and transmitting the current frame data in the current frame memory and the reference frame data in the reference frame memory to an arithmetic unit for subtraction operation, wherein the value of i traverses 1 to n-1;
The n is 4 to 8;
The Huffman coding module comprises a Huffman code table connected with the arithmetic unit, a counter, a data shift register and a FIFO buffer which are connected with the control logic, and can convert an indefinite length code value obtained by inquiring the Huffman code table through third data addressing into fourth data of a definite length value through the counter, the data shift register and the FIFO buffer, and a plurality of lines of code words stored in the Huffman code table respectively correspond to all values in a value range of the prediction residual;
The Huffman code table is generated through a fixed probability model; the number of data bits of each row of the Huffman code table is 22 bits, the [21:17] is effective data bits, the [16:0] is a coded value, and the coded value is read from low to high according to the value of the effective data bits;
The output interface module is respectively connected with the counter, the data shift register and the control logic, can process fourth data into fifth data meeting the technical requirements of a data bus between a collector and an encoder of the measurement while drilling instrument, transmits the fifth data to the encoder of the measurement while drilling instrument, and provides required control and status signals for the control bus of the measurement while drilling instrument.
2. A measurement while drilling system for improving data transmission efficiency comprising a measurement while drilling instrument having a collector, an encoder, a data bus, and a control bus, wherein the measurement while drilling system further comprises the FPGA-based data compression while drilling system of claim 1.
3. The measurement while drilling system for improving data transmission efficiency of claim 2, wherein the measurement while drilling system employs a wireless data transmission of mud pulses.
4. An FPGA-based downhole data compression method, wherein the downhole data compression method is implemented by using the FPGA-based downhole data compression system according to claim 1.
5. A measurement while drilling method for improving data transmission efficiency, wherein the measurement while drilling method is implemented by using the measurement while drilling system for improving data transmission efficiency according to claim 2.
6. Use of the FPGA-based downhole data compression system of claim 1 in oil and gas drilling or boring.
7. Use of the improved data transmission efficiency measurement while drilling system of claim 2 in oil and gas drilling or boring.
CN202110898746.9A 2021-08-05 2021-08-05 Downhole while-drilling data compression method and system based on FPGA Active CN114629504B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110898746.9A CN114629504B (en) 2021-08-05 2021-08-05 Downhole while-drilling data compression method and system based on FPGA

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110898746.9A CN114629504B (en) 2021-08-05 2021-08-05 Downhole while-drilling data compression method and system based on FPGA

Publications (2)

Publication Number Publication Date
CN114629504A CN114629504A (en) 2022-06-14
CN114629504B true CN114629504B (en) 2024-04-30

Family

ID=81897582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110898746.9A Active CN114629504B (en) 2021-08-05 2021-08-05 Downhole while-drilling data compression method and system based on FPGA

Country Status (1)

Country Link
CN (1) CN114629504B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115410525B (en) * 2022-10-31 2023-02-10 长春希达电子技术有限公司 Sub-pixel addressing method and device, display control system and display screen

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101945286A (en) * 2010-09-29 2011-01-12 上海华为技术有限公司 Compression coding method, decoding decompression method, device and communication system
CN103236845A (en) * 2013-04-18 2013-08-07 西安石油大学 Method for compacting data transmitted with drilling well mud pulse
CN104301070A (en) * 2014-10-10 2015-01-21 中国石油天然气集团公司 Data error detection and correction method for measurement-while-drilling system
CN104410425A (en) * 2014-10-10 2015-03-11 中国石油天然气集团公司 Method for compressing data of measurement while drilling system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
NO20211599A1 (en) * 2019-06-12 2021-12-29 Baker Hughes Oilfield Operations Llc Compressing data collected downhole in a wellbore

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101945286A (en) * 2010-09-29 2011-01-12 上海华为技术有限公司 Compression coding method, decoding decompression method, device and communication system
CN103236845A (en) * 2013-04-18 2013-08-07 西安石油大学 Method for compacting data transmitted with drilling well mud pulse
CN104301070A (en) * 2014-10-10 2015-01-21 中国石油天然气集团公司 Data error detection and correction method for measurement-while-drilling system
CN104410425A (en) * 2014-10-10 2015-03-11 中国石油天然气集团公司 Method for compressing data of measurement while drilling system

Also Published As

Publication number Publication date
CN114629504A (en) 2022-06-14

Similar Documents

Publication Publication Date Title
JP7010548B2 (en) Methods, devices, and systems for hybrid data compression and decompression
CN100517979C (en) Data compression and decompression method
US5608396A (en) Efficient Ziv-Lempel LZI data compression system using variable code fields
CN107135004B (en) Self-adaptive real-time lossless compression method for seismic data stream
US20030128140A1 (en) Code compression algorithms and architectures for embedded systems
RU2006138607A (en) DATA COMPRESSION METHODS AND SYSTEMS
CN114629504B (en) Downhole while-drilling data compression method and system based on FPGA
CN103236847A (en) Multilayer Hash structure and run coding-based lossless compression method for data
CN108873062A (en) A kind of Multi-encoder high-speed seismic data parallel lossless compression method based on FPGA
CN112968706B (en) Data compression method, FPGA chip and FPGA online upgrading method
KR20030009313A (en) Hardware implementation of a compression algorithm
CN1426629A (en) Method and apparatus for optimized lossless compression using plurality of coders
CN103618554A (en) Internal storage page compression method based on dictionary
CN108494409B (en) Underground high-speed real-time compression method of neutron logging-while-drilling instrument based on small dictionary
CN115967750A (en) Compression and transmission method, compression device and storage medium for while-drilling data
CN115567059A (en) Data compression and decompression method and device
CN112506876B (en) Lossless compression query method supporting SQL query
CN114629962A (en) Method and device for compressing, decompressing and transmitting downhole data while drilling
CN107248899B (en) Turbo code based signal non-uniform error code protection method
KR100702453B1 (en) Circuit and method for use in data compression
CN106772567A (en) A kind of data transfer lossless compression algorithm for seismic prospecting instrument
JP2590287B2 (en) Data compression method and data compression apparatus
CN107659315A (en) A kind of sparse binary-coding circuit for compressed sensing
YuJie et al. A lossless acoustic logging while drill compression scheme based on differential prediction
CN110865299B (en) Folding set layered compression method and device based on forward compatibility

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
GR01 Patent grant
GR01 Patent grant