A planning and design long text intelligent generation method and system based on thought chain reasoning

CN122904864APending Publication Date: 2026-10-13CHINA INFOMRAITON CONSULTING & DESIGNING INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611090604.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

但实际应用中发现,其存在“行业适配不足”的问题,由于通用大模型缺乏专业领域知识,对专业术语理解和工程逻辑推理的能力不足,导致生成的内容发散,且格式混乱,不符合工程标准,难以直接应用于规划设计等专业场景

Benefits of technology

[0047]通过数据结构化与SQL聚类优化,实现数据库自动精准取数,降低人工数据整理与查询成本,提升数据调用准确性与效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122904864A_ABST
    Figure CN122904864A_ABST
Patent Text Reader

Abstract

The application discloses a kind of planning design long text intelligent generation method and system based on thought chain reasoning, the method includes: step 1, collect the data table in planning design long text, carry out structured processing, obtain two-dimensional table, two-dimensional table is stored in database with coordinate form;Step 2, obtain data acquisition SQL language set;Step 3, input data acquisition SQL language set into general large model learning, make it learn to write SQL statement according to standard format, automatically read database, obtain the required data, obtain industry special large model;Step 4, split professional long text into multiple short texts, carding logic thought chain to short text;Step 5, convert logic thought chain into formatted thought chain;Step 6, industry special large model according to user instruction, automatically obtain required data, generate format standard, content complete planning design long text.The method and system can efficiently and accurately generate text, without manual modification and post-audit, improve the efficiency and quality of professional personnel when writing planning design long text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence content generation technology, and in particular relates to a method and system for intelligently generating long texts based on thought chain reasoning. Background Technology

[0002] Driven by the development of the digital economy, the communications planning and design industry is at a critical juncture of technological iteration and business transformation, facing the triple challenges of increasingly complex network architecture, diversified business scenarios, and agile design delivery. The traditional manual planning and design model, due to the length and content of planning and design documents and low writing efficiency, has resulted in slow delivery progress and is no longer able to meet the requirements of rapid development in the new era.

[0003] The parameter scale of current general-purpose large-scale models has jumped from tens of billions to trillions, and their natural language understanding and text generation capabilities are approaching human levels. Theoretically, they can be used to generate long texts for planning and design. However, in practical applications, it has been found that they have the problem of "insufficient industry adaptability." Due to the lack of professional domain knowledge and insufficient ability to understand professional terminology and reason about engineering logic, the generated content is scattered, has a messy format, does not meet engineering standards, and is difficult to apply directly to professional scenarios such as planning and design.

[0004] Therefore, industry-specific large-scale models, with their deep adaptation to professional fields, are becoming the core direction for the practical application of AI-generated content. Summary of the Invention

[0005] Purpose of the invention: The technical problem to be solved by the present invention is to provide a method and system for intelligent generation of long texts for planning and design based on thought chain reasoning, which addresses the shortcomings of the existing technology.

[0006] To address the aforementioned technical issues, firstly, a method for intelligently generating long texts related to planning and design based on thought chain reasoning is disclosed, comprising:

[0007] Step 1: Collect the data tables involved in the long planning and design text, perform structured processing on the data tables to obtain two-dimensional tables, and store the two-dimensional tables in the form of coordinates in the database;

[0008] Step 2: Construct the source SQL language set, perform cluster analysis on the source SQL language set, and obtain the data acquisition SQL language set;

[0009] Step 3: Input the SQL language set obtained from the data into the general large model for learning to obtain an industry-specific large model. The industry-specific large model can write SQL statements according to the standard format, automatically read the database, and obtain the required data.

[0010] Step 4: Break down the long professional text into multiple short texts, organize the logical thinking chain of each short text, and define the writing reasoning logic, format requirements, and content requirements of the professional text.

[0011] Step 5: Transform the logical thinking chain into a formatted thinking chain that is easy for industry-specific large models to understand;

[0012] Step 6: The industry-specific large model automatically acquires the required data according to user instructions and automatically generates a long planning and design text with standard format and complete content based on the formatted thinking chain.

[0013] Further, step 2 includes:

[0014] Step 2-1: Collect all SQL statements and assemble the source SQL statement set;

