Security data generation method and device, storage medium and electronic device

By obtaining and filling the description information in the template library, generating structured prompt words and inputting them into a large language model, the problem of low efficiency in safety measures data generation in new energy power plants is solved, and higher quality and efficient safety measures data are achieved Generation ensures the safety of the power plant.

CN119416761APending Publication Date: 2025-02-11HUANENG CLEAN ENERGY RES INST
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202411440254.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The prior art is difficult to improve the generation quality and efficiency of safety measure data in operating tickets and working tickets of new energy power plants, resulting in an increase in the risk of safety accidents.

Method used

By obtaining the description information of the target task, using the description information to fill the placeholder information in the pre-constructed template library, generate structured prompt words, and input them into the pre-trained large language model to generate corresponding security data.

Benefits of technology

The quality and efficiency of generation of safety measures data in operation tickets and work tickets of new energy power plants have been improved, the errors and burdens of manual compilation have been reduced, and the safety of power plant personnel and equipment has been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119416761A_ABST
    Figure CN119416761A_ABST
Patent Text Reader

Abstract

The invention discloses a security data generation method and device, a storage medium and an electronic device.The method comprises the steps that description information of a target task is obtained, the description information at least comprises a first task attribute corresponding to an equipment type associated with the target task, a second task attribute corresponding to an operation type associated with the target task, and a third task attribute corresponding to an operation step associated with the target task; the description information is used for filling placeholder information in a target template, multiple structured cue words are obtained, and the target template is a cue word template which is retrieved from a pre-constructed template library and related to the target task; and screening out a target cue word from the plurality of structured cue words, and inputting the target cue word into a pre-trained large language model to obtain security data corresponding to the target cue word. The problem of how to improve the generation quality and the generation efficiency of the safety measure data corresponding to the operation ticket and the work ticket is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of intelligent device maintenance, and more specifically, to a method and device for generating security data, a storage medium, and an electronic device. Background Art

[0002] The "two tickets" system of new energy power plants is an important safety management tool, including work tickets and operation tickets, which are used to manage and control the safety of grassroots operators. The work ticket clarifies safety responsibilities and safety measures, and the operation ticket ensures the correct operation of the equipment. Safety measures are an important part of the "two tickets" and are of great significance to ensuring the safety of personnel and equipment. However, with the rapid construction of new energy power plants and the rapid update and iteration of new technology equipment, the interoperability relationship between various devices and equipment has become more complex, and the staff engaged in the preparation and implementation of safety measures such as power plant equipment troubleshooting and maintenance face huge challenges. The main problem is that in the actual work on site, personnel need to manually prepare the safety measures in the "two tickets" in combination with the maintenance scenario, the design drawings of the specific power station, and the requirements of the relevant system. Due to the uneven technical level of on-site personnel and the increasing workload of new energy operation and maintenance, the accuracy and efficiency of the safety measures in the "two tickets" compiled and verified completely manually can no longer meet the actual work needs, and may even cause safety accidents.

[0003] Regarding the problem of how to improve the generation quality and efficiency of safety measures data corresponding to operation tickets and work tickets in related technologies, no effective solution has been proposed so far.

[0004] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention

[0005] The embodiments of the present application provide a method and device for generating safety data, a storage medium and an electronic device to at least solve the problem of how to improve the generation quality and efficiency of safety measures data corresponding to setting operation tickets and work tickets.

[0006] According to one aspect of an embodiment of the present application, a method for generating security data is provided, comprising: obtaining descriptive information of a target task, wherein the descriptive information includes at least: a first task attribute corresponding to a device type associated with the target task, a second task attribute corresponding to an operation type associated with the target task, and a third task attribute corresponding to an operation step associated with the target task; using the descriptive information to fill in placeholder information in a target template to obtain a plurality of structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library; filtering out a target prompt word from the plurality of structured prompt words, inputting the target prompt word into a pre-trained large language model, and obtaining security data corresponding to the target prompt word.

[0007] In an exemplary embodiment, before the description information is used to fill the placeholder information in the target template to obtain multiple structured prompts, the above method also includes: receiving high-feature prompt words annotated by a domain expert object corresponding to the domain where the target task is located; using the high-feature prompt words as the initial content of the template library, and extracting historical prompt words from historical task data through text mining and pattern matching algorithms based on the initial content; sending the historical prompt words to the domain expert object for review; updating the template library according to the review results to obtain a pre-built template library for supporting retrieval.

