A method and apparatus for detecting gas pipelines based on gyroscopes
By identifying and correcting abnormal data caused by interference from welds, joints, debris, etc. when the measurement unit is walking in the gas pipeline, an accurate three-dimensional pipeline diagram is generated, which solves the problem of inaccurate three-dimensional pipeline diagrams in the prior art and improves the accuracy of the diagram.
Patent Information
- Application Number
- CN202311375437.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-23
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2043-10-23
AI Technical Summary
In the prior art, the data collected by the measurement unit is used to generate a three-dimensional pipeline diagram, and the impact of pipeline welds, joints, debris, etc. on the measurement unit cannot be ruled out, resulting in the generated three-dimensional pipeline diagram inaccurate.
By receiving the data collected by the gyroscope and odometer in the measurement unit, identifying and correcting the abnormal azimuth angular velocity, generating the corrected target azimuth angular velocity sequence and the target program sequence, and combining the three-dimensional coordinates of the start and end points of the gas pipeline, an accurate three-dimensional pipeline diagram is generated.
Effectively identify and correct abnormal data caused by interference from welds, joints, debris, etc., improve the accuracy of the three-dimensional pipeline diagram, and provide accurate gas pipeline location for engineering construction.
Smart Images

Figure CN117606440B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of pipeline surveying and mapping, and in particular relates to a gyroscope-based gas pipeline detection method and device. Background Art
[0002] Gas pipelines are widely distributed in various locations in the city to transport gas to various areas in the city. Therefore, it is necessary to map the accurate three-dimensional pipeline map of the gas pipelines.
[0003] In the prior art, a measuring unit equipped with a gyroscope is usually used to walk and detect in a gas pipeline, and a plurality of three-dimensional coordinates of the measuring unit in the gas pipeline are obtained through the self-positioning of the gyroscope, which are used as the plurality of coordinates of the center of the gas pipeline, thereby generating a three-dimensional pipeline map of the gas pipeline. Currently, after the measuring unit has finished measuring in the gas pipeline, the collected data is directly received from the measuring unit, and the three-dimensional pipeline map is directly generated using the collected data. However, there are interference objects such as welds, joints or debris in the gas pipeline. When the measuring unit walks in the gas pipeline, it is affected by the interference objects, and the collected data is abnormal. The three-dimensional pipeline map is directly generated using the collected data, resulting in inaccurate three-dimensional pipeline map. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a gyroscope-based gas pipeline detection method and device, which aims to solve the problem that the three-dimensional pipeline map is currently generated directly using data collected by a measuring unit, and the influence of pipeline welds, joints, debris, etc. on the measuring unit cannot be eliminated, resulting in inaccurate generated three-dimensional pipeline maps.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] A gas pipeline detection method based on a gyroscope is applied to a measurement unit provided with a gyroscope and an odometer, and specifically comprises the following steps:
[0007] When the measuring unit finishes walking in the gas pipeline, receiving an initial azimuth velocity sequence collected by the gyroscope at a first frequency and an initial mileage sequence collected by the odometer at a second frequency, wherein the second frequency is greater than the first frequency;
[0008] Identifying an abnormal azimuth velocity from the initial azimuth velocity sequence, wherein the abnormal azimuth velocity is an azimuth velocity collected when the measuring unit passes through an interfering object in the gas pipeline;
[0009] Correcting the abnormal azimuth velocity in the initial azimuth velocity sequence to obtain a corrected target azimuth velocity sequence;
[0010] Determine the mileage matching each azimuth velocity in the target azimuth velocity sequence from the initial mileage sequence to obtain a target mileage sequence;
[0011] Based on the three-dimensional coordinates of the starting point and the end point of the gas pipeline, the target azimuth velocity sequence and the target mileage sequence are used to generate a three-dimensional coordinate sequence of the gas pipeline;
[0012] A three-dimensional pipeline diagram of the gas pipeline is generated based on the three-dimensional coordinate sequence.
[0013] As a further limitation of the embodiment of the present invention, the identifying the abnormal azimuth velocity from the initial azimuth velocity sequence specifically includes the following steps:
[0014] Using the initial azimuth velocity sequence to generate an azimuth velocity curve graph;
[0015] The azimuth velocity curve graph is input into a pre-trained anomaly recognition model to obtain the abnormal azimuth velocity.
[0016] As a further limitation of the embodiment of the present invention, the anomaly recognition model is trained in the following manner:
[0017] Acquiring training data, wherein the training data includes training azimuth angular velocity, and the training azimuth angular velocity includes abnormal azimuth angular velocity;
[0018] Generate a training curve using the training azimuth velocity, and mark each sample point on the training curve with an abnormal azimuth velocity or a normal azimuth velocity to obtain a label value for each sample point;
[0019] Inputting the training curve into an anomaly recognition model to obtain a predicted value of each sample point in the training curve;
[0020] The loss rate is calculated using the label value and predicted value of each sample point;
[0021] Determining whether the loss rate is less than a loss rate threshold;
[0022] If yes, stop training the anomaly recognition model;
[0023] If not, the model parameters of the anomaly recognition model are adjusted based on the loss rate, and the process returns to the step of inputting the training curve into the anomaly recognition model.
[0024] As a further limitation of the embodiment of the present invention, the calculation of the loss rate using the label value and the predicted value of each sample point specifically includes the following steps:
[0025] Obtaining the label value of the sample point;
[0026] The loss rate is calculated according to the following formula:
[0027] ;
[0028] ;
[0029] Among them, i is the i-th sample point, is the predicted value of sample point i, is the label value of sample point i, n is the number of sample points, is the weight of sample point i.
[0030] As a further limitation of the embodiment of the present invention, the identifying the abnormal azimuth velocity from the initial azimuth velocity sequence specifically includes the following steps:
[0031] For each target azimuth velocity in the initial azimuth velocity sequence, calculating a first change rate between the target azimuth velocity and a previous azimuth velocity, and calculating a second change rate between the target azimuth velocity and a subsequent azimuth velocity;
[0032] When both the first change rate and the second change rate are greater than a first change rate threshold and less than a second change rate threshold, it is determined that the target azimuth velocity is an abnormal azimuth velocity.
[0033] As a further limitation of the embodiment of the present invention, the identifying the abnormal azimuth velocity from the initial azimuth velocity sequence specifically includes the following steps:
[0034] Using a sliding window of a preset length to slide from the beginning to the end in the initial azimuth velocity sequence according to a preset step length;
[0035] Each time the sliding window slides once, calculating the absolute value of the difference between two adjacent azimuth velocities in the sliding window;
[0036] When there is an absolute value greater than a preset threshold, two adjacent azimuth angular velocities whose absolute value of the difference is greater than the preset threshold are determined to be abnormal azimuth angular velocities.
[0037] As a further limitation of the embodiment of the present invention, the correcting the abnormal azimuth velocity in the initial azimuth velocity sequence to obtain a corrected target azimuth velocity sequence specifically includes the following steps:
[0038] Determine the first n azimuth angular velocities and the last m azimuth angular velocities of the abnormal azimuth angular velocity from the initial azimuth angular velocity sequence;
[0039] The abnormal azimuth angular velocity is corrected based on the first n azimuth angular velocities and the last m azimuth angular velocities to obtain a corrected target azimuth angular velocity sequence.
[0040] As a further limitation of an embodiment of the present invention, the correcting the abnormal azimuth angular velocity based on the first n azimuth angular velocities and the last m azimuth angular velocities to obtain a corrected target azimuth angular velocity sequence specifically includes the following steps:
[0041] Calculating the average or median of the first n azimuth angular velocities and the last m azimuth angular velocities;
[0042] The abnormal azimuth velocity is replaced by the average value or the median value to obtain a corrected target azimuth velocity sequence.
[0043] As a further limitation of the embodiment of the present invention, determining the mileage matching each azimuth velocity in the target azimuth velocity sequence from the initial mileage sequence to obtain the target mileage sequence specifically includes the following steps:
[0044] Determine a first acquisition timestamp of each azimuth velocity in the target azimuth velocity sequence, and determine a second acquisition timestamp of each mileage in the initial mileage sequence;
[0045] For each azimuth velocity in the target azimuth velocity sequence, a target mileage having a minimum time difference between a second acquisition timestamp and a first acquisition timestamp of the azimuth velocity is determined from the initial mileage sequence to generate a target mileage sequence.
[0046] A gas pipeline detection device based on a gyroscope is applied to a measuring unit provided with a gyroscope and an odometer, and specifically includes the following units:
[0047] A data receiving unit is used to receive, when the measuring unit finishes walking in the gas pipeline, an initial azimuth velocity sequence collected by the gyroscope at a first frequency and an initial mileage sequence collected by the odometer at a second frequency, wherein the second frequency is greater than the first frequency;
[0048] an abnormal data identification unit, used to identify an abnormal azimuth velocity from the initial azimuth velocity sequence, wherein the abnormal azimuth velocity is the azimuth velocity collected when the measuring unit passes through an interfering object in the gas pipeline;
[0049] an abnormal data correction unit, used for correcting the abnormal azimuth velocity in the initial azimuth velocity sequence to obtain a corrected target azimuth velocity sequence;
[0050] a target mileage sequence determination unit, configured to determine, from the initial mileage sequence, a mileage matching each azimuth velocity in the target azimuth velocity sequence, to obtain a target mileage sequence;
[0051] A three-dimensional coordinate sequence generating unit, configured to generate a three-dimensional coordinate sequence of the gas pipeline based on the three-dimensional coordinates of the starting point and the end point of the gas pipeline, using the target azimuth velocity sequence and the target mileage sequence;
[0052] A three-dimensional pipeline diagram generating unit is used to generate a three-dimensional pipeline diagram of the gas pipeline based on the three-dimensional coordinate sequence.
[0053] Compared with the prior art, the present invention has the following beneficial effects:
[0054] After receiving the initial azimuth velocity sequence output by the gyroscope and the initial mileage sequence output by the odometer, the embodiment of the present invention identifies abnormal azimuth velocities from the initial azimuth velocity sequence, corrects the abnormal azimuth velocities in the initial azimuth velocity sequence to obtain a corrected target azimuth velocity sequence, determines the mileage matching each azimuth velocity in the target azimuth velocity sequence from the initial mileage sequence to obtain a target mileage sequence, generates a three-dimensional coordinate sequence of the gas pipeline based on the three-dimensional coordinates of the starting point and the end point of the gas pipeline, and generates a three-dimensional pipeline map by using the target azimuth velocity sequence and the target mileage sequence, and identifies abnormal azimuth velocities caused by the influence of welds, joints or debris in the gas pipeline on the gyroscope through the abnormal azimuth velocity and correcting the abnormal azimuth velocity, solves the problem of inaccurate generation of the three-dimensional pipeline map due to the presence of abnormal azimuth velocity in the data collected by the gyroscope, improves the accuracy of the generated three-dimensional pipeline map, and provides the accurate position of the gas pipeline for engineering construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention.
[0056] Figure 1 A flow chart of a gyroscope-based gas pipeline detection method provided by an embodiment of the present invention is shown.
[0057] Figure 2 A schematic diagram showing an azimuth velocity curve diagram of an embodiment of the present invention is shown;
[0058] Figure 3 A schematic diagram of a sequence of azimuth velocity and mileage in an embodiment of the present invention is shown;
[0059] Figure 4 An application architecture diagram of a gyroscope-based gas pipeline detection device provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0061] Figure 1 The flowchart of the gas pipeline detection method based on the gyroscope provided by the embodiment of the present invention is shown. Specifically, the gas pipeline detection method based on the gyroscope according to the embodiment of the present invention specifically includes the following steps:
[0062] Step S101, when the measuring unit finishes walking in the gas pipeline, an initial azimuth velocity sequence collected by the gyroscope at a first frequency and an initial mileage sequence collected by the odometer at a second frequency are received, and the second frequency is greater than the first frequency.
[0063] The gas pipeline in this embodiment is buried deep under the ground, and the gas pipeline is a circular pipe. After the construction of the gas pipeline is completed, a three-dimensional pipeline map of the gas pipeline needs to be surveyed and mapped for record, so as to facilitate subsequent construction to determine whether there is a gas pipeline under the ground.
[0064] The measuring unit may include a gyroscope and an odometer, and the measuring unit may refer to the gyroscope, inertial measurement unit, etc. used for pipeline detection in the prior art. When mapping a three-dimensional pipeline map of a gas pipeline, the measuring unit is placed in the gas pipeline, and the measuring unit is moved from the starting point of the gas pipeline to the end point of the gas pipeline. During the movement of the measuring unit, the gyroscope is controlled to collect the azimuth velocity at a first frequency so that the gyroscope outputs an azimuth velocity sequence, and the odometer is controlled to collect the mileage at a second frequency so that the odometer outputs an initial mileage sequence, wherein the second frequency is greater than the first frequency.
[0065] After the measuring unit finishes walking in the gas pipeline, the initial azimuth velocity sequence collected by the gyroscope can be received from the measuring unit in a wired or wireless manner, and the initial mileage sequence collected by the odometer can be received from the odometer.
[0066] Step S102, identifying an abnormal azimuth velocity from the initial azimuth velocity sequence, where the abnormal azimuth velocity is the azimuth velocity collected when the measurement unit passes through the interference object in the gas pipeline.
[0067] In this embodiment, the gas pipeline is composed of multiple sections of pipelines connected by joints or welding, and there may be debris in the gas pipeline. When the measuring unit moves in the gas pipeline, the joints, welds, and debris may affect the walking mechanism of the measuring unit, such as affecting the wheels of the measuring unit, causing the azimuth velocity collected by the gyroscope to be abnormal. In this case, the initial azimuth velocity sequence needs to be processed to remove the abnormal azimuth velocity.
[0068] In one embodiment, an azimuth velocity curve graph may be generated using an initial azimuth velocity sequence, and the azimuth velocity curve graph may be input into a pre-trained abnormality recognition model to obtain abnormal azimuth velocity. The abnormality recognition model may be a model that can recognize abnormal azimuth velocity after inputting an azimuth velocity curve, and the azimuth velocity curve may be a curve generated using the azimuth velocities in the initial azimuth velocity sequence, such as Figure 2 As shown, in the azimuth velocity curve diagram, the horizontal axis is time, the vertical axis is azimuth velocity, and the abnormal recognition model can output the time of abnormal azimuth velocity.
[0069] Among them, when training the anomaly recognition model, training data can be obtained, and the training data includes training azimuth angular velocity, and the training azimuth angular velocity includes abnormal azimuth angular velocity. The training azimuth angular velocity is used to generate a training curve, and the abnormal azimuth angular velocity or the normal azimuth angular velocity is marked for each sample point on the training curve to obtain the label value of each sample point, and the training curve is input into the anomaly recognition model to obtain the predicted value of each sample point in the training curve, and the loss rate is calculated using the label value and the predicted value of each sample point, and it is determined whether the loss rate is less than the loss rate threshold. If so, stop training the anomaly recognition model, if not, adjust the model parameters of the anomaly recognition model based on the loss rate, and return to the step of inputting the training curve into the anomaly recognition model.
[0070] like Figure 2 The following is a schematic diagram of a training curve. The horizontal axis of the training curve is time and the vertical axis is angular velocity. The training curve is generated by fitting the azimuth angular velocity at multiple time points. Each azimuth angular velocity is a sample point. Figure 2 In the example, the sample point P1 is an abnormal azimuth velocity. For example, the sample point P1 may be a gyroscope in the measurement unit. When the gyroscope passes through a protruding weld, a concave seam or debris in the gas pipeline, the azimuth velocity is abnormal due to a sudden change in the moving direction of the gyroscope. Therefore, the label value of the sample point P1 can be marked as 1, indicating that the sample point P1 is an abnormal azimuth velocity, and the label values of the other sample points are 0, indicating that the other sample points are normal azimuth velocities.
[0071] The training curve is input into the anomaly recognition model to obtain the predicted value of each sample point in the training curve. The loss rate is calculated by the predicted value and the label value, and the model parameters are adjusted by the loss rate so that the model can have the ability to identify abnormal azimuth velocity. The loss rate can be calculated according to the following formula:
[0072] ;
[0073] ;
[0074] Among them, i is the i-th sample point, is the predicted value of sample point i, is the label value of sample point i, n is the number of sample points, is the weight of sample point i. It can be seen from the above loss rate calculation formula that when marked as abnormal azimuth angular velocity, it has a higher weight when calculating the loss rate. After adjusting the model through the loss rate, the model pays more attention to learning and identifying abnormal azimuth angular velocity, and improves the accuracy of the model in identifying abnormal azimuth angular velocity. This embodiment identifies abnormal azimuth angular velocity by training the abnormal recognition model, which has good versatility and high accuracy.
[0075] In another embodiment, for each target azimuth velocity in the initial azimuth velocity sequence, a first change rate of the target azimuth velocity with the previous azimuth velocity can be calculated, and a second change rate of the target azimuth velocity with the next azimuth velocity can be calculated. When the first change rate and the second change rate are both greater than the first change rate threshold and less than the second change rate threshold, the target azimuth velocity is determined to be an abnormal azimuth velocity. Exemplarily, for the azimuth velocity ωn, a first change rate Rate1 of the azimuth velocity ωn with the previous azimuth velocity ωn-1 and a second change rate Rate2 of the azimuth velocity ωn with the next azimuth velocity ωn+1 can be calculated. The change rate can be the ratio of the difference between the two values to one of the two values. When the first change rate Rate1 and the second change rate Rate2 are both greater than the first change rate threshold and less than the second change rate threshold, the azimuth velocity ωn is determined to be an abnormal azimuth velocity, wherein the second change rate threshold can be the minimum change rate of two adjacent azimuth velocities collected at the bend when the gas pipeline is bent. This embodiment determines the abnormal azimuth angular velocity by calculating the change rate of adjacent azimuth angular velocities. The calculation method is simple, the amount of calculation is small, the efficiency of identifying the abnormal azimuth angular velocity is high, and the abnormal azimuth angular velocity can be quickly determined.
[0076] In another embodiment, a sliding window of a preset length may be used to slide from the beginning to the end of the initial azimuth velocity sequence according to a preset step size. Each time the sliding window slides, the absolute value of the difference between two adjacent azimuth velocities in the sliding window is calculated. When there is an absolute value greater than a preset threshold, the two adjacent azimuth velocities whose absolute value of the difference is greater than the preset threshold are determined to be abnormal azimuth velocities.
[0077] Exemplarily, the length of the sliding window can be 10, and the step length can be 2, that is, each time the sliding window slides, the sliding window includes 10 azimuth velocities, and the absolute value of the difference between two adjacent azimuth velocities in the 10 azimuth velocities can be calculated. If the absolute value of the difference between two adjacent azimuth velocities is greater than a threshold, the two adjacent azimuth velocities are determined to be abnormal azimuth velocities, and then continue to slide according to the step length until the initial azimuth velocity sequence is traversed to obtain all abnormal azimuth velocities. In this embodiment, the abnormal azimuth velocity is determined by the absolute value of the difference between two adjacent azimuth velocities in the sliding window, the amount of calculation is small, the efficiency of identifying abnormal azimuth velocities is high, and the abnormal azimuth velocity can be quickly determined.
[0078] Step S103, correcting the abnormal azimuth angular velocity in the initial azimuth angular velocity sequence to obtain a corrected target azimuth angular velocity sequence.
[0079] In one embodiment, the first n azimuth velocities and the last m azimuth velocities of the abnormal azimuth velocities can be determined from the initial azimuth velocity sequence, and the abnormal azimuth velocities are corrected based on the first n azimuth velocities and the last m azimuth velocities to obtain a corrected target azimuth velocity sequence, wherein n and m can be equal or unequal natural numbers, and for example, n can be 3 and m can be 5.
[0080] In an example, the average values of the first n azimuth angular velocities and the last m azimuth angular velocities can be calculated, and the calculated average values are used to replace the abnormal azimuth angular velocity to obtain a corrected target azimuth angular velocity sequence. For example, corresponding to the abnormal azimuth angular velocity ωi, the average values of ωi-1, ωi-2, ..., ωi-n, ωi+1, ωi+2, ..., ωi+m are calculated, and the calculated average values are used to replace ωi in the initial azimuth angular velocity sequence to obtain a corrected target azimuth angular velocity sequence.
[0081] In another embodiment, corresponding to the abnormal azimuth angular velocity ωi, ωi-1, ωi-2, ..., ωi-n, ωi+1, ωi+2, ..., ωi+m are sorted in order from large to small, and the azimuth angular velocity (median) in the middle is used to replace ωi in the initial azimuth angular velocity sequence to obtain a corrected target azimuth angular velocity sequence.
[0082] This embodiment replaces the abnormal azimuth angular velocity by the mean or median of the first n azimuth angular velocities and the last m azimuth angular velocities of the abnormal azimuth angular velocity to correct the abnormal azimuth angular velocity, thereby improving the accuracy of the target azimuth angular velocity sequence used to generate a three-dimensional pipeline map and being able to generate an accurate three-dimensional pipeline map.
[0083] Of course, in practical applications, the abnormal azimuth angular velocity may be corrected by linear or nonlinear fitting using the first n azimuth angular velocities and the last m azimuth angular velocities of the abnormal azimuth angular velocity. This embodiment does not limit the method for correcting the abnormal azimuth angular velocity.
[0084] Step S104, determining the mileage matching each azimuth velocity in the target azimuth velocity sequence from the initial mileage sequence to obtain the target mileage sequence.
[0085] In this embodiment, the second frequency of the mileage output by the odometer is greater than the first frequency of the azimuth velocity output by the gyroscope. The first acquisition timestamp of each azimuth velocity in the target azimuth velocity sequence and the second acquisition timestamp of each mileage in the initial mileage sequence can be determined first. For each azimuth velocity in the target azimuth velocity sequence, the target mileage with the smallest time difference between the second acquisition timestamp and the first acquisition timestamp of the azimuth velocity is determined from the initial mileage sequence to generate a target mileage sequence.
[0086] Specifically, Figure 3 As shown in the figure, the target azimuth velocity sequence includes 8 azimuth velocities from ω1 to ω8, and the initial mileage sequence includes 16 mileages from d1 to d16. Figure 3 It can be seen that the difference between the timestamps of the azimuth velocity ω1 and the mileage d1 is the smallest, so the azimuth velocity ω1 is matched with the mileage d1. Similarly, the azimuth velocity ω2 is matched with the mileage d3, the azimuth velocity ω3 is matched with the mileage d5, the azimuth velocity ω4 is matched with the mileage d7, the azimuth velocity ω5 is matched with the mileage d9, the azimuth velocity ω6 is matched with the mileage d12, the azimuth velocity ω7 is matched with the mileage d14, and the azimuth velocity ω8 is matched with the mileage d16. The final target mileage sequence includes mileages d1, d3, d5, d7, d9, d12, d14, and d16.
[0087] Step S105 , based on the three-dimensional coordinates of the starting point and the end point of the gas pipeline, a three-dimensional coordinate sequence of the gas pipeline is generated using a target azimuth velocity sequence and a target mileage sequence.
[0088] Specifically, the RTK positioning technology or GPS positioning technology can be used to locate the inertial center points of the starting point and the end point of the gas pipeline to obtain the three-dimensional coordinates of the starting point and the end point of the gas pipeline, and the strapdown inertial navigation algorithm can be combined with the target azimuth velocity sequence and the target mileage sequence to calculate the three-dimensional coordinates of the position of the measurement unit when each azimuth velocity in the target azimuth velocity sequence is collected to obtain the three-dimensional coordinate sequence of the center line of the gas pipeline. Among them, the strapdown inertial navigation algorithm can refer to the existing technology and will not be described in detail here.
[0089] Step S106, generating a three-dimensional pipeline diagram of the gas pipeline based on the three-dimensional coordinate sequence.
[0090] Specifically, after obtaining the three-dimensional coordinate sequence of the center line of the gas pipeline, the center line of the gas pipeline can be generated, and a circular pipeline with a radius of R is generated with the center line as the center to obtain a three-dimensional pipeline map. Each point on the three-dimensional pipeline map includes the x, y, and z coordinates of the point, thereby providing an accurate gas pipeline location for engineering construction. Exemplarily, when it is necessary to excavate point A on the ground, after obtaining the three-dimensional coordinates of point A, when it is determined that the x and y coordinates of point A match the x and y coordinates of any point on the three-dimensional pipeline map, it is determined that a gas pipeline is buried under point A, and the buried depth of the gas pipeline is calculated by the z coordinate of point A on the ground and the z coordinate of the gas pipeline, thereby avoiding accidents caused by excavating the ground at point A and digging into the gas pipeline.
[0091] After receiving the initial azimuth velocity sequence output by the gyroscope and the initial mileage sequence output by the odometer, the embodiment of the present invention identifies abnormal azimuth velocities from the initial azimuth velocity sequence, corrects the abnormal azimuth velocities in the initial azimuth velocity sequence to obtain a corrected target azimuth velocity sequence, determines the mileage matching each azimuth velocity in the target azimuth velocity sequence from the initial mileage sequence to obtain a target mileage sequence, and generates a three-dimensional coordinate sequence of the gas pipeline based on the three-dimensional coordinates of the starting point and the end point of the gas pipeline by using the target azimuth velocity sequence and the target mileage sequence to generate a three-dimensional pipeline map. By identifying the abnormal azimuth velocity and correcting the abnormal azimuth velocity, the abnormal azimuth velocity caused by the influence of the weld, joint or debris in the gas pipeline on the gyroscope can be identified, thereby solving the problem that the abnormal azimuth velocity in the data collected by the gyroscope causes the generation of the three-dimensional pipeline map to be inaccurate, improving the accuracy of the generated three-dimensional pipeline map, and providing the accurate position of the gas pipeline for engineering construction.
[0092] Figure 4 The application architecture diagram of the gas pipeline detection device based on the gyroscope provided in the embodiment of the present invention is shown. The gas pipeline detection device based on the gyroscope in the embodiment is applied to a measurement unit provided with a gyroscope and an odometer, and specifically includes the following units:
[0093] The data receiving unit 401 is used to receive the initial azimuth velocity sequence collected by the gyroscope at a first frequency and the initial mileage sequence collected by the odometer at a second frequency when the measuring unit finishes walking in the gas pipeline, and the second frequency is greater than the first frequency;
[0094] The abnormal data identification unit 402 is used to identify abnormal azimuth angular velocity from the initial azimuth angular velocity sequence, where the abnormal azimuth angular velocity is the azimuth angular velocity collected when the measurement unit passes through the interference object in the gas pipeline;
[0095] An abnormal data correction unit 403 is used to correct the abnormal azimuth velocity in the initial azimuth velocity sequence to obtain a corrected target azimuth velocity sequence;
[0096] The target mileage sequence determination unit 404 is used to determine the mileage matching each azimuth velocity in the target azimuth velocity sequence from the initial mileage sequence to obtain the target mileage sequence;
[0097] A three-dimensional coordinate sequence generating unit 405 is used to generate a three-dimensional coordinate sequence of the gas pipeline based on the three-dimensional coordinates of the starting point and the end point of the gas pipeline, using a target azimuth velocity sequence and a target mileage sequence;
[0098] The three-dimensional pipeline diagram generating unit 406 is used to generate a three-dimensional pipeline diagram of the gas pipeline based on the three-dimensional coordinate sequence.
[0099] As a further limitation of the embodiment of the present invention, the abnormal data identification unit 402 specifically includes the following modules:
[0100] A curve graph generating module, used for generating an azimuth velocity curve graph by using an initial azimuth velocity sequence;
[0101] The model input module is used to input the azimuth velocity curve graph into the pre-trained anomaly recognition model to obtain the abnormal azimuth velocity.
[0102] As a further limitation of the embodiment of the present invention, the anomaly recognition model is trained by the following units:
[0103] A training data acquisition unit, used to acquire training data, the training data including training azimuth velocity, the training azimuth velocity including abnormal azimuth velocity;
[0104] A training curve generating unit is used to generate a training curve using the training azimuth velocity, and mark the abnormal azimuth velocity or the normal azimuth velocity for each sample point on the training curve to obtain a label value for each sample point;
[0105] A training unit, used to input the training curve into the anomaly recognition model to obtain the predicted value of each sample point in the training curve;
[0106] A loss rate calculation unit, used to calculate the loss rate using the label value and the predicted value of each sample point;
[0107] A loss rate determination unit, used to determine whether the loss rate is less than a loss rate threshold;
[0108] A stop training unit is used to stop training the anomaly recognition model;
[0109] The model parameter adjustment unit is used to adjust the model parameters of the anomaly recognition model based on the loss rate and return it to the training unit.
[0110] As a further limitation of the embodiment of the present invention, the loss rate calculation unit specifically includes the following modules:
[0111] The label value acquisition module is used to obtain the label value of the sample point;
[0112] The loss rate calculation module is used to calculate the loss rate according to the following formula:
[0113] ;
[0114] ;
[0115] Among them, i is the i-th sample point, is the predicted value of sample point i, is the label value of sample point i, n is the number of sample points, is the weight of sample point i.
[0116] As a further limitation of the embodiment of the present invention, the abnormal data identification unit 402 specifically includes the following modules:
[0117] a change rate calculation module, for calculating, for each target azimuth velocity in the initial azimuth velocity sequence, a first change rate between the target azimuth velocity and a previous azimuth velocity, and a second change rate between the target azimuth velocity and a subsequent azimuth velocity;
[0118] The first abnormal azimuth velocity determination module is used to determine that the target azimuth velocity is an abnormal azimuth velocity when the first change rate and the second change rate are both greater than the first change rate threshold and less than the second change rate threshold.
[0119] As a further limitation of the embodiment of the present invention, the abnormal data identification unit 402 specifically includes the following modules:
[0120] A sliding window sliding module, used to slide a sliding window of a preset length from the beginning to the end in the initial azimuth velocity sequence according to a preset step length;
[0121] An absolute value calculation module is used to calculate the absolute value of the difference between two adjacent azimuth velocities in the sliding window each time the sliding window slides;
[0122] The second abnormal azimuth velocity determination module is used to determine that two adjacent azimuth velocities whose absolute value of difference is greater than the preset threshold are abnormal azimuth velocities when there is an absolute value greater than the preset threshold.
[0123] As a further limitation of the embodiment of the present invention, the abnormal data correction unit 403 specifically includes the following modules:
[0124] A front and rear azimuth velocity determination module is used to determine the first n azimuth velocities and the last m azimuth velocities of the abnormal azimuth velocity from the initial azimuth velocity sequence;
[0125] The correction module is used to correct the abnormal azimuth angular velocity based on the first n azimuth angular velocities and the last m azimuth angular velocities to obtain a corrected target azimuth angular velocity sequence.
[0126] As a further limitation of the embodiment of the present invention, the correction module specifically includes the following submodules:
[0127] A mean or median calculation submodule is used to calculate the mean or median of the first n azimuth velocities and the last m azimuth velocities;
[0128] The replacement submodule is used to replace the abnormal azimuth velocity with an average value or a median value to obtain a corrected target azimuth velocity sequence.
[0129] As a further limitation of the embodiment of the present invention, the target mileage sequence determination unit 404 specifically includes the following modules:
[0130] A timestamp determination module, used to determine a first acquisition timestamp of each azimuth velocity in the target azimuth velocity sequence, and to determine a second acquisition timestamp of each mileage in the initial mileage sequence;
[0131] The target mileage sequence generation module is used to determine the target mileage with the smallest time difference between the second acquisition timestamp and the first acquisition timestamp of the azimuth velocity from the initial mileage sequence for each azimuth velocity in the target azimuth velocity sequence, so as to generate the target mileage sequence.
[0132] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0134] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0135] The above embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present invention. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention patent shall be subject to the attached claims.
[0136] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A gas pipeline detection method based on a gyroscope, characterized in that: The method is applied to a measuring unit provided with a gyroscope and an odometer, and specifically comprises the following steps: When the measuring unit finishes walking in the gas pipeline, receiving an initial azimuth velocity sequence collected by the gyroscope at a first frequency and an initial mileage sequence collected by the odometer at a second frequency, wherein the second frequency is greater than the first frequency; Identifying an abnormal azimuth velocity from the initial azimuth velocity sequence, wherein the abnormal azimuth velocity is an azimuth velocity collected when the measuring unit passes through an interfering object in the gas pipeline; Correcting the abnormal azimuth velocity in the initial azimuth velocity sequence to obtain a corrected target azimuth velocity sequence; Determine the mileage matching each azimuth velocity in the target azimuth velocity sequence from the initial mileage sequence to obtain a target mileage sequence; Based on the three-dimensional coordinates of the starting point and the end point of the gas pipeline, the target azimuth velocity sequence and the target mileage sequence are used to generate a three-dimensional coordinate sequence of the gas pipeline; generating a three-dimensional pipeline diagram of the gas pipeline based on the three-dimensional coordinate sequence; The step of identifying abnormal azimuth angular velocity from the initial azimuth angular velocity sequence specifically comprises the following steps: Using the initial azimuth velocity sequence to generate an azimuth velocity curve graph; Inputting the azimuth velocity curve graph into a pre-trained anomaly recognition model to obtain an abnormal azimuth velocity; The anomaly recognition model is trained in the following way: Acquiring training data, wherein the training data includes training azimuth angular velocity, and the training azimuth angular velocity includes abnormal azimuth angular velocity; Generate a training curve using the training azimuth velocity, and mark each sample point on the training curve with an abnormal azimuth velocity or a normal azimuth velocity to obtain a label value for each sample point; Inputting the training curve into an anomaly recognition model to obtain a predicted value of each sample point in the training curve; The loss rate is calculated using the label value and predicted value of each sample point; Determining whether the loss rate is less than a loss rate threshold; If yes, stop training the anomaly recognition model; If not, adjusting the model parameters of the anomaly recognition model based on the loss rate, and returning to the step of inputting the training curve into the anomaly recognition model; The loss rate is calculated by using the label value and the predicted value of each sample point, specifically including the following steps: Obtaining the label value of the sample point; The loss rate is calculated according to the following formula: ; ; Among them, i is the i-th sample point, A i is the predicted value of sample point i, B i is the label value of sample point i, n is the number of sample points, w i is the weight of sample point i; Determining the mileage matching each azimuth velocity in the target azimuth velocity sequence from the initial mileage sequence to obtain the target mileage sequence specifically includes the following steps: Determine a first acquisition timestamp of each azimuth velocity in the target azimuth velocity sequence, and determine a second acquisition timestamp of each mileage in the initial mileage sequence; For each azimuth velocity in the target azimuth velocity sequence, a target mileage having a minimum time difference between a second acquisition timestamp and a first acquisition timestamp of the azimuth velocity is determined from the initial mileage sequence to generate a target mileage sequence.
2. The gyroscope-based gas pipeline detection method according to claim 1, characterized in that: The correcting the abnormal azimuth velocity in the initial azimuth velocity sequence to obtain a corrected target azimuth velocity sequence specifically comprises the following steps: Determine the first n azimuth angular velocities and the last m azimuth angular velocities of the abnormal azimuth angular velocity from the initial azimuth angular velocity sequence; The abnormal azimuth angular velocity is corrected based on the first n azimuth angular velocities and the last m azimuth angular velocities to obtain a corrected target azimuth angular velocity sequence.
3. The gyroscope-based gas pipeline detection method according to claim 2, characterized in that: The correcting the abnormal azimuth angular velocity based on the first n azimuth angular velocities and the last m azimuth angular velocities to obtain a corrected target azimuth angular velocity sequence specifically includes the following steps: Calculating the average or median of the first n azimuth angular velocities and the last m azimuth angular velocities; The abnormal azimuth velocity is replaced by the average value or the median value to obtain a corrected target azimuth velocity sequence.
4. A gas pipeline detection device based on a gyroscope, characterized in that: Applicable to the measurement unit equipped with a gyroscope and an odometer, specifically including the following units: A data receiving unit is used to receive, when the measuring unit finishes walking in the gas pipeline, an initial azimuth velocity sequence collected by the gyroscope at a first frequency and an initial mileage sequence collected by the odometer at a second frequency, wherein the second frequency is greater than the first frequency; an abnormal data identification unit, used to identify an abnormal azimuth velocity from the initial azimuth velocity sequence, wherein the abnormal azimuth velocity is the azimuth velocity collected when the measuring unit passes through an interfering object in the gas pipeline; an abnormal data correction unit, used for correcting the abnormal azimuth velocity in the initial azimuth velocity sequence to obtain a corrected target azimuth velocity sequence; a target mileage sequence determination unit, configured to determine, from the initial mileage sequence, a mileage matching each azimuth velocity in the target azimuth velocity sequence, to obtain a target mileage sequence; A three-dimensional coordinate sequence generating unit, configured to generate a three-dimensional coordinate sequence of the gas pipeline based on the three-dimensional coordinates of the starting point and the end point of the gas pipeline, using the target azimuth velocity sequence and the target mileage sequence; A three-dimensional pipeline diagram generating unit, used for generating a three-dimensional pipeline diagram of the gas pipeline based on the three-dimensional coordinate sequence; The abnormal data identification unit specifically includes the following modules: A curve graph generating module, used for generating an azimuth velocity curve graph by using an initial azimuth velocity sequence; A model input module is used to input the azimuth velocity curve graph into a pre-trained anomaly recognition model to obtain an abnormal azimuth velocity; The anomaly recognition model is trained by the following units: A training data acquisition unit, used to acquire training data, the training data including training azimuth velocity, the training azimuth velocity including abnormal azimuth velocity; A training curve generating unit is used to generate a training curve using the training azimuth velocity, and mark the abnormal azimuth velocity or the normal azimuth velocity for each sample point on the training curve to obtain a label value for each sample point; A training unit, used to input the training curve into the anomaly recognition model to obtain the predicted value of each sample point in the training curve; A loss rate calculation unit, used to calculate the loss rate using the label value and the predicted value of each sample point; A loss rate determination unit, used to determine whether the loss rate is less than a loss rate threshold; A stop training unit is used to stop training the anomaly recognition model; A model parameter adjustment unit, used to adjust the model parameters of the anomaly recognition model based on the loss rate and return the parameters to the training unit; The loss rate calculation unit specifically includes the following modules: The label value acquisition module is used to obtain the label value of the sample point; The loss rate calculation module is used to calculate the loss rate according to the following formula: ; ; Among them, i is the i-th sample point, A i is the predicted value of sample point i, B i is the label value of sample point i, n is the number of sample points, w i is the weight of sample point i; The target mileage sequence determination unit specifically includes the following modules: A timestamp determination module, used to determine a first acquisition timestamp of each azimuth velocity in the target azimuth velocity sequence, and to determine a second acquisition timestamp of each mileage in the initial mileage sequence; The target mileage sequence generation module is used to determine the target mileage with the smallest time difference between the second acquisition timestamp and the first acquisition timestamp of the azimuth velocity from the initial mileage sequence for each azimuth velocity in the target azimuth velocity sequence, so as to generate the target mileage sequence.
Citation Information
Patent Citations
Gas pipeline leakage detection method, system and device and storage medium
CN114352947A
Tunnel disease real-time detection and early warning system
CN116164704A