[0015] Step 2-2: Use a clustering algorithm to perform K-means clustering analysis on the source SQL language set to obtain the data acquisition SQL language set and other SQL language sets.

[0016] Further, step 3 includes: step 3-1, associating the data acquisition SQL language set with the two-dimensional table coordinate information and the text chapter type in the long text of planning and design to construct text data acquisition training samples; each training sample includes user instructions, chapter type, target data table, field name, field alias, field unit, field type, cell coordinates, standard SQL statement and SQL execution result;

[0017] Step 3-2: Jointly encode the field name, field alias, field unit, field type, and cell coordinates to form a field coordinate fusion feature; based on the field coordinate fusion feature, the general model first determines the mapping relationship between the business fields in the user command and the database fields, and then generates the corresponding SQL statement;

[0018] Step 3-3: Input the data training samples into the general large model for training. During training, freeze the basic parameters of the general large model and train only the data acquisition adapter parameters. During the training of the general large model, learn three objectives simultaneously: field mapping, coordinate matching, and SQL generation, and dynamically adjust the weights of each objective based on the validation results.

[0019] Steps 3-4: Low randomness inference parameters are used in the SQL generation stage, and the temperature parameters in the SQL generation stage are lower than those in the long text generation stage; at the same time, the large model is limited to generating only data reading SQL statements.

[0020] Steps 3-5 involve performing syntax validation, target table validation, target field validation, field coordinate validation, and permission validation on the SQL statements generated by the general large model; after passing the validation, the SQL statements are executed and data is retrieved.

[0021] After the above training, an industry-specific large model adapted to the planning and design is obtained.

[0022] Furthermore, step 4 includes:

[0023] Step 4-1: Break down the long professional text into multiple short texts to decompose the task;

[0024] Step 4-2: For each short text, analyze the data that needs to be read from the database, the mathematical calculation rules between the data, the text description methods, the content layout format, clarify the writing logic, and guide the industry-specific large model to perform reasoning.

[0025] Furthermore, step 5 includes: refining the content in the logical thinking chain, marking the reasoning steps, and clarifying the execution content of each step.

[0026] Furthermore, step 5 includes: in the first step of intelligent data retrieval, the industry-specific large model automatically retrieves the required data from the database according to the user's instructions; in the second step of calculation rules, calculation rules are set to calculate the target data from the retrieved required data; in the third step of outputting text or a table, when outputting text, the precautions for generating text based on the template are specified; when outputting a table, the coordinate values ​​and table format are specified.

[0027] Further, step 1 includes:

[0028] Step 1-1: Collect all data tables involved in the long planning and design document;

[0029] Steps 1-2: Structure the different forms of tables and convert them into two-dimensional tables. Each cell in the table can be uniquely identified by coordinates (a, b), where a represents the a-th row and b represents the b-th column.

[0030] Steps 1-3 involve mapping the cell values ​​to coordinates and then storing the coordinate information in the database.

[0031] Furthermore, step 2-2 includes:

[0032] Step 2-2-1, define the source SQL language set as Where n is the number of SQL language samples, For SQL language samples, the number of clusters is defined as K, where K≥2;

[0033] Step 2-2-2: Randomly select K SQL language samples from the source SQL language set as initial cluster centers, defined as... , i.e., the initial value of the cluster centers;

[0034] Step 2-2-3: Calculate the Euclidean distance for each SQL language sample. with the j-th cluster center The distance between them; for each SQL language sample All n samples are classified into K clusters by the minimum distance between them. ;

[0035] Step 2-2-4, for each cluster Let the number of samples within a cluster be... The cluster centers are updated according to the mean of the samples within the cluster, resulting in a new round of cluster centers;

[0036] Step 2-2-5: Repeat steps 2-2-3 and 2-2-4 until the cluster centers no longer change, and finally obtain the data retrieval SQL language set.

[0037] Furthermore, in step 2-2-1, the number of uppercase characters in each SQL statement of the source SQL language set is used as the SQL language sample value. .

[0038] Secondly, a long text intelligent generation system for planning and design based on thought chain reasoning is disclosed, including a data preprocessing module, a data acquisition module, a thought chain generation module, and a long text generation module.

[0039] The data preprocessing module is used to collect data tables involved in the long planning and design text, perform structured processing on the data tables to obtain a two-dimensional table, and store the two-dimensional table in the form of coordinates in the database.

