Intelligent generation method of power grid maintenance work ticket and electronic device

By combining inverted file indexing and product quantization techniques with flat inner product indexing, and utilizing a large language model, intelligent generation of power grid maintenance work orders is achieved. This solves the problems of inaccurate and inefficient work order generation in existing technologies, and realizes efficient and accurate work order generation.

CN121366058BActive Publication Date: 2026-04-10STATE GRID SHANXI ELECTRIC POWER COMPANY TAIYUAN POWER SUPPLY COMPANY
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID SHANXI ELECTRIC POWER COMPANY TAIYUAN POWER SUPPLY COMPANY
Filing Date
2025-12-19
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies struggle to efficiently generate reliable power grid maintenance work tickets, especially in manual ticketing, historical ticket reuse, and expert system-automated ticketing modes, where accuracy and coverage are incomplete.

Method used

Approximate nearest neighbor retrieval is performed using inverted file indexing and product quantization techniques, while precise nearest neighbor retrieval is performed using flat inner product indexing. A large language model is used for task decomposition, step framework construction, and equipment association analysis to generate work tickets that comply with power safety regulations.

Benefits of technology

It achieves millisecond-level efficient retrieval in large-scale data scenarios and comprehensive and accurate retrieval in small-scale data scenarios, generating standardized work tickets with strict format specifications and accurate descriptions of equipment relationships, thereby improving the accuracy and efficiency of work ticket generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121366058B_ABST
    Figure CN121366058B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of power grid maintenance, and provides an intelligent generation method and electronic equipment for a power grid maintenance work ticket, comprising: in the case that the data amount of a business logic vector library is greater than a preset threshold, performing approximate nearest neighbor retrieval in the business logic vector library based on an inverted file index and a product quantization manner and a query vector to obtain a plurality of logic chain segments related to a current power grid maintenance task; in the case that the data amount is less than or equal to the preset threshold, performing accurate nearest neighbor retrieval based on a flat inner product index manner to obtain the plurality of logic chain segments; inputting the plurality of logic chain segments into a business logic reasoning model to perform task decomposition, step framework building and equipment correlation analysis, and obtaining a business logic thinking chain including equipment, equipment correlation constraints and operation rules, and combining original information to input work content generation model to obtain a work ticket. The present application solves the problem that related technologies cannot efficiently generate reliable work tickets.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of power grid maintenance, in particular to an intelligent generation method of a power grid maintenance work ticket and an electronic device. BACKGROUND

[0002] In the power industry, especially in the field of power grid maintenance, the work ticket for the maintenance management of various types of equipment in the power grid is a legal document and operation permission certificate for guaranteeing personal safety, equipment safety and stable operation of the power grid.

[0003] The mode of generating the work ticket in the related art is as follows: 1. manual ticket generation mode: the operator manually searches and inputs the name, number, installation position and other information of the equipment, and the quality of the work ticket highly depends on the technical experience accumulation of the operator, and in the case of heavy ticket task, the accuracy is obviously reduced. 2. historical ticket reuse mode: the existing ticket template or the work ticket that has been completed is called to directly apply the existing ticket for the routine maintenance task with high repeatability; however, if the maintenance task is significantly different from the existing ticket, the existing ticket needs to be recompiled. A large amount of manpower is required to systemically compile and edit the typical work ticket library, and when the actual task is significantly different from the template, the manual experience needs to be relied on for adjustment, and the modification error or omission is prone to occur. 3. expert system automatic ticket generation mode: a universal rule library is constructed for a specific wiring mode, an expert system is developed, and the automatic generation of the work ticket is realized, but the problem of insufficient reliability of the generated work ticket due to incomplete rules exists.

[0004] In view of the problem that the related art is difficult to efficiently generate a reliable work ticket, no effective solution has been proposed. SUMMARY

[0005] The intelligent generation method of the power grid maintenance work ticket and the electronic device provided by the application at least solve the problem that the related art is difficult to efficiently generate a reliable work ticket.

[0006] This invention provides an intelligent generation method for power grid maintenance work orders, comprising: when the data volume of the business logic vector library exceeds a preset threshold, performing an approximate nearest neighbor search in the business logic vector library based on an inverted file index, product quantization, and a query vector to obtain multiple logical chain fragments related to the current power grid maintenance task; when the data volume of the business logic vector library is less than or equal to the preset threshold, performing an exact nearest neighbor search in the business logic vector library based on a flat inner product index and a query vector to obtain multiple logical chain fragments; inputting the multiple logical chain fragments into a business logic reasoning model, sequentially performing task decomposition, step framework construction, and equipment association analysis to obtain a business logic thinking chain including equipment, equipment association constraints, and operation rules; wherein the business logic reasoning model is trained based on a large language model and historical business logic documents; and inputting the business logic thinking chain and the original information into a work content generation model to obtain a work order, wherein the work content generation model is trained based on a large language model and historical information of power grid maintenance.

[0007] Preferably, the business logic thinking chain and original information are input into the work content generation model to obtain a work order, including: embedding the business logic thinking chain into a prompt word template to obtain dynamic prompt words corresponding to the current power grid maintenance task, wherein the prompt word template reserves corresponding placeholders for the business logic thinking chain, and the relationship constructed in the prompt word template includes the subordinate relationship between primary and secondary equipment in power maintenance; and inputting the dynamic prompt words and original information into the work content generation model to obtain a work order.

