Long-distance pipeline linear reference calculation method and device, electronic equipment and storage medium
By collecting and storing pipeline and pile data and using the database to calculate the location parameters of offline pipelines and piles, the shortcomings of position calculation in the long-distance oil and gas industry are solved, and efficient and accurate pipeline and ancillary facility management is achieved.
Patent Information
- Application Number
- CN202510700644.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-05-28
AI Technical Summary
In the long-distance oil and gas industry, the lack of a complete system for linear reference calculation of location elements of pipelines and their ancillary facilities leads to management difficulties.
By collecting pipeline data and pile data, storing them in the database, obtaining the spatial position and pile data of the offline pipeline, calculating the offline pile mileage and coordinates, determining the location parameters of the target offline pipeline and ancillary facilities, and using geometric formulas and linear interpolation methods to perform position calculations.
It provides a complete system to improve the efficiency and accuracy of pipeline and ancillary facility location calculations and meet the needs of web-based development.
Smart Images

Figure CN120596586A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of long-distance oil and gas pipelines, and in particular to a linear reference calculation method, device, electronic equipment and storage medium for long-distance pipelines. Background Art
[0002] In the long-distance oil and gas industry, pipelines and their ancillary facilities are part of the infrastructure, such as valves, crossings, and hydraulic protection. Managing these pipelines and their ancillary facilities requires location positioning, which requires the use of specialized data models and tools. However, there is currently a lack of a complete system for performing linear reference calculations on location elements in web-based development. Summary of the Invention
[0003] In view of this, the purpose of the present invention is to overcome the deficiencies in the prior art and provide a method, device, electronic device and storage medium for calculating linear reference of a long-distance pipeline.
[0004] In a first aspect, an embodiment of the present application provides a method for calculating a linear reference for a long-distance pipeline, the method comprising:
[0005] Collect pipeline data and pile data, store the pipeline data and the pile data in a database, and obtain first offline pile data and second offline pile data, wherein the first offline pile data is offline pile data including offline pipeline data; and the second offline pile data is offline pile data excluding offline pipeline data;
[0006] Acquire the spatial position of the offline pipeline through the first offline pile data in the database;
[0007] Determine the offline pile mileage by using the first offline pile data in the database;
[0008] Determine the offline pile coordinates using the first offline pile data in the database;
[0009] Determine the target offline pipeline closest to the target offline pile using the second offline pile data in the database, and determine the target offline pile mileage and target offline pile coordinates based on the target offline pipeline;
[0010] Collect pipeline ancillary facilities data;
[0011] The pipeline ancillary facility location parameters are determined according to the spatial location of the pipeline ancillary facility data. The pipeline ancillary facility location parameters include: the mileage of the pipeline ancillary facility, the coordinates of the pipeline ancillary facility, the mileage of the offline pile plus the offset parameter of the pipeline ancillary facility.
[0012] In one embodiment, determining the offline pile mileage using the first offline pile data in the database includes:
[0013] Taking the starting point and the end point of the offline pipeline as a first vector, calculating a second vector from the starting point of the offline pipeline to the offline pile using a geometric formula, and determining the straight-line distance from the offline pipeline to the offline pile based on the second vector;
[0014] Calculating the angle between the straight-line distance and the offline pipeline direction vector to obtain an angle value;
[0015] determining, based on the angle value, whether the offline pile is on the offline pipeline;
[0016] If the angle value is a first preset value and the offline pile is on the offline pipeline, the offline pile mileage is the distance from the offline pile to the starting point of the offline pipeline;
[0017] If the angle value is a second preset value and the offline pile is on the extension line of the offline pipeline, then the offline pile mileage is the distance from the offline pile to the end point of the offline pipeline;
[0018] If the angle value is a third preset value and the offline pile is not on the offline pipeline or the extension line of the offline pipeline, the offline pile mileage is the perpendicular distance from the offline pile to the offline pipeline.
[0019] In one embodiment, determining the offline pile coordinates using the first offline pile data in the database includes:
[0020] Determine the designated offline pipeline and calculate the designated offline pile according to the user's selection operation;
[0021] Determining the starting point and the ending point of the designated offline pipeline;
[0022] Calculating a first position of the designated offline pile on the designated offline pipeline according to the starting point and the end point of the designated offline pipeline;
[0023] The offline pile coordinates of the designated offline pile on the designated offline pipeline are calculated according to the first position.
[0024] In one embodiment, the calculating the first position of the designated offline pile on the designated offline pipeline according to the starting point and the end point includes:
[0025] Calculating the segment length of the designated offline pipeline;
[0026] Determining whether the distance between the starting point of the designated offline pipeline and the designated offline pile is less than the line segment length;
[0027] If so, the distance between the designated offline pile and the starting point of the offline pipeline is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the length of the segment;
[0028] If not, the distance between the designated offline pile and the offline pipeline end point is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the segment length.
[0029] In one embodiment, determining the target offline pipeline closest to the target offline pile using the second offline pile data in the database includes:
[0030] Calculating a vertical distance from each offline pile to each offline pipeline based on the second offline pile data;
[0031] The offline pipeline corresponding to the shortest vertical distance of each offline pile is used as the target offline pipeline.
[0032] In one embodiment, determining the pipeline ancillary facility location parameter according to the spatial location of the pipeline ancillary facility data includes:
[0033] When the offset parameters are known, the starting coordinates and the ending coordinates of the offline pipeline and the distance from the starting point of the offline pipeline to the target point are determined, where the target point is the pipeline auxiliary facility;
[0034] Calculate the total length of the offline pipeline according to the following first formula;
[0035] First formula:
[0036]
[0037] Assume that the coordinates of the starting point of the offline pipeline are known to be (x1, y1), and the coordinates of the ending point of the offline pipeline are known to be (x2, y2);
[0038] Calculating the distance ratio of the target point on the offline pipeline according to the following second formula;
[0039] Second formula:
[0040]
[0041] Wherein, p is the distance ratio, d is the distance from the starting point to the target point, and L is the total length;
[0042] According to the following third formula, the second coordinate of the target point is obtained;
[0043] The third formula:
[0044] x0=x1+p×(x2-x1)
[0045] y0=y1+p×(y2-y1)
[0046] Wherein, x0, y0 are the second coordinates;
[0047] When the mileage of the pipeline ancillary facilities is known, the second coordinate of the target point is calculated according to linear interpolation, and the offset parameter is determined according to the spatial position of the pipeline ancillary facilities data, including:
[0048] Finding the nearest pile by the coordinates of the pipeline auxiliary facilities, subtracting the mileage of the nearest pile from the current mileage to obtain an offset parameter of the nearest pile;
[0049] Determining the mileage of the pipeline ancillary facilities according to the spatial position of the pipeline ancillary facilities data includes:
[0050] When the coordinates of the pipeline ancillary facilities are known, the projection position of the target point on the offline pipeline is found, and the mileage of the pipeline ancillary facilities is obtained by adding the offset parameters of the pipeline ancillary facilities to the known mileage of the offline pile.
[0051] In a second aspect, an embodiment of the present application provides a method and apparatus for calculating a linear reference for a long-distance pipeline, the method comprising:
[0052] A data module is used to collect pipeline data and pile data, store the pipeline data and the pile data in a database, and obtain first offline pile data and second offline pile data;
[0053] a mileage calculation module, configured to obtain the spatial position of an offline pipeline using the first offline pile data in the database, determine the offline pile mileage using the first offline pile data in the database; determine the target offline pipeline closest to the target offline pile using the second offline pile data in the database, and determine the target offline pile mileage based on the target offline pipeline;
[0054] a coordinate module, configured to obtain the spatial position of an offline pipeline using the first offline pile data in the database, determine the offline pile coordinates using the first offline pile data in the database; determine the target offline pipeline closest to the target offline pile using the second offline pile data in the database, and determine the target offline pile coordinates based on the target offline pipeline;
[0055] The ancillary facility module is used to determine the pipeline ancillary facility location parameters according to the spatial location of the pipeline ancillary facility data.
[0056] In one embodiment, the long-distance pipeline linear reference calculation method device, the coordinate module is further used to calculate the line segment length of the designated offline pipeline;
[0057] Determining whether the distance between the starting point of the designated offline pipeline and the designated offline pile is less than the line segment length;
[0058] If so, the distance between the designated offline pile and the starting point of the offline pipeline is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the length of the segment;
[0059] If not, the distance between the designated offline pile and the offline pipeline end point is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the segment length.
[0060] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory and a processor, wherein the memory is used to store a computer program, and when the processor is running, the computer program executes the long-distance pipeline linear reference calculation method provided in the first aspect.
[0061] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when running on a processor, executes the long-distance pipeline linear reference calculation method provided in the first aspect.
[0062] The long-distance pipeline linear reference calculation method provided by the present application collects pipeline data and pile data, stores the pipeline data and pile data in a database, and obtains first offline pile data and second offline pile data; for the first offline pile data containing offline pipeline data, after obtaining the spatial position of the offline pipeline through the database, the offline pile mileage and offline pile coordinates are calculated; for the second offline pile data that does not contain offline pipeline data, by calculating the target offline pipeline with the shortest vertical distance to the second offline pile, after obtaining the data of the target offline pipeline, the same mileage and coordinate calculation as the first offline pile is performed; the position parameters of the pipeline ancillary facilities are determined by spatial position, and the spatial position is the starting point and end point of the pipeline ancillary facilities fitted to the pipeline, and the geometric shape of the pipeline ancillary facilities on the pipeline. Then, by knowing the mileage of the pipeline ancillary facilities, or the coordinates of the pipeline ancillary facilities, or the mileage of the offline pile plus the offset parameters of the pipeline ancillary facilities, knowing one of them can calculate the parameters of the other pipeline ancillary facilities, so that a complete system can be used in web-side development to calculate the position of piles and pipeline ancillary facilities, with high efficiency and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0064] Figure 1 A schematic diagram of a process for calculating a linear reference for a long-distance pipeline provided in an embodiment of the present application is shown;
[0065] Figure 2 Another schematic diagram of a process for calculating a linear reference for a long-distance pipeline provided by an embodiment of the present application is shown;
[0066] Figure 3 Another schematic diagram of a process for calculating a linear reference for a long-distance pipeline provided by an embodiment of the present application is shown;
[0067] Figure 4 Another schematic diagram of a process for calculating a linear reference for a long-distance pipeline provided by an embodiment of the present application is shown;
[0068] Figure 5 Another schematic diagram of a process for calculating a linear reference for a long-distance pipeline provided by an embodiment of the present application is shown;
[0069] Figure 6 A schematic structural diagram of a linear reference calculation device for a long-distance pipeline provided in an embodiment of the present application is shown;
[0070] Figure 7 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown.
[0071] Icon: 500-long-distance pipeline linear reference calculation device; 501-data module; 502-mileage calculation module; 503-coordinate module; 504-ancillary facilities module; 700-electronic equipment, 701-transceiver, 702-processor, 703-memory. DETAILED DESCRIPTION
[0072] The following describes embodiments of the present invention in detail. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present invention and are not to be construed as limiting the present invention.
[0073] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be an intermediate element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be an intermediate element. Conversely, when an element is referred to as being "directly on" another element, there is no intermediate element. The terms "vertical," "horizontal," "left," "right," and similar expressions used herein are for illustrative purposes only.
[0074] In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "connect," "fixed," etc. should be understood broadly. For example, they may refer to fixed connection, detachable connection, or integration; mechanical connection or electrical connection; direct connection or indirect connection through an intermediate medium; internal communication between two components or interaction between two components. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.
[0075] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature identified as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, "plurality" means two or more, unless otherwise specifically defined.
[0076] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs. The terms used in the template description herein are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0077] Example 1
[0078] The embodiment of the present application provides a method for calculating linear reference of a long-distance pipeline.
[0079] See also Figure 1 , the linear reference calculation methods for long-distance pipelines include:
[0080] Step S101 : collecting pipeline data and pile data, storing the pipeline data and the pile data in a database, and obtaining first offline pile data and second offline pile data.
[0081] The first offline pile data is offline pile data including offline pipeline data; the second offline pile data is offline pile data not including offline pipeline data.
[0082] In this embodiment, the database is a PostGreSQL database. When the user collects pipeline data and pile data, some offline pile data contains offline pipeline data, while some offline pile data does not contain offline pipeline data. It is necessary to calculate the offline pile data containing offline pipeline data and the offline pile data not containing offline pipeline data separately.
[0083] Step S102: Acquire the spatial position of the offline pipeline through the first offline pile data in the database.
[0084] In this embodiment, the spatial position is a geometric shape within the range of the start point and the end point of the offline pipeline.
[0085] Step S103: determining the offline pile mileage through the first offline pile data in the database.
[0086] See also Figure 2 , step S103 includes:
[0087] In step S1031, the starting point and the end point of the offline pipeline are used as the first vector, and the second vector from the starting point of the offline pipeline to the offline pile is calculated by a geometric formula, and the straight-line distance from the offline pipeline to the offline pile is determined based on the second vector.
[0088] In this embodiment, the starting point and the end point of the offline pipeline are used as vectors to calculate the vertical distance from the point to the line. The geometric formula is: Wherein, the equation of the line segment from the starting point to the end point of the offline pipeline is ax+by+c=0, and the coordinates of the offline pile are (x, y).
[0089] Step S1032: Calculate the angle between the straight-line distance and the offline pipeline direction vector to obtain an angle value.
[0090] In this embodiment, the offline pile is not necessarily on the offline pipeline, so there is an angle between the starting point of the offline pipeline and the end point of the offline pipeline, and between the starting point of the offline pipeline and the offline pile.
[0091] Step S1033: judging whether the offline pile is on the offline pipeline according to the angle value.
[0092] Step S1034: If the angle value is the first preset value and the offline pile is on the offline pipeline, the offline pile mileage is the distance from the offline pile to the starting point of the offline pipeline.
[0093] In this embodiment, the first preset value is an angle of 0. When the angle between the offline pile and the offline pipeline is 0, the offline pile is on the offline pipeline.
[0094] Step S1035: If the angle value is the second preset value and the offline pile is on the extension line of the offline pipeline, the offline pile mileage is the distance from the offline pile to the end point of the offline pipeline.
[0095] In this embodiment, the second preset value is 180 degrees. When the angle between the offline pile and the offline pipeline is 180 degrees, the offline pile is on the extension line of the offline pipeline.
[0096] Step S1036: If the angle value is the third preset value and the offline pile is not on the offline pipeline or the extension line of the offline pipeline, the offline pile mileage is the perpendicular distance from the offline pile to the offline pipeline.
[0097] In this embodiment, the third preset value is that when the angle between the offline pile and the offline pipeline is neither 0 degrees nor 180 degrees, the offline pile is neither on the offline pipeline nor on the extension line of the offline pipeline. The pseudo code of this part is as follows:
[0098] public static double computeDistance(Coordinate p,Coordinate p1,Coordinate p2){
[0099] p is the offline pile, P1 is the starting point of the offline pipeline, and P2 is the end point of the offline pipeline
[0100] double x=p1.xp.x;
[0101] double y=p1.yp.y;
[0102] doubledx=p2.x-p1.x;
[0103] doubledy=p2.y-p1.y;
[0104] doubledot=x*dx+y*dy;
[0105] double len=dx*dx+dy*dy;
[0106] double t=dot / len;
[0107] if(t<0){
[0108] x=px-p1.x;
[0109] y=py-p1.y;
[0110] }else if(t>1){
[0111] x=px-p2.x;
[0112] y=py-p2.y;
[0113] }else{
[0114] double cx=p1.x+t*dx;
[0115] double cy=p1.y+t*dy;
[0116] x=px-cx;
[0117] y=py-cy;
[0118] }
[0119] return Math.sqrt(x*x+y*y);
[0120] }
[0121] The above code can be used to calculate the offline pile mileage, and other codes can also be used, which is not limited here.
[0122] Step S104: determining the offline pile coordinates through the first offline pile data in the database.
[0123] include:
[0124] See also Figure 3 , step S104 includes:
[0125] Step S1041 : determining the designated offline pipeline and calculating the designated offline pile according to the user's selection operation.
[0126] In this embodiment, if a user wants to calculate an offline pipeline, he only needs to input the offline pipeline he wants to calculate in the front-end interface, and then he will get the data of the specified offline pipeline.
[0127] Step S1042: Determine the starting point and the end point of the designated offline pipeline.
[0128] In this embodiment, the starting point and the end point of the offline pipeline are determined during planning and design, and the data thereof are stored in the database.
[0129] Step S1043 : calculating a first position of the designated offline pile on the designated offline pipeline according to the starting point and the end point of the designated offline pipeline.
[0130] In this embodiment, a linear interpolation method is used to calculate the first position. The pseudo code of this part is as follows:
[0131]
[0132]
[0133] Step S1044, calculating the offline pile coordinates of the designated offline pile on the designated offline pipeline according to the first position, includes:
[0134] See also Figure 4 , step S1044 includes:
[0135] Step S10441, calculating the line segment length of the designated offline pipeline.
[0136] Step S10442: Determine whether the distance between the starting point of the designated offline pipeline and the designated offline pile is less than the line segment length.
[0137] In this embodiment, the length of the line segment is half the length of the offline pipeline. When the offline pile is not necessarily on the offline pipeline, the distance from the starting point of the offline pipeline to the offline pile may be greater than half the length of the offline pipeline, or may be less than half the length of the offline pipeline.
[0138] Step S10443: If yes, calculate the distance between the designated offline pile and the starting point of the offline pipeline, and calculate the first position according to the direction of the designated offline pipeline segment and the length of the segment.
[0139] Step S10444: If not, calculate the distance between the designated offline pile and the offline pipeline end point, and calculate the first position according to the direction of the designated offline pipeline segment and the segment length.
[0140] Step S105 , determining the target offline pipeline closest to the target offline pile through the second offline pile data in the database, and determining the target offline pile mileage and target offline pile coordinates based on the target offline pipeline.
[0141] See also Figure 5 , step S105 includes:
[0142] Step S1051: Calculate the vertical distance from each offline pile to each offline pipeline based on the second offline pile data.
[0143] In this embodiment, since the second offline pile data is for offline piles that do not include offline pipeline data, it is necessary to calculate the vertical distance from each offline pile that does not include offline pipeline data to each offline pipeline.
[0144] Step S1052: The offline pipeline corresponding to the shortest vertical distance of each offline pile is used as the target offline pipeline.
[0145] In this embodiment, after calculating the vertical distance from each offline pile to each offline pipeline, the offline pipeline corresponding to the shortest vertical distance is found and used as the target offline pipeline. After collecting the data of the target offline pipeline, the offline pile mileage and offline pile coordinates that are the same as the first offline pile data are calculated.
[0146] Step S106: collecting pipeline ancillary facilities data.
[0147] In this embodiment, during pipeline planning and design, there is data on pipeline ancillary facilities, such as the geographical location of the pipeline ancillary facilities relative to the pipeline, and offset parameters of the pipeline ancillary facilities, which are stored in a database.
[0148] Step S107: Determine the pipeline ancillary facility location parameters based on the spatial location of the pipeline ancillary facility data. The pipeline ancillary facility location parameters include: the mileage of the pipeline ancillary facility, the coordinates of the pipeline ancillary facility, the mileage of the offline pile plus the offset parameter of the pipeline ancillary facility, including:
[0149] When the offset parameters are known, the starting coordinates and the ending coordinates of the offline pipeline and the distance from the starting point of the offline pipeline to the target point are determined. The target point is the pipeline ancillary facility.
[0150] In this embodiment, the offset parameter is the mileage of the offline pile plus the offset parameter of the pipeline auxiliary facilities.
[0151] Calculate the total length of the offline pipeline according to the following first formula;
[0152] First formula:
[0153]
[0154] Assume that the coordinates of the starting point of the offline pipeline are known to be (x1, y1), and the coordinates of the ending point of the offline pipeline are known to be (x2, y2).
[0155] In this embodiment, x2 is the position of the offline pipeline on the x-axis of the end coordinate, x1 is the position of the offline pipeline on the x-axis of the starting coordinate, y2 is the position of the offline pipeline on the y-axis of the end coordinate, and y1 is the position of the offline pipeline on the y-axis of the starting coordinate.
[0156] Calculating the distance ratio of the target point on the offline pipeline according to the following second formula;
[0157] Second formula:
[0158]
[0159] Wherein, p is the distance ratio, d is the distance from the starting point to the target point, and L is the total length.
[0160] According to the following third formula, the second coordinate of the target point is obtained;
[0161] The third formula:
[0162] x0=x1+p×(x2-x1)
[0163] y0=y1+p×(y2-y1)
[0164] Wherein, x0, y0 are the second coordinates.
[0165] When the mileage of the pipeline ancillary facilities is known, the second coordinate of the target point is calculated according to linear interpolation, and the offset parameter is determined according to the spatial position of the pipeline ancillary facilities data, including:
[0166] The nearest pile is found through the coordinates of the pipeline auxiliary facilities, and the mileage of the nearest pile is subtracted from the current mileage to obtain the offset parameter of the nearest pile.
[0167] Determining the mileage of the pipeline ancillary facilities according to the spatial position of the pipeline ancillary facilities data includes:
[0168] When the coordinates of the pipeline ancillary facilities are known, the projection position of the target point on the offline pipeline is found, and the mileage of the pipeline ancillary facilities is obtained by adding the offset parameters of the pipeline ancillary facilities to the known mileage of the offline pile.
[0169] In this embodiment, the linear reference of GeoTools (geological tools) is used for calculation.
[0170] After determining the target offline pipeline closest to the target offline pile, the mileage and coordinates of the target offline pile are calculated; this enables users to determine the coordinates of the pile. Since long-distance oil and gas pipelines have many ancillary facilities in addition to piles, such as valves, crossing spans, hydraulic protection, etc., this solution can also determine the location parameters of these pipeline ancillary facilities. By determining the mileage of the pipeline ancillary facilities, the coordinates of the pipeline ancillary facilities, the mileage of the offline pile plus the offset parameters of the pipeline ancillary facilities, one of these parameters can be used to obtain other location parameters, making it easier for users to manage these pipelines and their pipeline ancillary facilities.
[0171] The linear reference calculation method for a long-distance pipeline provided in this embodiment collects pipeline data and pile data, stores the pipeline data and pile data in a database, and obtains first offline pile data and second offline pile data. For the first offline pile data containing offline pipeline data, the spatial position of the offline pipeline is obtained from the database, and the offline pile mileage and offline pile coordinates are calculated. For the second offline pile data that does not contain offline pipeline data, the target offline pipeline with the shortest vertical distance to the second offline pile is calculated. After obtaining the target offline pipeline data, the mileage and coordinate calculations are performed in the same manner as for the first offline pile. The position parameters of pipeline ancillary facilities are determined based on the spatial position, which is the geometric shape of the pipeline ancillary facilities on the pipeline by fitting the starting and ending points of the pipeline ancillary facilities onto the pipeline. Then, by knowing the mileage of the pipeline ancillary facilities, or the coordinates of the pipeline ancillary facilities, or the mileage of the offline pile plus the offset parameter of the pipeline ancillary facilities, the parameters of the other pipeline ancillary facilities can be calculated, so that a complete system can be used in web-based development to calculate the position of piles and pipeline ancillary facilities with high efficiency and accuracy.
[0172] Example 2
[0173] In addition, an embodiment of the present application provides a long-distance pipeline linear reference calculation device, which is applied to electronic equipment.
[0174] like Figure 6 As shown, the long-distance pipeline linear reference calculation device 500 includes:
[0175] Data module 501, for collecting pipeline data and pile data, storing the pipeline data and the pile data in a database, and obtaining first offline pile data and second offline pile data;
[0176] The mileage calculation module 502 is configured to obtain the spatial position of the offline pipeline using the first offline pile data in the database, determine the offline pile mileage using the first offline pile data in the database; determine the target offline pipeline closest to the target offline pile using the second offline pile data in the database, and determine the target offline pile mileage based on the target offline pipeline;
[0177] A coordinate module 503 is configured to obtain a spatial position of an offline pipeline using the first offline pile data in the database, determine offline pile coordinates using the first offline pile data in the database, determine a target offline pipeline closest to the target offline pile using the second offline pile data in the database, and determine target offline pile coordinates based on the target offline pipeline;
[0178] The ancillary facility module 504 is configured to determine the pipeline ancillary facility location parameters according to the spatial location of the pipeline ancillary facility data.
[0179] Optionally, the coordinate module is further used to calculate the line segment length of the designated offline pipeline;
[0180] Determining whether the distance between the starting point of the designated offline pipeline and the designated offline pile is less than the line segment length;
[0181] If so, the distance between the designated offline pile and the starting point of the offline pipeline is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the length of the segment;
[0182] If not, the distance between the designated offline pile and the offline pipeline end point is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the segment length.
[0183] The long-distance pipeline linear reference calculation device 500 provided in this embodiment can implement the long-distance pipeline linear reference calculation method provided in Example 1, and will not be described again here to avoid repetition.
[0184] The long-distance pipeline linear reference calculation device provided in this embodiment collects pipeline data and pile data, stores the pipeline data and pile data in a database, and obtains first offline pile data and second offline pile data. For the first offline pile data containing offline pipeline data, the offline pipeline spatial position is obtained from the database, and the offline pile mileage and offline pile coordinates are calculated. For the second offline pile data that does not contain offline pipeline data, the target offline pipeline with the shortest vertical distance to the second offline pile is calculated. After obtaining the target offline pipeline data, the mileage and coordinate calculations are performed in the same manner as for the first offline pile. The position parameters of pipeline ancillary facilities are determined based on the spatial position, which is the geometric shape of the pipeline ancillary facilities on the pipeline by fitting the starting and ending points of the pipeline ancillary facilities onto the pipeline. Then, by knowing the mileage of the pipeline ancillary facilities, or the coordinates of the pipeline ancillary facilities, or the mileage of the offline pile plus the offset parameter of the pipeline ancillary facilities, the parameters of the other pipeline ancillary facilities can be calculated, thereby providing a complete system for calculating the position of piles and pipeline ancillary facilities in web-based development with high efficiency and accuracy.
[0185] Example 3
[0186] In addition, an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program runs on the processor, it executes the long-distance pipeline linear reference calculation method provided in Example 1.
[0187] For details, see Figure 7The electronic device 700 includes: a transceiver 701, a bus interface and a processor 702, wherein the processor 702 is configured to: collect pipeline data and pile data, store the pipeline data and the pile data in a database, obtain first offline pile data and second offline pile data, wherein the first offline pile data is offline pile data containing offline pipeline data; and the second offline pile data is offline pile data not containing offline pipeline data; obtain the spatial position of the offline pipeline using the first offline pile data in the database; determine the offline pile mileage using the first offline pile data in the database; determine the offline pile coordinates using the first offline pile data in the database; determine the target offline pipeline closest to the target offline pile using the second offline pile data in the database, and determine the target offline pile mileage and target offline pile coordinates based on the target offline pipeline; collect pipeline ancillary facility data; and determine pipeline ancillary facility location parameters according to the spatial position of the pipeline ancillary facility data, wherein the pipeline ancillary facility location parameters include: the mileage of the pipeline ancillary facility, the coordinates of the pipeline ancillary facility, the mileage of the offline pile plus the offset parameter of the pipeline ancillary facility.
[0188] In one embodiment, the processor 702 is further configured to: use the starting point and the end point of the offline pipeline as a first vector, calculate a second vector from the starting point of the offline pipeline to the offline pile using a geometric formula, and determine a straight-line distance from the offline pipeline to the offline pile based on the second vector;
[0189] Calculating the angle between the straight-line distance and the offline pipeline direction vector to obtain an angle value;
[0190] determining, based on the angle value, whether the offline pile is on the offline pipeline;
[0191] If the angle value is a first preset value and the offline pile is on the offline pipeline, the offline pile mileage is the distance from the offline pile to the starting point of the offline pipeline;
[0192] If the angle value is a second preset value and the offline pile is on the extension line of the offline pipeline, then the offline pile mileage is the distance from the offline pile to the end point of the offline pipeline;
[0193] If the angle value is a third preset value and the offline pile is not on the offline pipeline or the extension line of the offline pipeline, the offline pile mileage is the perpendicular distance from the offline pile to the offline pipeline.
[0194] In one embodiment, the processor 702 is further configured to: determine a designated offline pipeline and calculate a designated offline pile according to a user selection operation;
[0195] Determining the starting point and the ending point of the designated offline pipeline;
[0196] Calculating a first position of the designated offline pile on the designated offline pipeline according to the starting point and the end point of the designated offline pipeline;
[0197] The offline pile coordinates of the designated offline pile on the designated offline pipeline are calculated according to the first position.
[0198] In one embodiment, the processor 702 is further configured to: calculate the segment length of the designated offline pipeline;
[0199] Determining whether the distance between the starting point of the designated offline pipeline and the designated offline pile is less than the line segment length;
[0200] If so, the distance between the designated offline pile and the starting point of the offline pipeline is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the length of the segment;
[0201] If not, the distance between the designated offline pile and the offline pipeline end point is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the segment length.
[0202] In one embodiment, the processor 702 is further configured to: calculate a vertical distance from each offline pile to each offline pipeline based on the second offline pile data;
[0203] The offline pipeline corresponding to the shortest vertical distance of each offline pile is used as the target offline pipeline.
[0204] In one embodiment, the processor 702 is further configured to: when the offset parameter is known, determine the starting coordinates and the ending coordinates of the offline pipeline and the distance from the starting point of the offline pipeline to a target point, where the target point is the pipeline auxiliary facility;
[0205] Calculate the total length of the offline pipeline according to the following first formula;
[0206] First formula:
[0207]
[0208] Assume that the coordinates of the starting point of the offline pipeline are known to be (x1, y1), and the coordinates of the ending point of the offline pipeline are known to be (x2, y2);
[0209] Calculating the distance ratio of the target point on the offline pipeline according to the following second formula;
[0210] Second formula:
[0211]
[0212] Wherein, p is the distance ratio, d is the distance from the starting point to the target point, and L is the total length;
[0213] According to the following third formula, the second coordinate of the target point is obtained;
[0214] The third formula:
[0215] x0=x1+p×(x2-x1)
[0216] y0=y1+p×(y2-y1)
[0217] Wherein, x0, y0 are the second coordinates;
[0218] When the mileage of the pipeline ancillary facilities is known, the second coordinate of the target point is calculated according to linear interpolation, and the offset parameter is determined according to the spatial position of the pipeline ancillary facilities data, including:
[0219] Finding the nearest pile by the coordinates of the pipeline auxiliary facilities, subtracting the mileage of the nearest pile from the current mileage to obtain an offset parameter of the nearest pile;
[0220] Determining the mileage of the pipeline ancillary facilities according to the spatial position of the pipeline ancillary facilities data includes:
[0221] When the coordinates of the pipeline ancillary facilities are known, the projection position of the target point on the offline pipeline is found, and the mileage of the pipeline ancillary facilities is obtained by adding the offset parameters of the pipeline ancillary facilities to the known mileage of the offline pile.
[0222] In the embodiment of the present application, the electronic device 700 further includes a memory 703. Figure 7 In the embodiment, the bus architecture can include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 702 and memory represented by memory 703. The bus architecture can also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are all well known in the art and therefore will not be further described herein. The bus interface provides an interface. The transceiver 701 can be multiple components, that is, including a transmitter and a receiver, providing a unit for communicating with various other devices on a transmission medium. The processor 702 is responsible for managing the bus architecture and general processing, and the memory 703 can store data used by the processor 702 when performing operations.
[0223] The electronic device 700 provided in the embodiment of the present application can execute the steps of the long-distance pipeline linear calculation method provided in the above-mentioned method embodiment 1, which will not be described again here to avoid repetition.
[0224] The electronic device provided in this embodiment can calculate the offline pile mileage, offline pile coordinates and pipeline ancillary facilities location parameters, and thus obtain other corresponding parameters, so that the long-distance oil and gas pipeline and its ancillary facilities can be managed more systematically.
[0225] Example 4
[0226] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the long-distance pipeline linear reference calculation method provided in Example 1 is implemented.
[0227] In this embodiment, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0228] The computer-readable storage medium provided in this embodiment can implement the long-distance pipeline linear reference calculation method provided in Example 1. To avoid repetition, it will not be described here.
[0229] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not limiting, and thus other examples of the exemplary embodiments may have different values.
[0230] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not need to be further defined or explained in subsequent drawings.
[0231] The above-described embodiments merely illustrate several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that variations and modifications are possible without departing from the scope of the present invention, and such variations and modifications are fully within the scope of protection of the present invention.
Claims
1. A linear reference calculation method for long-distance pipelines, characterized in that: The method comprises: Collect pipeline data and pile data, store the pipeline data and the pile data in a database, and obtain first offline pile data and second offline pile data, wherein the first offline pile data is offline pile data including offline pipeline data; and the second offline pile data is offline pile data excluding offline pipeline data; Acquire the spatial position of the offline pipeline through the first offline pile data in the database; Determine the offline pile mileage by using the first offline pile data in the database; Determine the offline pile coordinates using the first offline pile data in the database; Determine the target offline pipeline closest to the target offline pile using the second offline pile data in the database, and determine the target offline pile mileage and target offline pile coordinates based on the target offline pipeline; Collect pipeline ancillary facilities data; The pipeline ancillary facility location parameters are determined according to the spatial location of the pipeline ancillary facility data. The pipeline ancillary facility location parameters include: the mileage of the pipeline ancillary facility, the coordinates of the pipeline ancillary facility, the mileage of the offline pile plus the offset parameter of the pipeline ancillary facility.
2. The linear reference calculation method for long-distance pipelines according to claim 1 is characterized in that: The determining of the offline pile mileage by using the first offline pile data in the database includes: Taking the starting point and the end point of the offline pipeline as a first vector, calculating a second vector from the starting point of the offline pipeline to the offline pile using a geometric formula, and determining the straight-line distance from the offline pipeline to the offline pile based on the second vector; Calculating the angle between the straight-line distance and the offline pipeline direction vector to obtain an angle value; determining, based on the angle value, whether the offline pile is on the offline pipeline; If the angle value is a first preset value and the offline pile is on the offline pipeline, the offline pile mileage is the distance from the offline pile to the starting point of the offline pipeline; If the angle value is a second preset value and the offline pile is on the extension line of the offline pipeline, then the offline pile mileage is the distance from the offline pile to the end point of the offline pipeline; If the angle value is a third preset value and the offline pile is not on the offline pipeline or the extension line of the offline pipeline, the offline pile mileage is the perpendicular distance from the offline pile to the offline pipeline.
3. The linear reference calculation method for long-distance pipelines according to claim 1 is characterized in that: The determining the offline pile coordinates using the first offline pile data in the database includes: Determine the designated offline pipeline and calculate the designated offline pile according to the user's selection operation; Determining the starting point and the ending point of the designated offline pipeline; Calculating a first position of the designated offline pile on the designated offline pipeline according to the starting point and the end point of the designated offline pipeline; The offline pile coordinates of the designated offline pile on the designated offline pipeline are calculated according to the first position.
4. The linear reference calculation method for long-distance pipelines according to claim 3 is characterized in that: Calculating the first position of the designated offline pile on the designated offline pipeline according to the starting point and the end point includes: Calculating the segment length of the designated offline pipeline; Determining whether the distance between the starting point of the designated offline pipeline and the designated offline pile is less than the line segment length; If so, the distance between the designated offline pile and the starting point of the offline pipeline is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the length of the segment; If not, the distance between the designated offline pile and the offline pipeline end point is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the segment length.
5. The linear reference calculation method for long-distance pipelines according to claim 1 is characterized in that: The determining the target offline pipeline closest to the target offline pile by using the second offline pile data in the database includes: Calculating a vertical distance from each offline pile to each offline pipeline based on the second offline pile data; The offline pipeline corresponding to the shortest vertical distance of each offline pile is used as the target offline pipeline.
6. The linear reference calculation method for long-distance pipelines according to claim 1 is characterized in that: The determining of the pipeline ancillary facility location parameters according to the spatial location of the pipeline ancillary facility data includes: When the offset parameters are known, the starting coordinates and the ending coordinates of the offline pipeline and the distance from the starting point of the offline pipeline to the target point are determined, where the target point is the pipeline ancillary facility; Calculate the total length of the offline pipeline according to the following first formula; First formula: Assume that the coordinates of the starting point of the offline pipeline are known to be (x1, y1), and the coordinates of the ending point of the offline pipeline are known to be (x2, y2); Calculating the distance ratio of the target point on the offline pipeline according to the following second formula; Second formula: Wherein, p is the distance ratio, d is the distance from the starting point to the target point, and L is the total length; According to the following third formula, the second coordinate of the target point is obtained; The third formula: x0=x1+p×(x2-x1) y0=y1+p×(y2-y1) Wherein, x0, y0 are the second coordinates; When the mileage of the pipeline ancillary facilities is known, the second coordinate of the target point is calculated according to linear interpolation, and the offset parameter is determined according to the spatial position of the pipeline ancillary facilities data, including: Finding the nearest pile by the coordinates of the pipeline auxiliary facilities, subtracting the mileage of the nearest pile from the current mileage to obtain an offset parameter of the nearest pile; Determining the mileage of the pipeline ancillary facilities according to the spatial position of the pipeline ancillary facilities data includes: When the coordinates of the pipeline ancillary facilities are known, the projection position of the target point on the offline pipeline is found, and the mileage of the pipeline ancillary facilities is obtained by adding the offset parameters of the pipeline ancillary facilities to the known mileage of the offline pile.
7. A linear reference calculation device for long-distance pipelines, characterized in that: The device comprises: A data module is used to collect pipeline data and pile data, store the pipeline data and the pile data in a database, and obtain first offline pile data and second offline pile data; a mileage calculation module, configured to obtain the spatial position of an offline pipeline using the first offline pile data in the database, determine the offline pile mileage using the first offline pile data in the database; determine the target offline pipeline closest to the target offline pile using the second offline pile data in the database, and determine the target offline pile mileage based on the target offline pipeline; a coordinate module, configured to obtain the spatial position of an offline pipeline using the first offline pile data in the database, determine the offline pile coordinates using the first offline pile data in the database; determine the target offline pipeline closest to the target offline pile using the second offline pile data in the database, and determine the target offline pile coordinates based on the target offline pipeline; The ancillary facility module is used to determine the pipeline ancillary facility location parameters according to the spatial location of the pipeline ancillary facility data.
8. The long-distance pipeline linear reference calculation device according to claim 7, characterized in that: The coordinate module further includes: Calculating the segment length of the designated offline pipeline; Determining whether the distance between the starting point of the designated offline pipeline and the designated offline pile is less than the line segment length; If so, the distance between the designated offline pile and the starting point of the offline pipeline is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the length of the segment; If not, the distance between the designated offline pile and the offline pipeline end point is calculated, and the first position is calculated according to the direction of the designated offline pipeline segment and the segment length.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program, the long-distance pipeline linear reference calculation method according to any one of claims 1 to 6 is executed.
10. A computer-readable storage medium, characterized in that The computer program stores a computer program, which executes the long-distance pipeline linear reference calculation method according to any one of claims 1 to 6 when running on a processor.
Citation Information
Patent Citations
Oil and gas pipeline positioning data acquisition method and device and oil and gas pipeline monitoring system
CN117516497A
Method and apparatus for determining optimal control settings of a pipeline
US6701223B1