[0040] The data acquisition module is used to construct a source SQL language set, perform cluster analysis on the source SQL language set to obtain a data acquisition SQL language set, and input the data acquisition SQL language set into a general large model for learning to obtain an industry-specific large model. The industry-specific large model can write SQL statements according to a standard format, automatically read the database, and obtain the required data.

[0041] The thought chain generation module is used to break down long professional texts into multiple short texts, organize the logical thought chain for each short text, define the writing reasoning logic, format requirements and content requirements of professional texts, and transform the logical thought chain into a formatted thought chain that is easy for industry-specific large models to understand.

[0042] The long text generation module is used to automatically obtain the required data according to user instructions from the industry-specific large model, and automatically generate long texts with standard format and complete content based on the formatted thinking chain.

[0043] Beneficial Effects: This invention provides a method and system for intelligently generating long-form planning and design texts based on thought chain reasoning. It can generate standardized, professional long-form texts according to user needs. Only some necessary data is required; the system can efficiently and accurately generate texts without manual modification or post-review, improving the efficiency and quality of professionals writing long-form planning and design texts. Specifically, it includes:

[0044] 1. Deep industry adaptation

[0045] Customized large-scale models are designed for communication planning and design scenarios. By combining thought chain reasoning to lock in professional writing logic, the model solves the problems of insufficient industry adaptability, divergent content, and chaotic format of general large-scale models, and generates text that meets engineering standards.

[0046] 2. Accurate and efficient data processing

[0047] By optimizing data structuring and SQL clustering, we can achieve automatic and accurate data retrieval from the database, reduce the cost of manual data processing and querying, and improve the accuracy and efficiency of data retrieval.

[0048] 3. Stable and controllable product quality

[0049] By breaking down long texts and formatting their thought processes, the reasoning steps and formatting requirements are clearly defined, ensuring that the output is standardized and logically rigorous, eliminating the need for extensive manual modification and review. Attached Figure Description

[0050] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments, and the advantages of the present invention in the above and / or other aspects will become clearer.

[0051] Figure 1 This is an architecture diagram of a long text intelligent generation system based on thought chain reasoning provided in an embodiment of this application.

[0052] Figure 2 This is a schematic diagram of the thinking chain reasoning in a long text intelligent generation method based on thinking chain reasoning provided in an embodiment of this application.

[0053] Figure 3 This is an interface diagram of a long text intelligent generation method based on thought chain reasoning provided in an embodiment of this application. Detailed Implementation

[0054] The embodiments of the present invention will now be described with reference to the accompanying drawings.

[0055] This invention proposes a method and system for intelligent generation of long texts for planning and design based on thought chain reasoning, aiming to create a large-scale model specifically for the planning and design industry and solve the problem that general-purpose large-scale models cannot be adapted to professional text generation.

[0056] By introducing thought chain reasoning technology, a logical chain is provided for the reasoning of industry-specific large models, guiding them to generate specific content according to a predetermined pattern. This effectively improves the accuracy of professional text generation and prevents industry-specific large models from diverging. Practical applications have proven that this invention has good application prospects and can significantly improve the efficiency and quality of professionals when writing long planning and design texts.

[0057] The first embodiment of this application discloses a method for intelligently generating long texts for planning and design based on thought chain reasoning, including:

[0058] Step 1: Structure the data tables

[0059] Step 1-1: Collect all data tables involved in the long planning and design document. The tables may be in various formats, such as one-dimensional tables, two-dimensional tables, three-dimensional tables, etc.

[0060] Steps 1-2: In order to facilitate data retrieval after storage in the database, different forms of tables need to be structured and uniformly converted into two-dimensional tables. Each cell of data in the table can be uniquely identified by coordinates (a, b), where a represents the a-th row and b represents the b-th column.

[0061] Steps 1-3 involve mapping the cell values ​​to coordinates and then storing the coordinate information in the system database.

[0062] Step 2: Obtain SQL language set from clustered data

[0063] Step 2-1: Collect all SQL statements and build a source SQL statement set.

[0064] Step 2-2: Use a clustering algorithm to perform K-means clustering analysis on the source SQL language set. The goal is to divide the source SQL language set into two categories: data retrieval SQL language set and other SQL language sets.