[0008] Furthermore, before embedding the business logic thought chain into the prompt word template to obtain the dynamic prompt words corresponding to the current power grid maintenance task, the above method also includes: setting multiple prompt word samples with different semantic densities and / or syntactic structures; inputting the multiple prompt word samples and test information into the work content generation model to obtain the test work tickets corresponding to each of the multiple prompt word samples; and determining the prompt word template based on the prompt word structure corresponding to the test work ticket with the highest accuracy.

[0009] Preferably, when the data volume of the business logic vector library exceeds a preset threshold, based on the inverted file index and product quantization method and the query vector, an approximate nearest neighbor retrieval is performed in the business logic vector library to obtain multiple logical chain segments related to the current power grid maintenance task. This includes: dividing the vector space in the business logic vector library into multiple cluster centers based on the inverted file index and product quantization method, and dividing each multidimensional vector in the business logic vector library into multiple sub-vectors for compressed storage to obtain document vectors; and performing an approximate nearest neighbor retrieval based on the cosine similarity between the query vector and the document vector to obtain multiple logical chain segments.

[0010] Furthermore, based on the cosine similarity between the query vector and the document vector, an approximate nearest neighbor retrieval is performed to obtain multiple logical chain segments. The formulas include:

[0011] ;

[0012] In the formula, and Both represent query vectors With document vectors The cosine similarity score between them, with the cosine similarity score ranging from [value missing]. , Represents the query vector With document vectors The inner product, Represents the query vector The Euclidean norm, Document vector The Euclidean norm, Represents the query vector The kth component, Document vector The k-th component, where n represents the vector dimension.

[0013] Preferably, before retrieving multiple logical chain fragments, the above method further includes: preprocessing multi-source data in historical business logic documents to obtain standardized data; extracting multiple logical chains from the standardized data, including three levels: device-device association constraints and operation rules; encoding each logical chain into a high-dimensional semantic vector based on a pre-trained embedding model; and storing and indexing the high-dimensional semantic vectors based on a vector index database to construct a business logic vector library.

[0014] Furthermore, before inputting multiple logical chain fragments into the business logic reasoning model and sequentially performing task decomposition, step framework construction, and equipment association analysis to obtain a business logic thinking chain including equipment, equipment association constraints, and operation rules, the above method also includes: extracting multiple labeled logical chain samples including task objectives, step frameworks, equipment associations, and constraint rules from standardized data; training the large language model based on the labeled logical chain samples to obtain a first training model; and using the first training model as the business logic reasoning model if the business logic thinking chain output by the first training model meets the preset indicators.

[0015] Furthermore, before inputting the business logic thinking chain and raw information into the work content generation model to obtain the work ticket, the above method also includes: preprocessing historical information to obtain the first training data; determining labeled data based on the first training data and the business logic reasoning model; performing supervised fine-tuning training on the large language model based on the labeled data to obtain the second training model; and using the second training model as the work content generation model when the work ticket output by the second training model meets the preset indicators.

[0016] Preferably, before retrieving multiple logical chain fragments, the above method further includes: sequentially performing denoising, word segmentation, and entity recognition on the original information input by the user to obtain first preprocessed data; extracting second preprocessed data including device name, operation type, and safety measures from the first preprocessed data; and converting the second preprocessed data into third preprocessed data in JavaScript object representation format, wherein the third preprocessed data is used to determine the query vector and to generate a work ticket by combining the work content input with the business logic thought chain.

[0017] The present invention provides an electronic device comprising: a processor, and a memory storing a program, the program including instructions that, when executed by the processor, cause the processor to perform any of the methods described above.

[0018] This invention provides an intelligent generation method and electronic device for power grid maintenance work tickets. It employs a dynamically adaptable retrieval method for data scenarios of different scales, achieving millisecond-level high-efficiency retrieval in large-scale data scenarios and comprehensive and accurate retrieval in small-scale data scenarios. Through a three-step reasoning process—task decomposition, step framework construction, and equipment association analysis—a business logic reasoning model is used to fuse multiple logical chain fragments obtained from the retrieval, generating a business logic thinking chain including equipment-equipment association constraints and operation rules. This structured business logic thinking chain serves as the core input, combined with the original information input work content generation model, to obtain a standardized work ticket with a strict and standardized format, accurate description of equipment relationships, and compliance with power safety regulations. This solves the problem of related technologies struggling to efficiently generate reliable work tickets. Attached Figure Description

[0019] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other embodiments based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating the steps of an intelligent generation method for power grid maintenance work orders in an embodiment of the present invention.

[0021] Figure 2 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Detailed Implementation

[0022] Embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. While some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0023] When generating power grid maintenance work orders based on the manual invoicing mode, operators manually search and enter relevant equipment information. The quality of the work orders is highly dependent on the technical experience of the staff, and the lack of accuracy will be more obvious when the workload of drafting work orders is heavy.

