Search

CN-122021588-A - Rail transit process file generation method and device based on large language model

CN122021588ACN 122021588 ACN122021588 ACN 122021588ACN-122021588-A

Abstract

The invention provides a track traffic process file generation method and device based on a large language model, wherein the method comprises the steps of responding to a process programming request, obtaining process data to be filled generated by using the large language model, analyzing a preset process file template, identifying preset positioning placeholders in the process file template, establishing a mapping relation between the process data to be filled and the positioning placeholders, injecting the process data to be filled into corresponding positions of the process file template based on the mapping relation, rendering the process data to be filled according to format attributes of the positioning placeholders to generate a target process file, and realizing organic combination of content generation and format control through a decoupling design of template analysis and data injection, so that the generated process file meets high standard requirements of the track traffic industry in terms of content accuracy, format normalization and version consistency.

Inventors

  • ZHU WEN
  • CHENG YONGCHAO
  • Hao Jiangyi
  • YAO TINGTING
  • HU HAO
  • LIU QI
  • TANG HAICHUAN
  • TIAN YIN
  • ZHAO MINGYUAN
  • BI JIAPENG
  • LI XUDONG
  • ZHANG JIAQI

Assignees

  • 中车工业研究院有限公司
  • 中车科技创新(北京)有限公司

Dates

Publication Date
20260512
Application Date
20251203

Claims (12)

  1. 1. The track traffic process file generation method based on the large language model is characterized by comprising the following steps of: Responding to a process compiling request, and acquiring process data to be filled, which is generated by utilizing a large language model; analyzing a preset process file template, and identifying a preset positioning placeholder in the process file template; Establishing a mapping relation between the process data to be filled and the positioning placeholder; and injecting the process data to be filled into the corresponding position of the process file template based on the mapping relation, and rendering the process data to be filled according to the format attribute of the positioning placeholder to generate a target process file.
  2. 2. The method of claim 1, wherein obtaining process data to be populated generated using a large language model in response to a process orchestration request comprises: Constructing a prompt word instruction comprising character setting, a process knowledge background and an output structure definition based on the process compiling request; Inputting the prompt word instruction into a large language model to generate a response text; And analyzing the response text, extracting a data entity in the form of a key value pair, and determining the data entity as the process data to be filled.
  3. 3. The method of claim 2, further comprising, prior to parsing the response text to extract the data entity in the form of a key-value pair: Carrying out structural validity check on the response text through a parser; if the verification fails, extracting an error log and feeding back to the large language model for correction until the response text passes the verification, so as to ensure that the extracted process data to be filled meets the preset data structure requirement.
  4. 4. The method of claim 1, wherein parsing the pre-set process file template to identify pre-set location placeholders therein comprises: Traversing text nodes in the process file template by using a regular expression, and extracting character strings containing type identifiers and name identifiers as the positioning placeholders; the type identifier is used for indicating processing logic called in subsequent rendering, and at least comprises a text type, an image type and a table type, and the name identifier is used for indicating a data key name corresponding to the positioning placeholder.
  5. 5. The method of claim 4, wherein the positioning placeholder comprises a text type, the process data to be populated comprising the text data; Based on the mapping relation, the process data to be filled is injected into the corresponding position of the process file template, and rendered according to the format attribute of the positioning placeholder, and a target process file is generated, wherein the process file comprises the following steps: based on the mapping relation, locating a text operation block of the locating placeholder in the process file template, and determining the text operation block as an injection position; Reading the font family, the font size, the font color and the thickening state of the text operation block as the format attribute; And clearing the original content of the text operation block, injecting the process data to be filled into the text operation block, and applying the format attribute to the injected process data to be filled to generate the target process file.
  6. 6. The method of claim 5, wherein locating the text run block to which the locating placeholder belongs in the process file template, determining it as an injection location, comprises: detecting whether the positioning placeholder is stored in a plurality of text running blocks in succession in a split manner; if yes, determining the first text operation block in the continuous text operation blocks as an anchor operation block, and marking the rest text operation blocks as operation blocks to be cleaned; The original content of the text operation block is emptied, and the process data to be filled is injected into the text operation block, comprising: and clearing the contents of the anchor point operation block and the operation block to be cleaned, and injecting the process data to be filled into the anchor point operation block.
  7. 7. The method of claim 4, wherein the positioning placeholder comprises an image type, the process data to be filled comprising the image data; Based on the mapping relation, the process data to be filled is injected into the corresponding position of the process file template, and rendered according to the format attribute of the positioning placeholder, and a target process file is generated, wherein the process file comprises the following steps: judging whether the positioning placeholder is positioned in a table cell of a process file template or not based on the mapping relation, if so, determining the table cell containing the positioning placeholder as the corresponding position; Analyzing the image data in the process data to be filled, obtaining the original size of the image data, and obtaining the width size of the table cells as the format attribute; calculating the ratio of the original dimension to the width dimension; and if the original size is larger than the width size, reducing the image data according to the ratio, and injecting the reduced image data into the table cells to finish rendering of the image data, so as to generate the target process file.
  8. 8. The method of claim 4, wherein the positioning placeholder comprises a form type, the process data to be filled comprising the form data; Based on the mapping relation, the process data to be filled is injected into the corresponding position of the process file template, and rendered according to the format attribute of the positioning placeholder, and a target process file is generated, wherein the process file comprises the following steps: positioning a template row containing the positioning placeholders based on the mapping relation, and determining the reference injection position of the template row; reading the frame line type, background color and paragraph alignment mode of each cell in the template line as the format attribute; copying and generating a corresponding number of new rows below the reference injection position according to the data row number of the table data; Writing the table data into the reference injection position and the new line by line, and applying the read format attribute to the reference injection position and the new line to complete the structured rendering of the table data and generate the target process file.
  9. 9. A large language model-based track traffic process file generation device, comprising: the data acquisition module is used for responding to the process compiling request and acquiring process data to be filled generated by utilizing the large language model; the data analysis module is used for analyzing a preset process file template and identifying a preset positioning placeholder in the process file template; The mapping establishing module is used for establishing a mapping relation between the process data to be filled and the positioning placeholders; and the process file generation module is used for injecting the process data to be filled into the corresponding position of the process file template based on the mapping relation, and rendering the process data to be filled according to the format attribute of the positioning placeholder to generate a target process file.
  10. 10. An electronic device comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor implements the large language model based rail transit process file generation method of any one of claims 1 to 8 when executing the computer program.
  11. 11. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the large language model based rail transit process file generation method according to any one of claims 1 to 8.
  12. 12. A computer program product comprising a computer program which, when executed by a processor, implements the large language model based rail transit process file generation method of any one of claims 1 to 8.