[0065] Step 2-2-1, define the source SQL language set as Where n is the number of SQL language samples, This is a sample SQL language. The number of clusters is defined as K, where K ≥ 2.

[0066] Step 2-2-2: Randomly select K SQL language samples from the source SQL language set as initial cluster centers, defined as... , that is, the initial value of the cluster centers.

[0067] Step 2-2-3: Calculate the Euclidean distance for each SQL language sample. with the j-th cluster center The distance between them is given by the formula:

[0068]

[0069] That is, each SQL language sample Each SQL language sample needs to have K distances calculated. Classify into the cluster with the smallest distance, minimum distance The formula is:

[0070]

[0071] Finally, all n samples are divided into K clusters: .

[0072] Step 2-2-4, for each cluster Let the number of samples within a cluster be... Update cluster centers according to the mean of samples within each cluster:

[0073]

[0074] A new set of cluster centers was obtained.

[0075] Step 2-2-5: Repeat steps 2-2-3 and 2-2-4 until the cluster centers no longer change. This will ultimately yield the SQL language set for data retrieval.

[0076] Step 3: Obtain industry-specific large model, automatically generate SQL statements, and read the database.

[0077] Step 3-1: Associate the data acquisition SQL language set with the coordinate information of the two-dimensional table and the text chapter types in the long planning and design text to construct text data retrieval training samples. Each training sample includes user instructions, chapter types, target data table, field names, field aliases, field units, field types, cell coordinates, standard SQL statements, and SQL execution results. The text chapter types include project overview, design scheme, construction requirements, and budget estimates, etc. The project overview includes project background, project scale, design division of labor, design basis, and mandatory clauses, etc. The design scheme includes design indicators, construction plan, and risk warnings, etc. The construction requirements include base station equipment installation requirements, lightning protection grounding requirements, seismic reinforcement requirements, fire prevention requirements, and safe production requirements, etc. The budget estimates include the basis for preparation and budget content, etc.

[0078] Step 3-2 involves jointly encoding the field name, field alias, field unit, field type, and cell coordinates to form a field coordinate fusion feature. Based on this field coordinate fusion feature, the general model first determines the mapping relationship between the business fields in the user command and the database fields, and then generates the corresponding SQL statement to reduce data retrieval errors caused by similar fields, synonymous fields, or misaligned coordinates in planning and design scenarios.

[0079] Step 3-3: Input the data acquisition training samples into the general large model for training. During training, freeze the basic parameters of the general large model and train only the data acquisition adapter parameters. The data acquisition adapter is used to learn the chapter data acquisition rules, field mapping rules, coordinate positioning rules, and SQL writing rules in the planning and design scenario.

[0080] During training, training samples are grouped according to text chapter type, field similarity, coordinate span, and SQL complexity, and training parameters are adjusted according to different groups. For samples with high field name similarity, the training weight of the field mapping task is increased; for samples that need to retrieve data across rows, columns, or tables, the training weight of the coordinate positioning task is increased; for samples containing statistics, deduplication, grouping, or conditional filtering, the training weight of the SQL execution result consistency task is increased.

[0081] Specifically, during the training of the general large model, three objectives are learned simultaneously: field mapping, coordinate matching, and SQL generation. The weights of each objective are dynamically adjusted based on the validation results. When the field mismatch rate exceeds the first threshold, the weight of field mapping is increased; when the coordinate mismatch rate exceeds the second threshold, the weight of coordinate matching is increased; and when the SQL execution failure rate exceeds the third threshold, the weights of SQL generation and execution result consistency are increased. The first, second, and third thresholds are determined within preset ranges based on the test results on the validation set after the large model completes its initial training. The first threshold is 5%–10%, the second threshold is 2%–5%, and the third threshold is 1%–3%.

[0082] Steps 3-4: Use low randomness inference parameters during the SQL generation stage, and set the temperature parameters during the SQL generation stage to be lower than those during the long text generation stage; at the same time, limit the large model to only generate data reading SQL statements such as SELECT, WITH, WHERE, GROUP BY, ORDER BY, and prohibit the generation of data modification SQL statements such as INSERT, UPDATE, DELETE, DROP, ALTER.

