Long-distance pipeline linear reference calculation method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202510700644.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-28
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2045-05-28
AI Technical Summary
[0002]在长输油气行业中,管线及其附属设施是基础设施之一,如阀门、穿跨越、水工保护等;管理这些管线及其附属设施需要进行位置定位,需使用专门的数据模型和工具,现有在web端开发中存在没有成套的体系来进行位置要素线性参考计算的问题
[0018]The linear reference calculation method for long-distance pipelines provided in this 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, the spatial location of the offline pipeline is obtained from the database, and the offline pile mileage and coordinates are calculated. For the second offline pile data not containing offline pipeline data, the target offline pipeline with the shortest vertical distance to the second offline pile is calculated, and the target offline pipeline data is obtained. The same mileage and coordinate calculations as for the first offline pile are then performed. The location parameters of pipeline ancillary facilities are determined through spatial location, where the starting and ending points of the pipeline ancillary facilities are fitted onto the pipeline, and the geometry of the pipeline ancillary facilities on the pipeline is considered. Furthermore, by knowing the mileage of the pipeline ancillary facilities, or the coordinates of the pipeline ancillary facilities, or the mileage of the offline piles plus the offset parameters of the pipeline ancillary facilities, the parameters of other pipeline ancillary facilities can be calculated. This allows for a complete system in web-based development to perform location calculations for piles and pipeline ancillary facilities with high efficiency and accuracy.
Smart Images

