Obtain the data processing method of petroleum casing pipe thickness
Technical field
The invention belongs to information data processing technology field, is related to a kind of data information processing method, and in particular to a kind of
Obtain the data processing method of petroleum casing pipe thickness.
Background technology
Oil well logging is link essential in petroleum recovery operations, and it is through whole petroleum recovery operations link
In.Log data is the data on the log parameter curve by the data collecting module collected of logger.The pole of log
Value point characterizes the required size for measuring downhole parameters.In order to realize the feature extraction of downhole parameters, it is necessary to extract log data
Waveforms amplitude.
The method that data discrete waveforms amplitude can be used for extracting at present mainly then asks for pole by matched curve method
The method being worth greatly.Most common of which is polynomial curve fitting method.But when data point is more, polynomial order is too low,
Fitting precision and effect are not ideal, and to improve fitting precision and effect just needs to improve the exponent number of polynomial fitting, but exponent number
It is too high and the complexity and otherwise unfavorable on calculating can be brought.Therefore, if only with a polynomial curve function
It is fitted more data point, it is difficult to obtain preferable fitting precision and effect.To efficiently solve above mentioned problem, general use is divided
Section curve matching.But because log data amount is big, precision prescribed is high, method of subsection simulation curve method need to could expire many sections of data point point
Sufficient required precision, thus the shortcomings such as workload is big, efficiency is low be present, then ask for polynomial maximum and add data meter again
Calculation amount, reduces efficiency.
The content of the invention
It is an object of the invention to provide a kind of data processing method for obtaining petroleum casing pipe thickness, using to the very big of data
The average value processing method of value, solve the problems, such as there is that efficiency is low, precision is low in the method for existing extraction data waveform amplitude.
The technical solution adopted in the present invention is the data processing method of petroleum casing pipe thickness to be obtained, specifically according to following
Step is implemented:
Step 1:Log data is gathered with logger;
Step 2:Using continuous every 5 log datas measured in step 1 as one group, find out in each group of data most
Big value aj(j=1,2,3 ... J);
Step 3:Take j=1,2,3,4,5, i.e., a1~a5As the 1st bag data, the average value of the 1st bag data is obtained
Mean1And replace a1~a5;
Step 4:Remainder data during to j >=6 does average value processing;
Step 5:Data a after being handled according to step 4j(j=1,2,3 ... J) generation assistance data bj(j=1,2,3 ... J);
Step 6:By contrasting ajWith bj, find out ajFlex point cjIf, i.e. aj=bj, then cj=aj;Otherwise, cj=0;
Step 7:According to flex point cj, obtain casing thickness relative value dj;
Step 8:Build and train neutral net;
Step 9:Extensive neutral net, sample when will differ from training are input in the neutral net trained,
Error ε between the output valve actual casing thickness value corresponding with sample of calculating neutral net, judges whether the error ε meets reality
The requirement of border error, if meeting to require, step 10 is transferred to, otherwise goes to step 8 structures for re-starting neutral net and training;
Step 10:The neutral net for being built and being trained using step 8 is handled data, obtains sleeve pipe actual (real) thickness value
ej。
The features of the present invention also resides in,
Wherein, step 4 is specifically implemented according to following steps:
Step 4.1:By aj~aj+n-1Data obtain the average value Mean of the i-th bag data as the i-th bag datai;Its
In, i=2,3 ... I;N=5,3,1, and n initial value is set as 5;
Step 4.2:Obtain the bag data average value Mean of this (adjacent) twoiAnd Meani-1Rate of change ratei(0<rate<
1);The rate of change formula for seeking two bag data average values is:
Wherein, abs is takes absolute value function, MeaniFor the average value of the i-th bag data, Meani-1For the flat of the i-th bag data
Average;
Step 4.3:Judge rate of change rateiWhether setting value rate is less than or equal to,
If rateiLess than or equal to rate, then replaced with the average value of n maximum in the i-th bag data in the i-th bag data
N maximum, then go to step 4.4;
If rateiMore than setting value rate, n=n-2 is made, judges whether n is equal to 1, step 4.4 is transferred to if n is equal to 1,
Step 4.1, which is transferred to, if n is more than 1 recalculates Meani,
Step 4.4:I=i+1 is made, judges whether i is less than I, meets that then return to step 4.1 continues to calculate this condition;If i=
I is transferred to step 5.
Step 5 is specifically implemented according to following steps:
Step 5.1:Seek ar-8~ar+8Maximum M in (r=9,10,11 ... J)maxAnd minimum Mmin;
Step 5.2:Use ar-8~ar+8In each data respectively with maximum MmaxAnd minimum MminCompare, if the number
According to maximum MmaxOr minimum MminIt is equal, then bj=aj,;If the data neither with maximum MmaxIt is equal also not with minimum
Value MminIt is equal, then bj=0,
Step 5.3:R=r+1 is made, judges whether r is less than or equal to J-8, meets that then return to step 5.1 continues to count this condition
Calculate;If r is transferred to step 6 more than J-8.
Step 7 is specifically implemented according to following steps:
Step 7.1:Make t=2, d1=a1;
Step 7.2:Judge ctWhether a is equal totIf ct=at, then dt=at;Otherwise, dt=dt-1;
Step 7.3:T=t+1 is made, judges whether t is less than or equal to J, meets that then return to step 7.2 continues to calculate this condition;
Otherwise it is transferred to step 7.4;
Step 7.4:To dtTake absolute value to obtain casing thickness relative value dj。
Wherein, step 8 is specifically implemented according to following steps:
Step 8.1, neutral net is built, defines each several part variable and function in neutral net
The input vector and output vector of wherein each layer be:
Input layer input vector:X=(x1,x2,L,xl)
Hidden layer input vector:Hi=(hi1,hi2,L,hip)
Hidden layer output vector:Ho=(ho1,ho2,L,hop)
Output layer input vector:Yi=(yi1,yi2,L,yiq)
Output layer output vector:Yo=(yo1,yo2,L,yoq)
Desired output vector:Do=(do1,do2,L,doq)
Wherein,
Input layer and the connection weight in intermediate layer:WshS=1,2, L, l h=1,2, L, p
The connection weight of hidden layer and output layer:WhoH=1,2, L, p o=1,2, L, q
The threshold value of each neuron of hidden layer:θhH=1,2, L, p
The threshold value of each neuron of output layer:θoO=1,2, L, q
Sample data number:K=1,2, LK, wherein, K represents number of samples;
Wherein, l represents input layer number,
P represents hidden layer neuron number,
Q represents output layer neuron number;
Hidden layer is using activation primitive:f1(net)=net (1)
Output layer is using activation primitive:
Error function:
Step 8.2, neutral net initializes,
To input layer and the connection weight W in intermediate layersh, hidden layer and output layer connection weight Who, each nerve of hidden layer
The threshold θ of memberh, each neuron of output layer threshold θoA random number in section (- 1,1) is assigned respectively, is given and is calculated essence
Angle value 0.0001, maximum frequency of training Z=1000 and learning rate η=0.8;
Step 8.3, the sample for training is inputted, calculates the output valve of output layer, the sample being trained is known
The thickness relative value of the sleeve pipe of actual (real) thickness value,
Specifically implement according to following steps:
Step 8.3.1, k-th of input sample is randomly selected,
X (k)=(x1(k),x2(k),L,xl(k)),
Its desired output is:
Do (k)=(do1(k),do2(k),L,doq(k));Desired output herein is that the sleeve pipe corresponding to input sample is real
Border thickness value,
Step 8.3.2, the input and output of each neuron of hidden layer are calculated,
The input of each neuron of hidden layer is:
Wherein, h=1,2, L, p; (4)
The output of each neuron of hidden layer is:
hoh(k)=f1(hih(k)) h=1,2, L, p; (5)
Step 8.3.3, the input and output of each neuron of output layer are calculated,
The input of each neuron of output layer is,
The output of each neuron of output layer is:
yoo(k)=f2(yio(k)) o=1,2, L q; (7)
Step 8.4, global error is calculated, and judges whether its precision meets the requirements:
Step 8.4.1:Utilize the desired output d in step 8.3oAnd reality output yo (k)o(k) difference between, is obtained
Global error,
Whether the global error of the neutral net calculated in step 8.4.2, judgment step 8.4.1 meets to require, if entirely
Office's error is not up to default precision 0.0001 and frequency of training is less than the maximum times 1000 of setting, then goes to step 8.5 and repaiied
Just, if global error reaches default precision 0.0001 or learns the maximum times 1000 that number is more than setting, 9 are gone to step;
Step 8.5, calculated according to network desired output do (k) and reality output yo (k), to input layer and intermediate layer
Connection weight Wsh, hidden layer and output layer connection weight Who, each neuron of hidden layer threshold θh, each neuron of output layer
Threshold θoIt is modified,
Specifically implement according to following steps:
Step 8.5.1, using error function e, output layer is calculated to the connection weight adjustment amount Δ w of hidden layerho;
Because
If willIt is defined as-δo(k), i.e.,
Then (9) formula abbreviation is
Δwho=η δo(k)hoh(k) (12)
Step 8.5.2, using error function e, hidden layer is calculated to the connection weight adjustment amount Δ w of input layerlh;
Because
If willIt is defined as-δh(k), i.e.,
Then formula (13) abbreviation is
Δwsh=η δh(k)xs(k) (16)
Step 8.5.3, utilize error function e, the adjusting thresholds amount Δ θ of calculating each neuron of output layero;
Step 8.5.4, utilize error function e, the adjusting thresholds amount Δ θ of calculating each neuron of hidden layerh;
Step 8.5.4, utilize the δ of each neuron of output layero(k) and each neuron of hidden layer output hoh(k) correct
Connection weight who(k);
After then correcting,
Wherein z (z=1,2,3 ..., Z) it is frequency of training;
Step 8.5.5:Utilize the δ of each neuron of hidden layerh(k) and each neuron of input layer input xs(k) amendment connection
Weight wsh(k);
After then correcting,
Step 8.5.6:Correct the threshold θ of each neuron of hidden layerhWith the threshold θ of each neuron of output layero;
After then correcting,
θh z+1=θh+Δθh (21)
θo z+1=θo+Δθo (22)
Using revisedθh z+1And θo z+1Return to step 8.3 is trained again, wherein revisedWith θo z+1WithWith θh z+1The w corresponded respectively in the formula in step 8.3 (6)hoWith and θoW in formula (4)shWith θh。
Step 10 is specifically implemented according to following steps:
Step 10.1, casing thickness relative value d step 7 drawnjAs input value be input to step 9 carry out it is extensive after
In obtained neutral net, hidden layer input vector hi is obtained using formula (4)h(j);
Step 10.2:By the input vector hi of the hidden layer obtained in step 10.1h(j) it is public to substitute into hidden layer output vector
Formula (5) hoh(j)=f1(hih(j) in) h=1,2, L, p,
Obtain hidden layer output vector hoh(j);
Step 10.3:By hoh(j) the input vector formula (6) of output layer is substituted into:
Obtain the input vector yi of output layero(j);
Step 10.4:By yio(j) output layer output vector formula is substituted into:
yoo(j)=f2(yio(j)) o=1,2, L q,
Obtain output layer output vector yoo(j), i.e. sleeve pipe actual (real) thickness value ej。
The invention has the advantages that data point need not be fitted to multinomial by the inventive method then tries to achieve extreme value
Point, data waveform amplitude is directly extracted by initial data, not only execution efficiency is high, and is not influenceed by data amount check;According to
Data variation rate replaces the processing method of maximum with average value, and flash removed can be gone to disturb, and improves precision.Therefore present invention side
Method has that processing data is more efficient, precision is higher, the simpler advantage of Project Realization.
Brief description of the drawings
Fig. 1 is the flow chart for the data processing method that the present invention obtains petroleum casing pipe thickness;
Fig. 2 is the ripple that log data connects into step 1 in the data processing method of the invention for obtaining petroleum casing pipe thickness
Shape detail view;
Fig. 3 is that the present invention obtains dispersion number in the step 3 and step 4 obtained in the data processing method of petroleum casing pipe thickness
According to the discrete envelope figure of the most value of waveforms amplitude;
Fig. 4 is the thickness log at the coupling of petroleum casing pipe measured in practice;
Fig. 5 is that the petroleum casing pipe obtained in the data processing method of present invention acquisition petroleum casing pipe thickness by step 7 connects
Thickness is with respect to change curve at hoop;
Fig. 6 is to utilize neutral net to carry out data processing in the data processing method of present invention acquisition petroleum casing pipe thickness
Flow chart
Fig. 7 is that the extensive output of BP neural network and expectation are defeated in the data processing method of the invention for obtaining petroleum casing pipe thickness
Go out data line chart;
Fig. 8 is that the extensive output of BP neural network and expectation are defeated in the data processing method of the invention for obtaining petroleum casing pipe thickness
The error amount line chart gone out;
Fig. 9 is that the present invention obtains in the data processing method of petroleum casing pipe thickness casing wall thickness schematic diagram at box cupling.
Embodiment
The present invention is described in detail with reference to the accompanying drawings and detailed description.
The present invention obtains the data processing method of petroleum casing pipe thickness, as shown in figure 1, specifically implementing according to following steps:
Step 1:Log data is gathered with logger;
Step 2:Using continuous every 5 log datas measured in step 1 as one group, find out in each group of data most
Big value aj(j=1,2,3 ... J);
Step 3:Take j=1,2,3,4,5, i.e., a1~a5As the 1st bag data, the average value of the 1st bag data is obtained
Mean1And replace a1~a5;
Step 4:Remainder data during to j >=6 does average value processing:
Step 4.1:By aj~aj+n-1(n=5,3,1) data obtain the i-th bag as i-th (i=2,3 ... I) bag data
The average value Mean of datai;If n initial value is 5;
Step 4.2:Obtain the bag data average value Mean of this (adjacent) twoiAnd Meani-1Rate of change ratei(0<rate<
1);The rate of change formula for seeking two bag data average values is:
Wherein, abs is takes absolute value function, MeaniFor the average value of the i-th bag data, Meani-1For the flat of the i-th bag data
Average;
Step 4.3:Judge rate of change rateiWhether setting value rate is less than or equal to,
If rateiLess than or equal to rate, then replaced with the average value of n maximum in the i-th bag data in the i-th bag data
N maximum, then go to step 4.4;
If rateiMore than setting value rate, n=n-2 is made, judges whether n is equal to 1, step 4.4 is transferred to if n is equal to 1,
Step 4.1, which is transferred to, if n is more than 1 recalculates Meani。
Step 4.4:I=i+1 is made, judges whether i is less than I, meets that then return to step 4.1 continues to calculate this condition;If i=
I is transferred to step 5.
Step 5:Data a after being handled according to step 4j(j=1,2,3 ... J) generation assistance data bj(j=1,2,3 ... J),
Specifically implement according to following steps:
Step 5.1:Seek ar-8~ar+8Maximum M in (r=9,10,11 ... J)maxAnd minimum Mmin。
Step 5.2:Use ar-8~ar+8In each data respectively with maximum MmaxAnd minimum MminCompare, if the number
According to maximum MmaxOr minimum MminIt is equal, then bj=aj,;If the data neither with maximum MmaxIt is equal also not with minimum
Value MminIt is equal, then bj=0.
Step 5.3:R=r+1 is made, judges whether r is less than or equal to J-8, meets that then return to step 5.1 continues to count this condition
Calculate;If r is transferred to step 6 more than J-8.
Step 6:Find out ajFlex point cj.If aj=bj, then cj=aj;Otherwise, cj=0.
Step 7:According to flex point cj, obtain casing thickness relative value dj。
Specifically implement according to following steps:
Step 7.1:Make t=2, d1=a1;
Step 7.2:Judge ctWhether a is equal totIf ct=at, then dt=at;Otherwise, dt=dt-1。
Step 7.3:T=t+1 is made, judges whether t is less than or equal to J, meets that then return to step 7.2 continues to calculate this condition;
Otherwise it is transferred to step 7.4.
Step 7.4:To dtTake absolute value to obtain casing thickness relative value dj。
Step 8:Build and train neutral net, as shown in fig. 6, specifically implementing according to following steps:
Step 8.1, neutral net is built, defines each several part variable and function in neutral net
The input vector and output vector of wherein each layer be:
Input layer input vector:X=(x1,x2,L,xl)
Hidden layer input vector:Hi=(hi1,hi2,L,hip)
Hidden layer output vector:Ho=(ho1,ho2,L,hop)
Output layer input vector:Yi=(yi1,yi2,L,yiq)
Output layer output vector:Yo=(yo1,yo2,L,yoq)
Desired output vector:Do=(do1,do2,L,doq)
Wherein,
Input layer and the connection weight in intermediate layer:WshS=1,2, L, l h=1,2, L, p
The connection weight of hidden layer and output layer:WhoH=1,2, L, p o=1,2, L, q
The threshold value of each neuron of hidden layer:θhH=1,2, L, p
The threshold value of each neuron of output layer:θoO=1,2, L, q
Sample data number:K=1,2, L K, wherein, K represents number of samples;
Wherein, l represents input layer number,
P represents hidden layer neuron number,
Q represents output layer neuron number.
Hidden layer is using activation primitive:f1(net)=net (1)
Output layer is using activation primitive:
Error function:
Step 8.2, neutral net initializes,
To input layer and the connection weight W in intermediate layersh, hidden layer and output layer connection weight Who, each nerve of hidden layer
The threshold θ of memberh, each neuron of output layer threshold θoA random number in section (- 1,1) is assigned respectively, is given and is calculated essence
Angle value 0.0001, maximum frequency of training Z=1000 and learning rate η=0.8;
Step 8.3, the sample for training is inputted, calculates the output valve of output layer, the sample being trained is known
The thickness relative value of the sleeve pipe of actual (real) thickness value,
Specifically implement according to following steps:
Step 8.3.1, k-th of input sample is randomly selected,
X (k)=(x1(k),x2(k),L,xl(k)),
Its desired output is:
Do (k)=(do1(k),do2(k),L,doq(k));Desired output herein is that the sleeve pipe corresponding to input sample is real
Border thickness value,
Step 8.3.2, the input and output of each neuron of hidden layer are calculated,
The input of each neuron of hidden layer is:
Wherein, h=1,2, L, p; (4)
The output of each neuron of hidden layer is:
hoh(k)=f1(hih(k)) h=1,2, L, p; (5)
Step 8.3.3, the input and output of each neuron of output layer are calculated,
The input of each neuron of output layer is,
The output of each neuron of output layer is:
yoo(k)=f2(yio(k)) o=1,2, L q; (7)
Step 8.4, global error is calculated, and judges whether its precision meets the requirements:
Step 8.4.1:Utilize the desired output d in step 8.3oAnd reality output yo (k)o(k) difference between, is obtained
Global error,
Whether the global error of the neutral net calculated in step 8.4.2, judgment step 8.4.1 meets to require, if entirely
Office's error is not up to default precision 0.0001 and frequency of training is less than the maximum times 1000 of setting, then goes to step 8.5 and repaiied
Just, if global error reaches default precision 0.0001 or learns the maximum times 1000 that number is more than setting, 9 are gone to step.
Step 8.5, calculated according to network desired output do (k) and reality output yo (k), to input layer and intermediate layer
Connection weight Wsh, hidden layer and output layer connection weight Who, each neuron of hidden layer threshold θh, each neuron of output layer
Threshold θoIt is modified,
Specifically implement according to following steps:
Step 8.5.1, using error function e, output layer is calculated to the connection weight adjustment amount Δ w of hidden layerho。
Because
If willIt is defined as-δo(k), i.e.,
Then formula (9) abbreviation is
Δwho=η δo(k)hoh(k) (12)
Step 8.5.2, using error function e, hidden layer is calculated to the connection weight adjustment amount Δ w of input layerlh。
Because
If willIt is defined as-δh(k), i.e.,
Then formula (13) abbreviation is
Δwsh=η δh(k)xs(k) (16)
Step 8.5.3, utilize error function e, the adjusting thresholds amount Δ θ of calculating each neuron of output layero。
Step 8.5.4, utilize error function e, the adjusting thresholds amount Δ θ of calculating each neuron of hidden layerh。
Step 8.5.4, utilize the δ of each neuron of output layero(k) and each neuron of hidden layer output hoh(k) correct
Connection weight who(k);
After then correcting,
Wherein z (z=1,2,3 ..., Z) it is frequency of training;
Step 8.5.5:Utilize the δ of each neuron of hidden layerh(k) and each neuron of input layer input xs(k) amendment connection
Weight wsh(k);
After then correcting,
Step 8.5.6:Correct the threshold θ of each neuron of hidden layerhWith the threshold θ of each neuron of output layero。
After then correcting,
θh z+1=θh+Δθh (21)
θo z+1=θo+Δθo (22)
Using revisedθh z+1And θo z+1Return to step 8.3 is trained again, wherein revisedWith θo z+1WithWith θh z+1The w corresponded respectively in the formula in step 8.3 (6)hoWith and θoW in formula (4)shWith θh。
Step 9:Extensive neutral net, sample when will differ from training are input in the neutral net trained,
Error ε between the output valve actual casing thickness value corresponding with sample of calculating neutral net, judges whether the error ε meets reality
Border error requirement (0.75mm, ε be less than casing thickness 10%), if meet require, be transferred to step 10, otherwise go to step 8
Re-start structure and the training of neutral net.
Step 10:The neutral net for being built and being trained using step 8 is handled data, obtains sleeve pipe actual (real) thickness value
ej, specifically implement according to following steps:
Step 10.1, casing thickness relative value d step 7 drawnjAs input value be input to step 9 carry out it is extensive after
In obtained neutral net, hidden layer input vector hi is obtained using formula (4)h(j);
Step 10.2:By the input vector hi of the hidden layer obtained in step 10.1h(j) it is public to substitute into hidden layer output vector
Formula (5) hoh(j)=f1(hih(j) in) h=1,2, L, p,
Obtain hidden layer output vector hoh(j);
Step 10.3:By hoh(j) the input vector formula (6) of output layer is substituted into:
Obtain the input vector yi of output layero(j);
Step 10.4:By yio(j) output layer output vector formula is substituted into:
yoo(j)=f2(yio(j)) o=1,2, L q
Obtain output layer output vector yoo(j), i.e. sleeve pipe actual (real) thickness value ej。
During step 1 gathered data, new double far-field electromagnetic focusing thickness meters, the data measured such as Fig. 2 well loggings are used
Shown in the waveform detail view that data connect into, data point therein is exactly the data used in the inventive method in step 1.Well logging
Data are the data on the log parameter curve by the data collecting module collected of logger.Due to the remote biography of data
It is defeated, it is desirable to describing the information data transmission of each physical parameter in underground should as quickly as possible, it is few, and accurately.This experimental data is to use
The log data of the 5 data points composition sampled on the thickness curve at coupling of petroleum casing pipe in a measurement period, it is each
The amplitude of point represents the casing thickness inscribed when this.
Fig. 3 is the discrete envelope figure of most value for the discrete data waveforms amplitude that step 3 and step 4 obtain, wherein index point *
Represent data point;Fig. 4 is the thickness log at coupling of petroleum casing pipe, log be by logger in depth under
The curve of each physical parameter in underground is measured during upper km;By comparison diagram 3 and Fig. 4, two figures have identical amplitude
Profile, show that the inventive method being capable of the accurate amplitude extracted on thickness log.
Fig. 5 be at coupling of petroleum casing pipe that step 7 obtains thickness with respect to change curve.
Fig. 7 is the extensive output of BP neural network and desired output.The extensive output of BP neural network and desired output in figure
Error is as shown in Figure 8.Know from figure, its worst error is 0.3368mm, fully meets engineering demand.
Fig. 9 is casing wall thickness schematic diagram at box cupling.At box cupling actual casing wall thickness be followed successively by from left to right 7.5mm,
17.75mm、10.25mm、17.75mm、7.5mm.Alphabetical A, B, C, D, E meaning curve thickness characterizes successively in Fig. 5 figures connects
Actual casing wall thickness 7.5mm, 17.75mm, 10.25mm, 17.75mm, 7.5mm at hoop.Pass through result figure and schematic diagram
Contrast knows that the result of the inventive method processing meets casing wall actual (real) thickness change curve.
The inventive method, it is not necessary to data point is fitted to multinomial and then tries to achieve extreme point, is directly carried by initial data
According to waveforms amplitude, not only execution efficiency is high, precision is high, and is not influenceed by data amount check for access.Therefore, can be quick and precisely
Ground obtains petroleum casing pipe thickness from a large amount of log datas.