[0083] Steps 3-5 involve performing syntax validation, target table validation, target field validation, field coordinate validation, and permission validation on the SQL statement generated by the general model. If the validation passes, the SQL statement is executed and data is retrieved. If the validation fails, or the execution result is inconsistent with the user's instructions, field coordinates, or formatting requirements, the error type is reported back to the general model, which then regenerates the SQL statement.

[0084] The general large model used in this embodiment is GLM4.7. After training through the above steps, an industry-specific large model adapted to planning and design is obtained.

[0085] Step 4: Organize the logical thought process, such as... Figure 2 As shown.

[0086] Step 4-1: Break down the long text into several short texts to decompose the task.

[0087] Step 4-2: For each short text, analyze the data that needs to be read from the database, the mathematical calculation rules between the data, the text description methods, the content layout format, etc., clarify the writing logic, guide the industry-specific large model to reason, and clarify what needs to be done in the first step, how to do it in the second step, and what the specific implementation details of the third step are.

[0088] Step 5: Format your thought process

[0089] Step 5-1, formatting the thought chain aims to help the larger model better understand the content of the thought chain. It is necessary to refine the content of the logical thought chain, give the larger model some keywords as annotations, and clarify what should be done in each step more quickly.

[0090] Step 6: Long text generation

[0091] Step 6-1: After the user uploads the raw data and issues an instruction, the large model automatically reads the data according to the instruction requirements and generates a standard long planning and design text based on the thought chain reasoning steps, such as... Figure 3 As shown.

[0092] Example:

[0093] Taking the generation process of a split long text fragment as an example, a long design text for a certain project involves a data table as follows:

[0094] Table 1 Equipment Selection Scheme

[0095]

[0096] According to step 1-1, the table is a two-dimensional table and has been structured.

[0097] According to steps 1-2, each cell can be uniquely identified by two-dimensional coordinates, such as the coordinates of "Serial Number" being (1,1) and "2.1G" being (2,4).

[0098] According to steps 1-3, after mapping the cell values ​​to coordinates, the coordinate information is stored in the system database.

[0099] Following step 2-2-1, collect all SQL statements to form a source SQL statement set, for example, {SELECT base_nameFROM sheet_1, SELETE * FROM frequency_band WHERE id=2.1G......}. Assume there are 4 SQL statement samples, i.e., n=4. The goal is to divide the source SQL statement set into two categories: data retrieval SQL statement set and other SQL statement sets, i.e., K=2. Each SQL statement sample uses the number of uppercase characters as its sample value. .

[0100] According to step 2-2-2, two SQL language samples are randomly selected from the source SQL language set as initial cluster centers, and their corresponding sample values ​​are the initial cluster center values. Let the initial value of the randomly selected cluster center be... .

[0101] Step 2-2-3: Calculate the distance of each sample value from the cluster center using Euclidean distance.

[0102] arrive The distance is 0, to The distance is 5, belonging to the cluster. ;

[0103] arrive The distance is 5, to The distance is 0, so it belongs to the cluster. ;

[0104] arrive The distance is 1, to The distance is 6, belonging to the cluster. ;

[0105] arrive The distance is 7, to The distance is 2, so it belongs to the cluster. ;

[0106] The current cluster is divided into .

[0107] Based on step 2-2-4, update the cluster centers, i.e. .

[0108] Based on step 2-2-5, repeat steps 2-2-3 and 2-2-4 until the cluster centers no longer change. Depending on the sample values, the data retrieval SQL languages ​​will be clustered into one cluster, ultimately resulting in a data retrieval SQL language set.

[0109] According to step 3-1, the data acquisition SQL language set is input into the general large model for learning, so that it can write SQL statements in a standard format and automatically read the database.

[0110] Based on step four, establish the logical thinking chain as follows:

[0111] The first step is to introduce the equipment selection in the base station design of this project.

[0112] The second step involves clarifying the calculation rules, including calculating the number of base stations, the types and quantities of equipment, and the types of coverage scenarios.

[0113] The third step details the implementation process and clarifies the generation format:

[0114] 1. Read "Table 1 Equipment Selection Scheme" to obtain the number of items in the serial number field (i.e., the number of base stations), the number and name of each type in the equipment type field, and the name of the coverage scenario field;