[0024] When generating power grid maintenance work orders based on the historical ticket reuse model, existing work order templates or previously completed work orders stored in the system can be directly applied to routine maintenance tasks with high repetition. However, if the maintenance task differs significantly from the existing work orders, they must be re-created. A large amount of manpower is required for systematic revision to build a comprehensive database of typical work orders. Furthermore, when the actual task differs significantly from the template, adjustments still rely on human experience, which can easily lead to errors or omissions.

[0025] When generating power grid maintenance work tickets based on the expert system's automatic ticket generation mode, a universal rule base is built for specific wiring methods, and an expert system is developed to realize the automatic generation of work tickets. However, there is a problem that the generated work tickets are not reliable due to incomplete rule coverage.

[0026] Therefore, please refer to Figure 1As shown, the present invention provides an intelligent generation method for power grid maintenance work orders, including steps S101 to S104.

[0027] Step S101: When the amount of data in the business logic vector library exceeds a preset threshold, an approximate nearest neighbor search is performed in the business logic vector library based on the inverted file index, product quantization, and query vector to obtain multiple logical chain segments related to the current power grid maintenance task. The business logic vector library is constructed based on the historical business logic documents of power grid maintenance, and the query vector is determined based on the original information input by the user. The original information is used to execute the current power grid maintenance task.

[0028] Step S102: If the amount of data in the business logic vector library is less than or equal to a preset threshold, perform precise nearest neighbor retrieval in the business logic vector library based on the flat inner product index and the query vector to obtain multiple logical chain segments.

[0029] Step S103: Input multiple logic chain fragments into the business logic reasoning model, and perform task decomposition, step framework construction, and device association analysis in sequence to obtain a business logic thinking chain including devices, device association constraints, and operation rules. The business logic reasoning model is trained based on a large language model and historical business logic documents.

[0030] Step S104: Input the business logic thinking chain and raw information into the work content generation model to obtain the work order. The work content generation model is trained based on the large language model and historical information of power grid maintenance.

[0031] The business logic vector library is built based on historical business logic documents for power grid maintenance. These documents include, but are not limited to, historical work orders, as well as business specifications, operating procedures, and safety rules related to power grid maintenance.

[0032] The preset threshold is a critical value for determining the data size of the business logic vector library. It is used to select the retrieval method for document vectors in the business logic vector library, essentially finding a balance between retrieval speed and retrieval accuracy that meets the needs of power grid maintenance operations. The specific value of the preset threshold can be determined by those skilled in the art based on actual usage requirements and a limited number of experiments.

[0033] For example, if a power grid company's business logic vector library for 10kV distribution network maintenance initially contains only 5,000 document vectors, a precise search would take only 50 milliseconds, meeting real-time requirements, and the preset threshold could be set to 10,000. However, when the business logic vector library for 35kV maintenance logic is subsequently expanded to 12,000, it automatically switches to approximate searching. Furthermore, if the time taken for a precise search after the addition is still controlled within 200 milliseconds, thus still meeting real-time requirements, the preset threshold can be increased to 20,000. Therefore, 10,000, 20,000, or even 100,000 are all possible specific values ​​for the preset threshold.

[0034] The business logic vector library can be dynamically adjusted according to the usage scenario and actual needs. Those skilled in the art can update the business logic vector library periodically, and the preset thresholds can remain unchanged or be adjusted accordingly. Whether it is the real-time raw information input for the current power grid maintenance task or the periodically updated business logic vector library, the method provided in this embodiment can efficiently obtain logic chain fragments and business logic thought chains based on this dynamic information, thereby outputting standardized work tickets with standardized formats, accurate descriptions of equipment subordination relationships, and compliance with power safety regulations.

[0035] Inverted File Index (IVF) is a vector retrieval optimization technique. It first clusters high-dimensional semantic vectors in the business logic vector library according to similarity, dividing them into multiple independent cluster centers. During retrieval, it first locates several cluster centers that are closest to the query vector, and then performs vector matching only within these clusters, rather than traversing the entire vector library, thereby reducing the retrieval computation load when the data volume is large.

[0036] Product Quantization (PQ) is a high-dimensional vector compression storage technology that divides each multi-dimensional business logic semantic vector into multiple non-overlapping sub-vectors and quantizes and encodes each sub-vector separately. Each sub-vector can be represented with fewer bytes, thereby significantly reducing the storage cost of the business logic vector library. Combined with inverted file index, it enables millisecond-level retrieval of large-scale vectors.

[0037] The query vector is obtained by semantic parsing and vectorization of the original information input by the user. The original information includes, but is not limited to, the power grid weekly plan and maintenance task description, which are used to execute the current power grid maintenance task.

[0038] Approximate nearest neighbor retrieval refers to a method that does not aim to find the vector that is absolutely most similar to the query vector in the business logic vector library. Instead, it uses an inverted file index and product quantization techniques to quickly find several logical chain segments that are closest to the query vector. This sacrifices some accuracy for a significant increase in retrieval speed, thereby meeting the real-time retrieval needs of large-scale data scenarios. The several logical chain segments that are closest to the query vector are the Top-K logical chain segments that are most relevant to the current power grid maintenance task.

