Automatic labeling algorithms and their applications in weld seam of oil pipeline

Abstract: Building information model (BIM) technology has become an important tool for construction practitioners to improve the engineering design, construction and management. However, it has not been widely used in petrochemical industry, such as oil pipeline construction. This paper presents an automatic labeling algorithm based on BIM technology. We used simulated annealing algorithm to optimize the overlap of pipe weld label positions, resulting in the sequential pipe welds. We used this algorithm in oil pipeline construction and verified its automatic labeling effect on pipe welds.


Introduction
Pipeline transportation has the advantages of short transportation distance, large transportation volume, unaffected by climate, continuous transportation, high environmental benefits, no harmful substance emissions and low energy consumption. Therefore, the huge domestic market demand for refined oil and natural gas greatly promotes the development of pipeline construction. However, there still have several problems in China's petrochemical industry. First, traditional 2D plan construction drawings are abstract and confusing, especially in spatial structure and direction of pipelines. Then, the oil pipelines in refineries are complex and changeable, resulting in collision. Moreover, the risk factor is high because of many cross operations on the construction site. Finally, the amount of drawings is large, therefore the statistics of engineering quantity is difficult. Dynamic labeling can count the workload of constructors and help pipeline inspectors to quickly determine the location of welds to be inspected. In traditional CAD mode, pipeline inspectors need to check the single-line and plane drawings to find the welds to be inspected. Using BIM technology, they can directly find the welds to be inspected in 3D drawings. The weld seams that need to be inspected is marked out quickly and directly.

Design concept of pipeline weld automatic marking plug-in
Oil pipelines are full of pressure. In order to reduce potential safety hazards, the welds of oil pipelines must be sampled and inspected within 24 hours after completion of welding to ensure the quality of construction. The traditional method is to complete the drawing in CAD, and then place a small circle at the position of welds, finally fill it in black. The serial number that masked in sequence near the weld seam, is shown in Figure 2.1. The operation of the machine is difficult and time-consuming.

Main functions of pipeline weld automatic marking plug-in design
Based on the above design concept, this paper presents a plug-in for automatic seam labeling of oil pipeline based on Revit platform. The main functions of the plug-in include: (1) Label the position of pipeline welding seam, and set the serial numbers of the weld seam in sequence. The location of the marked weld seam mainly focuses on flange, elbow, tee, four-way, pipe cap, and blind plate etc.
(2) Because of the long corridor, the pipeline on the corridor is made of the seamless steel pipes with a length of 8 to 12 m, therefore the straight pipeline section is set to mark a weld every 8 m.
(3) Mark nominal diameter, pipe material and material type; (4) Display the labels in3D view. Through secondary development, the purpose is to improve the construction efficiency, reduce the workload of engineers and technicians, facilitate the pipeline inspection technicians to quickly find the weld location that needs to detect, and provide convenience for pipeline inspection work.

Development and design process
Based on Visual Studio, C# programming language and Revit API, were developed the Revit software. Revit secondary development process can be roughly divided into three parts: development platform, development preparation, and development and implementation.

Design of automatic marking algorithms for pipeline welds
Pipeline system consists of pipelines and pipeline components. The length of seamless steel pipes in oil pipelines generally are 8 to 12 m. If the pipelines are in the pipeline gallery, the length of the pipeline gallery is different. Therefore, after collecting the pipelines into the assembly, it is necessary to determine the length of the pipeline. If it is greater than 8 m, a weld is automatically added.
According to the above ideas, an optimization algorithm for seam picking is proposed, and the flow chart is shown in Figure 1.

Experiments and analysis of results
The experimental object of this algorithm optimization is the filter device of Shenhua Sewage Physicochemical Pretreatment Project.Using the above-mentioned pipeline seam picking algorithm and the improved simulated annealing optimization algorithm to optimize the pipeline seam marking, and the specific experimental steps are listed as follows: 1. Pipeline seam pickup algorithm designed in this chapter is used to pick up pipeline seam.
2. Mark the weld seam as the initial solution of simulated annealing algorithm. 3. Find the potential label position around the pipeline weld and set up the potential label position set.
4. Iterate many times to find the optimal solution. 5. Find the optimal layout of labels.   Figure 2 is the weld seam labeling of pipeline without optimization. It can be seen that there are many parts of pipeline. The labels overlap and are difficult to recognize. Figure3 is the optimized weld seam labeling arrangement by improved simulated annealing algorithm. Compared with Figure 2, the labeling position of the weld seam is rearranged. The orderliness has been enhanced, and the aesthetic level has been improved to a certain extent.  The experimental sample only selected one of the multi-media filters in the filter workshop, because its structure is most complex and the pipeline trend is most changeable. Through the optimization of simulated annealing algorithm, the overlap phenomenon of pipeline welds has been greatly improved, and the aesthetic degree of labeling has also been greatly improved, but when the pipeline welds are relatively dense. At the same time, the optimized tagging plug-in still cannot achieve complete non-overlap. Finally, it is concluded that Revit software is applicable in oil pipeline.
According to the labeling effect diagram, the pipeline weld labeling plug-in basically meets the engineering requirement. The original purpose of the pipeline weld automatic labeling plug-in development is to assist the defect detection technicians to quickly locate the pipeline weld and help engineers and technicians to count the engineering quantity.

Application of pipeline weld automatic marking plug-in in engineering
Pipeline weld automatic marking plug-in can facilitate pipeline inspectors to quickly find the location of the weld to be inspected and assist engineers and technicians to count the workload of welders every day. The effect of pipeline weld automatic marking is shown in Figure 4.
Pipeline Auto-marking of filter workshop shows a total of 516 welds. If the effect Figure 4 is delivered to the inspection technicians, a dense piece is not conducive to the rapid search of welds. Therefore, the project will divide a device into many small parts and connect the cut-off part with the same pipe name. When we take the single-line drawing, that is, there is only one continuous pipeline in each drawing, so that it is more convenient for constructors to construct without confusing the pipeline under construction. The effect of the single-line icon is shown in Figure5.   4 Concluding remarks (1) By using recursive and calling library functions in Revit API, the sequence of pipeline welds can be achieved, and the welds can be labeled.
(3) Based on the analysis of practical engineering