[0115] 2. Please refer to the text description template: This single project will construct a total of "number of base stations" 5G base stations, of which "number of equipment types" base stations will use "corresponding equipment type name" AAU to cover "coverage scenario name"; and "number of equipment types" base stations will use "corresponding equipment type name" RRU to cover "coverage scenario name".

[0116] Based on step five, format the thought process:

[0117] 1. Output text

[0118] The first step is intelligent data acquisition, which retrieves all equipment selection schemes.

[0119] The second step involves calculating the total number of base stations, which is the number of base stations after removing duplicate data from the base station number column. Finally, the output table shows all equipment selection schemes for each site, along with the total number of base stations.

[0120] The third step is to output the text and analyze the device type. The device type parameter is used to determine whether the device type is 32T32R or 64T64R. The other types are RRUs. Note: (1) Replace the "**" in the template with the corresponding input parameter value. (2) If the parameter value of the number is 0, delete the sentence part corresponding to the parameter. For example, if the number of AAUs is 0, delete the part "of which "**" base stations use AAUs to cover "**". Do not have any questions about data integrity. Text description template: This project has built a total of "number of base stations" 5G base stations. Among them, "number of device types" base stations use "corresponding device type name" AAUs to cover "coverage scenario name"; among them, "number of device types" base stations use "corresponding device type name" RRUs to cover "coverage scenario name".

[0121] 2. Output table

[0122] The first step is intelligent data acquisition, which retrieves all equipment selection schemes.

[0123] The second step of the calculation rule is to take the value of each coordinate; no calculation is required.

[0124] The third step is to output a table, displaying the values ​​of all coordinates from the equipment selection scheme table according to their coordinate positions. All content within each cell should be centered, with no borders in the title section and solid borders for the data sections.

[0125] Based on step six, the generated long text fragment is as follows:

[0126] This project involves the construction of two 5G base stations. One base station uses a 4T4R RRU to cover general urban areas, while the other base station uses an 8T8R RRU to cover densely populated urban areas.

[0127] Table 1 Equipment Selection Scheme

[0128]

[0129] This invention proposes a method and system for intelligently generating long texts for planning and design based on thought chain reasoning. It is the first to apply thought chain reasoning technology to the field of professional text generation, achieving standardized and highly adaptable automatic generation of long texts through four core modules. The system first performs structured preprocessing on heterogeneous data tables, uniformly converting them into two-dimensional tables and storing them in a database. Then, it uses the K-means clustering algorithm to classify and filter the source SQL language set, forming a dedicated data acquisition SQL language set for a general-purpose large model to learn from, resulting in an industry-specific large model. This industry-specific large model can automatically write SQL statements to achieve accurate data retrieval. Simultaneously, the long text for planning and design is broken down into short text subtasks, which are then organized and transformed into a formatted thought chain with step-by-step annotations, clarifying the reasoning logic, content, and format specifications. Finally, the industry-specific large model automatically acquires data according to user instructions, generating long texts for planning and design that are rigorous in content, standardized in format, and meet engineering requirements by reasoning step-by-step along the thought chain. This fundamentally solves the problems of insufficient industry adaptability, content dispersion, and chaotic formatting of the general-purpose large model, significantly improving the efficiency and quality of professional text generation.

[0130] This invention proposes a method and system for intelligently generating long planning and design texts based on thought chain reasoning. Utilizing thought chain reasoning technology, it enables large models to generate long planning and design texts according to standard formats and content. The system consists of four parts, and the system architecture diagram is shown below. Figure 1 As shown, it includes:

[0131] 1. Data preprocessing module: The user inputs the data source, namely the data table required in the planning and design text. Then, the table is structured and transformed into a two-dimensional table that is easy to process in large models. Finally, the two-dimensional table is stored in the database in the form of coordinates.

[0132] 2. The data acquisition module first collects a set of Structured Query Language (SQL) languages ​​used for database operation and management, defined as the source SQL language set. Then, a K-means clustering analysis is performed on the source SQL language set to obtain SQL languages ​​capable of reading the database and accurately retrieving data, defined as the data acquisition SQL language set. This data acquisition SQL language set is then input into a large-scale model for learning, resulting in an industry-specific large-scale model. This model can automatically write SQL statements to retrieve the required data according to a standard format.