[0039] For example, with a preset threshold of 100,000 entries and a business logic vector library of 500,000 entries, the query vector for "220kV East Ring Line #3 Transformer Insulation Inspection" is searched using an inverted file index and product quantization technique. This allows for an approximate nearest neighbor search, returning the top-50 logical chain fragments related to the task in just 10 milliseconds. Examples include "220kV Transformer - Power outage and voltage testing required before insulation inspection - safety measures" and "220kV Transformer - Protection device restoration required after inspection - power restoration steps". Although not all 500,000 vectors are traversed, the relevance of the returned results is sufficient to meet the maintenance task requirements.

[0040] IndexFlatIP is a precise vector retrieval technology that directly stores all original high-dimensional semantic vectors determined based on historical business logic documents. When performing precise nearest neighbor retrieval, it calculates the inner product similarity between the query vector and all original high-dimensional semantic vectors in the business logic vector library without performing any compression or clustering. It can comprehensively find the logical chain segments most similar to the query vector, achieving a retrieval accuracy close to 100%.

[0041] For example, with a preset threshold of 10,000 entries and a business logic vector library of 5,000 entries, a flat inner product index is used to perform precise nearest neighbor retrieval on the query vector for "10kV#2 switchgear fault repair". The system will calculate the inner product similarity between the query vector and the 5,000 original vectors in the business logic vector library, sort them from high to low similarity, and return the Top-10 most relevant logical chain segments without any loss of accuracy.

[0042] In addition, whether performing approximate nearest neighbor retrieval or exact nearest neighbor retrieval, when calculating the similarity between the query vector and a document vector in the business logic vector library, the query vector and the document vector can be L2 normalized first, so that the directional features of the query vector and the document vector are preserved and their absolute magnitude is unified to 1. The inner product of the two vectors is equivalent to the cosine similarity.

[0043] The formula for L2 normalization is shown below:

[0044] ;

[0045] In the formula, Represents an n-dimensional vector The Euclidean norm, Represents an n-dimensional vector The k-th component. This can be applied to an n-dimensional vector. Add subscript To represent the query vector For an n-dimensional vector Add subscript To represent document vectors .

[0046] Understandably, during approximate nearest neighbor retrieval, the original high-dimensional semantic vectors within the cluster centers closest to the query vector in the business logic vector library are document vectors. During exact nearest neighbor retrieval, the original high-dimensional semantic vectors in the business logic vector library are document vectors.

[0047] In step S103, task decomposition is to clarify the core objective task and subdivided sub-tasks, step framework construction is to plan the execution order of various operations, and equipment correlation analysis is to identify the primary equipment, secondary equipment and the correlation rules between equipment involved in the current power grid maintenance task.

[0048] Primary equipment, also known as main equipment, is directly involved in the production, transmission, distribution, and use of electrical energy. Its core function is to realize the physical flow and form transformation of energy, forming the hardware framework of the power grid. Examples include transformers, circuit breakers, disconnect switches, busbars, power cables, and primary-side instrument transformers. Secondary equipment, also known as auxiliary equipment, serves the safe operation of primary equipment. Its core functions are to monitor the status of primary equipment, control its actions, and protect it in case of faults. Examples include relay protection devices, measuring instruments, control circuits, signal circuits, and operating power systems.

[0049] The business logic reasoning model is trained based on the Large Language Model (LLM) and historical business logic documents, while the work content generation model is trained based on the LLM and historical information from power grid maintenance. Both are derived by fine-tuning pre-trained Large Language Models (LLMs) according to functional requirements. The historical information used to train the work content generation model includes, but is not limited to, power grid weekly plans, historical end-of-life work orders, maintenance records, power grid maintenance business specifications, and power grid topology.

[0050] The large language model used to obtain the business logic reasoning model and the large language model used to obtain the work content generation model can use the same general-purpose large language model or different general-purpose large language models. The aforementioned general-purpose large language model can be, but is not limited to, the OpenAI GPT series large language model or the Meta Llama series large language model. This embodiment will further explain the trained business logic reasoning model and work content generation model later.

[0051] The intelligent generation method for power grid maintenance work tickets provided by the embodiments of the present invention adopts a dynamically adaptable retrieval method for data scenarios of different scales. It can achieve millisecond-level efficient retrieval in large-scale data scenarios and comprehensive and accurate retrieval in small-scale data scenarios.

[0052] This approach employs a three-step reasoning process—task decomposition, step framework construction, and equipment association analysis—using a business logic reasoning model. Multiple retrieved logical chain fragments are then merged to generate a business logic thinking chain encompassing equipment-equipment association constraints and operational rules. This structured business logic thinking chain serves as the core input, combined with the original information input to generate a work order for the current power grid maintenance task. This effectively addresses the problem of logical gaps—such as reversed step order and missing equipment associations—that often occur when using large language models to generate work orders, due to a lack of business specifications, thus failing to meet the stringent logical requirements of power operations.

[0053] Based on the above-described method provided by the embodiments of the present invention, the ability of the work order generation system to understand complex tasks can be significantly improved. While ensuring that the generated work orders logically comply with business specifications and security constraints, they can automatically adapt to the needs of different voltage levels and different equipment combinations. This fundamentally solves the problem of poor flexibility and narrow coverage leading to insufficient reliability in fixed-mode work order generation methods, and has high generalization ability and practicality.