Figure CN120596586B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of long-distance oil and gas pipeline technology, and in particular to a linear reference calculation method, apparatus, electronic device and storage medium for long-distance pipelines. Background Technology
[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 systems. Managing these pipelines and their ancillary facilities requires location positioning, which necessitates the use of specialized data models and tools. Currently, there is a lack of a complete system for linear reference calculation of 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 shortcomings of the prior art and provide a linear reference calculation method, apparatus, electronic device and storage medium for long-distance pipelines.
[0004] In a first aspect, embodiments of this application provide a linear reference calculation method for long-distance pipelines, the method comprising: Collect pipeline data and pile data, store the pipeline data and pile data in a database to obtain first offline pile data and second offline pile data. The first offline pile data is offline pile data that includes offline pipeline data; the second offline pile data is offline pile data that does not include offline pipeline data. The spatial location of the offline pipeline is obtained through the first offline pile data in the database; The offline pile mileage is determined using the first offline pile data in the database; The coordinates of the offline piles are determined using the first offline pile data in the database; The target offline pipeline closest to the target offline pile is determined using the second offline pile data in the database, and the target offline pile mileage and target offline pile coordinates are determined based on the target offline pipeline; Collect data on pipeline ancillary facilities; The location parameters of the pipeline ancillary facilities are determined based on the spatial location of the pipeline ancillary facility data. The location parameters of the pipeline ancillary facilities include: the mileage of the pipeline ancillary facilities, the coordinates of the pipeline ancillary facilities, the mileage of the offline stake, and the offset parameters of the pipeline ancillary facilities.
[0005] In one embodiment, determining the offline pile mileage using the first offline pile data in the database includes: Using the starting point and the ending point of the offline pipeline as the first vector, a second vector from the starting point of the offline pipeline to the offline pile is calculated using a geometric formula. The straight-line distance from the offline pipeline to the offline pile is then determined based on the second vector. Calculate the angle between the straight-line distance and the direction vector of the offline pipeline to obtain the angle value; Based on the angle value, determine 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, then 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 stake is on the extension line of the offline pipeline, then the offline stake mileage is the distance from the offline stake to the end point of the offline pipeline; If the angle value is a third preset value, and the offline stake is not on the offline pipeline or on the extension line of the offline pipeline, then the offline stake mileage is the perpendicular distance from the offline stake to the offline pipeline.
[0006] In one embodiment, determining the coordinates of the offline stake using the first offline stake data in the database includes: The specified offline pipeline is determined and the specified offline pile is calculated based on the user's selected operation; Determine the start and end points of the specified offline pipeline; Calculate the first position of the designated offline pile on the designated offline pipeline based on the start and end points of the designated offline pipeline; The coordinates of the designated offline pile on the designated offline pipeline are calculated based on the first location.
[0007] In one embodiment, calculating the first position of the designated offline stake on the designated offline pipeline based on the start point and the end point includes: Calculate the segment length of the specified offline pipeline; Determine whether the distance between the starting point of the specified offline pipeline and the specified offline stake is less than the length of the line segment; If so, calculate the distance between the designated offline stake and the starting point of the offline pipeline, and calculate the first position based on the direction of the designated offline pipeline segment and the length of the segment; If not, calculate the distance between the designated offline stake and the end point of the offline pipeline, and calculate the first position based on the direction of the designated offline pipeline segment and the length of the segment.
[0008] In one embodiment, determining the target offline pipeline closest to the target offline pile using the second offline pile data in the database includes: Calculate the 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 taken as the target offline pipeline.
[0009] In one embodiment, determining the location parameters of the pipeline accessories based on the spatial location of the pipeline accessory data includes: When the offset parameter is known, the starting point coordinates, ending point coordinates, and distance from the starting point of the offline pipeline to the target point are determined, where the target point is the pipeline's auxiliary facility. The total length of the offline pipeline is calculated according to the following first formula; First formula:
[0010] Assume the starting coordinates of the offline pipeline are known to be ( , The endpoint coordinates of the offline pipeline are ( ). , ); The distance proportion occupied by the target point on the offline pipeline is calculated according to the following second formula; Second formula:
[0011] In the formula, p is the distance ratio, d is the distance from the starting point to the target point, and L is the total length; The second coordinates of the target point are obtained according to the following third formula; Third formula:
[0012]
[0013] In the formula, the , The second coordinate; When the mileage of the pipeline ancillary facilities is known, the second coordinates of the target point are calculated using linear interpolation, and the offset parameters are determined based on the spatial location of the pipeline ancillary facility data, including: The nearest pile is located by finding the coordinates of the pipeline accessories, and the offset parameter of the nearest pile is obtained by subtracting the current mileage from the mileage of the nearest pile. Determining the mileage of pipeline ancillary facilities based on their spatial location 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 parameter of the pipeline ancillary facilities to the known mileage of the offline pile.
[0014] Secondly, embodiments of this application provide a linear reference calculation method apparatus for long-distance pipelines, the long-distance pipeline linear reference calculation apparatus comprising: The data module is used to collect pipeline data and pile data, store the pipeline data and pile data into the database, and obtain the first offline pile data and the second offline pile data. The mileage calculation module is used to obtain the spatial location of the offline pipeline through the first offline pile data in the database, and determine the mileage of the offline pile through the first offline pile data in the database; and to determine the target offline pipeline closest to the target offline pile through the second offline pile data in the database, and determine the mileage of the target offline pile based on the target offline pipeline. The coordinate module is used to obtain the spatial location of the offline pipeline through the first offline pile data in the database, and determine the coordinates of the offline pile through the first offline pile data in the database; to determine the target offline pipeline closest to the target offline pile through the second offline pile data in the database, and to determine the coordinates of the target offline pile based on the target offline pipeline; The ancillary facilities module is used to determine the location parameters of the pipeline ancillary facilities based on the spatial location of the pipeline ancillary facilities data.
[0015] In one embodiment, in the linear reference calculation method apparatus for long-distance pipelines, the coordinate module is further used to calculate the segment length of the specified offline pipeline; Determine whether the distance between the starting point of the specified offline pipeline and the specified offline stake is less than the length of the line segment; If so, calculate the distance between the designated offline stake and the starting point of the offline pipeline, and calculate the first position based on the direction of the designated offline pipeline segment and the length of the segment; If not, calculate the distance between the designated offline stake and the end point of the offline pipeline, and calculate the first position based on the direction of the designated offline pipeline segment and the length of the segment.
[0016] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is used to store a computer program, and the computer program executes the long-distance pipeline linear reference calculation method provided in the first aspect when the processor is running.
[0017] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a processor, executes the long-distance pipeline linear reference calculation method provided in the first aspect.
[0018] The linear reference calculation method for long-distance pipelines provided in this 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, the spatial location of the offline pipeline is obtained from the database, and the offline pile mileage and coordinates are calculated. For the second offline pile data not containing offline pipeline data, the target offline pipeline with the shortest vertical distance to the second offline pile is calculated, and the target offline pipeline data is obtained. The same mileage and coordinate calculations as for the first offline pile are then performed. The location parameters of pipeline ancillary facilities are determined through spatial location, where the starting and ending points of the pipeline ancillary facilities are fitted onto the pipeline, and the geometry of the pipeline ancillary facilities on the pipeline is considered. Furthermore, by knowing the mileage of the pipeline ancillary facilities, or the coordinates of the pipeline ancillary facilities, or the mileage of the offline piles plus the offset parameters of the pipeline ancillary facilities, the parameters of other pipeline ancillary facilities can be calculated. This allows for a complete system in web-based development to perform location calculations for piles and pipeline ancillary facilities with high efficiency and accuracy. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This paper illustrates a flowchart of a linear reference calculation method for long-distance pipelines provided in an embodiment of this application. Figure 2 This paper illustrates another flowchart of a linear reference calculation method for long-distance pipelines provided in an embodiment of this application. Figure 3 This paper illustrates another flowchart of a linear reference calculation method for long-distance pipelines provided in an embodiment of this application. Figure 4 This paper illustrates another flowchart of a linear reference calculation method for long-distance pipelines provided in an embodiment of this application. Figure 5 This paper illustrates another flowchart of a linear reference calculation method for long-distance pipelines provided in an embodiment of this application. Figure 6 This paper shows a schematic diagram of the structure of a linear reference computing device for long-distance pipelines provided in an embodiment of this application; Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown.
[0021] Icons: 500-Long-distance pipeline linear reference calculation device; 501-Data module; 502-Mileage calculation module; 503-Coordinate module; 504-Auxiliary facility module; 700-Electronic equipment; 701-Transceiver; 702-Processor; 703-Memory. Detailed Implementation
[0022] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0023] It should be noted that when an element is said to be "fixed" to another element, it can be directly on the other element or there may be an intervening element. When an element is said to be "connected" to another element, it can be directly connected to the other element or there may be an intervening element. Conversely, when an element is said to be "directly" on another element, there is no intervening element. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.
[0024] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0025] 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 technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0026] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the template description is for the purpose of describing particular embodiments only and is not intended to limit the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0027] Example 1 This application provides a linear reference calculation method for long-distance pipelines.
[0028] See Figure 1 The linear reference calculation methods for long-distance pipelines include: Step S101: Collect pipeline data and pile data, store the pipeline data and pile data in the database to obtain first offline pile data and second offline pile data.
[0029] The first offline pile data includes offline pipeline data; the second offline pile data does not include offline pipeline data.
[0030] In this embodiment, the database is a PostgreSQL database. When users collect pipeline data and pile data, some offline pile data includes offline pipeline data, while some offline pile data does not. It is necessary to calculate the offline pile data that includes offline pipeline data and the offline pile data that does not include offline pipeline data separately.
[0031] Step S102: Obtain the spatial location of the offline pipeline through the first offline pile data in the database.
[0032] In this embodiment, the spatial location refers to the geometry within the range of the starting and ending points of the offline pipeline.
[0033] Step S103: Determine the offline pile mileage using the first offline pile data in the database.
[0034] See Figure 2 Step S103 includes: In step S1031, the starting point and the ending point of the offline pipeline are used as the first vector. A second vector from the starting point of the offline pipeline to the offline pile is calculated using a geometric formula. The straight-line distance from the offline pipeline to the offline pile is determined based on the second vector.
[0035] In this embodiment, the start and end points of the offline pipeline are used as vectors to calculate the perpendicular distance from the point to the line. The geometric formula is as follows: In the formula, the equation of the offline pipeline from the starting point to the ending point is: The coordinates of the offline stake are .
[0036] Step S1032: Calculate the angle between the straight-line distance and the direction vector of the offline pipeline to obtain the angle value.
[0037] In this embodiment, the offline stake is not necessarily on the offline pipeline, so there is an angle between the starting point to the ending point of the offline pipeline and the starting point to the offline stake.
[0038] Step S1033: Determine whether the offline pile is on the offline pipeline based on the angle value.
[0039] Step S1034: If the angle value is a first preset value and the offline pile is on the offline pipeline, then the offline pile mileage is the distance from the offline pile to the starting point of the offline pipeline.
[0040] In this embodiment, the first preset value is an angle of 0. When the angle between the offline stake and the offline pipeline is 0, the offline stake is on the offline pipeline.
[0041] Step S1035: If the angle value is a second preset value and the offline stake is on the extension line of the offline pipeline, then the offline stake mileage is the distance from the offline stake to the end point of the offline pipeline.
[0042] In this embodiment, the second preset value is 180 degrees. When the angle between the offline stake and the offline pipeline is 180 degrees, the offline stake is on the extension line of the offline pipeline.
[0043] Step S1036: 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, then the offline pile mileage is the vertical distance from the offline pile to the offline pipeline.
[0044] In this embodiment, the third preset value is when the angle between the offline stake and the offline pipeline is neither 0 degrees nor 180 degrees, meaning the offline stake is neither on the offline pipeline nor on its extension. The pseudocode for this part is as follows: public static double computeDistance(Coordinate p, Coordinate p1,Coordinate p2) { p represents the offline stake, P1 is the starting point of the offline pipeline, and P2 is the ending point of the offline pipeline. double x = p1.x - px; double y = p1.y - py; double dx = p2.x - p1.x; double dy = p2.y - p1.y; double dot = x * dx + y * dy; double len = dx * dx + dy * dy; double t = dot / len; if (t<0) { x = px - p1.x; y = py - p1.y; } else if (t>1) { x = px - p2.x; y = py - p2.y; } else { double cx = p1.x + t * dx; double cy = p1.y + t * dy; x = px - cx; y = py - cy; } return Math.sqrt(x * x + y * y); } The code above can be used to calculate offline pile mileage, but other code can also be used; no restrictions are placed here.
[0045] Step S104: Determine the coordinates of the offline stakes using the first offline stake data in the database. This includes: See Figure 3 Step S104 includes: Step S1041: Determine the specified offline pipeline and calculate the specified offline pile according to the user's selected operation.
[0046] In this embodiment, if a user wants to calculate an offline pipeline, they only need to input the offline pipeline they want to calculate on the front-end interface, and then they will get the data of the specified offline pipeline.
[0047] Step S1042: Determine the start and end points of the specified offline pipeline.
[0048] In this embodiment, the start and end points of the offline pipeline are determined during the planning and design phase, and their data is stored in a database.
[0049] Step S1043: Calculate the first position of the designated offline pile on the designated offline pipeline based on the start and end points of the designated offline pipeline.
[0050] In this embodiment, the first position is calculated using a linear interpolation method. The pseudocode for this part is as follows: public Coordinate getLocation(double length) { double d = length / getLength(); if (d <= 0.5) { return new Coordinate( p0.x + d * (p1.x - p0.x), p0.y + d * (p1.y - p0.y) p0 is the start point of the offline pipeline, and p1 is the end point of the offline pipeline. ); } else { return new Coordinate( p1.x + (1 - d) * (p0.x - p1.x), p1.y + (1 - d) * (p0.y - p1.y) ); } } Step S1044, calculating the coordinates of the designated offline pile on the designated offline pipeline based on the first location, includes: See Figure 4 Step S1044 includes: Step S10441: Calculate the segment length of the specified offline pipeline.
[0051] Step S10442: Determine whether the distance between the starting point of the specified offline pipeline and the specified offline pile is less than the length of the line segment.
[0052] In this embodiment, the length of the line segment is half the length of the offline pipeline. When the offline stake is not necessarily on the offline pipeline, the distance from the starting point of the offline pipeline to the offline stake may be greater than half the length of the offline pipeline or less than half the length of the offline pipeline.
[0053] Step S10443: If yes, calculate the distance between the designated offline stake and the starting point of the offline pipeline, and calculate the first position based on the direction of the designated offline pipeline segment and the length of the segment.
[0054] Step S10444: If not, calculate the distance between the designated offline stake and the end point of the offline pipeline, and calculate the first position based on the direction of the designated offline pipeline segment and the length of the segment.
[0055] Step S105: 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.
[0056] See Figure 5 Step S105 includes: Step S1051: Calculate the vertical distance from each offline pile to each offline pipeline based on the second offline pile data.
[0057] In this embodiment, since the second offline pile data does not include offline pipeline data, it is necessary to calculate the vertical distance from each offline pile (which does not include offline pipeline data) to each offline pipeline.
[0058] Step S1052: The offline pipeline corresponding to the shortest vertical distance of each offline pile is taken as the target offline pipeline.
[0059] In this embodiment, after calculating the vertical distance from each offline stake to each offline pipeline, the offline pipeline corresponding to the shortest vertical distance is identified as the target offline pipeline. After collecting the data of the target offline pipeline, the offline stake mileage and offline stake coordinates are calculated in the same way as the data of the first offline stake.
[0060] Step S106: Collect data on pipeline ancillary facilities.
[0061] 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 the offset parameters of the pipeline ancillary facilities. This data is stored in a database.
[0062] Step S107: Determine the location parameters of the pipeline ancillary facilities based on the spatial location of the pipeline ancillary facility data. The location parameters include: the mileage of the pipeline ancillary facility, the coordinates of the pipeline ancillary facility, the mileage of the offline stake plus the offset parameter of the pipeline ancillary facility, including: When the offset parameter is known, the starting point coordinates, ending point coordinates, and distance from the starting point of the offline pipeline to the target point are determined, where the target point is the pipeline's auxiliary facility.
[0063] In this embodiment, the offset parameter is the mileage of the offline pile plus the offset parameter of the pipeline ancillary facilities.
[0064] The total length of the offline pipeline is calculated according to the following first formula; First formula:
[0065] Assume the starting coordinates of the offline pipeline are known to be ( , The endpoint coordinates of the offline pipeline are ( ). , ).
[0066] In this embodiment, The position of the offline pipeline on the x-axis of the endpoint coordinate system. The position of the offline pipeline on the x-axis of the starting point is... The position of the offline pipeline on the y-axis of the endpoint is given by the following: The position of the offline pipeline on the y-axis of the starting point.
[0067] The distance proportion occupied by the target point on the offline pipeline is calculated according to the following second formula; Second formula:
[0068] In the formula, p is the distance ratio, d is the distance from the starting point to the target point, and L is the total length.
[0069] The second coordinates of the target point are obtained according to the following third formula; Third formula:
[0070]
[0071] In the formula, the , This is the second coordinate.
[0072] When the mileage of the pipeline ancillary facilities is known, the second coordinates of the target point are calculated using linear interpolation, and the offset parameters are determined based on the spatial location of the pipeline ancillary facility data, including: The nearest pile is located by finding the coordinates of the pipeline accessories, and the offset parameter of the nearest pile is obtained by subtracting the current mileage from the mileage of the nearest pile.
[0073] Determining the mileage of pipeline ancillary facilities based on their spatial location 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 parameter of the pipeline ancillary facilities to the known mileage of the offline pile.
[0074] In this embodiment, linear references from GeoTools are used for calculations.
[0075] After determining the target offline pipeline closest to the target offline stake, the mileage and coordinates of the target offline stake are calculated. This allows users to determine the coordinates of the stake. Since long-distance oil and gas pipelines have many auxiliary facilities besides stakes, such as valves, crossings, and hydraulic protection systems, this solution can also determine the location parameters of these pipeline auxiliary facilities. By determining the mileage of the pipeline auxiliary facilities, the coordinates of the pipeline auxiliary facilities, the mileage of the offline stake, and the offset parameters of the pipeline auxiliary facilities, one of these parameters can be used to obtain other location parameters, making it convenient for users to manage these pipelines and their auxiliary facilities.
[0076] The linear reference calculation method for long-distance pipelines provided in this embodiment collects pipeline data and pile data, stores the pipeline 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 location of the offline pipeline is obtained from the database, and the offline pile mileage and coordinates are calculated. For the second offline pile data not containing offline pipeline data, the target offline pipeline with the shortest vertical distance to the second offline pile is calculated, and the target offline pipeline data is obtained. The same mileage and coordinate calculations are performed as for the first offline pile. The location parameters of pipeline ancillary facilities are determined by spatial location, where the starting and ending points of the pipeline ancillary facilities are fitted onto the pipeline, and the geometry of the pipeline ancillary facilities on the pipeline is considered. Furthermore, 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, the parameters of other pipeline ancillary facilities can be calculated. This allows for a complete system in web development to perform location calculations for piles and pipeline ancillary facilities with high efficiency and accuracy.
[0077] Example 2 Furthermore, embodiments of this application provide a linear reference computing device for long-distance pipelines, which is applied to electronic devices.
[0078] like Figure 6 As shown, the long-distance pipeline linear reference calculation device 500 includes: Data module 501 is used to collect pipeline data and pile data, store the pipeline data and pile data into a database, and obtain first offline pile data and second offline pile data; The mileage calculation module 502 is used to obtain the spatial location of the offline pipeline through the first offline pile data in the database, and determine the mileage of the offline pile through the first offline pile data in the database; and to determine the target offline pipeline closest to the target offline pile through the second offline pile data in the database, and determine the mileage of the target offline pile based on the target offline pipeline. The coordinate module 503 is used to obtain the spatial location of the offline pipeline through the first offline pile data in the database, determine the coordinates of the offline pile through the first offline pile data in the database, determine the target offline pipeline closest to the target offline pile through the second offline pile data in the database, and determine the coordinates of the target offline pile based on the target offline pipeline. The auxiliary facility module 504 is used to determine the location parameters of the pipeline auxiliary facilities based on the spatial location of the pipeline auxiliary facility data.
[0079] Optionally, the coordinate module is also used to calculate the segment length of the specified offline pipeline; Determine whether the distance between the starting point of the specified offline pipeline and the specified offline stake is less than the length of the line segment; If so, calculate the distance between the designated offline stake and the starting point of the offline pipeline, and calculate the first position based on the direction of the designated offline pipeline segment and the length of the segment; If not, calculate the distance between the designated offline stake and the end point of the offline pipeline, and calculate the first position based on the direction of the designated offline pipeline segment and the length of the segment.
[0080] The linear reference calculation device 500 for long-distance pipelines provided in this embodiment can implement the linear reference calculation method for long-distance pipelines provided in Embodiment 1. To avoid repetition, it will not be described again here.
[0081] The linear reference calculation device for long-distance pipelines 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 location of the offline pipeline is obtained from the database, and the offline pile mileage and coordinates are calculated. For the second offline pile data not containing offline pipeline data, the target offline pipeline with the shortest vertical distance to the second offline pile is calculated, and the target offline pipeline data is obtained. The same mileage and coordinate calculations are performed as for the first offline pile. The location parameters of pipeline ancillary facilities are determined by the spatial location, which is the starting and ending points of the pipeline ancillary facilities fitted onto the pipeline, and the geometry of the pipeline ancillary facilities on the pipeline. Furthermore, 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, the parameters of other pipeline ancillary facilities can be calculated. This allows for a complete system in web-based development to perform location calculations for piles and pipeline ancillary facilities with high efficiency and accuracy.
[0082] Example 3 Furthermore, this application provides an electronic device, including a memory and a processor. The memory stores a computer program, which, when run on the processor, executes the linear reference calculation method for long-distance pipelines provided in Embodiment 1.
[0083] For details, see Figure 7 The electronic device 700 includes a transceiver 701, a bus interface, and a processor 702. The processor 702 is used for: collecting pipeline data and pile data; storing the pipeline data and pile data into a database to obtain first offline pile data and second offline pile data, wherein the first offline pile data includes offline pile data and the second offline pile data does not include offline pipeline data; obtaining the spatial location of the offline pipeline through the first offline pile data in the database; determining the mileage of the offline pile through the first offline pile data in the database; determining the coordinates of the offline pile through the first offline pile data in the database; determining the target offline pipeline closest to the target offline pile through the second offline pile data in the database, and determining the mileage and coordinates of the target offline pile based on the target offline pipeline; collecting pipeline ancillary facility data; and determining the location parameters of the pipeline ancillary facilities according to the spatial location of the pipeline ancillary facility data, wherein the location parameters of the pipeline ancillary facilities include: the mileage of the pipeline ancillary facilities, the coordinates of the pipeline ancillary facilities, and the mileage of the offline pile plus the offset parameter of the pipeline ancillary facilities.
[0084] In one embodiment, the processor 702 is further configured to: take the starting point and the ending point of the offline pipeline as a first vector, calculate a second vector from the starting point of the offline pipeline to the offline stake using a geometric formula, and determine the straight-line distance from the offline pipeline to the offline stake based on the second vector; Calculate the angle between the straight-line distance and the direction vector of the offline pipeline to obtain the angle value; Based on the angle value, determine 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, then 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 stake is on the extension line of the offline pipeline, then the offline stake mileage is the distance from the offline stake to the end point of the offline pipeline; If the angle value is a third preset value, and the offline stake is not on the offline pipeline or on the extension line of the offline pipeline, then the offline stake mileage is the perpendicular distance from the offline stake to the offline pipeline.
[0085] In one embodiment, the processor 702 is further configured to: determine a specified offline pipeline based on a user-selected operation, and calculate a specified offline stub; Determine the start and end points of the specified offline pipeline; Calculate the first position of the designated offline pile on the designated offline pipeline based on the start and end points of the designated offline pipeline; The coordinates of the designated offline pile on the designated offline pipeline are calculated based on the first location.
[0086] In one embodiment, the processor 702 is further configured to: calculate the segment length of the specified offline pipeline; Determine whether the distance between the starting point of the specified offline pipeline and the specified offline stake is less than the length of the line segment; If so, calculate the distance between the designated offline stake and the starting point of the offline pipeline, and calculate the first position based on the direction of the designated offline pipeline segment and the length of the segment; If not, calculate the distance between the designated offline stake and the end point of the offline pipeline, and calculate the first position based on the direction of the designated offline pipeline segment and the length of the segment.
[0087] In one embodiment, the processor 702 is further configured to: calculate the vertical distance from each offline stake to each offline pipeline based on the second offline stake data; The offline pipeline corresponding to the shortest vertical distance of each offline pile is taken as the target offline pipeline.
[0088] In one embodiment, the processor 702 is further configured to: when the offset parameter is known, determine the starting point coordinates, the ending point coordinates, and the distance from the starting point of the offline pipeline to a target point, wherein the target point is an auxiliary facility of the pipeline; The total length of the offline pipeline is calculated according to the following first formula; First formula:
[0089] Assume the starting coordinates of the offline pipeline are known to be ( , The endpoint coordinates of the offline pipeline are ( ). , ); The distance proportion occupied by the target point on the offline pipeline is calculated according to the following second formula; Second formula:
[0090] In the formula, p is the distance ratio, d is the distance from the starting point to the target point, and L is the total length; The second coordinates of the target point are obtained according to the following third formula; Third formula:
[0091]
[0092] In the formula, the , The second coordinate; When the mileage of the pipeline ancillary facilities is known, the second coordinates of the target point are calculated using linear interpolation, and the offset parameters are determined based on the spatial location of the pipeline ancillary facility data, including: The nearest pile is located by finding the coordinates of the pipeline accessories, and the offset parameter of the nearest pile is obtained by subtracting the current mileage from the mileage of the nearest pile. Determining the mileage of pipeline ancillary facilities based on their spatial location 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 parameter of the pipeline ancillary facilities to the known mileage of the offline pile.
[0093] In this embodiment of the application, the electronic device 700 further includes a memory 703. Figure 7 In this context, the bus architecture can include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 702) and memory (memory 703). The bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 701 can be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over 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 during operation.
[0094] The electronic device 700 provided in this application embodiment can execute the steps of the linear calculation method for long-distance pipelines provided in the above method embodiment 1. To avoid repetition, it will not be described again here.
[0095] The electronic device provided in this embodiment can perform mutual calculations between offline pile mileage calculation, offline pile coordinate calculation, and pipeline ancillary facility location parameters to determine other corresponding parameters, enabling more systematic management of long-distance oil and gas pipelines and their ancillary facilities.
[0096] Example 4 This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the linear reference calculation method for long-distance pipelines provided in Embodiment 1.
[0097] 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, etc.
[0098] The computer-readable storage medium provided in this embodiment can implement the linear reference calculation method for long-distance pipelines provided in Embodiment 1. To avoid repetition, it will not be described again here.
[0099] In all examples shown and described herein, any specific values should be interpreted as merely exemplary and not as limitations; therefore, other examples of exemplary embodiments may have different values.
[0100] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0101] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall 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 includes: Collect pipeline data and pile data, store the pipeline data and pile data in a database to obtain first offline pile data and second offline pile data. The first offline pile data is offline pile data that includes offline pipeline data; the second offline pile data is offline pile data that does not include offline pipeline data. The spatial location of the offline pipeline is obtained through the first offline pile data in the database; The offline pile mileage is determined using the first offline pile data in the database; The coordinates of the offline piles are determined using the first offline pile data in the database; The target offline pipeline closest to the target offline pile is determined using the second offline pile data in the database, and the target offline pile mileage and target offline pile coordinates are determined based on the target offline pipeline; Collect data on pipeline ancillary facilities; The location parameters of the pipeline ancillary facilities are determined based on the spatial location of the pipeline ancillary facilities data. The location parameters of the pipeline ancillary facilities include: the mileage of the pipeline ancillary facilities, the coordinates of the pipeline ancillary facilities, the mileage of the offline stake plus the offset parameters of the pipeline ancillary facilities. Determining the offline pile mileage using the first offline pile data in the database includes: Using the starting point and the ending point of the offline pipeline as the first vector, a second vector from the starting point of the offline pipeline to the offline pile is calculated using a geometric formula. The straight-line distance from the offline pipeline to the offline pile is then determined based on the second vector. Calculate the angle between the straight-line distance and the direction vector of the offline pipeline to obtain the angle value; Based on the angle value, determine 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, then 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 stake is on the extension line of the offline pipeline, then the offline stake mileage is the distance from the offline stake to the end point of the offline pipeline; If the angle value is a third preset value, and the offline stake is not on the offline pipeline or on the extension line of the offline pipeline, then the offline stake mileage is the perpendicular distance from the offline stake to the offline pipeline.
2. The linear reference calculation method for long-distance pipelines according to claim 1, characterized in that, Determining the coordinates of the offline stakes using the first offline stake data in the database includes: The specified offline pipeline is determined and the specified offline pile is calculated based on the user's selected operation; Determine the start and end points of the specified offline pipeline; Calculate the first position of the designated offline pile on the designated offline pipeline based on the start and end points of the designated offline pipeline; The coordinates of the designated offline pile on the designated offline pipeline are calculated based on the first location.
3. The linear reference calculation method for long-distance pipelines according to claim 2, characterized in that, The step of calculating the first position of the designated offline pile on the designated offline pipeline based on the starting point and the ending point includes: Calculate the segment length of the specified offline pipeline; Determine whether the distance between the starting point of the specified offline pipeline and the specified offline stake is less than the length of the line segment; If so, calculate the distance between the designated offline stake and the starting point of the offline pipeline, and calculate the first position based on the direction of the line segment and the length of the line segment of the designated offline pipeline; If not, calculate the distance between the designated offline stake and the end point of the offline pipeline, and calculate the first position based on the direction and length of the line segment of the designated offline pipeline.
4. The linear reference calculation method for long-distance pipelines according to claim 1, characterized in that, The step of determining the target offline pipeline closest to the target offline pile using the second offline pile data in the database includes: Calculate the 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 taken as the target offline pipeline.
5. The linear reference calculation method for long-distance pipelines according to claim 1, characterized in that, The step of determining the location parameters of pipeline ancillary facilities based on the spatial location of the pipeline ancillary facility data includes: When the offset parameter is known, determine the starting point coordinates, ending point coordinates, and distance from the starting point of the offline pipeline to the target point, where the target point is the pipeline auxiliary facility; The total length of the offline pipeline is calculated according to the following first formula; First formula: Assume the starting coordinates of the offline pipeline are known to be ( , The endpoint coordinates of the offline pipeline are ( , ); The distance proportion of the target point on the offline pipeline is calculated according to the following second formula; Second formula: In the formula, p is the distance ratio, d is the distance from the starting point to the target point, and L is the total length; The second coordinates of the target point are obtained according to the following third formula; Third formula: In the formula, the , The second coordinate; When the mileage of the pipeline ancillary facilities is known, the second coordinates of the target point are calculated using linear interpolation, and the offset parameters are determined based on the spatial location of the pipeline ancillary facility data, including: The nearest pile is located by finding the coordinates of the pipeline accessories, and the offset parameter of the nearest pile is obtained by subtracting the current mileage from the mileage of the nearest pile. Determining the mileage of pipeline ancillary facilities based on their spatial location data includes: When the coordinates of the pipeline accessories are known, the projection position of the target point on the offline pipeline is found, and the mileage of the pipeline accessories is obtained by adding the offset parameter of the pipeline accessories to the known mileage of the offline stake.
6. A linear reference calculation device for long-distance pipelines, characterized in that, The device includes: The data module is used to collect pipeline data and pile data, store the pipeline data and pile data into the database, and obtain the first offline pile data and the second offline pile data. The mileage calculation module is used to obtain the spatial location of the offline pipeline through the first offline pile data in the database, and determine the mileage of the offline pile through the first offline pile data in the database; and to determine the target offline pipeline closest to the target offline pile through the second offline pile data in the database, and determine the mileage of the target offline pile based on the target offline pipeline. The coordinate module is used to obtain the spatial location of the offline pipeline through the first offline pile data in the database, and determine the coordinates of the offline pile through the first offline pile data in the database; to determine the target offline pipeline closest to the target offline pile through the second offline pile data in the database, and to determine the coordinates of the target offline pile based on the target offline pipeline; The ancillary facilities module is used to determine the location parameters of pipeline ancillary facilities based on the spatial location of the pipeline ancillary facilities data; Determining the offline pile mileage using the first offline pile data in the database includes: Using the starting point and the ending point of the offline pipeline as the first vector, a second vector from the starting point of the offline pipeline to the offline pile is calculated using a geometric formula. The straight-line distance from the offline pipeline to the offline pile is then determined based on the second vector. Calculate the angle between the straight-line distance and the direction vector of the offline pipeline to obtain the angle value; Based on the angle value, determine 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, then 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 stake is on the extension line of the offline pipeline, then the offline stake mileage is the distance from the offline stake to the end point of the offline pipeline; If the angle value is a third preset value, and the offline stake is not on the offline pipeline or on the extension line of the offline pipeline, then the offline stake mileage is the perpendicular distance from the offline stake to the offline pipeline.
7. The linear reference calculation device for long-distance pipelines according to claim 6, characterized in that, The coordinate module further includes: Calculate the segment length of a specified offline pipeline; Determine whether the distance between the starting point of the specified offline pipeline and the specified offline stake is less than the length of the line segment; If so, calculate the distance between the designated offline stake and the starting point of the offline pipeline, and calculate the first position based on the direction of the line segment and the length of the line segment of the designated offline pipeline; If not, calculate the distance between the designated offline stake and the end point of the offline pipeline, and calculate the first position based on the direction and length of the line segment of the designated offline pipeline.
8. An electronic device, characterized in that, It includes a memory and a processor, the memory storing a computer program that executes the linear reference calculation method for long-distance pipelines according to any one of claims 1 to 5 when the processor is running.
9. A computer-readable storage medium, characterized in that, It stores a computer program that, when run on a processor, executes the linear reference calculation method for long-distance pipelines as described in any one of claims 1 to 5.
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