[0008] In an exemplary embodiment, before using the description information to fill in the placeholder information in the target template to obtain multiple structured prompt words, the above method also includes: preprocessing the description information to obtain a first-category keyword set corresponding to the description information; extracting keyword information in each template in the pre-built template library to obtain multiple second-category keyword sets; calculating the keyword similarity between the first-category keyword set and each second-category keyword set to obtain multiple similarity values; arranging the multiple similarity values ​​according to a preset arrangement method, and selecting the template with the largest similarity as the target template.

[0009] In an exemplary embodiment, after the target prompt word is input into a pre-trained large language model to obtain security data corresponding to the target prompt word, the method further includes: determining the degree of match between the measure content corresponding to the security data and the reference measure content historically written by the domain expert object; and determining whether to update the pre-trained large language model used to generate security data based on the degree of match.

[0010] In an exemplary embodiment, determining whether to perform update training on a pre-trained large language model for generating security data is determined based on a matching degree, including: when it is determined that the matching degree is greater than or equal to a preset update matching degree, determining not to perform update training on the pre-trained large language model for generating security data; when it is determined that the matching degree is less than a preset update matching degree, determining to perform update training on the pre-trained large language model for generating security data.

[0011] In an exemplary embodiment, after the target prompt word is input into a pre-trained large language model to obtain security data corresponding to the target prompt word, the above method also includes: sending the measure content corresponding to the security data to a domain expert object for review; determining the target measure content that meets the target task based on the review result; adjusting the target measure content based on the task requirements of the target task to obtain the final measure for actual execution.

[0012] According to another aspect of an embodiment of the present application, a device for generating security data is also provided, including: an acquisition module, used to acquire description information of a target task, wherein the description information includes at least: a first task attribute corresponding to a device type associated with the target task, a second task attribute corresponding to an operation type associated with the target task, and a third task attribute corresponding to an operation step associated with the target task; a filling module, used to fill in placeholder information in a target template with the description information to obtain a plurality of structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library; a screening module, used to screen out a target prompt word from a plurality of structured prompt words, and input the target prompt word into a pre-trained large language model to obtain security data corresponding to the target prompt word.

[0013] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for generating security data when running.

[0014] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the method for generating security data through the computer program.

[0015] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program and the method for generating the above-mentioned security data when the computer program is executed by a processor.

[0016] Through this application, the description information of the target task is obtained, wherein the description information at least includes: the first task attribute corresponding to the equipment type associated with the target task, the second task attribute corresponding to the operation type associated with the target task, and the third task attribute corresponding to the operation step associated with the target task; the description information is used to fill the placeholder information in the target template to obtain multiple structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library; the target prompt word is screened out from the multiple structured prompt words, and the target prompt word is input into the pre-trained large language model to obtain the safety data corresponding to the target prompt word. The above technical solution solves the problem of how to improve the generation quality and generation efficiency of the safety measures data corresponding to the operation ticket and the work ticket. Furthermore, by using the prompt word optimization module to guide the pre-trained large language model to generate safety measures content that meets the requirements, the quality and efficiency of the safety measures generated in the operation ticket and work ticket of the new energy power plant are improved, the errors and burdens of manual compilation are reduced, and the safety of the power plant personnel and equipment is guaranteed. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0019] Figure 1 It is a hardware structure block diagram of a computer terminal of a method for generating security data in an embodiment of the present application;

[0020] Figure 2 is a flow chart of a method for generating security data according to an embodiment of the present application;

[0021] Figure 3 It is a flow chart of a method for generating "two tickets" safety measures for a new energy power plant based on a large language model according to an embodiment of the present application;

[0022] Figure 4 It is a structural block diagram of generation of security data according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] The method embodiments provided in the embodiments of the present application can be executed in a computer terminal, a mobile terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 1 is a hardware structure block diagram of a computer terminal of a method for generating security data in an embodiment of the present application. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor (Central Processing Unit, CPU) or a programmable logic device (Field Programmable Gate Array, FPGA)) and a memory 104 for storing data, wherein the above-mentioned computer terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for generating security data in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0027] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0028] In this embodiment, a method for generating security data is provided. Figure 2 is a flow chart of a method for generating security data according to an embodiment of the present application. Figure 2 As shown, the process includes the following steps S202-S206:

[0029] Step S202: Acquire description information of the target task, wherein the description information at least includes: a first task attribute corresponding to the device type associated with the target task, a second task attribute corresponding to the operation type associated with the target task, and a third task attribute corresponding to the operation step associated with the target task;

[0030] Step S204: using the description information to fill in the placeholder information in the target template to obtain a plurality of structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library;

[0031] Step S206: Filter out a target prompt word from the multiple structured prompt words, input the target prompt word into a pre-trained large language model, and obtain security data corresponding to the target prompt word.

[0032] The above steps obtain the description information of the target task, wherein the description information at least includes: the first task attribute corresponding to the equipment type associated with the target task, the second task attribute corresponding to the operation type associated with the target task, and the third task attribute corresponding to the operation step associated with the target task; use the description information to fill the placeholder information in the target template to obtain multiple structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library; select the target prompt word from the multiple structured prompt words, input the target prompt word into the pre-trained large language model, and obtain the safety data corresponding to the target prompt word. The above technical solution solves the problem of how to improve the generation quality and generation efficiency of the safety measures data corresponding to the operation ticket and the work ticket. Furthermore, by using the prompt word optimization module to guide the pre-trained large language model to generate safety measures content that meets the requirements, the quality and efficiency of the generation of safety measures in the operation ticket and work ticket of the new energy power plant are improved, the errors and burdens of manual compilation are reduced, and the safety of the power plant personnel and equipment is guaranteed.

[0033] In an exemplary embodiment, before the description information is used to fill the placeholder information in the target template to obtain multiple structured prompts, the above method also includes: receiving high-feature prompt words annotated by a domain expert object corresponding to the domain where the target task is located; using the high-feature prompt words as the initial content of the template library, and extracting historical prompt words from historical task data through text mining and pattern matching algorithms based on the initial content; sending the historical prompt words to the domain expert object for review; updating the template library according to the review results to obtain a pre-built template library for supporting retrieval.

[0034] It is understandable that the construction of the template library adopts a semi-automatic approach. First, a batch of high-quality prompt word templates are designed by domain experts as the initial content of the template library, including content such as overhaul, maintenance, and debugging. Then, text mining and pattern matching algorithms are used to automatically extract more templates from historical work tickets and operation tickets, such as fault descriptions, operation steps, safety precautions, etc. Specifically, text mining technology is used to analyze the text content of historical work tickets and operation tickets to identify key information and patterns. Common text mining technologies include natural language processing and word frequency statistics; pattern matching algorithms are used to automatically identify similarities in texts based on known templates and rules and extract them. Common pattern matching algorithms include regular expressions, machine learning algorithms, etc. New work ticket and operation ticket templates are generated based on the extracted templates and rules. These templates can include work steps, safety measures, equipment information, etc. Finally, after manual review and screening, the extracted templates are sorted and classified, and added to the template library to form a complete template library. The above method can not only save a lot of manpower and time costs, but also improve the accuracy and quality of the template, making the template library more complete and practical, and providing better support for safe production management.

[0035] In an exemplary embodiment, before using the description information to fill in the placeholder information in the target template to obtain multiple structured prompt words, the above method also includes: preprocessing the description information to obtain a first-category keyword set corresponding to the description information; extracting keyword information in each template in the pre-built template library to obtain multiple second-category keyword sets; calculating the keyword similarity between the first-category keyword set and each second-category keyword set to obtain multiple similarity values; arranging the multiple similarity values ​​according to a preset arrangement method, and selecting the template with the largest similarity as the target template.