[0054] In addition, the inefficiency of related technologies is due to the large number of manual intervention steps and the low rate of machine substitution. However, the overall logic of the method provided in this embodiment realizes full-process automation from user input to work ticket output, avoiding the repetitive losses of manual operation and the time-consuming error correction, compressing the overall invoicing cycle to the second level, and realizing the efficient generation of work tickets.

[0055] In summary, the method provided by the embodiments of the present invention can solve the problem that related technologies have difficulty in efficiently generating reliable work orders.

[0056] Preferably, before retrieving multiple logical chain fragments, the above method further includes: sequentially performing denoising, word segmentation, and entity recognition on the original information input by the user to obtain first preprocessed data; extracting second preprocessed data including device name, operation type, and security measures from the first preprocessed data; and converting the second preprocessed data into third preprocessed data in JavaScript object representation format (JSON format), wherein the third preprocessed data is used to determine the query vector and to generate a work ticket by combining the work content input with the business logic thought chain.

[0057] Denoising the raw user input eliminates irrelevant interference, allowing focus on core task information. Subsequent word segmentation and entity recognition help accurately locate key business elements, preventing the omission of crucial information. Extracting device names, operation types, and security measures, along with JSON format conversion, provides a machine-readable foundation for subsequent retrieval and generation processes, improving overall efficiency and accuracy. JSON format, in particular, offers advantages such as standardized structure, clear semantics, and machine readability.

[0058] By inputting the third preprocessed data as a structured query text source into a pre-trained embedding model for semantic encoding, a multi-dimensional query vector can be obtained. The pre-trained embedding model can be, but is not limited to, a Transformer-based text embedding model, which is existing technology and will not be described further in this embodiment.

[0059] Preferably, before retrieving multiple logical chain fragments, the above method further includes: preprocessing multi-source data in historical business logic documents to obtain standardized data; extracting multiple logical chains from the standardized data, including three levels: device-device association constraints and operation rules; encoding each logical chain into a high-dimensional semantic vector based on a pre-trained embedding model; and storing and indexing the high-dimensional semantic vectors based on a vector index database to construct a business logic vector library.

[0060] The multi-source data in historical business logic documents includes, but is not limited to, security procedures in PDF format, historical work orders in Excel format, and operation manuals in Word format. Preprocessing methods for multi-source data can include, but are not limited to, standardizing data formats, denoising and normalizing, and data cleaning and validation.

[0061] In related technologies, historical business logic documents often exist in the form of natural paragraphs, such as "When overhauling a 110kV main transformer, the circuit breaker should be disconnected first, then the voltage should be checked, and the grounding wire should be connected after confirming there is no voltage." This does not clearly distinguish the hierarchical relationships between equipment, equipment-related constraints, and operating rules. Manual reuse requires sentence-by-sentence interpretation, which is inefficient. Machines, on the other hand, struggle to directly extract the structured logic from equipment A to associated equipment B and then to operating step C. However, the preferred method provided in this embodiment, by extracting a three-layer logic chain of equipment-constraint-operation, solves the problems of fragmented business logic and missing connections, ensuring logical integrity.

[0062] Furthermore, the embedding model that encodes each logical chain into a high-dimensional semantic vector can be the same embedding model that encodes the third preprocessed data into a query vector. The high dimension of the high-dimensional semantic vector is a relative concept formed by combining semantic encoding requirements, technical implementation scenarios, and industry standards. Taking the Transformer-based text embedding model as an example, the high dimension can be, but is not limited to, 768 dimensions or 1024 dimensions.

[0063] The vector index database can be, but is not limited to, the FAISS vector database or the Milvus vector database. Considering that the FAISS vector database has multi-GPU accelerated retrieval capabilities, this embodiment preferably uses the FAISS vector database to store and index high-dimensional semantic vectors, construct a business logic vector library, and a corresponding large-scale data retrieval structure based on inverted file index + product quantization technology or a small-scale data retrieval structure based on flat inner product index technology.

[0064] The business logic vector library is the foundation for logic chain fragment retrieval, business logic chain reasoning, and work ticket generation. Building the business logic vector library based on the above-mentioned preferred method helps to provide high-quality logical support for subsequent reasoning and generation stages, improving the accuracy and compliance of the final generated work tickets from another source that is different from the original information input by the user.

[0065] Further, in step S103, before inputting multiple logic chain fragments into the business logic reasoning model and sequentially performing task decomposition, step framework construction, and device association analysis to obtain a business logic thinking chain including devices, device association constraints, and operation rules, the above method also includes: extracting multiple labeled logic chain samples including task objectives, step frameworks, device associations, and constraint rules from standardized data; training the large language model based on the labeled logic chain samples to obtain a first training model; and using the first training model as the business logic reasoning model if the business logic thinking chain output by the first training model meets the preset indicators.

[0066] Extracting labeled logical chain samples from standardized data can provide accurate supervision signals for training large language models, avoiding inference bias caused by poor training data quality.

[0067] Since the labeled logic chain samples are domain samples of power grid maintenance, training a large language model based on these domain samples can achieve the integration of general capabilities and domain expertise, thus solving the problem of poor domain adaptability of general large language models.

[0068] Selecting the first training model that meets the predefined criteria as the business logic reasoning model helps ensure the reliability and stability of the business logic thought chain. The predefined criteria for selecting the first training model can include, but are not limited to, logical accuracy, compliance, completeness, and consistency.