[0133] 3. The thought chain generation module breaks down long professional texts into several shorter texts, outlines the logical thought chain for each short text, and defines the writing reasoning logic, format requirements, and content requirements for professional texts. Then, the logical thought chain is transformed into a formatted thought chain that is easily understood by the industry-specific large model, and the reasoning steps are annotated.

[0134] 4. Long text generation module: The industry-specific large model automatically obtains the required data according to user instructions and automatically generates long texts with standard format and complete content based on the formatted thinking chain.

[0135] This method achieves intelligent generation of long planning and design texts through steps such as data preprocessing, data storage, data acquisition from industry-specific large models, thought chain generation, and long text generation, thereby improving the efficiency and quality of text writing.

[0136] In its specific implementation, this application provides a computer storage medium and a corresponding data processing unit. The computer storage medium is capable of storing a computer program, which, when executed by the data processing unit, can run the invention's content regarding a long text intelligent generation method based on thought chain reasoning, as well as some or all of the steps in various embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0137] Those skilled in the art will clearly understand that the technical solutions in the embodiments of the present invention can be implemented using computer programs and their corresponding general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of the present invention, or the parts that contribute to the prior art, can be embodied in the form of computer programs, i.e., software products. These computer program software products can be stored in a storage medium and include several instructions to cause a device containing a data processing unit (which may be a personal computer, server, microcontroller, MCU, or network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments of the present invention.

[0138] This invention provides a method and system for intelligently generating long texts for planning and design based on thought chain reasoning. Many methods and approaches exist for implementing this technical solution; the above description is merely a preferred embodiment of the invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this invention, and these improvements and modifications should also be considered within the scope of protection of this invention. All components not explicitly stated in this embodiment can be implemented using existing technologies.

Claims

1. A method for intelligently generating long texts for planning and design based on thought chain reasoning, characterized in that, include: Step 1: Collect the data tables involved in the long planning and design text, perform structured processing on the data tables to obtain two-dimensional tables, and store the two-dimensional tables in the form of coordinates in the database; Step 2: Construct the source SQL language set, perform cluster analysis on the source SQL language set, and obtain the data acquisition SQL language set; Step 3: Input the SQL language set obtained from the data into the general large model for learning to obtain an industry-specific large model. The industry-specific large model can write SQL statements according to the standard format, automatically read the database, and obtain the required data. Step 4: Break down the long professional text into multiple short texts, organize the logical thinking chain of each short text, and define the writing reasoning logic, format requirements, and content requirements of the professional text. Step 5: Transform the logical thinking chain into a formatted thinking chain that is easy for industry-specific large models to understand; Step 6: The industry-specific large model automatically acquires the required data according to user instructions and automatically generates a long planning and design text with standard format and complete content based on the formatted thinking chain.

2. The method for intelligent generation of long texts for planning and design based on thought chain reasoning as described in claim 1, characterized in that, Step 2 includes: Step 2-1: Collect all SQL statements and assemble the source SQL statement set; Step 2-2: Use a clustering algorithm to perform K-means clustering analysis on the source SQL language set to obtain the data acquisition SQL language set and other SQL language sets.

3. The method for intelligent generation of long texts for planning and design based on thought chain reasoning as described in claim 2, characterized in that, Step 3 includes: Step 3-1: Associate the data acquisition SQL language set with the coordinate information of the two-dimensional table and the text chapter type in the long text of the planning and design to construct a text data acquisition training sample; each training sample includes user command, chapter type, target data table, field name, field alias, field unit, field type, cell coordinate, standard SQL statement and SQL execution result; Step 3-2: Jointly encode the field name, field alias, field unit, field type, and cell coordinates to form a field coordinate fusion feature; based on the field coordinate fusion feature, the general model first determines the mapping relationship between the business fields in the user command and the database fields, and then generates the corresponding SQL statement; Step 3-3: Input the data training samples into the general large model for training. During training, freeze the basic parameters of the general large model and train only the data acquisition adapter parameters. During the training of the general large model, learn three objectives simultaneously: field mapping, coordinate matching, and SQL generation, and dynamically adjust the weights of each objective based on the validation results. Steps 3-4: Low randomness inference parameters are used in the SQL generation stage, and the temperature parameters in the SQL generation stage are lower than those in the long text generation stage; at the same time, the large model is limited to generating only data reading SQL statements. Steps 3-5 involve performing syntax validation, target table validation, target field validation, field coordinate validation, and permission validation on the SQL statements generated by the general large model; after the validation passes, the SQL statements are executed and the data is retrieved.