[0036] Optionally, after preprocessing the operation tickets and work tickets of the "two tickets" work tasks of the new energy power plant, a first-category keyword set corresponding to the description information is obtained, such as keywords such as "wind turbine", "maintenance", "maintenance equipment", and "safety inspection". Then, the keyword information in each template is extracted from the pre-built template library to obtain multiple second-category keyword sets, such as Template 1 contains the keywords "wind turbine", "maintenance", and "safety inspection", and Template 2 contains the keywords "solar panel", "maintenance", and "regular inspection". Next, the keyword similarity between the first-category keyword set and each second-category keyword set is calculated to obtain multiple similarity values, such as the similarity value between the first-category keyword set and Template 1 is 0.8, and the similarity value with Template 2 is 0.6. Finally, the multiple similarity values ​​are arranged according to the preset arrangement method, and the template with the largest similarity is selected as the target template, that is, Template 1 is selected as the most matching template for executing the "two tickets" work tasks.

[0037] In an exemplary embodiment, after the target prompt word is input into a pre-trained large language model to obtain security data corresponding to the target prompt word, the method further includes: determining the degree of match between the measure content corresponding to the security data and the reference measure content historically written by the domain expert object; and determining whether to update the pre-trained large language model used to generate security data based on the degree of match.

[0038] Optionally, in the "two tickets" work of new energy power plants, for example, when formulating operation tickets and work tickets, you can use templates to generate prompt words to help write relevant safety data. For example, in the operation ticket, you can use templates to generate prompt words to list the operation steps, safety precautions, and emergency disposal measures; in the work ticket, you can use templates to generate prompt words to fill in the work process. After determining the degree of match between the measure content corresponding to the safety data and the reference measure content historically written by the domain expert object, it can be determined whether the pre-trained large language model used to generate safety data needs to be updated and trained based on the degree of match. By continuously updating and training, the accuracy and professionalism of the model can be improved to better meet the needs of different scenarios and task types. This ensures that the generated safety data is more in line with actual needs and standard requirements.

[0039] In an exemplary embodiment, determining whether to perform update training on a pre-trained large language model for generating security data is determined based on a matching degree, including: when it is determined that the matching degree is greater than or equal to a preset update matching degree, determining not to perform update training on the pre-trained large language model for generating security data; when it is determined that the matching degree is less than a preset update matching degree, determining to perform update training on the pre-trained large language model for generating security data.

[0040] It can be understood that in the above embodiment, whether to perform update training on the pre-trained large language model used to generate security data is determined based on the matching degree. Specifically, by calculating the matching degree between the measure content corresponding to the security data and the reference measure content historically written by the domain expert object, if the preset update matching degree is set to 0.8, if the matching degree between the measure content corresponding to the security data and the reference measure content historically written by the domain expert object is greater than or equal to 0.8, it is considered that the measure content corresponding to the security data is sufficiently matched with the pre-trained data of the large language model, and update training is not performed; if the matching degree is less than 0.8, it is considered that the model needs to be updated and trained to adapt to the new data sample. In this way, it is possible to flexibly decide whether to update the model according to the actual situation, thereby improving the efficiency and accuracy of the system.

[0041] In an exemplary embodiment, after the target prompt word is input into a pre-trained large language model to obtain security data corresponding to the target prompt word, the above method also includes: sending the measure content corresponding to the security data to a domain expert object for review; determining the target measure content that meets the target task based on the review result; adjusting the target measure content based on the task requirements of the target task to obtain the final measure for actual execution.

[0042] Optionally, a new energy power plant needs to perform a "two-ticket" work task, including the task prompt word of the operation ticket and the work ticket is "fire prevention measures under high temperature weather". This task prompt word is input into the pre-trained large language model to obtain the safety data corresponding to the target prompt word. Then send this data to the domain expert object for review. After the expert review, it is determined that the target measures that meet the target task are to increase the inspection frequency under high temperature weather and strengthen the equipment maintenance under high temperature. Based on the task requirements of the target task, the target measures are adjusted, such as increasing the frequency and content of employee emergency drills. Finally, the final measures for actual implementation are obtained to ensure that the fire prevention work of the power plant is fully prepared and guaranteed under high temperature weather. By sending the measure content corresponding to the safety data to the domain expert object for review, the scientificity and practicality of the measure content can be ensured, and the safety and reliability of the work task can be improved.

[0043] Obviously, the embodiments described above are only some embodiments of the present application, not all embodiments. In order to better understand the above method, the above process is described below in conjunction with the embodiments, but it is not intended to limit the technical solutions of the embodiments of the present application, specifically:

[0044] The optional embodiment of the present application provides a method for generating safety measures for "two tickets" of a new energy power plant based on a large language model to solve the problem of how to improve the generation quality and generation efficiency of safety measures data corresponding to the operation ticket and the work ticket. The method is based on a pre-trained large prediction model (Large Language Model 1, referred to as LLM), and guides the model to generate safety measures content that meets the requirements through a prompt word optimization module. Specifically, given a "two tickets" work task of a new energy power plant, first, retrieve the prompt word template related to the task from the template library, and fill the placeholder in the template according to the task attributes (such as equipment type, operation type, etc.) to obtain a structured prompt word. Then, using a keyword matching algorithm, calculate the semantic relevance between the prompt word and the task description, and filter out the optimal prompt word. Finally, the optimized prompt word is input into the pre-trained LLM to generate the corresponding safety measures content. This relies on its powerful understanding and generation capabilities, and realizes the automatic generation of safety measures according to known condition information, which can ensure that the safety measures content is more accurate and reliable.

[0045] Optionally, prompt engineering is a method of carefully constructing problem or task descriptions that can guide LLMs to more accurately understand and solve complex problems by carefully selecting vocabulary, adjusting sentence structure, and utilizing specific formats.

[0046] Alternatively, rather than being tediously trained for each new task, the LLM can be flexibly and instantly applied to a variety of new tasks. This application is called contextual learning, where the LLM is controlled via natural language task specifications or prompts. These prompts are defined by specific templates that contain placeholders for describing and displaying task inputs and outputs, thereby guiding the LLM's performance in new tasks.

[0047] Optionally, the prompt word optimization module includes two submodules: template library construction and keyword matching, which are responsible for the structured representation of prompt words and the calculation of semantic relevance, respectively. The details are as follows:

[0048] (1) Template library construction. The template library is the basis for prompt word optimization, which stores a large number of predefined prompt word templates, covering various scenarios and task types of the "two tickets" work of new energy power plants. Each template consists of a fixed sentence structure and fillable placeholders, which formally represent the basic format and elements of prompt words. Among them, placeholders are used to indicate task attributes, such as equipment name, operation steps, etc., which are filled in according to the actual task when applying the template. The construction of the template library comprehensively considers factors such as the equipment characteristics, operating procedures, and safety management requirements of new energy power plants. A semi-automated method is adopted, which specifically includes the following steps:

[0049] Step 1: Domain experts manually design a batch of high-quality prompt word templates based on their experience and knowledge as the initial content of the template library.

[0050] Optionally, to improve the reusability and generalization of templates, you need to follow the following principles when designing templates:

[0051] Principle 1: The template should have a clear sentence structure and semantic expression, and accurately convey task requirements and operating procedures;

[0052] Principle 2: The placeholders in the template should cover the key attributes of the task and correspond one-to-one with the attribute types;

[0053] Principle 3: Templates should be as concise and general as possible, avoiding overly complex and specialized descriptions;

[0054] Principle 4: The template library should have sufficient coverage and diversity to adapt to different types of work tasks.

[0055] Step 2: Use text mining and pattern matching algorithms to automatically extract and generalize more templates from historical work tickets and operation tickets, and add them to the template library after manual review and screening.

[0056] Optionally, the process of template library construction can be formally expressed as:

[0057] T=T manual ∪T auto ;

[0058] Where T represents the template library, T manual represents the set of manually designed templates, T auto Represents a collection of templates for automatic mining.

[0059] (2) Keyword matching. When applying templates to generate prompt words, it is necessary to select the template that is most relevant to the task from the template library. Through the keyword matching method, the semantic relevance between the task description and the template is calculated as the basis for template selection. Specifically, the following steps are included:

[0060] Step 1: Preprocess the task description, extract the keywords, and assign weights. Keywords can be extracted using algorithms such as TF-IDF and TextRank, and weights are calculated based on factors such as word frequency, part of speech, and position.

[0061] Step 2: For each candidate template, extract the keywords and calculate the matching degree with the task keywords. The matching degree is calculated by using methods such as cosine similarity, taking into account the weight and semantic distance of the keywords.