[0069] Taking compliance as an example, the business logic thought chain output by the first training model needs to comply with the industry standard of the "Electric Power Safety Work Regulations", such as including the mandatory step of power testing.

[0070] Taking completeness as an example, the business logic thinking chain output by the first training model is required to cover all elements of task objectives, equipment, constraints, and operations, such as not omitting security measures.

[0071] Further, in step S104, before inputting the business logic thinking chain and original information into the work content generation model to obtain the work ticket, the above method also includes: preprocessing historical information to obtain first training data; determining labeled data based on the first training data and the business logic reasoning model; performing supervised fine-tuning training on the large language model based on the labeled data to obtain a second training model; and using the second training model as the work content generation model when the work ticket output by the second training model meets the preset indicators.

[0072] The method for preprocessing historical information can be the same as the method for preprocessing raw information input by users.

[0073] The process of training a work content generation model is similar to the process of training a business logic reasoning model. Both training processes essentially involve supervised training and fine-tuning of a general large language model using domain samples from power grid maintenance. The difference lies in the specific domain samples used for training and the content generated.

[0074] Selecting a qualified second training model based on preset criteria as the work content generation model helps generate reliable work orders. These preset criteria for selecting the second training model can include, but are not limited to, accuracy, compliance, format conformity, and completeness.

[0075] For example, in terms of accuracy, the equipment name and operation steps in the work order output by the second training model must match the content of the business logic thinking chain. For instance, if the business logic thinking chain contains 1001 circuit breaker, the work order output by the second training model cannot show 1002 circuit breaker.

[0076] Taking format standardization as an example, the equipment number, step number, and safety measure itemization in the work order output by the second training model are required to conform to the "Work Order Management Standard" of the power grid company.

[0077] Furthermore, the trained job content generation model is not an isolated step, but rather deeply collaborative with the construction of the business logic vector library and the trained business logic reasoning model. The business logic vector library provides retrieval materials for the business logic reasoning model, while the business logic reasoning model provides logical annotation basis for the job content generation model. The business logic vector library, the business logic reasoning model, and the job content generation model form a closed loop through the flow of data, logic, and text.

[0078] In the case of new power grid maintenance scenarios, such as the maintenance of new energy storage equipment, it is only necessary to supplement the historical information of the new power grid maintenance scenario, preprocess this historical information into new first training data, and then determine the new labeled data through the business logic reasoning model. Then, the work content generation model is fine-tuned and trained to quickly adapt to the new scenario, breaking through the scalability bottleneck of related technologies that use fixed templates and require redevelopment and adjustment cycles that are too long in new scenarios.

[0079] Preferably, in step S101, when the data volume of the business logic vector library exceeds a preset threshold, an approximate nearest neighbor search is performed in the business logic vector library based on the inverted file index and product quantization, along with the query vector, to obtain multiple logical chain segments related to the current power grid maintenance task. This includes: dividing the vector space in the business logic vector library into multiple cluster centers based on the inverted file index and product quantization, and dividing each multidimensional vector in the business logic vector library into multiple sub-vectors for compressed storage to obtain document vectors. An approximate nearest neighbor search is performed based on the cosine similarity between the query vector and the document vectors to obtain multiple logical chain segments. This method is suitable for semantic search scenarios and can perform millisecond-level retrieval in large-scale data scenarios, which helps to efficiently generate work tickets.

[0080] In this embodiment, a multidimensional vector can also be called a high-dimensional vector or a high-dimensional semantic vector. The multidimensionality of a multidimensional vector can be understood by referring to the high-dimensionality of the aforementioned high-dimensional semantic vector.

[0081] Furthermore, based on the cosine similarity between the query vector and the document vector, an approximate nearest neighbor retrieval is performed to obtain multiple logical chain segments. The formulas include:

[0082] ;

[0083] In the formula, and Both represent query vectors With document vectors The cosine similarity score between them, with the cosine similarity score ranging from [value missing]. , Represents the query vector With document vectors The inner product, Represents the query vector The Euclidean norm, Document vector The Euclidean norm, Represents the query vector The kth component, Document vector The k-th component, where n represents the vector dimension.

[0084] The higher the cosine similarity score, the more consistent the direction of the corresponding query vector and document vector, and the higher the similarity.

[0085] Preferably, step S104, which involves inputting the business logic thinking chain and raw information into the work content generation model to obtain a work order, includes: embedding the business logic thinking chain into a prompt word template to obtain dynamic prompt words corresponding to the current power grid maintenance task. The prompt word template reserves corresponding placeholders for the business logic thinking chain, and the relationships constructed in the prompt word template include the subordinate relationships between primary and secondary equipment in power maintenance. The dynamic prompt words and raw information are then input into the work content generation model to obtain the work order.

[0086] Directly generating work orders using a large language model carries the risk of illusion and logical divergence, while static prompts are insufficient to adapt to specific tasks and fail to constrain the generation logic of the large language model. To address this, the preferred method in step S104 embeds the business logic thought chain into the prompt template design, resulting in dynamic prompts containing key nodes such as task objective analysis, step framework construction, equipment association analysis, and rule verification. Guided by these dynamic prompts, the work content generation model strictly adheres to the business logic thought chain and outputs corresponding work orders based on the original information, thus avoiding errors or redundant information in the work orders due to a lack of business support.