4. The method for intelligent generation of long texts for planning and design based on thought chain reasoning according to claim 3, characterized in that, Step 4 includes: Step 4-1: Break down the long professional text into multiple short texts to decompose the task; Step 4-2: For each short text, analyze the data that needs to be read from the database, the mathematical calculation rules between the data, the text description methods, the content layout format, clarify the writing logic, and guide the industry-specific large model to perform reasoning.

5. The method for intelligent generation of long texts for planning and design based on thought chain reasoning according to claim 4, characterized in that, Step 5 includes: refining the content in the logical thinking chain, marking the reasoning steps, and clarifying the execution content of each step.

6. The method for intelligent generation of long texts for planning and design based on thought chain reasoning as described in claim 5, characterized in that, Step 5 includes: Step 1, intelligent data retrieval, where the industry-specific large model automatically retrieves the required data from the database according to user instructions; Step 2, calculation rules, where calculation rules are set to calculate the target data from the retrieved required data; Step 3, outputting text or a table, where when outputting text, the precautions for generating text based on the template are specified; when outputting a table, the coordinate values ​​and table format are specified.

7. The method for intelligent generation of long texts for planning and design based on thought chain reasoning as described in claim 6, characterized in that, Step 1 includes: Step 1-1: Collect all data tables involved in the long planning and design document; Steps 1-2: Structure the different forms of tables and convert them into two-dimensional tables. Each cell in the table can be uniquely identified by coordinates (a, b), where a represents the a-th row and b represents the b-th column. Steps 1-3 involve mapping the cell values ​​to coordinates and then storing the coordinate information in the database.

8. The method for intelligent generation of long texts for planning and design based on thought chain reasoning as described in claim 7, characterized in that, Step 2-2 includes: Step 2-2-1, define the source SQL language set as Where n is the number of SQL language samples, For SQL language samples, the number of clusters is defined as K, where K≥2; Step 2-2-2: Randomly select K SQL language samples from the source SQL language set as initial cluster centers, defined as... , i.e., the initial value of the cluster centers; Step 2-2-3: Calculate the Euclidean distance for each SQL language sample. with the j-th cluster center The distance between them; for each SQL language sample All n samples are classified into K clusters by the minimum distance between them. ; Step 2-2-4, for each cluster Let the number of samples within a cluster be... The cluster centers are updated according to the mean of the samples within the cluster, resulting in a new round of cluster centers; Step 2-2-5: Repeat steps 2-2-3 and 2-2-4 until the cluster centers no longer change, and finally obtain the data retrieval SQL language set.

9. The method for intelligent generation of long texts for planning and design based on thought chain reasoning as described in claim 8, characterized in that, In step 2-2-1, the number of uppercase characters in each SQL statement of the source SQL language set is used as the SQL language sample value. .

10. A long text intelligent generation system for planning and design based on thought chain reasoning, characterized in that, It includes a data preprocessing module, a data acquisition module, a thought chain generation module, and a long text generation module. The data preprocessing module is used to collect data tables involved in the long planning and design text, perform structured processing on the data tables to obtain a two-dimensional table, and store the two-dimensional table in the form of coordinates in the database. The data acquisition module is used to construct a source SQL language set, perform cluster analysis on the source SQL language set to obtain a data acquisition SQL language set, and input the data acquisition SQL language set into a general large model for learning to obtain an industry-specific large model. The industry-specific large model can write SQL statements according to a standard format, automatically read the database, and obtain the required data. The thought chain generation module is used to break down long professional texts into multiple short texts, organize the logical thought chain for each short text, define the writing reasoning logic, format requirements and content requirements of professional texts, and transform the logical thought chain into a formatted thought chain that is easy for industry-specific large models to understand. The long text generation module is used to automatically obtain the required data according to user instructions from the industry-specific large model, and automatically generate long texts with standard format and complete content based on the formatted thinking chain.