[0062] Step 3: Select the template with the highest matching degree as the optimal template, fill in the task attributes to generate the final prompt word.

[0063] Alternatively, the keyword matching process can be formally expressed as:

[0064]

[0065] Among them, t* represents the optimal template selected, w q and w t They represent the keyword weight vectors of task description and template respectively, and cos() represents the cosine similarity function.

[0066] Optional, Figure 3 It is a flow chart of a method for generating "two tickets" safety measures for a new energy power plant based on a large language model according to an embodiment of the present application; specifically, it includes the following steps:

[0067] Step 1: Enter the task description. Enter the description of the task, including equipment type, operation type, operation steps, etc.

[0068] Step 2: Description preprocessing: Preprocess the task description, extract keywords and calculate weights;

[0069] Step 3: Template retrieval. Retrieve candidate templates from the template library and calculate the matching degree between each template and the keywords in the task description;

[0070] Step 4: Fill in task attributes. Select the template with the highest matching degree, fill in task attributes, and generate optimized prompt words;

[0071] Step 5: Input the large model to generate safety measures. Input the prompt words into the pre-trained LLM to generate the corresponding safety measures content;

[0072] Step 6: Post-processing: Post-process the generated security measures content, such as format adjustment, error correction, etc., to obtain the final result.

[0073] Optionally, in order to evaluate the effectiveness of the above method, the leave-one-out method is used to evaluate the above method, that is, a sample is randomly selected from the data set as a test case each time, and the remaining samples are used for template library construction and prompt word optimization. For each test case, the optimized prompt words are used to generate safety measures content and compared with the manually written content. The evaluation indicator is the BLEU score: it is used to evaluate the n-gram matching between the generated content and the reference content, reflecting the fluency and accuracy of the generated quality.

[0074] Optionally, n-gram is a method for measuring text similarity by comparing the number of n consecutive items (n consecutive words or characters) that co-occur in the text to determine the degree of similarity between the texts. Specifically, n-gram counts the number of identical n-grams in two texts and evaluates their similarity based on this number. Generally, the higher the n-gram match, the more similar the two texts are.

[0075] Optionally, the BLEU score is calculated as:

[0076]

[0077] Among them, BP is the penalty factor, w n is the weight of the n-gram, p n is the precision of n-gram.

[0078] It should be noted that when filling in the prompt word template, it is necessary to ensure that the filled information accurately reflects the specific attributes of the task in order to generate structured prompt words. At the same time, ensure that the pre-trained LLM model can accurately understand the prompt words when generating security measures content and generate content that meets the requirements. In addition, it is also necessary to pay attention to the stability of the model to avoid unstable or unexpected generated content. When using the pre-trained LLM model to generate security measures content, it is necessary to ensure that the generated content does not leak sensitive information. At the same time, it is necessary to consider data security and privacy protection issues to avoid information leakage and data risks.

[0079] In summary, the optional embodiment of the present application can quickly generate structured prompt words by retrieving relevant prompt word templates from the template library and filling in placeholders, reducing the time and effort of manually writing safety measures content. By using the keyword matching algorithm to calculate the semantic relevance between the prompt words and the task description, the prompt words that best meet the requirements can be screened out, thereby generating safety measures content that better meets actual needs. Specifically, through keyword extraction and weight calculation, the core semantic information of the task description can be effectively captured; using metrics such as cosine similarity, the correlation between the task and the template can be quantitatively evaluated to improve the accuracy of template selection; the matching process is simple and efficient, easy to implement and optimize, and suitable for large-scale online applications. By inputting the optimized prompt words into the pre-trained LLM, the powerful language generation ability of the deep learning model can be used to generate more organized and logical safety measures content. The above method can flexibly adjust the settings of the prompt word template and the keyword matching algorithm according to different task attributes and requirements to generate safety measures content that meets specific requirements.

[0080] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0081] In this embodiment, a device for generating security data is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0082] Figure 4 : is a structural block diagram of a device for generating security data according to an embodiment of the present application, the device comprising:

[0083] An acquisition module 42 is used to acquire description information of the target task, wherein the description information at least includes: a first task attribute corresponding to a device type associated with the target task, a second task attribute corresponding to an operation type associated with the target task, and a third task attribute corresponding to an operation step associated with the target task;

