Intelligent generation method of power grid maintenance work ticket and electronic equipment
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 tickets is achieved. This solves the problems of low accuracy and incomplete coverage in existing technologies, and realizes efficient and accurate work ticket generation.
Patent Information
- Application Number
- CN202511923246.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-19
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2045-12-19
AI Technical Summary
Existing technologies struggle to efficiently generate reliable power grid maintenance work tickets, particularly in manual ticketing, historical ticket reuse, and expert system-automated ticketing modes, where accuracy and coverage are incomplete.
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.
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.
Smart Images

Figure CN121366058A_ABST
Abstract
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] The application provides an intelligent generation method of a power grid maintenance work ticket, including: 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, wherein the business logic vector library is constructed according to historical business logic documents of power grid maintenance, the query vector is determined according to original information input by a user, and the original information is used to perform 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, performing accurate nearest neighbor retrieval in the business logic vector library based on a flat inner product index manner and the query vector to obtain the plurality of logic chain segments; inputting the plurality of logic chain segments 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 including devices, device 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 the work ticket, wherein the work content generation model is trained based on a large language model and historical information of power grid maintenance.
[0007] Preferably, inputting the business logic thinking chain and the original information into the work content generation model to obtain the work ticket includes: embedding the business logic thinking chain into a prompt word template to obtain a dynamic prompt word corresponding to the current power grid maintenance task, wherein 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 relationship between primary devices and secondary devices in power maintenance; and inputting the dynamic prompt word and the original information into the work content generation model to obtain the work ticket.
[0008] Further, before embedding the business logic thinking chain into the prompt word template to obtain the dynamic prompt word corresponding to the current power grid maintenance task, the method further includes: setting a plurality of prompt word samples with different semantic densities and / or syntactic structures; inputting the plurality of prompt word samples and test information into the work content generation model to obtain test work tickets corresponding to the plurality of prompt word samples respectively; and determining the prompt word template based on the prompt word structure corresponding to the test work ticket with the highest accuracy.
[0009] Preferably, in the case that the data amount of the business logic vector library is greater than a preset threshold, approximate nearest neighbor retrieval is performed in the business logic vector library based on the inverted file index and the product quantization manner and the query vector, to obtain a plurality of pieces of logical chain fragments related to the current power grid maintenance task, including: based on the inverted file index and the product quantization manner, dividing a vector space in the business logic vector library into a plurality of cluster centers, and dividing each multi-dimensional vector in the business logic vector library into a plurality of sub-vectors for compressed storage, to obtain a document vector; based on the cosine similarity of the query vector and the document vector, performing approximate nearest neighbor retrieval to obtain the plurality of pieces of logical chain fragments.
[0010] Further, the formula for performing approximate nearest neighbor retrieval based on the cosine similarity of the query vector and the document vector to obtain the plurality of pieces of logical chain fragments includes: ; In the formula, and both represent the cosine similarity score between the query vector and the document vector , and the cosine similarity score has a value range of , 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.
[0011] Preferably, before the plurality of pieces of logical chain fragments are retrieved, the above method further includes: 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 logical chain 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.
[0012] Further, the plurality of logical chain segments are input into the business logic reasoning model to sequentially perform task decomposition, step framework building, and device association analysis, and a business logic thinking chain including devices, device association constraints, and operation rules is obtained.
[0013] Further, the business logic thinking chain and the original information are input into a work content generation model to obtain a work ticket, and the method further comprises: 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 in a case where a work ticket output by the second training model reaches a preset index, the second training model is taken as the work content generation model.
[0014] Preferably, before the plurality of logical chain segments are retrieved, the method further comprises: 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 names, operation types, and safety measures from the first preprocessed data; and converting the second preprocessed data into third preprocessed data in JavaScript Object Notation (JSON) format, wherein the third preprocessed data is used to determine a query vector and is input into the business logic thinking chain to generate a work ticket by the work content generation model.
[0015] The electronic device provided by the application comprises a processor and a memory storing a program, the program comprising instructions which, when executed by the processor, cause the processor to perform any of the above methods.
[0016] The intelligent generation method and electronic device for power grid maintenance work tickets provided by the application use a dynamically adaptive retrieval method for different scales of data scenarios, can achieve millisecond-level efficient retrieval in large-scale data scenarios, and can achieve comprehensive and accurate retrieval in small-scale data scenarios. The business logic reasoning model is used to perform three-step reasoning of task decomposition, step framework building, and device association analysis, the plurality of logical chain segments retrieved are fused, and a business logic thinking chain including device-device association constraints-operation rules is generated. This structured business logic thinking chain is used as a core input, combined with original information to input a work content generation model, and a standardized work ticket with strict format, accurate device relationship expression, and compliance with power safety regulations is obtained. The problems that related technologies cannot efficiently generate reliable work tickets are solved. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required to be used in the embodiments or prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other embodiments can also be obtained from these drawings without creative labor.
[0018] Figure 1 is a step flow chart of an intelligent generation method of a power grid maintenance work ticket in an embodiment of the present application.
[0019] Figure 2 is a structural schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0020] The embodiments of the present application will be described in detail below with reference to the drawings. Although some embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms, and should not be interpreted as being limited to the embodiments described herein, on the contrary, these embodiments are provided to more thoroughly and completely understand the present application. It should be understood that the drawings and embodiments of the present application are only for exemplary purposes, and are not intended to limit the scope of protection of the present application.
[0021] When generating a power grid maintenance work ticket based on the manual ticket generation mode, the work personnel manually retrieve and input device-related information, and the quality of the work ticket is highly dependent on the technical experience accumulation of the work personnel, and the lack of accuracy will be more obvious in the case of heavy ticket task quantity.
[0022] When generating a power grid maintenance work ticket based on the historical ticket reuse mode, by calling the work ticket templates stored in the system or the work tickets that have been completed in the past, for the repetitive and regular maintenance tasks, the existing tickets can be directly applied; but if the maintenance task and the existing ticket have significant differences, it needs to be recompiled. A large amount of manpower is needed to systematize the revision in order to build a perfect typical work ticket library, and when there is a large difference between the actual task and the template, it still needs to rely on manual experience for adjustment, which is easy to make modification errors or omissions.
[0023] When generating a power grid maintenance work ticket based on the expert system automatic ticket generation mode, for a specific wiring mode, a universal rule base is constructed, an expert system is developed, and the automatic generation of the work ticket is realized, but there is a problem of insufficient reliability of the generated work ticket due to incomplete rules.
[0024] Therefore, please refer to Figure 1As shown, the embodiment of the present application provides an intelligent generation method of a power grid maintenance work ticket, comprising steps S101 to S104.
[0025] Step S101, in the case that the data amount of the business logic vector library is greater than a preset threshold, approximate nearest neighbor retrieval 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 the 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.
[0026] Step S102, 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 retrieval 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 logic chain segments.
[0027] Step S103, inputting the plurality of logic chain segments into a business logic reasoning model, sequentially performing task decomposition, step framework building, and device correlation analysis, to obtain a business logic thinking chain including devices, device correlation constraints, and operation rules, wherein the business logic reasoning model is trained based on a large language model and historical business logic documents.
[0028] Step S104, inputting the business logic thinking chain and the original information into a work content generation model, to obtain a work ticket, wherein the work content generation model is trained based on a large language model and historical information of power grid maintenance.
[0029] The business logic vector library is constructed according to historical business logic documents of power grid maintenance, and the historical business logic documents include but are not limited to historical work tickets, and business specifications, operation processes, and safety rules related to power grid maintenance.
[0030] The preset threshold is a critical value for judging the data size of the business logic vector library, and is used to select the retrieval manner of the document vector of the business logic vector library, and essentially finds a balanced critical point meeting the business demand of power grid maintenance between retrieval speed and retrieval accuracy. The specific value of the preset threshold can be determined by a person skilled in the art according to actual use requirements, combined with a limited number of experiments.
[0031] For example, if a power grid company initially has only 5000 document vectors in the business logic vector library for 10kV distribution network maintenance logic, the exact search only takes 50 milliseconds, which meets the real-time requirement, and the preset threshold can be set to 10,000. When the business logic vector library for 35kV maintenance logic is added to 12,000, the approximate search is automatically switched. At the same time, if the time consumption of the exact search after the addition is still controlled within 200 milliseconds, which still meets the real-time requirement, the preset threshold can be increased to 20,000. Therefore, 10,000, 20,000 or even 100,000 are possible specific values of the preset threshold.
[0032] The business logic vector library can be dynamically adjusted according to the use scenario and actual demand. Those skilled in the art can update the used business logic vector library regularly, and the preset threshold 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 regularly updated business logic vector library, the above-mentioned method provided by the embodiment can efficiently obtain the logic chain segment and the business logic thinking chain based on these dynamic information, so as to output the standardized work ticket with a standard format, accurate device dependency relationship and compliance with the power safety regulations.
[0033] The inverted file index (IVF) is a vector retrieval optimization technology. The high-dimensional semantic vectors in the business logic vector library are clustered according to similarity, and divided into multiple independent cluster centers. When searching, the closest cluster centers to the query vector are located first, and then the vector matching is performed only within these clusters, rather than traversing the entire vector library, so as to reduce the calculation amount of retrieval when the data amount is large.
[0034] Product quantization (PQ) is a high-dimensional vector compression storage technology. Each multi-dimensional business logic semantic vector is divided into multiple non-overlapping sub-vectors, and each sub-vector is quantized and coded separately. Each sub-vector can be represented by fewer bytes, thereby greatly reducing the storage cost of the business logic vector library, and realizing millisecond-level retrieval of large-scale vectors in combination with the inverted file index.
[0035] The query vector is obtained by performing semantic analysis and vectorization processing on the raw information input by the user, and the raw information includes but is not limited to power grid weekly plan and maintenance task description, which is used to perform the current power grid maintenance task.
[0036] Approximate nearest neighbor search refers to not pursuing to find the absolutely most similar vector to the query vector in the business logic vector library, but quickly finding several closest similar logical chain fragments through the technology of inverted file index + product quantization, sacrificing a certain accuracy in exchange for a substantial improvement in search speed, so as to meet the real-time search demand in the large-scale data scenario. The several closest similar logical chain fragments are the Top-K logical chain fragments with the strongest relevance to the current power grid maintenance task.
[0037] Exemplarily, the preset threshold is set to 100,000, the data amount of the business logic vector library is 500,000, and the inverted file index + product quantization technology is used to perform approximate nearest neighbor search on the query vector of “220kV East Ring Line #3 Transformer Insulation Detection”. Only 10 milliseconds are needed to return the Top-50 logical chain fragments related to the task, such as “220kV Transformer - Power-off for Pre-insulation Detection - Safety Measures” and “220kV Transformer - Protection Device Restoration after Detection - Power-on Step”. Although all the 500,000 vectors are not traversed, the relevance of the returned results can already meet the maintenance task demand.
[0038] IndexFlatIP is an accurate vector search technology, which directly stores all original high-dimensional semantic vectors determined according to historical business logic documents, and calculates the inner product similarity of the query vector and all original high-dimensional semantic vectors in the business logic vector library when performing accurate nearest neighbor search, without any compression or clustering, so as to comprehensively find the most similar logical chain fragments to the query vector, achieving a search accuracy close to 100%.
[0039] Exemplarily, the preset threshold is set to 10,000, the data amount of the business logic vector library is 5,000, and IndexFlatIP is used to perform accurate nearest neighbor search on the query vector of “10kV #2 Switch Cabinet Fault Maintenance”. The system will calculate the inner product similarity of the query vector and the 5,000 original vectors in the business logic vector library, and sort the similarity from high to low, and return the Top-10 most relevant logical chain fragments without any accuracy loss.
[0040] In addition, whether it is approximate nearest neighbor search or accurate nearest neighbor search, 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 first subjected to L2 normalization, so that the directional features of the query vector and the document vector are preserved and the absolute size is unified to 1, and the vector inner product of the two is equivalent to the cosine similarity.
[0041] The formula for performing L2 normalization is as follows: ; In the formula, x represents an n-dimensional vector, and x represents the L2 norm of the n-dimensional vector x. The L2 norm of the n-dimensional vector x is calculated as follows: 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 .
[0042] 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.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] The large language model for obtaining the business logic inference model and the large language model for obtaining the work content generation model can adopt the same general large language model or different general large language models. The general large language model can be, but is not limited to, an OpenAI GPT series large language model or a Meta Llama series large language model. The business logic inference model and the work content generation model are further described below.
[0047] The intelligent generation method of the power grid maintenance work ticket provided by the embodiment of the present application can adopt a dynamically adaptive retrieval method for different scales of data scenes, and can achieve millisecond-level efficient retrieval in a large-scale data scene and comprehensive and accurate retrieval in a small-scale data scene.
[0048] The three-step reasoning of task decomposition, step framework construction, and device association analysis is performed by the business logic inference model, the multiple logic chain segments retrieved are fused, and a business logic thinking chain including device-device association constraints-operation rules is generated. The structured business logic thinking chain is used as the core input, and the original information is input into the work content generation model to obtain the work ticket for the current power grid maintenance task, which can effectively solve the problem that the related art uses a large language model to generate a work ticket, and the logic fault such as step sequence reversal and device association omission is caused due to the lack of business specification support, and it is difficult to meet the strong logicality requirement of power operation.
[0049] Based on the above method provided by the embodiment of the present application, the understanding ability of the work ticket generation system for complex tasks can be significantly improved, and the generated work ticket can be automatically adapted to the scene requirements of different voltage levels and different device combinations while meeting the business specification and safety constraints in logic, thereby fundamentally solving the problem of poor flexibility and narrow coverage of the fixed mode work ticket generation method, and having high generalization ability and practicality.
[0050] In addition, the inefficiency of the related art is caused by the multiple manual intervention links and low machine replacement rate, and the overall logic of the above method provided by the embodiment of the present application realizes the full-process automation from user input to work ticket output, avoids the repeated loss and time-consuming error correction of manual operation, and compresses the overall period of ticketing to seconds, thereby realizing efficient generation of the work ticket.
[0051] In summary, the above method provided by the embodiment of the present application can solve the problem that the related art is difficult to efficiently generate a reliable work ticket.
[0052] Preferably, before retrieving the plurality of logical chain segments, the method further comprises: sequentially performing denoising, word segmentation, and entity recognition on the original information input by the user to obtain first pre-processed data; extracting second pre-processed data including device name, operation type, and safety measures from the first pre-processed data; and converting the second pre-processed data into third pre-processed data in JavaScript Object Notation (JSON) format, wherein the third pre-processed data is used to determine a query vector and to generate a work ticket with a business logic thinking chain input work content generation model.
[0053] Denoising the original information input by the user can exclude irrelevant interference and focus on core task information. Subsequent word segmentation and entity recognition help accurately locate key business elements and avoid missing core information. Extracting device name, operation type, and safety measures, and converting to JSON format provides a machine-readable basis for subsequent retrieval and generation to improve overall process efficiency and accuracy. JSON format has the advantages of structured specification, clear semantics, and machine readability.
[0054] Inputting the third pre-processed data as structured query text source into a pre-trained embedding Embedding model for semantic encoding can obtain a multi-dimensional query vector. The pre-trained embedding Embedding model can be, but is not limited to, a Transformer-based text embedding model, which is prior art and will not be described in detail in this embodiment.
[0055] Preferably, before retrieving the plurality of logical chain segments, the method further comprises: pre-processing multi-source data in historical business logic documents to obtain standardized data; extracting a plurality of logical chains containing device-device association constraints-operation rules from the standardized data; encoding each logical chain 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 a business logic vector library.
[0056] The multi-source data in the historical business logic documents includes, but is not limited to, safety procedures in PDF format, historical work tickets in Excel format, and operation guide books in Word format. The pre-processing method for multi-source data can be, but is not limited to, uniform data format, denoising and standardization, data cleaning and verification.
[0057] In the related art, the information of the historical business logic document is in the form of natural paragraphs, such as "When overhauling the 110kV main transformer, the circuit breaker should be disconnected first, then the electricity should be checked, and the ground wire should be connected after confirming that there is no voltage", which does not explicitly distinguish the hierarchical relationship of the equipment, the equipment association constraint and the operation rule, and manual reuse needs to be interpreted sentence by sentence, which is low in efficiency, and machines are difficult to directly extract the structured logic from the equipment A to the associated equipment B and then to the operation step C. In the above preferred mode provided by the embodiment, the problem of business logic fragmentation and association loss can be solved by extracting the three-layer logic chain of equipment-constraint-operation, and the logic integrity is guaranteed.
[0058] In addition, the embedding model for encoding each logic chain into a high-dimensional semantic vector can be the same embedding model as the embedding model for encoding 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 conventional standards. Taking a text embedding model based on Transformer as an example, the high dimension can be but is not limited to 768 dimensions, 1024 dimensions.
[0059] The vector index database can be but is not limited to a FAISS vector database and a Milvus vector database. Considering that the FAISS vector database has multi-GPU acceleration retrieval capability, the embodiment preferably stores and indexes the high-dimensional semantic vector based on the FAISS vector database, constructs a business logic vector library, and a large-scale data retrieval structure based on an inverted file index + product quantization technology or a small-scale data retrieval structure based on a flat inner product index technology.
[0060] The business logic vector library is the basis for logic chain segment retrieval, business logic chain reasoning and work ticket generation. Constructing the business logic vector library based on the above preferred mode helps to provide high-quality logic support for subsequent reasoning and generation links, improves the accuracy and compliance of the finally generated work ticket from another source different from the original information input by the user.
[0061] Further, in step S103, the plurality of logic chain segments are input into the business logic reasoning model for task decomposition, step framework building and equipment association analysis in sequence to obtain a business logic thinking chain including equipment, equipment association constraint and operation rule. The above method further includes: extracting a plurality of labeled logic chain samples including task target, step framework, equipment association and constraint rule from the standardized data; training the large language model based on the labeled logic chain samples to obtain a first training model; and taking the first training model as the business logic reasoning model in a case where the business logic thinking chain output by the first training model reaches a preset index.
[0062] Extracting the annotated logic chain samples from the standardized data can provide accurate supervision signals for training the large language model, and avoid reasoning deviation caused by poor training data quality.
[0063] Since the annotated logic chain samples are domain samples of power grid maintenance, training the large language model based on the domain samples can realize the fusion of general ability and domain professional knowledge, and solve the problem of poor domain adaptability of general large language models.
[0064] Screening the first training model that meets the standard as the business logic reasoning model through the preset index helps to ensure the reliability and stability of the business logic thinking chain. The preset index for screening the first training model can be, but is not limited to, logic accuracy, compliance, integrity, consistency.
[0065] Taking compliance as an example, the business logic thinking chain output by the first training model needs to comply with the industry standard of the Power Safety Work Regulations, for example, it needs to include the mandatory step of checking the electricity.
[0066] Taking integrity as an example, the business logic thinking chain output by the first training model needs to cover all elements of task target, equipment, constraint, operation, for example, it cannot omit safety measures.
[0067] Further, before step S104, the method further includes: 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 training model; and taking the second training model as the work content generation model when the work ticket output by the second training model meets the preset index.
[0068] The way of preprocessing the historical information can refer to the way of preprocessing the original information input by the user.
[0069] The process of training the work content generation model is similar to the process of training the business logic reasoning model. Essentially, both training processes are to supervise and fine-tune the general large language model using domain samples of power grid maintenance. The difference lies in the specific training domain samples and the generated content.
[0070] Screening the second training model that meets the standard as the work content generation model through the preset index helps to generate reliable work tickets. The preset index for screening the second training model can be, but is not limited to, accuracy, compliance, format specification, integrity.
[0071] Taking accuracy as an example, the second training model is required to output the device name and operation steps in the work ticket that match the content of the business logic thinking chain, for example, the business logic thinking chain contains 1001 circuit breaker, and the second training model cannot output 1002 circuit breaker in the work ticket.
[0072] Taking format specification as an example, the second training model is required to output the work ticket in the format of device number, step number, and safety measure entry, which conforms to the Work Ticket Management Standard of the power grid enterprise.
[0073] In addition, the training of the work content generation model is not an isolated link, but forms a deep synergy with the construction of the business logic vector library and the training of the business logic reasoning model. The business logic vector library provides retrieval materials for the business logic reasoning model, and the business logic reasoning model provides logical labeling basis for the work content generation model. The business logic vector library, the business logic reasoning model, and the work content generation model form a closed loop through the flow of data-logic-text.
[0074] In the case of adding a new power grid maintenance scene, such as the maintenance of a new type of energy storage equipment, only the historical information of the new power grid maintenance scene needs to be supplemented, the historical information is preprocessed into new first training data, and then the new labeled data is determined through the business logic reasoning model, and the work content generation model is fine-tuned and trained, which can quickly adapt to the new scene and break through the expansion bottleneck of the related technology that requires re-development and adjustment for a long period of time in the new scene.
[0075] Preferably, in step S101, when the data amount of the business logic vector library is greater than a preset threshold, approximate nearest neighbor retrieval is performed in the business logic vector library based on an inverted file index and a product quantization method and a query vector, to obtain a plurality of logic chain segments related to the current power grid maintenance task, including: based on the inverted file index and the product quantization method, dividing the vector space in the business logic vector library into a plurality of cluster centers, and dividing each multi-dimensional vector in the business logic vector library into a plurality of sub-vectors for compressed storage to obtain a document vector. The cosine similarity between the query vector and the document vector is used for approximate nearest neighbor retrieval to obtain a plurality of logic chain segments. This is suitable for semantic search scenarios and can perform millisecond-level retrieval in large-scale data scenarios, which helps to efficiently generate work tickets.
[0076] In this embodiment, the multi-dimensional vector can also be referred to as a high-dimensional vector or a high-dimensional semantic vector. The multi-dimension of the multi-dimensional vector can be understood with reference to the high-dimension of the aforementioned high-dimensional semantic vector.
[0077] Further, the formula for performing approximate nearest neighbor retrieval based on the cosine similarity between the query vector and the document vector to obtain a plurality of logic chain segments includes: ; wherein, and both represent the cosine similarity score between the query vector and the document vector , the cosine similarity score ranges 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 dimension of the vector.
[0078] The greater the value of the cosine similarity score, the more consistent the direction of the corresponding query vector and the document vector, and the higher the similarity.
[0079] Preferably, in step S104, the business logic thinking chain and the original information are input into the work content generation model to obtain the work ticket, including: embedding the business logic thinking chain 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 includes the dependency relationship between the primary equipment and the secondary equipment of power maintenance. The dynamic prompt word and the original information are input into the work content generation model to obtain the work ticket.
[0080] Directly using a large language model to generate a work ticket has the risk of illusion and logical divergence, and a static prompt word Prompt cannot adapt to specific tasks and is difficult to constrain the generation logic of the large language model. To this end, in the above preferred mode of step S104, by embedding the business logic thinking chain into the design of the prompt word template, a dynamic prompt word containing key nodes such as task target analysis-step framework building-equipment correlation analysis-rule verification is obtained. The work content generation model is guided by the dynamic prompt word, strictly based on the business logic thinking chain, and outputs the corresponding work ticket in combination with the original information, which can avoid the presence of errors or redundant information in the work ticket due to the lack of business support.
[0081] The dynamic prompt word is dynamically filled according to the business logic thinking chain corresponding to the current power grid maintenance task, therefore, the work order generation system executed based on the above method provided in the embodiment can automatically instantiate the prompt word template according to the original information input by the user to obtain the personalized prompt word for the current power grid maintenance task. By following the mechanism of logical reasoning first and content generation later, the problem of rigidification of static prompt words is solved. Whether the original information input by the user is simple or complex, the above work order generation system can guide the optimal instruction model and finally stably output a high-quality work order with a standard format and safety compliance.
[0082] Further, before embedding the business logic thinking chain into the prompt word template to obtain the dynamic prompt word corresponding to the current power grid maintenance task, the above method further comprises: setting a plurality of prompt word samples with different semantic densities and / or syntactic structures; inputting the plurality of prompt word samples and test information into the work content generation model to obtain a plurality of test work orders respectively corresponding to the plurality of prompt word samples; and determining the prompt word template based on the prompt word structure corresponding to the test work order with the highest accuracy.
[0083] The different prompt word samples can be different in semantic density, different in syntactic structure, or different in both semantic density and syntactic structure.
[0084] The test information is sample information determined based on historical input information of the user and pre-set in a callable sample database by a person skilled in the art.
[0085] By setting a plurality of different prompt word samples, a plurality of different test work orders are obtained, and the optimal prompt word template is determined, which helps to ensure the guiding stability of the dynamic prompt word in multiple scenarios and generate reliable work orders.
[0086] A person skilled in the art can judge the test work order with the highest accuracy in combination with multiple evaluation indexes such as task information integrity, operation logic and business process compliance, safety constraints and compliance, and actual execution scene adaptability.
[0087] Taking the task information integrity as an example, satisfying the task information integrity can mean that the test work order contains all necessary information required to complete the task, such as device name, operation type and safety measures.
[0088] Taking the actual execution scene adaptability as an example, satisfying the actual execution scene adaptability can mean that the content of the test work order is consistent with the actual scene, the operation steps are executable and unambiguous, and will not be too general or dependent on non-existent conditions.
[0089] The embodiment of the present application further provides a non-transitory machine readable medium storing a computer program, wherein the computer program is used for enabling the computer to execute the method of the embodiment of the present application when the computer program is executed by a processor of the computer.
[0090] The embodiment of the present application further provides a computer program product comprising a computer program, wherein the computer program is used for enabling the computer to execute the method of the embodiment of the present application when the computer program is executed by a processor of the computer.
[0091] The embodiment of the present application further provides an electronic device comprising at least one processor and a memory connected with the at least one processor in communication. The memory stores a computer program capable of being executed by the at least one processor, and the computer program is used for enabling the electronic device to execute the method of the embodiment of the present application when the computer program is executed by the at least one processor.
[0092] Reference Figure 2 is a structural block diagram of an electronic device of a server or a client of the embodiment of the present application, which is an example of a hardware device that can be applied to each aspect of the present application. The electronic device is intended to represent various forms of digital electronic computer devices, such as a laptop computer, a desktop computer, a workstation, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as a personal digital processing, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown in this figure, their connections, and relationships, and their functions, are merely examples and are not intended to limit implementations of the present application described and / or claimed herein.
[0093] As Figure 2 shown, the electronic device includes a computing unit 201, which can perform various appropriate actions and processes according to 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. In the RAM 203, various programs and data required for the operation of the electronic device can also be stored. The computing unit 201, the read-only memory (ROM) 202, and the random access memory (RAM) 203 are connected to each other through a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.
[0094] A plurality of components in the electronic device are connected to the I / O interface 205, including an input unit 206, an output unit 207, a storage unit 208, and a communication unit 209. The input unit 206 can be any type of device capable of inputting information to the electronic device, and can receive inputted digital or character information, as well as generate key signal inputs related to user settings and / or function controls of the electronic device. The output unit 207 can be any type of device capable of presenting information, and can include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. The storage unit 208 can include, but is not limited to, a magnetic disk, an optical disk. The communication unit 209 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include, but is not limited to, a modem, a network card, an infrared communication device, and / or a wireless communication transceiver, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.
[0095] The computing unit 201 can be various general and / or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 201 include, but are not limited to, a CPU, a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing units, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 201 performs various methods and processes described above. For example, in some embodiments, the method embodiments of the present creation can be implemented as a computer program tangibly embodied in a machine-readable medium, such as the storage unit 208. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device via the ROM 202 and / or the communication unit 209. In some embodiments, the computing unit 201 can be configured to perform the above-described methods by any other appropriate means, such as by means of firmware.
[0096] The computer program for implementing the method embodiments of the present creation can be written in any combination of one or more programming languages. The computer program can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor or controller, produces the functions / operations specified in the flowcharts and / or the block diagrams. The computer program can be executed entirely on the machine, partially on the machine, partially on the machine as a stand-alone software package, and partially on a remote machine or server.
[0097] In the context of embodiments of the present invention, a machine-readable medium can be a tangible medium that contains or stores a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable signal medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, or infrared signals, or any suitable combination thereof. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a searchable electronic database or a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0098] It should be noted that the term "comprising" and variations thereof as used in the embodiments of the present invention are to be interpreted generically and do not exclude other steps. The term "based on" is to be interpreted as "based, at least in part, 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 terms "a" or "an", as used in the context of the embodiments of the present invention, are to be interpreted as "one or more". The terms "the first", "the second", etc. are used only as identifiers and do not imply a relative importance or a specific order of the technical features they are used to describe.
[0099] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the embodiments of the present invention are all information and data authorized by the user or fully authorized by all parties.
[0100] The steps described in the method embodiments provided by the embodiments of the present invention can be executed in different orders and / or in parallel. Furthermore, the method embodiments can include additional steps and / or omit the steps shown. The scope of protection of the present invention is not limited in this respect.
[0101] The word "implementation" in this description refers to the fact that the specific features, structures, or characteristics described in connection with an implementation can be included in at least one implementation of the invention. The occurrence of the phrase in various locations and repetitions of the phrase throughout the specification does not necessarily all refer to the same implementation, nor does it necessarily mean that other implementations are mutually exclusive or alternative. Each implementation described in this specification is described in a related manner, and the same or similar parts of each implementation refer to each other. In particular, for device, apparatus, system implementations, since they are basically similar to method implementations, the description is relatively simple, and the relevant parts refer to the part of the method implementation description.
[0102] The above-described implementations only express several implementation manners of the present invention, and the description is relatively specific and detailed, but it cannot be understood as a limitation on the protection scope. It should be noted that, for ordinary skilled persons in the art, under the premise of not departing from the inventive concept, a number of modifications and improvements can be made, which all belong to the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to 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
Power inspection method for generating work ticket based on similarity calculation
CN120634774A