[0087] The aforementioned dynamic prompts are dynamically filled based on the business logic chain corresponding to the current power grid maintenance task. Therefore, the work order generation system based on the method provided in this embodiment can automatically instantiate the prompt template based on the user's current input information, obtaining personalized prompts for the current power grid maintenance task. By following the mechanism of logical reasoning first and content generation later, the problem of static prompts becoming rigid is solved. Regardless of whether the user's input information is simple or complex, the aforementioned work order generation system can guide the model with optimal instructions, ultimately outputting high-quality work orders that are formatted correctly, safe, and compliant.

[0088] Furthermore, before embedding the business logic thought chain into the prompt word template to obtain the dynamic prompt words corresponding to the current power grid maintenance task, the above method also includes: setting multiple prompt word samples with different semantic densities and / or syntactic structures; inputting the multiple prompt word samples and test information into the work content generation model to obtain the test work tickets corresponding to each of the multiple prompt word samples; and determining the prompt word template based on the prompt word structure corresponding to the test work ticket with the highest accuracy.

[0089] Different prompt word examples can differ in semantic density, syntactic structure, or both.

[0090] The test information is sample information determined based on the user's historical input information and is pre-set in a callable sample database by those skilled in the art.

[0091] By setting multiple different prompt word examples, multiple different test work tickets are obtained, and then the optimal prompt word template is determined. This helps to ensure the stability of dynamic prompt words in multiple scenarios and generate reliable work tickets.

[0092] Those skilled in the art can combine multiple evaluation indicators, including task information completeness, operational logic and business process compliance, security constraints and compliance, and adaptability to actual execution scenarios, to determine the most accurate test work order.

[0093] Taking task information integrity as an example, satisfying task information integrity can mean that the test work order contains all the necessary information required to complete the task, such as equipment name, operation type and safety measures.

[0094] Taking the adaptability to actual execution scenarios as an example, meeting the adaptability to actual execution scenarios can mean that the content of the test work order is consistent with the actual situation on site, the operation steps are executable and unambiguous, and are not too general or dependent on non-existent conditions.

[0095] The present invention also provides a non-transitory machine-readable medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to an embodiment of the present invention.

[0096] The present invention also provides a computer program product, including a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform the method of the embodiments of the present invention.

[0097] This invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, which, when executed by the at least one processor, causes the electronic device to perform the method of this invention.

[0098] refer to Figure 2 This is a structural block diagram of an electronic device, either a server or a client, according to an embodiment of the present invention. It is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0099] like Figure 2 As shown, the electronic device includes a computing unit 201, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 202 or a computer program loaded from a storage unit 208 into a random access memory (RAM) 203. The RAM 203 may also store various programs and data required for the operation of the electronic device. The computing unit 201, the ROM 202, and the RAM 203 are interconnected via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.

[0100] Multiple components in the electronic device are connected to I / O interface 205, including: input unit 206, output unit 207, storage unit 208, and communication unit 209. Input unit 206 can be any type of device capable of inputting information into the electronic device. Input unit 206 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 207 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 208 may include, but is not limited to, disks and optical discs. Communication unit 209 allows the electronic device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, and / or wireless communication transceivers, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0101] The computing unit 201 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 201 include, but are not limited to, CPUs, graphics processing units (GPUs), various special-purpose artificial intelligence (AI) computing units, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. The computing unit 201 performs the various methods and processes described above. For example, in some embodiments, the method embodiments of the present invention can be implemented as computer programs tangibly contained in a machine-readable medium, such as storage unit 208. In some embodiments, part or all of the computer program can be loaded and / or installed on an electronic device via ROM 202 and / or communication unit 209. In some embodiments, the computing unit 201 can be configured to perform the methods described above by any other suitable means (e.g., by means of firmware).

[0102] Computer programs for implementing the methods of embodiments of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0103] In the context of embodiments of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, or infrared systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0104] It should be noted that the term "comprising" and its variations used in the embodiments of this invention are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The modifications of "one" and "a plurality" mentioned in the embodiments of this invention are illustrative and not restrictive, and those skilled in the art should understand that unless explicitly indicated otherwise in the context, they should be understood as "one or more". The descriptions of terms such as "first", "second", etc., are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of indicated technical features.

[0105] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this invention are all information and data authorized by the user or fully authorized by all parties.

[0106] The steps described in the method embodiments provided by the present invention can be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of protection of the present invention is not limited in this respect.

[0107] The term "embodiment" in this specification refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily imply the same embodiment, nor does it imply independence or alternativeity from other embodiments. The various embodiments in this specification are described in a related manner, with reference to each other for similar or identical parts. In particular, for apparatus, device, and system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and relevant details are referred to in the description of the method embodiments.

[0108] The above-described embodiments are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.

Claims