[0084] A filling module 44 is used to fill the placeholder information in the target template with the description information to obtain a plurality of structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library;

[0085] The screening module 46 is used to screen out a target prompt word from the multiple structured prompt words, input the target prompt word into a pre-trained large language model, and obtain security data corresponding to the target prompt word.

[0086] The above device obtains description information of the target task, wherein the description information at least includes: a first task attribute corresponding to the equipment type associated with the target task, a second task attribute corresponding to the operation type associated with the target task, and a third task attribute corresponding to the operation step associated with the target task; uses the description information to fill in the placeholder information in the target template to obtain multiple structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library; selects the target prompt word from the multiple structured prompt words, inputs the target prompt word into the pre-trained large language model, and obtains the safety data corresponding to the target prompt word. The above technical solution solves the problem of how to improve the generation quality and generation efficiency of the safety measures data corresponding to the operation ticket and the work ticket. Furthermore, by using the prompt word optimization module to guide the pre-trained large language model to generate safety measures content that meets the requirements, the quality and efficiency of the generation of safety measures in the operation ticket and work ticket of the new energy power plant are improved, the errors and burdens of manual compilation are reduced, and the safety of the power plant personnel and equipment is guaranteed.

[0087] In an exemplary embodiment, the above-mentioned device also includes: a receiving module, which is used to use the description information to fill in the placeholder information in the target template, and before obtaining multiple structured prompts, receive high-feature prompt words annotated by the domain expert object corresponding to the domain where the target task is located; use the high-feature prompt words as the initial content of the template library, and extract historical prompt words from historical task data through text mining and pattern matching algorithms based on the initial content; send the historical prompt words to the domain expert object for review; update the template library according to the review results to obtain a pre-built template library for supporting retrieval.

[0088] In an exemplary embodiment, the above-mentioned device also includes: an extraction module, which is used to use the description information to fill the placeholder information in the target template, and before obtaining multiple structured prompt words, pre-process the description information to obtain a first-category keyword set corresponding to the description information; extract the keyword information in each template in the pre-built template library to obtain multiple second-category keyword sets; calculate the keyword similarity between the first-category keyword set and each second-category keyword set to obtain multiple similarity values; arrange the multiple similarity values ​​according to a preset arrangement method, and select the template with the largest similarity as the target template.

[0089] In an exemplary embodiment, the above-mentioned device also includes: a determination module, which is used to input the target prompt word into a pre-trained large language model, and after obtaining the security data corresponding to the target prompt word, determine the matching degree between the measure content corresponding to the security data and the reference measure content historically written by the domain expert object; and determine whether to update the pre-trained large language model used to generate security data based on the matching degree.

[0090] In an exemplary embodiment, the above-mentioned determination module is also used to determine that when it is determined that the matching degree is greater than or equal to a preset update matching degree, update training is not performed on the pre-trained large language model used to generate security data; when it is determined that the matching degree is less than the preset update matching degree, update training is performed on the pre-trained large language model used to generate security data.

[0091] In an exemplary embodiment, the above-mentioned device also includes: a sending module, which is used to input the target prompt word into a pre-trained large language model, and after obtaining the security data corresponding to the target prompt word, send the measure content corresponding to the security data to the domain expert object for review; determine the target measure content that meets the target task based on the review result; adjust the target measure content based on the task requirements of the target task to obtain the final measure for actual execution.

[0092] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0093] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0094] S1. Obtain description information of a target task, wherein the description information includes at least: a first task attribute corresponding to a device type associated with the target task, a second task attribute corresponding to an operation type associated with the target task, and a third task attribute corresponding to an operation step associated with the target task;

[0095] S2, using the description information to fill in the placeholder information in the target template to obtain a plurality of structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library;

[0096] S3. Filter out a target prompt word from the multiple structured prompt words, input the target prompt word into a pre-trained large language model, and obtain security data corresponding to the target prompt word.

[0097] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0098] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0099] An embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, the steps in any one of the above method embodiments are performed.

[0100] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above method embodiments are implemented.

