Gas pipe network maintenance method and system based on large language model and electronic equipment
By building a multimodal vector database and a large language model for intelligent reasoning on the root causes of faults, the problems of data silos and manual dependence in gas pipeline network management are resolved, efficient and automated fault diagnosis and operation and maintenance processes are implemented, and the accuracy and safety of gas pipeline network management are improved.
Patent Information
- Application Number
- CN202511261613.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-05
- Publication Date
- 2025-10-14
- Estimated Expiration
- 2045-09-05
AI Technical Summary
The existing gas pipeline network management system has data silos, fault diagnosis relies on manual analysis, and the operation and maintenance process has a low degree of automation, which cannot meet the smart city's needs for refined management of gas pipeline networks.
A method based on a large language model is adopted to obtain multi-source heterogeneous data for standardization, build a unified multimodal vector database, and use retrieval enhancement generation technology to perform intelligent reasoning on the root cause of faults, generate structured maintenance instructions, and realize automated operation and maintenance processes.
It has achieved comprehensive and accurate situational awareness of the gas pipeline network status, significantly improved the efficiency and accuracy of fault diagnosis, reduced operating costs, formed a data-driven closed-loop optimization, and enhanced the system's interpretability and credibility.
Smart Images

Figure CN120780816A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of urban infrastructure safety and intelligent operation and maintenance, in particular to a gas pipe network maintenance method and system based on a large language model and an electronic device. BACKGROUND
[0002] The urban gas pipe network is the "lifeline" that sustains the normal operation of the city, and its safety and stability are of vital importance. Traditional pipe network management systems usually rely on digitized maps and basic sensor data monitoring to build a preliminary digital twin model; however, these systems have obvious technical bottlenecks when dealing with complex operating conditions.
[0003] Firstly, the data island phenomenon is serious, and the operating state of the pipe network is reflected by multiple types of data, including time series sensor data such as pressure and flow, maintenance inspection records in text form, images and videos taken by unmanned aerial vehicle or robot inspection, and geological subsidence monitoring reports; existing systems lack effective technical means to deeply integrate and correlate analyze these multi-modal data with different sources and formats, resulting in a one-sided and fragmented understanding of the pipe network state.
[0004] Secondly, the fault diagnosis and root cause analysis capability is insufficient; when the monitoring system detects abnormal data such as pressure and flow, it can only issue a simple threshold alarm; the root cause of the anomaly is highly dependent on experienced operation and maintenance experts for manual investigation; experts need to consult historical maintenance records and compare different types of data, the entire process is time-consuming and labor-intensive, and the accuracy of the diagnosis result is limited by individual experience level, making it difficult to cope with sudden situations and shortage of expert resources.
[0005] Thirdly, the automation level of the operation and maintenance process is low. From discovering anomalies, analyzing causes to finally generating maintenance work orders and dispatching personnel, there are many manual intervention links in the entire workflow, the response chain is long, and the processing efficiency is low; this not only increases the operating cost, but more importantly, in emergency situations, it may miss the best processing opportunity due to delayed response, and may bury serious safety hazards.
[0006] Therefore, the existing technology cannot meet the fine management needs of modern smart cities for gas pipe networks "active early warning, accurate diagnosis, and efficient disposal"; there is an urgent need for a new technical solution that can integrate multi-modal data, implement intelligent reasoning of fault root causes, and automatically generate executable maintenance instructions. SUMMARY
[0007] To solve the above technical problems, the present application provides a gas pipe network maintenance method and system based on a large language model and an electronic device, which aims to solve the problems of difficult data fusion, reliance on manual fault root cause analysis, and low automation level of operation and maintenance process in the prior art.
[0008] To achieve the above object, the technical scheme adopted by the present application is: In a first aspect, a gas pipeline network maintenance method based on a large language model is provided, comprising the following steps: S100, acquiring multi-source heterogeneous data corresponding to the gas pipeline network, and performing standardization processing on the multi-source heterogeneous data; wherein the multi-source heterogeneous data includes time series data, text data and image data, the time series data includes pressure, flow, temperature, gas concentration, vibration frequency and amplitude and sound signal data of the gas pipeline network, the text data includes maintenance records and geological reports of the gas pipeline network, and the image data includes pipeline images of the gas pipeline network shot by unmanned aerial vehicle inspection; S200, vectorizing and fusing the multi-source heterogeneous data after standardization processing to construct a unified multi-modal vector database; S300, when the gas pipeline network data anomaly is monitored, a query is initiated to the large language model fine-tuned by gas field professional knowledge instructions based on retrieval enhancement, intelligent reasoning of the fault root cause is performed on the monitored gas pipeline network data anomaly, and an analysis report is generated; S400, automatically generating a structured maintenance instruction based on the analysis report and interfacing with an operation and maintenance system to form a feedback loop.
[0009] Preferably, the step S100 comprises the following steps: S101, collecting the time series data in real time through an Internet of Things gateway, and performing data cleaning and time alignment on the time series data; wherein the data cleaning on the time series data includes filling in missing values in the time series data and standardization processing on the time series data; the time alignment on the time series data includes resampling the time series data based on a unified time grid; S102, acquiring the text data through an application programming interface or optical character recognition technology, and extracting predefined key entities from the text data using a named entity recognition model, wherein the predefined key entities include core entities, event entities, and space-time and attribute entities; S103, acquiring the image data, and identifying features in the pipeline image using a target detection model, wherein the features include pipeline corrosion, structural cracks and external environmental risks.
[0010] Preferably, in the step S101, the filling in of missing values in the time series data and the standardization processing on the time series data comprise the following steps: The time series data containing the temperature of the gas pipeline network is filled in based on linear interpolation; Fill in time series data containing gas network flow based on spline interpolation of previous and next data points or predicted values of ARIMA model; The time series data is normalized based on the minimum and maximum normalization method, and each dimension of data is linearly mapped to the interval [0, 1].
[0011] Preferably, the step S200 includes the following steps: S201. Based on multi-source heterogeneous data, a corresponding deep learning encoder is constructed; wherein, the deep learning encoder includes a time series encoder, a text encoder and an image encoder; the time series encoder is constructed based on a time series converter model of a self-attention mechanism, and is used to convert multivariate data slices within a fixed time window into vectors representing the dynamic mode of gas network operation; the text encoder is based on The architecture is fine-tuned with gas field corpus and is used to convert input text into a dense vector of fixed dimension; the image encoder is constructed based on the visual converter model and is used to convert the input pipe network image into a high-dimensional feature vector; S202, performing cross-modal semantic alignment training based on contrastive learning; that is, after constructing the deep learning encoder, let the three independent encoders of time series, text, and image learn to describe the same event in the same language; S203. Build and deploy a unified multimodal vector database; that is, all historical and real-time accessed, standardized multi-source heterogeneous data are forward-inferred through their corresponding trained deep learning encoders to generate corresponding semantic vectors, and the semantic vectors, together with their metadata, are uniformly stored in a multimodal vector database designed specifically for efficient similarity retrieval.
[0012] Preferably, in the contrastive learning, The loss function optimizes the training objective, The mathematical expression of the loss function is as follows: Mode middle: is the vector of anchor point samples; is the corresponding positive sample vector; It is A vector of negative samples; Represents the cosine similarity calculation between vectors, and its value range is is the temperature hyperparameter.
[0013] Preferably, the step S300 includes the following steps: S301. Based on the abnormal event, generate a query object containing metadata and abnormal data, including: Compare the abnormal data corresponding to the abnormal event description with the historical data of the same period to quantify the degree of abnormality and statistical significance; Structurally encapsulate abnormal events and generate a query object containing metadata and abnormal data; S302. Constructing a multimodal evidence chain based on hybrid query, semantic retrieval, and cross-attention re-ranking model, including: Performing keyword and metadata filtering in the multimodal vector database based on the metadata contained in the query object to obtain a filtered data subset; Obtaining a query vector corresponding to the query object, and performing semantic retrieval on the filtered data subset based on a cosine similarity method to obtain one or more candidate data; Calculating the relevance score between each candidate data and the query object based on the cross-attention re-ranking model, and selecting a preset number of candidate data in the order of the relevance scores to construct a multimodal evidence chain; S303: Constructing prompt words based on the description of the abnormal event and the multimodal evidence chain, and inputting the prompt words into a large language model fine-tuned with professional knowledge instructions in the gas field; S304: After performing logical association using the large language model fine-tuned by the professional knowledge instructions in the gas field, an analysis report including root cause inference and maintenance suggestions is generated.
[0014] Preferably, the step S400 includes the following steps: S401: Generate a standardized JSON work order from the analysis report based on a predefined structure, including: Build a predefined structure containing urgency, location, fault inference, and maintenance recommendations; Based on the predefined structure and the analysis report, a standardized JSON work order is generated using a large language model fine-tuned with gas field professional knowledge instructions, wherein the JSON work order includes structured maintenance instructions; S402: Push the JSON work order to the operation and maintenance system through an API interface, so that the operation and maintenance system automatically creates and dispatches maintenance tasks according to the structured maintenance instructions contained in the JSON work order; S403. Receive maintenance reports, form closed-loop feedback, and update the large language model based on supervised fine-tuning data; that is, re-collect the maintenance reports completed on site as new text data for iteratively updating the multimodal vector database and the large language model fine-tuned by professional knowledge instructions in the gas field, forming a data-driven closed-loop optimization; wherein, the large language model fine-tuned by professional knowledge instructions in the gas field is based on the abnormal description of the abnormal event, selects a preset number of candidate data in the order of the relevance score, the analysis report and the JSON work order for iterative update.
[0015] Secondly, a gas pipeline network maintenance system based on a large language model is also provided, including: A data fusion module is used to obtain multi-source heterogeneous data corresponding to the gas pipeline network, standardize the multi-source heterogeneous data, and vectorize and fuse the standardized multi-source heterogeneous data to build a unified multimodal vector database; The inference module is used to generate queries based on retrieval enhancement to a large language model fine-tuned with gas domain expertise when abnormal gas network data is detected. This module then intelligently infers the root cause of the abnormal gas network data and generates an analysis report. The workflow generation module is used to automatically generate structured maintenance instructions based on the analysis report and connect with the operation and maintenance system to form a feedback closed loop.
[0016] Furthermore, the multi-source heterogeneous data includes time series data, text data, and image data. The time series data includes pressure, flow, temperature, gas concentration, vibration frequency and amplitude, and sound signal data of the gas pipeline network. The text data includes maintenance records and geological reports of the gas pipeline network. The image data includes images of the gas pipeline network taken by drone inspections. Among them, when the data fusion module obtains multi-source heterogeneous data corresponding to the gas pipeline network and standardizes the multi-source heterogeneous data, it specifically collects time series data including pressure, flow, temperature, gas concentration, vibration frequency and amplitude and sound signals of the gas pipeline network in real time through the Internet of Things gateway, and performs data cleaning and time alignment on the time series data; and specifically obtains text data including maintenance records and geological reports of the gas pipeline network through an application program interface or optical character recognition technology, and uses a named entity recognition model to extract predefined key entities from the text data.
[0017] On the third aspect, an electronic device is also provided, comprising at least one processor and a memory communicatively connected to the at least one processor; characterized in that the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the gas pipeline maintenance method based on a large language model of the first aspect.
[0018] Compared with the prior art, the present invention has the following beneficial effects: (1) Achieved comprehensive and accurate situational awareness and completely broke the data silos: Due to technical limitations, traditional pipe network management systems have resulted in the separation of various data such as time series data such as pressure and flow, inspection records in text form, images and videos, and geological reports, forming "data silos". This invention fundamentally solves this problem by building a unified multimodal data fusion platform. First, it can standardize the access and processing of all relevant data sources such as time series, text, and images. Second, through innovative multimodal data vectorization technology, different types of data are mapped into the same high-dimensional vector space, so that semantically related data are spatially adjacent. This constructs a comprehensive and three-dimensional cognitive model of the gas pipeline network status, so that fault analysis is no longer limited to isolated sensor readings, but can be comprehensively judged by integrating historical maintenance background, on-site visual evidence and environmental factors, greatly improving the depth and accuracy of the overall situational awareness of the pipeline network.
[0019] (2) Achieved efficient and intelligent root cause analysis, significantly improving diagnostic efficiency and accuracy: When faced with data anomalies, existing technologies can usually only issue simple threshold alarms, and subsequent fault diagnosis is highly dependent on the personal experience of operation and maintenance experts, which is not only time-consuming and labor-intensive, but also cannot guarantee accuracy. The present invention adopts a large language model reasoning paradigm with retrieval enhancement generation as the core, shortening this process from several hours of manual investigation to automatic analysis in seconds; when an anomaly occurs, the system does not simply rely on the internal knowledge solidified by the large language model, but first retrieves the historical and real-time data most relevant to the current anomaly from the multimodal vector database in real time (such as historical maintenance records, recent inspection images, related time series data, etc.). Subsequently, these rich and well-documented multi-source information are used as context and handed over to the large language model that has been fine-tuned with professional knowledge in the gas field for logical reasoning, thereby generating root cause inferences that conform to professional logic and are supported by data, greatly shortening the fault diagnosis time and effectively avoiding the challenges brought about by the shortage of expert resources.
[0020] (3) A closed-loop automated operation and maintenance process has been achieved, significantly reducing operating costs and safety risks: Traditional operation and maintenance processes involve a large number of manual intervention links, a long response chain, and low processing efficiency. In emergency situations, it is easy to miss the best processing opportunity, which poses a serious safety hazard. The present invention has opened up a full-process automated closed loop from "data monitoring-intelligent analysis-work order generation-task dispatching-result feedback". After the intelligent analysis module generates a root cause report, the system uses the function call capability of the large language model to automatically convert the analysis results into a standardized JSON structured work order. The work order is then seamlessly connected to the company's existing work order system (FSM) through the API interface, realizing the automatic creation and intelligent dispatching of maintenance tasks.
[0021] More importantly, the maintenance reports generated by engineers after completing on-site tasks will be automatically collected by the system as a new data source, feeding back and optimizing the multimodal vector database and large language model, forming a data-driven, continuously iterative, and continuously optimized intelligent closed loop; this not only minimizes labor costs and the risks caused by delays or errors in manual operations, but also ensures that maintenance tasks can be accurately executed at the fastest speed, providing solid technical support for the safe and stable supply of urban gas.
[0022] (4) It ensures good interpretability and credibility, and effectively solves the "hallucination" problem of large language models: traditional artificial intelligence models are often like a "black box", and their decision-making process is not transparent, making it difficult to gain the trust of operation and maintenance personnel; one of the core advantages of the retrieval-augmented generation (RAG) architecture adopted by this invention is its high interpretability; since each analysis and judgment of the large language model is clearly based on the specific data fragments retrieved from the vector database, any conclusion it outputs has a basis to follow.
[0023] (5) The system can clearly show users which historical maintenance record, which drone inspection image, or which pressure time series data is used to draw the current fault inference. This mechanism of making the judgment basis transparent effectively avoids the "hallucination" problem of large language models fabricating answers out of thin air, significantly enhances the trust of operation and maintenance personnel in system decisions, and is the core guarantee for the successful implementation of intelligent technology in the field of critical infrastructure security. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 A schematic diagram of the workflow of a gas pipeline network maintenance method based on a large language model according to the present invention; Figure 2 Schematic diagram of the workflow for building a unified multimodal vector database; Figure 3 Schematic diagram of the workflow for generating analysis reports; Figure 4A workflow diagram for forming a closed feedback loop with the operation and maintenance system; Figure 5 This is a system block diagram of a gas pipe network maintenance system based on a large language model involved in the present invention; Figure 6 It is a structural schematic diagram of an electronic device involved in the present invention. DETAILED DESCRIPTION
[0025] The following will provide a clear and complete description of the technical solutions of the present invention in conjunction with the accompanying drawings and specific embodiments. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present invention.
[0026] Example 1: Reference Figure 1 The present invention provides a large language model-based gas pipeline network maintenance method, aiming to address the existing issues of data fusion difficulties, manual fault analysis, and low automation in operations and maintenance. Specifically, the implementation steps of the large language model-based gas pipeline network maintenance method are as follows: S100. Acquire multi-source heterogeneous data corresponding to the gas pipeline network and perform standardization processing on the multi-source heterogeneous data; wherein the multi-source heterogeneous data includes time series data such as pressure, flow, temperature, gas concentration, vibration frequency and amplitude, and sound signals of the gas pipeline network collected in real time through the Internet of Things gateway, and text data such as maintenance records and geological reports of the gas pipeline network obtained through application program interface (API) or optical character recognition (OCR) technology, as well as pipeline network image data taken by inspection equipment such as drones; after acquiring the multi-source heterogeneous data, perform standardization processing on the multi-source heterogeneous data, including cleaning and time alignment of the time series data, extracting key information such as equipment number and fault phenomenon from the text using a named entity recognition (NER) model, and identifying features such as pipeline corrosion and structural cracks in the image through a target detection model.
[0027] S200, vectorize and fuse the standardized multi-source heterogeneous data to build a unified multimodal vector database; this step specifically uses the contrastive learning method to build dedicated encoders for time series, text and image data, such as encoders based on time series converters, BERT architectures and visual converter models; then The dedicated encoder constructed is trained with equal loss functions, which brings different modal data (positive samples) describing the same event closer in the vector space, while pushing irrelevant samples (negative samples) away, thereby constructing a semantically unified multimodal vector database.
[0028] S300, when the gas pipeline network data anomaly is monitored, a query is initiated to a large language model (LLM) fine-tuned with gas field professional knowledge instructions based on retrieval augmented generation (RAG), intelligent reasoning of the fault root cause of the monitored gas pipeline network data situation anomaly is performed, and an analysis report is generated. Specifically, when the gas pipeline network data anomaly is monitored, the retrieval augmented generation (RAG) based fault root cause intelligent reasoning process is started, that is, first, the most relevant real-time and historical data to the current abnormal event is retrieved from the multi-modal vector database; then the retrieved associated information is input into the large language model (LLM) fine-tuned with the gas field professional knowledge instructions as context together with the description of the abnormal event; finally, logical association and reasoning are performed through the large language model, and an analysis report containing the root cause inference and maintenance suggestions is finally generated.
[0029] S400, structured maintenance instructions are automatically generated based on the analysis report, and are interfaced with the operation and maintenance system to form a feedback closed loop. Specifically, the function calling capability of the large language model is used to convert the natural language format analysis report into a JSON format standardized work order containing fields such as urgency, location, fault inference, etc.; then the JSON format standardized work order is automatically pushed to an external work order system or a field service management platform through an API interface, realizing automatic creation and distribution of maintenance tasks; finally, after the repair task is completed, the on-site feedback repair report is re-collected as new text data and used to iteratively update the multi-modal vector database and fine-tune the large language model, forming a data-driven, continuously optimized closed loop system.
[0030] Specifically, the first phase of the gas pipeline network maintenance method based on the large language model provided by the embodiment 1 of the present application is a process of building a comprehensive, standardized multi-source heterogeneous data fusion. The core task of this phase is to systematically acquire, deeply process and strictly standardize the gas pipeline network related data of various sources and formats through technical means, to lay a solid and high-quality data foundation for subsequent vector fusion, intelligent reasoning and automatic operation and maintenance. In the embodiment of the present application, this phase specifically covers the processing of time series data, text data and image data.
[0031] Among them, the processing of time series data includes: First, industrial-grade intelligent Internet of Things gateways are deployed at key nodes of the gas pipeline network, such as regional pressure regulating stations, building pressure regulating boxes, key valve wells, and pipe sections prone to geological subsidence. These gateways have edge computing capabilities and are built-in with multiple industrial communication protocol stacks, such as Modbus, OPC UA, etc., to be compatible with sensor devices of different manufacturers.
[0032] Then, high-frequency real-time collection of multi-dimensional physical quantities is performed through the sensors connected to these gateways, including but not limited to conventional pressure ,flow ,temperature , gas concentration , pipe network vibration frequency and amplitude and , and pipe network sound signals collected by acoustic sensors. These data are transmitted through lightweight To ensure data transmission security, Communication is adopted throughout encryption.
[0033] Next, the collected raw data stream is fed into a distributed time series database designed for high-throughput reading and writing, such as or The database performs persistent storage. After the data is written, a series of data cleaning and standardization processes are performed.
[0034] Then, statistical methods such as The algorithm uses the rule to eliminate isolated, obvious “wild points” caused by transient electrical faults in sensors or communication interference. For more complex anomalies, unsupervised anomaly detection is performed using machine learning algorithms such as isolation forests.
[0035] Next, for missing time series data due to network fluctuations and other factors, appropriate interpolation methods are used based on the data characteristics. For example, linear interpolation is used for gently fluctuating temperature data; for highly volatile flow data, spline interpolation based on previous and next data points or predicted values from the ARIMA model are used to ensure the integrity of the data series. To reduce the interference of inherent sensor noise, a sliding average filter or exponential smoothing method is applied to the data to better reveal its underlying trends.
[0036] Finally, due to the huge differences in the dimensions and numerical ranges of different physical quantities, for example, the unit of pressure is , the flow unit is In order to eliminate the dominant influence of large numerical features in subsequent model training, normalization processing is required. This embodiment preferentially adopts minimum and maximum normalization to linearly map the data of each dimension to The calculation formula for interval is: in, is the original data point, and are the maximum and minimum values of the data in a specific time window, Normalized data. In some scenarios, you can also use Standardize it so that it obeys the mean , the standard deviation is The standard normal distribution of .
[0037] Furthermore, because timestamp alignment is a fundamental prerequisite for multivariate time series analysis, this embodiment deploys a Network Time Protocol (NTP) client at the gateway layer to ensure high synchronization between all acquisition devices and the central server. To ensure a complete data snapshot containing all dimensional measurements at any given point in time, thus ensuring the subsequent construction of multivariate time series feature vectors, this embodiment resamples all sensor data (or time series data) using a unified time grid during the data processing process.
[0038] The processing of text data includes: For the extraction and structuring of text data, The adapter actively pulls structured historical maintenance work orders, equipment ledgers, inspection records, etc. in batches from the company's existing operation and maintenance management system.
[0039] For the large number of existing paper documents, such as early design drawings, geological subsidence monitoring reports, and safety assessment reports, they are digitized using scanning equipment equipped with a high-precision optical character recognition (OCR) engine. This OCR engine is optimized to recognize tables and specific layouts within documents, and has a higher accuracy rate for recognizing specialized gas terminology.
[0040] Advanced natural language processing (NLP) technology is applied to the acquired unstructured or semi-structured text for in-depth analysis. The core of this process is a named entity recognition (NER) model based on the BERT architecture, fine-tuned for the domain using an internal enterprise corpus. This NER model accurately and automatically identifies and extracts predefined key entities from massive amounts of text. These entities form a comprehensive knowledge graph of pipeline network events, including: core entities such as "equipment number," "equipment type" (e.g., valve, pressure regulator), and "pipe material" (e.g., PE pipe, steel pipe); event entities such as "fault phenomenon" (e.g., "pressure drop," "abnormal flow," "odor"), "repair measures" (e.g., "gasket replacement," "bolt tightening," "welding repair"), and "repair results" (e.g., "restored to normal"); and spatiotemporal and attribute entities such as "geographic coordinates," "administrative region," "occurrence time," "settlement value," and "corrosion level."
[0041] The processing of image data includes: On the recognition and feature extraction of image data, the image and video data collected by unmanned aerial vehicle or pipeline robot inspection provides the most intuitive visual evidence for the state of gas pipeline network. The system is connected to the data interface of the unmanned aerial vehicle ground station or the pipeline robot control system, and the high-definition image and video data generated by the inspection task are automatically obtained. These data usually contain rich EXIF meta information such as GPS geographic coordinates, shooting time, camera parameters, etc. These meta data are extracted and stored in the database together with the image content.
[0042] Before model analysis, the original image is preprocessed, including image enhancement, noise removal, and geometric correction for unmanned aerial vehicle aerial image, to eliminate lens distortion. Then, computer vision technology is applied, and a target detection model trained and optimized on a large number of gas pipeline facility defect samples is used for automatic analysis of the image. The target detection model can not only identify, but also accurately locate and label a variety of visual features related to safety hazards on the image, such as: pipeline body defect features including rust patches at pipeline welds, coating peeling, pipeline structure cracks, and pipe deformation; abnormal support structure cracks of auxiliary facilities, damage or displacement of valve covers, and missing or damage of warning stakes; third-party illegal construction signs directly above the pipeline, and signs of excavators and soil piles, ground subsidence or collapse, abnormal wilting of vegetation, and accumulation of flammable materials near the pipeline. Among them, the type, location coordinates and confidence score of each identified feature are recorded in a structured manner to form a vectorized preliminary description of the image content.
[0043] Through the above three dimensions of fine processing, a unified, standard and high-quality multi-modal data base is constructed, and the noise and gap of the original data are eliminated, which provides a unified multi-modal vector database for the next stage.
[0044] Specifically, the second stage of the gas pipeline maintenance method based on the large language model provided by the embodiment 1 of the present application is to vectorize and encode the multi-source heterogeneous data and deeply fuse them, and the final goal is to construct a unified multi-modal vector database with semantic consistency. The core task of this stage is to map different data types to a unified high-dimensional vector space, so that semantically related data are close to each other in space geometry. In the embodiment of the present application, the contrast learning (Contrastive Learning) method is used to achieve the goal of constructing a unified multi-modal vector database with semantic consistency.
[0045] Referring to Figure 2, which is a workflow diagram for constructing a multimodal vector database in Example 1 of the present invention. In this embodiment of the present invention, a contrastive learning method is used to achieve the technical path for constructing a unified and semantically consistent multimodal vector database. The specific steps are as follows: S201. Build corresponding deep learning encoders based on multi-source heterogeneous data. To accurately capture and characterize the deep semantic features of various data types, dedicated deep learning encoders are designed and built for different modalities of data. For example, a time series encoder is built for time series data; a text encoder is built for text data; and an image encoder is built for image data. These encoders are fine-tuned using domain-specific data to ensure their understanding of specialized gas pipeline network scenarios.
[0046] For time series data, such as multivariate time series data like gas pipeline pressure and flow collected from sensors, a Time Series Transformer (TST) model based on a self-attention mechanism is constructed. Whether it's short-term, sharp fluctuations or long-term, slow trends, the self-attention-based TST can effectively capture the complex dependencies between any two time points in the time series. The input to the time series encoder is a slice of multivariate data within a fixed time window, such as pressure and flow data sampled every minute over the past six hours. The TST model encodes this data slice and ultimately generates a vector that represents the dynamic pattern of pipeline network operation during that period.
[0047] For text data such as maintenance inspection records, technical reports, and operating procedures, a BERT-based architecture was used, which was deeply fine-tuned with professional gas-related corpora. BERT was chosen due to its powerful bidirectional contextual understanding capabilities. During the fine-tuning phase, a massive amount of gas-related corpora was used, including but not limited to national gas safety standards, historical accident analysis reports, and equipment maintenance manuals. Through self-supervised learning tasks such as "masked language models" and "next sentence prediction," the model fully grasped industry terminology, fault description methods, and causal relationship expressions. The text encoder can ultimately convert input text of any length, such as a maintenance record stating that "a leak occurred in the pipeline near valve well B-05 due to rough construction by a third party," into a dense vector of fixed dimension, which serves as the semantic representation of the input text.
[0048] Among them, for image data, such as image data taken by drones or robot inspections, a Vision Transformer (ViT) model is used to build it. Compared with traditional convolutional neural networks, ViT can better capture the global dependencies of images, which is crucial for identifying features that require a wide field of view, such as slight ground subsidence and abnormal growth of vegetation along pipelines. The present invention constructs a professional dataset containing hundreds of thousands of annotated images to fine-tune the ViT model. The dataset covers a variety of scenarios such as pipeline defects such as weld rust, coating peeling, structural cracks, abnormal valve manhole cover displacement of ancillary facilities, support frame deformation, and external environmental risks. After fine-tuning, the image encoder can efficiently convert the input pipeline image into a high-dimensional feature vector that condenses the key visual information in the image.
[0049] S202. Perform cross-modal semantic alignment training based on contrastive learning. After constructing the dedicated encoders, the three independent encoders for time series, text, and images are trained to describe the same event using the same language. Specifically, a contrastive learning training paradigm is used to bring positive samples closer and push negative samples further away. First, construct training sample tuples for contrastive learning; these training sample tuples include positive and negative sample tuples. Positive sample tuples are composed of data from different modalities (text, time series, and image) that describe the same objective event or state. For example, a tuple (i.e., a pair of associated data) for the event "pipeline rupture" consists of: <a time-series data vector of a sudden drop in pressure, a text vector of a maintenance record stating "XX valve ruptures, urgent repairs required," and an on-site image vector of a valve with visible cracks>. Another example: a tuple for the event "third-party construction risk" consists of: <a time-series vector of abnormal vibration sensor data installed near the pipeline, a text vector of an inspection record stating "a large excavator at a construction site operating within a pipeline protection zone," and an image vector of a drone-photographed excavator operating too close to the pipeline>. A negative sample tuple consists of all other samples within a given sample that do not belong to the same event tuple (i.e., a positive sample tuple). In actual training, this paper employs a "within-batch negative sample" strategy, whereby for a given anchor point, all other samples within the same training batch are considered negative. In addition, this invention introduces a "hard negative sample" mining strategy. This strategy specifically selects samples that are close to the anchor point (i.e., the positive sample tuple) in vector space but semantically completely different as hard negative samples. For example, time series data of "planned pressure reduction maintenance" is used as a hard negative sample for "sudden pressure leakage." This forces the model to learn more subtle semantic differences and improves its discriminative ability. Then, loss function and model optimization are performed, specifically using the InfoNCE loss function as the optimization target. The mathematical expression of the InfoNCE loss function is as follows: (1) In formula (1): is the vector of anchor point samples; is the corresponding positive sample vector; The first A vector of negative samples; Represents the cosine similarity calculation between vectors, and its value range is ; It is a temperature hyperparameter used to adjust the model's attention to difficult and easy samples. It will force the model to work harder to distinguish similar negative samples. The goal of the entire training process is to minimize this loss function. , so that the model is driven to maximize the numerator and minimize the second term in the denominator, thereby achieving the goal of "pulling positive samples closer and pushing negative samples further away" in the vector space.
[0050] S203. Build a unified multimodal vector database and deploy it. After large-scale contrastive learning training, the parameters of the three dedicated encoders for time series, text, and images are frozen, and they have the ability to map input data of different modalities to the same semantic space. At this point, the final construction stage will be entered, that is, all historical and real-time accessed, standardized multi-source heterogeneous data will be forward-reasoned through their corresponding trained encoders to generate corresponding semantic vectors. These generated semantic vectors (i.e., high-dimensional vectors) will be uniformly stored together with their metadata (for example: original data ID, timestamp, geographic location, data source, etc.) in a multimodal vector database designed specifically for efficient similarity retrieval. Through the indexing algorithm of this type of multimodal vector database, millisecond-level similarity retrieval can be achieved in a vector set of hundreds of millions. Similarity retrieval provides high-performance retrieval support for subsequent intelligent reasoning of fault root causes.
[0051] Specifically, the third stage of the large language model-based gas pipeline network maintenance method provided in Example 1 of the present invention involves initiating queries based on retrieval enhancement to the large language model, which has been fine-tuned with gas domain expertise, to conduct in-depth, intelligent root cause reasoning for detected pipeline network data anomalies. The core task of this stage is to generate an analysis report containing root cause inferences and maintenance recommendations. In this embodiment of the present invention, this stage specifically covers the entire process from triggering an anomaly event to generating a professional analysis report.
[0052] The following example assumes that the system monitors that the outlet pressure of the No. 5 pressure regulating station in area B of a gas pipeline network is lower than the normal threshold by 15% (abnormal event) for one hour starting at 3:15 pm. Figure 3The complete technical process from triggering an abnormal event to generating a professional analysis report is described in detail, aiming to demonstrate the significant advantages of this invention in terms of reasoning efficiency, accuracy, and interpretability. The specific steps from triggering an abnormal event to generating a professional analysis report are as follows: S301. Generate a query object containing metadata and abnormal data based on the abnormal event. In this embodiment, the abnormal event can be an event when the monitored factors such as pressure, flow, temperature, gas concentration, pipeline vibration frequency and amplitude in the gas pipeline network exceed the predetermined range. For example, when the monitoring captures the outlet pressure data of the No. 5 pressure regulating station in area B of a gas pipeline network deviating from the normal range, the system will first start a dynamic analysis program to compare the abnormal data corresponding to the abnormal event with the historical data for the same period (such as data from the same time period on the same day in the past few weeks, and normal values predicted based on the time series model) to quantify its degree of abnormality and statistical significance. This effectively avoids false alarms caused by seasonal or normal daytime fluctuations. Subsequently, the system automatically encapsulates this abnormal event in a structured manner and generates a query object containing metadata and abnormal data. This query object not only contains the core anomaly description, but also automatically aggregates relevant contextual information, such as: asset information: equipment ID (e.g., B-DRS-05), equipment type (pressure regulating station), geographic coordinates (latitude and longitude), pipe diameter, material, commissioning year, etc.; real-time operating conditions: upstream pressure, downstream flow, valve opening, gas temperature, etc. when the anomaly occurs; anomaly characteristics: anomaly start time, duration, deviation amplitude, change rate (slow drop or sudden drop), etc. Finally, this structured query object is fed into the inference module and encoded as a query vector. .
[0053] S302. Construct a multimodal evidence chain based on hybrid query, semantic retrieval and cross-attention re-ranking model. In order to ensure the accuracy and comprehensiveness of the retrieval, the present invention adopts a hybrid retrieval strategy rather than a single vector similarity retrieval. First, perform metadata hard filtering to obtain a filtered data subset: that is, use the structured metadata in the query object to perform a round of fast keyword and metadata filtering in the multimodal vector database. For example, it will filter out all historical data that is directly related to "Device ID: B-DRS-05" or whose geographical location is within 500 meters around "B-DRS-05". This step greatly narrows the search space and improves the efficiency and relevance of subsequent vector retrieval. Then, perform vector semantic retrieval: that is, use the query vector on the filtered data subset. Perform high-speed semantic retrieval based on cosine similarity to obtain one or more candidate data. That is, the vector semantic retrieval aims to find historical events that are "semantically" similar to the current anomaly, even if their expression methods or data modalities are completely different. For example, the current "pressure drop" event may match a historical "flow anomaly" or a maintenance report describing a "pressure regulator failure." In order to ensure retrieval efficiency, the underlying vector database can use a mature approximate nearest neighbor search library such as FAISS. At this stage, the system will recall the most similar event. candidate data, for example, K=100. Then, cross attention reordering is performed to construct a multimodal evidence chain: that is, in order to The system uses a lightweight cross-attention re-ranking model to select the information that is most closely related to the current anomaly from the candidates. The cross-attention re-ranking model calculates the precise relevance score between the query object and each candidate data one by one, and it can understand the subtle relationship between the two at a deeper level. Unlike the retrieval that only calculates the overall similarity of two vectors, the cross-attention mechanism can capture the correspondence between specific words or features, thereby achieving more accurate sorting. After re-sorting (such as sorting by relevance score from high to low), the system selects the final The most relevant multimodal information fragments are used as the "evidence chain" for reasoning. For example, this search may eventually obtain the following highly relevant evidence: Text message (Evidence 1): A two-week inspection log: "There is frequent traffic of large construction vehicles near the No. 5 pressure regulating station in Area B, and the road surface is showing signs of subsidence." Image Information (Evidence 2): An image taken three days prior during a drone inspection. The description generated by the object detection model reads: "The external protective fence of the pressure regulating station is clearly deformed due to an impact. Coordinates: [XX, YY]." Time series information (Evidence 3): A piece of data from a vibration sensor installed in a voltage regulating station. The feature extraction module describes it as follows: "Two days ago in the afternoon, a severe shock vibration lasting three seconds was detected, with the peak value exceeding the warning threshold." Historical Maintenance (Exhibit 4): A maintenance work order from one year ago states: "This pressure regulating station experienced unstable outlet pressure due to a clogged filter screen, which has been cleaned." S303, based on the description of the abnormal event and the multimodal evidence chain, construct prompt words, and input the prompt words into the large language model fine-tuned by the professional knowledge instructions in the gas field. Multimodal evidence chains are integrated to construct a highly structured, information-rich contextual prompt. To guide large language models to perform rigorous logical reasoning rather than simply listing information, this paper uses Chain-of-Thought (CoT) prompt engineering technology. The structure of the prompt is carefully designed as follows: [System Commands] [Background]: You are a senior gas pipeline network safety diagnostic expert with 20 years of experience. Your analysis must be based on the evidence provided, using step-by-step reasoning and prioritizing public safety. Unfounded speculation is prohibited.
[0054] [Task]: Based on the following information, please fully analyze the root cause of the failure and provide maintenance recommendations with specific steps. Please clearly cite the source of evidence in your report.
[0055] [Current Anomaly] - Equipment: B Area No. 5 Pressure Regulating Station (ID: B-DRS-05) - Phenomenon: The outlet pressure has been below the normal threshold by 15% for 1 hour since [time].
[0056] - Characteristics: The pressure decreases slowly and continuously.
[0057] [Retrieved related evidence] - [Evidence 1-Text]: Inspection records from two weeks ago showed heavy vehicle traffic and road subsidence nearby.
[0058] - [Evidence 2-Image]: Images taken three days ago show that the guardrail has signs of deformation from impact.
[0059] - [Evidence 3 - Timeline]: The vibration sensor recorded a severe impact two days ago.
[0060] - [Evidence 4-History]: A year ago, the filter was clogged, causing unstable pressure.
[0061] [Output requirements] 1. Reasoning process (chain of thought): First, list all possible fault hypotheses. Next, evaluate each hypothesis against the provided evidence. Finally, identify the most likely root cause.
[0062] 2. **Final Conclusion**: Clearly state the root cause inference and provide a confidence score.
[0063] 3. **Action Recommendations**: Provides detailed, actionable maintenance steps and safety precautions.
[0064] S304: After logically associating the large language model, fine-tuned with gas domain expertise, an analysis report is generated containing root cause inferences and maintenance recommendations. Upon receiving the above prompts, the large language model, fine-tuned with gas domain expertise and instructions, begins working. It follows the instructions of the thought chain and generates a logically rigorous analysis report. For example: "Fault Root Cause Analysis Report: Abnormal Pressure at Pressure Regulating Station No. 5 in Area B" 1. Reasoning Process: " - Hypothesis A: The filter is clogged. This hypothesis is consistent with [Evidence 4] and is a common malfunction of this equipment. However, it cannot explain the strong external influence signals in [Evidence 1], [Evidence 2], and [Evidence 3]. Therefore, the probability is low." "- Hypothesis B: External impact caused damage to internal components. This hypothesis perfectly connects all the evidence. The heavy vehicle traffic in [Evidence 1] provided the source of the impact; the violent vibration in [Evidence 3] recorded the occurrence of the impact; and the deformation of the guardrail in [Evidence 2] was direct physical evidence of the impact. This impact is very likely to cause displacement or damage to key internal components (such as the pressure regulating valve diaphragm or pilot), causing the current continuous pressure drop. This hypothesis is a high-probability event." 2. Final Conclusion: "- Root cause inference: Comprehensive analysis shows that the root cause is most likely damage to the internal components of the voltage regulator caused by rough external construction or vehicle collision; confidence level: 95%." 3. Recommended Actions: "- Urgency: High. Dispatch immediately. - **Steps**: 1. Immediately dispatch a maintenance team to Pressure Regulating Station No. 5 in Area B. 2. First confirm on-site for any gas leaks. 3. Inspect the protective fence and equipment exterior for signs of impact. 4. Suspend service at the pressure regulating station and activate a backup line (if available). 5. Open the pressure regulator and carefully inspect the integrity of internal components such as valves, diaphragms, and springs. 6. Replace or repair any damage as appropriate." " - Materials Required: Spare regulator assembly, portable gas detector." This report not only provides a conclusion, but more importantly, it demonstrates a complete logical deduction process and clearly links each judgment with specific evidence, effectively solving the "black box" problem of AI decision-making and significantly enhancing the credibility of operation and maintenance personnel in the system's conclusions.
[0065] Specifically, the fourth stage of the gas pipeline maintenance method based on the large language model in Example 1 of the present invention is a process of automatically generating structured maintenance instructions based on the analysis report, and connecting with the operation and maintenance system to form a feedback loop, that is, converting the intelligent analysis results into executable action instructions, and deeply integrating with the operation and maintenance system to form a data-driven, continuously optimized automated operation and maintenance feedback loop. Although in the third stage, the large language model has generated a professional, natural language format fault root cause analysis report based on rich multimodal context. However, this report is unstructured for the back-end operation and maintenance system that needs to execute tasks accurately. Therefore, in order to break through the barriers between "analysis" and "execution", the core of this stage is to use the advanced capabilities of the large language model to accurately convert this report into structured instructions that can be executed by the operation and maintenance system.
[0066] The following is an example of an analysis report generated after an abnormal event occurs at the outlet pressure of the No. 5 pressure regulating station in area B of a gas pipeline network at a specific time point. Figure 4 , detailing the entire process of this stage from generating analysis reports to implementing automated workflows: S401. Generate a standardized JSON work order from the analysis report based on a predefined structure; First, define a standardized JSON work order schema. This means pre-defining a detailed, standardized JSON object template that includes predefined structures such as urgency, location, fault inference, and maintenance recommendations. It also clarifies the format, type, and constraints of the required information. An example of a refined JSON schema is as follows: JSON { "workOrderID": "string (UUID)", "creationTimestamp": "string (ISO 8601)", "urgencyLevel": "enum ('Critical', 'High', 'Medium', 'Low')", "location": { "area": "string", "stationID": "string", "coordinates": { "latitude": "number", "longitude": "number" } }, "faultSummary": { "phenomenon": "string", "inferredRootCause": "string", "supportingEvidence": [ { "type": "enum ('Text', 'Image', 'Time-Series')", "description": "string", "referenceID": "string" } ] }, "maintenancePlan": { "suggestedActions": [ { "step": "integer", "description": "string", "priority": "integer" } ], "requiredMaterials": [ { "itemName": "string", "itemCode": "string", "quantity": "integer", "unit": "string" } ], "requiredTools": ["string"], "estimatedDurationHours": "number" }, "safetyPrecautions": ["string"] } Then, a second call and formatting is performed, that is, the system initiates a second call with a clear target to the large language model. The input of this call includes: Complete analysis report: The full natural language report generated in the third stage.
[0067] Function signature: The predefined JSON schema above serves as the signature of the “function” that the large language model needs to call.
[0068] Instruction prompt: A carefully designed prompt, for example: "You are a professional gas operation and maintenance dispatcher. Please strictly follow the fault analysis report provided below, call the create_work_order function, and fill in all parameter fields completely and accurately to generate a standardized JSON format maintenance work order. Ensure that all information extracted is based on the original report." Finally, the output is verified and corrected. After receiving the second call instruction, the large language model no longer performs open generation. Instead, it performs the extraction and conversion tasks from text to structured data, ultimately outputting a JSON object that strictly conforms to the predefined schema. To ensure absolute reliability, the system performs an automatic verification after receiving the JSON work order output by the large language model. The verification program checks whether the JSON format is correct, whether all required fields are filled, and whether the data types match. If the verification fails, the system can trigger an automatic correction loop, sending the error message along with the original request to the large language model again, and instructing it to correct the error and re-output.
[0069] S402: Push the JSON work order to the operation and maintenance system through the API interface; AP1 Push: After receiving a standardized JSON work order, the system seamlessly pushes it to the company's existing operations and maintenance system, automating the task flow. The system pushes the generated JSON work order to the company's existing work order system or field service management platform via a secure RESTful API interface using HTTP POST requests. This API call is authenticated and authorized using methods such as OAuth 2.0 or API keys to ensure secure data exchange.
[0070] Intelligent task creation and dispatching: When the field service management platform receives an API request, its built-in parser automatically reads the JSON data. Since the JSON data contains structured maintenance instructions, the operation and maintenance system creates a new maintenance task. The operation and maintenance system also implements intelligent dispatching based on structured information. Its internal scheduling engine takes into account the following factors: Geographic location, based on the location.coordinates field, matches the nearest operation and maintenance team; Skills and qualifications: Based on the information in the faultSummary and maintenancePlan, engineers with the necessary qualifications to repair a specific type of pressure regulating station or handle a specific fault type are matched; Materials and tools: Check the requiredMaterials and requiredTools fields and connect with the inventory system to ensure that the assigned team can bring the correct materials and tools, and even automatically generate picking lists; Real-time status, combined with the engineer's real-time schedule, current workload, and GPS location, selects the best execution candidate for the fastest response.
[0071] This approach achieves end-to-end automation, from intelligent fault analysis to the issuance of specific action instructions, significantly reducing response time. The core advantage of this invention lies in its ability to continuously learn and evolve through practice, forming a virtuous cycle of intelligent closed loops.
[0072] S403: Receive maintenance reports, form a closed-loop feedback loop, and update the large language model based on supervised fine-tuning data; On-site data transmission: After completing a repair task on-site, the engineer submits a detailed repair report via the FSM app on their mobile device. This report typically includes the confirmed cause of the failure, specific repair measures taken, information on replaced parts, and on-site photos.
[0073] Incremental optimization of the knowledge base and model: This new maintenance report is automatically collected and returned as new text data. In this embodiment, after key information is extracted by the NER model and vectorized by the text encoder, it is stored in the multimodal vector database. The next time a similar fault occurs, the system can perform enhanced search to find this successful, verified maintenance case, enabling more accurate judgment.
[0074] This complete incident constitutes a high-quality supervised fine-tuning data pair. The structure of this data pair is: { "input": "[Original anomaly description + Retrieved multimodal information]", "output": "[Final analysis report and repair work order verified by field engineers]"}. Once a sufficient number of these high-quality data pairs have been accumulated, they can be used regularly to incrementally fine-tune the large language model. This fine-tuning process utilizes efficient parameter adjustment techniques, updating only a small portion of the model's parameters. This incorporates new domain knowledge and reasoning logic while avoiding the significant overhead of training from scratch. Through this closed-loop "analysis-execution-feedback-learning," the system described in this invention can continuously draw insights from real-world O&M practices. Its diagnostic accuracy and the professionalism of its generated recommendations will improve over time, ultimately achieving a highly intelligent system that grows alongside gas pipeline network O&M operations.
[0075] Example 2: Please refer to Figure 5 The embodiment of the present invention provides a gas pipe network maintenance system 600 based on a large language model, including: The data fusion module 601 is used to obtain multi-source heterogeneous data corresponding to the gas pipeline network, standardize the multi-source heterogeneous data, and vectorize and fuse the standardized multi-source heterogeneous data to build a unified multimodal vector database; The reasoning module 602 is used to initiate a query to a large language model fine-tuned with gas field expertise based on search enhancement generation when abnormal pipe network data is detected, perform intelligent reasoning on the root cause of the abnormal pipe network data, and generate an analysis report; The workflow generation module 603 is used to automatically generate structured maintenance instructions based on the analysis report and connect with the operation and maintenance system to form a feedback closed loop.
[0076] Specifically, in Example 2 of the present invention, data fusion module 601 is used to perform the functions of S100 and S200 in the aforementioned example, inference module 602 is used to perform the function of S300 in the aforementioned example, and workflow generation module 603 is used to perform the function of S400 in the aforementioned example. The specific functions of the large language model-based gas pipeline network maintenance system 600 of this embodiment can be found in the details of the aforementioned embodiments, and will not be further described here.
[0077] Example 3: Please refer to Figure 6 , an electronic device is provided according to an embodiment of the present invention. Specifically, the electronic device 700 includes a processor 701, a memory 702, a communication interface 703, and a bus 704. The processor 701, the memory 702, and the communication interface 703 may be connected to each other via the bus 704, or may be connected using other connection methods besides the bus 704.
[0078] Specifically, in Embodiment 3 of the present invention, the processor 701 may be a general-purpose processor, which may be a processor that performs specific steps and / or operations by reading and executing the contents stored in a memory (e.g., memory 702). For example, the general-purpose processor may be a central processing unit (CPU). The processor 701 may include at least one circuit to execute Figures 1 to 4 All or part of the steps of the method shown.
[0079] Specifically, in embodiment 3 of the present invention, the memory 702 can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), flash memory, optical storage, hard disk, etc.
[0080] The memory 702 can be used to store a number of program codes. When the processor 701 executes the program code, the above Figures 1 to 4 The corresponding process steps.
[0081] Specifically, in Embodiment 3 of the present invention, the communication interface 703 includes input / output (I / O) interfaces, physical interfaces, and logical interfaces, which are used to interconnect components within the electronic device 700, as well as interfaces for interconnecting the electronic device 700 with other devices (e.g., other computing devices or user equipment). The physical interface may be an Ethernet interface, a fiber optic interface, an ATM interface, or the like.
[0082] Specifically, in Embodiment 3 of the present invention, the bus 704 may be any type of communication bus for interconnecting the processor 701 , the memory 702 , and the communication interface 703 , such as a system bus.
[0083] The electronic devices 700 can be implemented on separate chips, or at least partially or entirely on the same chip. Whether to implement each component on separate chips or integrate them into one or more chips often depends on product design requirements. The present invention does not limit the specific implementation of the electronic components.
[0084] It needs to be explained that,Figure 6 The electronic device 700 shown is merely exemplary. During implementation, the electronic device 700 may further include other components, which are not listed here one by one.
[0085] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).
[0086] It should be understood that the various numbers used in the embodiments of the present invention are merely for ease of description and are not intended to limit the scope of the embodiments of the present invention. It should be understood that in the embodiments of the present invention, the order of the sequence numbers of the above-mentioned processes does not necessarily indicate the order in which they are executed. The order in which the processes are executed is determined by their functions and inherent logic and does not constitute any limitation on the implementation of the embodiments of the present invention.
[0087] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A gas pipeline network maintenance method based on a large language model, characterized in that: The following steps are involved: S100. Acquire multi-source heterogeneous data corresponding to a gas pipeline network and perform standardization processing on the multi-source heterogeneous data; wherein the multi-source heterogeneous data includes time series data, text data, and image data; the time series data includes pressure, flow, temperature, gas concentration, vibration frequency and amplitude, and sound signal data of the gas pipeline network; the text data includes maintenance records and geological reports of the gas pipeline network; and the image data includes images of the gas pipeline network taken by drone inspections; S200, vectorize and fuse the standardized multi-source heterogeneous data to build a unified multimodal vector database; S300: When abnormal gas network data is detected, a query is initiated to a large language model fine-tuned with gas field expertise based on retrieval enhancement generation, and intelligent reasoning is performed on the root cause of the abnormal gas network data to generate an analysis report. S400: Automatically generate structured maintenance instructions based on the analysis report, and connect with the operation and maintenance system to form a feedback closed loop.
2. The gas pipeline network maintenance method based on a large language model according to claim 1 is characterized in that: Step S100 includes the following steps: S101. Collect the time series data in real time through an IoT gateway, and perform data cleaning and time alignment on the time series data; wherein the data cleaning of the time series data includes filling missing values in the time series data and standardizing the time series data; and the time alignment of the time series data includes resampling the time series data based on a unified time grid. S102, acquiring the text data through an application program interface or optical character recognition technology, and extracting predefined key entities from the text data using a named entity recognition model, wherein the predefined key entities include core entities, event entities, and time, space, and attribute entities; S103: Acquire the image data, and use a target detection model to identify features in the pipe network image, wherein the features include pipe network corrosion, structural cracks, and external environmental risks.
3. The gas pipeline network maintenance method based on a large language model according to claim 2, characterized in that: In step S101, the missing values in the time series data are filled and the time series data is normalized, including the following steps: Fill the time series data containing gas network temperature based on linear interpolation; Fill in time series data containing gas network flow based on spline interpolation of previous and next data points or predicted values of ARIMA model; The time series data is normalized based on the minimum and maximum normalization method, and each dimension of data is linearly mapped to the interval [0, 1].
4. The gas pipeline network maintenance method based on a large language model according to claim 1 is characterized in that: The step S200 includes the following steps: S201. Based on multi-source heterogeneous data, a corresponding deep learning encoder is constructed; wherein, the deep learning encoder includes a time series encoder, a text encoder and an image encoder; the time series encoder is constructed based on a time series converter model of a self-attention mechanism, and is used to convert multivariate data slices within a fixed time window into vectors representing the dynamic mode of gas network operation; the text encoder is based on The architecture is fine-tuned with gas field corpus and is used to convert input text into a dense vector of fixed dimension; the image encoder is constructed based on the visual converter model and is used to convert the input pipe network image into a high-dimensional feature vector; S202, performing cross-modal semantic alignment training based on contrastive learning; that is, after constructing the deep learning encoder, let the three independent encoders of time series, text, and image learn to describe the same event in the same language; S203. Build and deploy a unified multimodal vector database; that is, all historical and real-time accessed, standardized multi-source heterogeneous data are forward-inferred through their corresponding trained deep learning encoders to generate corresponding semantic vectors, and the semantic vectors, together with their metadata, are uniformly stored in a multimodal vector database designed specifically for efficient similarity retrieval.
5. The gas pipeline network maintenance method based on a large language model according to claim 4 is characterized in that: In the contrastive learning, we use The loss function optimizes the training objective, The mathematical expression of the loss function is as follows: Mode middle: is the vector of anchor point samples; is the corresponding positive sample vector; It is A vector of negative samples; Represents the cosine similarity calculation between vectors, and its value range is is the temperature hyperparameter.
6. The gas pipeline network maintenance method based on a large language model according to claim 1 is characterized in that: The step S300 includes the following steps: S301. Based on the abnormal event, generate a query object containing metadata and abnormal data, including: Compare the abnormal data corresponding to the abnormal event description with the historical data of the same period to quantify the degree of abnormality and statistical significance; Structurally encapsulate abnormal events and generate a query object containing metadata and abnormal data; S302. Constructing a multimodal evidence chain based on hybrid query, semantic retrieval, and cross-attention re-ranking model, including: Performing keyword and metadata filtering in the multimodal vector database based on the metadata contained in the query object to obtain a filtered data subset; Obtaining a query vector corresponding to the query object, and performing semantic retrieval on the filtered data subset based on a cosine similarity method to obtain one or more candidate data; Calculating the relevance score between each candidate data and the query object based on the cross-attention re-ranking model, and selecting a preset number of candidate data in the order of the relevance scores to construct a multimodal evidence chain; S303: Constructing prompt words based on the description of the abnormal event and the multimodal evidence chain, and inputting the prompt words into a large language model fine-tuned with professional knowledge instructions in the gas field; S304: After performing logical association using the large language model fine-tuned by the professional knowledge instructions in the gas field, an analysis report including root cause inference and maintenance suggestions is generated.
7. The gas pipeline network maintenance method based on a large language model according to claim 6 is characterized in that: The S400 includes the following steps: S401: Generate a standardized JSON work order from the analysis report based on a predefined structure, including: Build a predefined structure containing urgency, location, fault inference, and maintenance recommendations; Based on the predefined structure and the analysis report, a standardized JSON work order is generated using a large language model fine-tuned with gas field professional knowledge instructions, wherein the JSON work order includes structured maintenance instructions; S402: Push the JSON work order to the operation and maintenance system through an API interface, so that the operation and maintenance system automatically creates and dispatches maintenance tasks according to the structured maintenance instructions contained in the JSON work order; S403. Receive maintenance reports, form closed-loop feedback, and update the large language model based on supervised fine-tuning data; that is, re-collect the maintenance reports completed on site as new text data for iteratively updating the multimodal vector database and the large language model fine-tuned by professional knowledge instructions in the gas field, forming a data-driven closed-loop optimization; wherein, the large language model fine-tuned by professional knowledge instructions in the gas field is based on the abnormal description of the abnormal event, selects a preset number of candidate data in the order of the relevance score, the analysis report and the JSON work order for iterative update.
8. A gas pipeline network maintenance system based on a large language model, characterized in that: include: A data fusion module (601) is used to obtain multi-source heterogeneous data corresponding to the gas pipeline network, perform standardization processing on the multi-source heterogeneous data, and perform vectorization encoding and fusion on the standardized multi-source heterogeneous data to construct a unified multi-modal vector database; The reasoning module (602) is used to initiate a query to a large language model fine-tuned with professional knowledge instructions in the field of gas based on retrieval enhancement generation when abnormal gas pipeline network data is monitored, perform intelligent reasoning on the root cause of the abnormality of the monitored gas pipeline network data, and generate an analysis report; The workflow generation module (603) is used to automatically generate structured maintenance instructions based on the analysis report and connect with the operation and maintenance system to form a feedback closed loop.
9. The gas pipe network maintenance system based on a large language model according to claim 8, characterized in that: The multi-source heterogeneous data includes time series data, text data, and image data. The time series data includes the pressure, flow, temperature, gas concentration, vibration frequency and amplitude, and sound signal data of the gas pipeline network. The text data includes maintenance records and geological reports of the gas pipeline network. The image data includes images of the gas pipeline network taken by drone inspections. The data fusion module (601) acquires multi-source heterogeneous data corresponding to the gas pipeline network and performs standardization processing on the multi-source heterogeneous data. Specifically, the module collects time series data including pressure, flow, temperature, gas concentration, vibration frequency and amplitude, and sound signals of the gas pipeline network in real time through the Internet of Things gateway, and performs data cleaning and time alignment on the time series data. Specifically, the module acquires text data including maintenance records and geological reports of the gas pipeline network through an application program interface or optical character recognition technology, and extracts predefined key entities from the text data using a named entity recognition model.
10. An electronic device comprising at least one processor (701) and a memory (702) communicatively connected to the at least one processor (701); characterized in that: The memory (702) stores instructions that can be executed by the at least one processor (701), and the instructions are executed by the at least one processor (701) so that the at least one processor (701) can execute the gas pipeline network maintenance method based on a large language model as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Gas pipeline monitoring system and method based on artificial intelligence mixed large model
CN117523177A
Metro equipment fault intelligent diagnosis method and system assisted by large language model
CN120337106A
Method for generating and constructing database test knowledge base based on open source large language model and retrieval enhancement
CN120338073A
Test analysis and report generation method and system based on large model retrieval enhancement
CN120579528A
Combined cycle power generation optimization system
WO2015035134A1
Cited By
Large model agent application system and method fusing heat supply industry data and knowledge
CN121030013A
Label information management and abnormity identification method and system
CN121053643A
Inspection work order intelligent quality inspection method and system based on semantic features
CN121543596A
Self-adaptive network security situation awareness method and device combined with online learning
CN121690666A
Analog machine maintenance quality evaluation method and system, electronic equipment and storage medium
CN122089163A