1. An intelligent generation method of a power grid maintenance work ticket, characterized in that, The method comprises the following steps: In the case that the data amount of the business logic vector library is greater than a preset threshold, approximate nearest neighbor search is performed in the business logic vector library based on an inverted file index and a product quantization manner and a query vector, to obtain a plurality of logic chain segments related to a current power grid maintenance task, wherein the business logic vector library is constructed according to historical business logic documents of power grid maintenance, and the query vector is determined according to original information input by a user, and the original information is used to execute the current power grid maintenance task; In the case that the data amount of the business logic vector library is less than or equal to the preset threshold, accurate nearest neighbor search is performed in the business logic vector library based on a flat inner product index manner and the query vector, to obtain a plurality of the logic chain segments; The plurality of logic chain segments are input into a business logic reasoning model to sequentially perform task decomposition, step framework building and device association analysis, to obtain a business logic thinking chain comprising devices, device association constraints and operation rules, wherein the business logic reasoning model is trained based on a large language model and the historical business logic documents; The business logic thinking chain and the original information are input into a work content generation model to obtain a work ticket, wherein the work content generation model is trained based on the large language model and historical information of power grid maintenance.

2. The method of claim 1, wherein, The method for obtaining the work ticket by inputting the business logic thinking chain and the original information into the work content generation model comprises the following steps: The business logic thinking chain is embedded into a prompt word template to obtain a dynamic prompt word corresponding to the current power grid maintenance task, wherein the prompt word template has a corresponding placeholder reserved for the business logic thinking chain, and the relationship constructed in the prompt word template comprises a subordinate relationship between primary devices and secondary devices in power maintenance; The dynamic prompt word and the original information are input into the work content generation model to obtain the work ticket.

3. The method of claim 2, wherein, Before the business logic thinking chain is embedded into the prompt word template to obtain the dynamic prompt word corresponding to the current power grid maintenance task, the method further comprises the following steps: A plurality of prompt word samples with different semantic densities and / or syntactic structures are set; The plurality of prompt word samples and test information are input into the work content generation model to obtain test work tickets corresponding to the plurality of prompt word samples respectively; The prompt word structure corresponding to the test work ticket with the highest accuracy is determined as the prompt word template.

4. The method of claim 1, wherein, In the case that the data amount of the business logic vector library is greater than a preset threshold, approximate nearest neighbor search is performed in the business logic vector library based on an inverted file index and a product quantization manner and a query vector, to obtain a plurality of logic chain segments related to a current power grid maintenance task, comprising: The vector space in the business logic vector library is divided into a plurality of cluster centers based on the inverted file index and the product quantization manner, and each multi-dimensional vector in the business logic vector library is segmented into a plurality of sub-vectors for compressed storage to obtain a document vector; Approximate nearest neighbor search is performed based on the cosine similarity of the query vector and the document vector to obtain a plurality of the logic chain segments.

5. The method of claim 4, wherein, performing approximate nearest neighbor retrieval based on cosine similarity of the query vector and the document vector to obtain formulas of the plurality of logical chain segments comprises: ; wherein and both represent the cosine similarity score between the query vector and the document vector ranging from , represents the inner product of the query vector and the document vector , represents the Euclidean norm of the query vector , represents the Euclidean norm of the document vector , represents the k-th component of the query vector , represents the k-th component of the document vector , and n represents the vector dimension.

6. The method of claim 1, wherein, Before retrieving the plurality of logical chain segments, the method further comprises: preprocessing multi-source data in the historical business logic document to obtain standardized data; extracting a plurality of logical chains containing three levels of device-device association constraint-operation rules from the standardized data; encoding each of the logical chains into a high-dimensional semantic vector based on a pre-trained embedding model; storing and indexing the high-dimensional semantic vector based on a vector index database to construct the business logic vector library.

7. The method of claim 6, wherein, Before inputting the plurality of logical chain segments into the business logic reasoning model to sequentially perform task decomposition, step framework building, and device association analysis to obtain a business logic thinking chain including devices, device association constraints, and operation rules, the method further comprises: extracting a plurality of annotated logical chain samples including task objectives, step frameworks, device associations, and constraint rules from the standardized data; training the large language model based on the annotated logical chain samples to obtain a first trained model; in a case where the business logic thinking chain output by the first trained model reaches a preset index, taking the first trained model as the business logic reasoning model.

8. The method of claim 7, wherein, Before inputting the business logic thinking chain and the original information into the work content generation model to obtain a work ticket, the method further comprises: preprocessing the historical information to obtain first training data; determining annotated data based on the first training data and the business logic reasoning model; performing supervised fine-tuning training on the large language model based on the annotated data to obtain a second trained model; in a case where the work ticket output by the second trained model reaches a preset index, taking the second trained model as the work content generation model.

9. The method of claim 1, wherein, Before retrieving the plurality of logical chain segments, the method further comprises: sequentially performing denoising, tokenization, and entity recognition on the original information input by a user to obtain first preprocessing data; extracting second preprocessing data including device names, operation types, and safety measures from the first preprocessing data; converting the second preprocessing data into third preprocessing data in JavaScript Object Notation (JSON) format, wherein the third preprocessing data is used to determine the query vector and is used to input the business logic thinking chain into the work content generation model to obtain the work ticket.

10. An electronic device comprising: A processor and a memory storing a program, characterized in that the program includes instructions that, when executed by the processor, cause the processor to perform the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Approximate nearest text semantic retrieval method and device, equipment and storage medium

    CN115470315A

  • Operation ticket generation method and device, equipment and medium

    CN117235280A