[0101] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0102] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0103] S1. Obtain description information of a target task, wherein the description information includes at least: a first task attribute corresponding to a device type associated with the target task, a second task attribute corresponding to an operation type associated with the target task, and a third task attribute corresponding to an operation step associated with the target task;

[0104] S2, using the description information to fill in the placeholder information in the target template to obtain a plurality of structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library;

[0105] S3. Filter out a target prompt word from the multiple structured prompt words, input the target prompt word into a pre-trained large language model, and obtain security data corresponding to the target prompt word.

[0106] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0107] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0108] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0109] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for generating security data, characterized in that: include: Acquire description information of the target task, wherein the description information at least includes: a first task attribute corresponding to a device type associated with the target task, a second task attribute corresponding to an operation type associated with the target task, and a third task attribute corresponding to an operation step associated with the target task; Filling placeholder information in a target template with the description information to obtain a plurality of structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library; A target prompt word is selected from the multiple structured prompt words, and the target prompt word is input into a pre-trained large language model to obtain security data corresponding to the target prompt word.

2. The method according to claim 1, characterized in that Before filling the placeholder information in the target template with the description information to obtain a plurality of structured prompts, the method further includes: Receiving high-feature prompt words annotated by domain expert objects corresponding to the domain where the target task is located; Using the high-characteristic prompt words as the initial content of the template library, and extracting historical prompt words from the historical task data through text mining and pattern matching algorithms based on the initial content; Sending the historical prompt words to the domain expert object for review; The template library is updated according to the audit result to obtain a pre-built template library for supporting retrieval.

3. The method according to claim 1, characterized in that Before filling the placeholder information in the target template with the description information to obtain a plurality of structured prompt words, the method further includes: Preprocessing the description information to obtain a first-category keyword set corresponding to the description information; extracting keyword information from each template in the pre-built template library to obtain multiple second-category keyword sets; Calculating the keyword similarity between the first keyword set and each second keyword set to obtain a plurality of similarity values; The multiple similarity values ​​are arranged in a preset manner, and the template with the greatest similarity is selected as the target template.

4. The method according to claim 1, characterized in that: After inputting the target prompt word into a pre-trained large language model to obtain security data corresponding to the target prompt word, the method further includes: determining a degree of matching between the measure content corresponding to the security data and the reference measure content historically written by the domain expert object; Determine whether to perform update training on a pre-trained large language model used to generate the security data according to the matching degree.

5. The method according to claim 4, characterized in that Determining whether to perform update training on a pre-trained large language model used to generate the security data according to the matching degree includes: In a case where it is determined that the matching degree is greater than or equal to a preset update matching degree, determining not to perform update training on the pre-trained large language model used to generate the security data; When it is determined that the matching degree is less than a preset update matching degree, it is determined to perform update training on the pre-trained large language model used to generate the security data.

6. The method according to claim 1, characterized in that After inputting the target prompt word into a pre-trained large language model to obtain security data corresponding to the target prompt word, the method further includes: sending the measure content corresponding to the security data to a domain expert object for review; Determine the content of target measures to meet the stated objectives and tasks based on the audit results; The target measure content is adjusted based on the task requirements of the target task to obtain final measures for actual execution.

7. A device for generating security data, characterized in that: include: An acquisition module, used to acquire description information of a target task, wherein the description information at least includes: a first task attribute corresponding to a device type associated with the target task, a second task attribute corresponding to an operation type associated with the target task, and a third task attribute corresponding to an operation step associated with the target task; A filling module, used to fill the placeholder information in the target template with the description information to obtain a plurality of structured prompt words, wherein the target template is a prompt word template related to the target task retrieved from a pre-built template library; The screening module is used to screen out a target prompt word from the multiple structured prompt words, input the target prompt word into a pre-trained large language model, and obtain security data corresponding to the target prompt word.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 6 when executed.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Construction engineering quality control rule set generation method fusing large model and process data chain

    CN119783808A

  • Pedestrian retrieval task data set construction method based on text description

    CN119807466A

  • A method for constructing a dataset for pedestrian retrieval tasks based on text description

    CN119807466B

  • Electrical work ticket safety measure intelligent checking method based on safety measure knowledge base

    CN121327191A

  • Safety measure intelligent checking method based on electrical work ticket safety measure knowledge base

    CN121327191B