Description

Rail transit process file generation method and device based on large language model Technical Field The invention relates to the technical field of rail transit, in particular to a rail transit process file generation method and device based on a large language model. Background With the increasing of the integration level and complexity of manufacturing systems of rail traffic equipment (such as motor train units, subway vehicles and magnetic levitation trains), higher requirements are put on the safety, reliability and maintainability of products. The process file (including technical regulations, operation instruction book, inspection standard, etc.) is used as a tie for connecting product design and field manufacture, and is a core technical document for guiding production operation, guaranteeing product quality and safe operation. In the field of rail transit manufacturing, the number of process files is huge, extremely high standard requirements are provided for format normalization, content accuracy and version consistency, and the compiling efficiency and quality directly influence the delivery cycle and manufacturing cost of products. At present, the process files in the rail transit industry are mainly compiled in the following modes that firstly, a large number of design drawings and standard data are required to be consulted by process staff, the process staff are compiled Word by Word in Word or Excel, typesetting is manually adjusted, secondly, structured data (such as a BOM table) are filled into a fixed template by utilizing a VBA macro or mail merging function based on a rule automation tool, thirdly, text contents are generated in a dialogue mode by utilizing a universal large language model (such as ChatGPT and the like) in an attempt, and then manually copied and pasted into the files. However, the above approaches all have significant drawbacks: the manual compiling mode is low in efficiency and easy to make mistakes, and highly depends on personal experience, so that the styles of files compiled by different personnel are not uniform, and frequent changes caused by rapid iteration of products are difficult to adapt. The rule-based tool can only realize simple handling of data, can not generate descriptive process texts (such as specific operation step descriptions and notes), and has stiff templates and high maintenance cost. The direct use of the general large model has content generation capability, but lacks control capability on strict format of industrial documents, the generated text often has marks, styles such as fonts, form borders, image layout and the like cannot be accurately controlled, and non-professional illusion content is easy to generate. Therefore, how to deeply integrate the semantic understanding and generating capability of a large language model with the strict format control requirement of an industrial document and realize the dual automation of the process file content and format is a technical problem to be solved currently. Disclosure of Invention The invention provides a rail transit process file generation method and device based on a large language model, which are used for solving the defects that in the prior art, manual compiling process files are low in efficiency and nonuniform in format, descriptive contents cannot be generated by a traditional automatic tool, and industrial-grade strict typesetting standards are difficult to be met by directly generating documents by a general large model. The invention provides a rail transit process file generation method based on a large language model, which comprises the following steps: Responding to a process compiling request, and acquiring process data to be filled, which is generated by utilizing a large language model; analyzing a preset process file template, and identifying a preset positioning placeholder in the process file template; Establishing a mapping relation between the process data to be filled and the positioning placeholder; and injecting the process data to be filled into the corresponding position of the process file template based on the mapping relation, and rendering the process data to be filled according to the format attribute of the positioning placeholder to generate a target process file. According to the method provided by the invention, the process data to be filled generated by using the large language model is obtained in response to the process compiling request, and the method comprises the following steps: Constructing a prompt word instruction comprising character setting, a process knowledge background and an output structure definition based on the process compiling request; Inputting the prompt word instruction into a large language model to generate a response text; And analyzing the response text, extracting a data entity in the form of a key value pair, and determining the data entity as the process data to be filled. The method provided by the invention further c