Textile workshop optimization algorithm recommendation method and system based on large language model

By constructing a textile knowledge vector database and using LoRA and self-prompting retrieval enhancement generation methods, the problems of misunderstanding of professional terms and inaccurate modeling logic in textile workshop scheduling systems were solved. This enabled efficient generation of textile scheduling mathematical models and automatic code generation, improving the intelligence and production efficiency of textile workshop scheduling systems.

CN120875477AInactive Publication Date: 2025-10-31HUAQIAO UNIVERSITY +1

Patent Information

Application Number
CN202511383706.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-26
Publication Date
2025-10-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing textile workshop scheduling optimization algorithm recommendation systems suffer from problems such as misunderstanding of professional terminology, inaccurate modeling logic, disconnect between domain knowledge and the modeling process, lack of intelligent algorithm recommendation, and reliance on manual code generation. These issues lead to a disconnect between the model and the actual production scenario, resulting in low adaptability and efficiency.

Method used

A textile knowledge vector database is constructed, and domain-adaptive fine-tuning is performed using the LoRA method. Combined with a self-prompting retrieval enhancement generation method, a textile scheduling mathematical model is automatically generated and code generation is optimized. This includes a textile knowledge vector database, low-rank adaptive LoRA, and iterative correction algorithms, which improve the model's professional adaptability and production practicality.

Benefits of technology

It has achieved accurate modeling and efficient code generation for textile scheduling problems, solved the problems of misunderstanding of professional terms and the disconnect between the model and actual production, and improved the intelligence and execution efficiency of the textile workshop scheduling system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120875477A_ABST
    Figure CN120875477A_ABST
Patent Text Reader

Abstract

The invention discloses a textile workshop optimization algorithm recommendation method and system based on a large language model, and relates to the technical field of textile workshop scheduling, and the method comprises the steps: S1, constructing a textile knowledge vector database comprising a first-stage textile modeling knowledge base and a second-stage algorithm code knowledge base; s2, taking the spinning knowledge vector database as a fine tuning data set, and performing spinning field adaptive fine tuning on the large language model to obtain a spinning field model; and S3, based on the textile knowledge vector database, taking the obtained textile workshop scheduling demand as input, and using a retrieval enhancement generation method to generate a recommendation algorithm code for textile workshop scheduling. The textile field model is obtained by establishing the textile knowledge vector database and performing efficient fine tuning in the textile field on the large language model, the executable code is automatically generated through the retrieval enhancement generation method, the scheduling requirements and constraint conditions of different textile workshops can be adapted, the manual intervention cost is reduced, and the scheduling efficiency is improved. And the reusability and the scheduling scheme solving efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of textile workshop scheduling technology, and in particular to a textile workshop optimization algorithm recommendation method and system based on a large language model. Background Technology

[0002] Based on the current technical status of textile workshop scheduling optimization algorithm recommendation systems, existing solutions mainly have the following three shortcomings:

[0003] (1) The general model lacks domain adaptability, and its understanding of technical terms and mathematical modeling logic are inaccurate:

[0004] When applying unoptimized general-purpose large language models (such as GPT and LLaMA), there are blind spots in textile expertise and modeling logic biases, which cannot support industrial scheduling needs.

[0005] (2) Domain knowledge is disconnected from the modeling process, and the scheduling model relies on human experience for construction, resulting in low accuracy and efficiency:

[0006] Existing methods lack an automated mechanism for linking textile industry knowledge with optimization models, requiring experts to manually integrate textile process knowledge with general optimization frameworks. Constraint capture is incomplete: manual modeling easily overlooks industry-specific implicit constraints, leading to a disconnect between the model and actual production scenarios. Modeling cycles are lengthy: for new orders or equipment adjustments, experts must manually modify the objective function and constraints, making it difficult to adapt to the needs of small-batch, multi-variety textile production.

[0007] (3) The algorithm recommendation and code generation lack intelligence, and have poor adaptability and reusability:

[0008] The existing system cannot adaptively recommend the optimal algorithm based on the workshop scheduling mathematical model, and the code needs to be written manually, resulting in problems of "experience dependence" and "repetitive development". Summary of the Invention

[0009] To address the above issues, this invention proposes a recommendation method and system for textile workshop optimization algorithms based on a large language model. By establishing a textile knowledge vector database and performing efficient fine-tuning of the large language model in the textile domain, a textile domain model is obtained. This model can adapt to different order types and equipment configuration scenarios in different textile workshops, reducing manual intervention costs, lowering the domain knowledge threshold, and improving reusability. Through a retrieval-enhanced generation method, the textile domain model is combined with the textile knowledge vector database to automatically generate a textile scheduling mathematical model that mathematically formalizes the textile scheduling requirements, and automatically generates executable code, thereby improving the efficiency of solving scheduling schemes.

[0010] On the one hand, the recommendation method for textile workshop optimization based on a large language model has the following specific steps:

[0011] S1, Construct a textile knowledge vector database that includes a first-stage textile modeling knowledge base and a second-stage algorithm code knowledge base; the first-stage textile modeling knowledge base includes equipment parameters, process rules, and order characteristics in the textile workshop; the second-stage algorithm code knowledge base includes algorithm cases and code templates;

[0012] S2, using the textile knowledge vector database as a fine-tuning dataset, performs textile domain adaptation fine-tuning on the large language model to obtain a textile domain model;

[0013] S3, based on a textile knowledge vector database, takes the obtained textile workshop scheduling requirements as input and uses a retrieval-enhanced generation method to generate recommendation algorithm code for textile workshop scheduling; specifically:

[0014] Using textile workshop scheduling requirements as the search term, a search enhancement generation method is used to search the first-stage textile modeling knowledge base. The search results are used as prompts for the textile domain model to generate a textile scheduling mathematical model that mathematically formalizes the textile scheduling requirements.

[0015] Using the mathematical model of textile scheduling as the search term, a search enhancement generation method is used to search the two-stage algorithm code knowledge base. The search results are used as prompt words for models in the textile field to generate recommendation algorithm code.

[0016] Preferably, the retrieval enhancement generation method is a self-suggestion retrieval enhancement algorithm, and the specific steps are as follows:

[0017] Perform query rewriting, breaking down the input search terms into executable subqueries;

[0018] Generate intermediate pre-response by taking the subquery as input and guiding the textile domain model through step-by-step reasoning with few-shot thought chain prompts to generate intermediate pre-response;

[0019] Extract key sentences; extract the core assertions from the intermediate pre-response to obtain key sentences.

[0020] A hybrid search is performed, using subqueries as search terms and key sentences as constraints, to conduct a hybrid search that combines precise retrieval based on word frequency matching and semantic understanding retrieval, and to obtain initial documents from the textile knowledge vector base;

[0021] The initial documents are re-ranked based on key sentences, with a comprehensive score for domain terminology matching and semantic relevance. The documents are then re-ranked according to the score results, and the highest-ranked result is output as the search result.

[0022] Preferably, the textile domain model is configured with textile domain prompts; the textile domain prompts include expert role prompts, textile workshop scheduling task descriptions, domain-specific seed words, and rejection statements;

[0023] The expert role prompt assigns textile scheduling expert roles to the textile domain model;

[0024] The textile workshop scheduling task description provides an operation guide for the textile big language model, including extracting scheduling parameters from the textile knowledge vector database, matching the optimization requirements of user queries, constructing mathematical models and generating executable algorithm code, while avoiding the generation of irrelevant or duplicate solutions.

[0025] The domain-specific seed words will focus the output of the textile big language model on the textile scheduling domain;

[0026] The aforementioned refusal to answer guides textile domain models to avoid generating incorrect answers and creating content unrelated to textiles, and to refrain from fabricating answers when the knowledge base does not contain relevant information.

[0027] Preferably, low-rank adaptive LoRA is used to fine-tune the large language model for the textile domain, as follows:

[0028] Obtain a large language model;

[0029] Introduce a trainable linear layer consisting of low-rank matrix A and low-rank matrix B;

[0030] Keeping the weights of the large language model unchanged, the trainable linear layer is trained using the textile knowledge vector database to obtain the weights of the low-rank matrix A and the low-rank matrix B.

[0031] The weights of the low-rank matrix are added to and combined with the weights of the large language model, and the large language model with combined weights is used as the textile domain model; the weights of the textile domain model are expressed as follows:

[0032] ;

[0033] in, Represents the weights of the model in the textile field; This represents the original weights of the pre-trained large language model; This represents the transpose of the low-rank matrix B.

[0034] Preferably, after S3, the algorithm further includes S4, which uses an iterative correction algorithm to correct the generated recommendation algorithm code; specifically as follows:

[0035] The generated recommendation algorithm code file undergoes multi-dimensional verification, including syntax compliance checks, logical structure verification, and data integrity checks. If the verification passes, the recommendation algorithm code file is output; otherwise, the following steps are executed.

[0036] The retrieval enhancement generation method is used to call the two-stage algorithm code knowledge base to correct erroneous code; all steps are repeated until the preset number of iterations is reached and the recommended algorithm code file is output.

[0037] Preferably, the equipment parameters include equipment model, dynamic parameters, and compatibility; the process rules include process flow and process constraints; and the order characteristics include delivery date, order size, and priority.

[0038] Preferably, the textile scheduling mathematical model includes variable definitions, an objective function, and constraints on textile workshop production.

[0039] On the other hand, the textile workshop optimization algorithm recommendation system based on a large language model includes the following:

[0040] The textile knowledge vector base construction module is used to construct a textile knowledge vector database that includes a first-stage textile modeling knowledge base and a second-stage algorithm code knowledge base. The first-stage textile modeling knowledge base includes equipment parameters, process rules, and order characteristics in the textile workshop. The second-stage algorithm code knowledge base includes algorithm cases and code templates.

[0041] The textile domain model acquisition module is used to use the textile knowledge vector database as a fine-tuning dataset to adapt and fine-tune the large language model to the textile domain, thereby obtaining a textile domain model.

[0042] The recommendation algorithm code generation module is used to generate recommendation algorithm code for textile workshop scheduling based on a textile knowledge vector database and the obtained textile workshop scheduling requirements as input, using a retrieval-enhanced generation method; specifically:

[0043] Using textile workshop scheduling requirements as the search term, a search enhancement generation method is used to search the first-stage textile modeling knowledge base. The search results are used as prompts for the textile domain model to generate a textile scheduling mathematical model that mathematically formalizes the textile scheduling requirements.

[0044] Using the mathematical model of textile scheduling as the search term, a search enhancement generation method is used to search the two-stage algorithm code knowledge base. The search results are used as prompt words for models in the textile field to generate recommendation algorithm code.

[0045] Compared with the prior art, the present invention has the following beneficial effects:

[0046] (1) This invention establishes a textile knowledge vector database and performs domain adaptation fine-tuning through the LoRA (Low-Rank Adaptation) method to construct a textile domain model for textile professionals. It has better professional adaptability and production practicality when dealing with textile scheduling problems. It can accurately understand the unique process parameters of the textile industry, accurately establish mathematical models that conform to production constraints, and generate optimization algorithm code that can be directly applied to production scheduling. It solves the problems that traditional general-purpose large language models usually have when dealing with textile scheduling problems, such as misunderstanding of professional terms and inaccurate mathematical modeling logic. It also solves the problem that the recommended algorithm or generated code is out of touch with actual production needs.

[0047] (2) The self-suggestion retrieval enhancement generation method of the present invention includes an improved structured thinking chain, a vector database hybrid retrieval, a rearrangement and a combination of high-quality suggestion engineering, to achieve efficient semantic understanding and query conversion, and solves the problems of query fuzziness and insufficient domain knowledge understanding in traditional retrieval enhancement generation (RAG) in textile workshop scheduling scenarios;

[0048] (3) This invention integrates textile process knowledge into the fine-tuned textile field model, automatically generates a textile scheduling mathematical model containing optimization objectives and variable constraints, and automatically matches a suitable optimization algorithm and generates an executable code file according to the textile scheduling mathematical model; it solves the problems that the existing textile workshop scheduling model establishment relies on human experience or is directly applied based on a general optimization model, and the existing methods cannot adaptively recommend the optimal algorithm according to the workshop scheduling mathematical model, and the code needs to be written manually, which has the problems of "experience dependence" and "repetitive development";

[0049] (4) The present invention proposes an iterative correction algorithm to perform syntax and logic checks on the generated recommendation algorithm code file until the generated code file passes all checks or reaches the maximum number of checks, ensuring that the final output scheduling scheme meets the requirements of textile production in terms of mathematical feasibility and engineering applicability, effectively avoiding the scheduling failure problem caused by human error or improper algorithm selection in traditional methods, and significantly improving the reliability and execution efficiency of the intelligent scheduling system in textile workshops. Attached Figure Description

[0050] The present invention will now be described in further detail with reference to the accompanying drawings;

[0051] Figure 1 This is a flowchart of the textile workshop optimization algorithm recommendation method based on a large language model, according to an embodiment of the present invention.

[0052] Figure 2 This is a framework diagram of the textile workshop optimization algorithm recommendation method based on a large language model, according to an embodiment of the present invention.

[0053] Figure 3 This is a schematic diagram illustrating the efficient fine-tuning of LoRA-based large language model parameters in the recommendation method of the textile workshop optimization algorithm based on the large language model, as described in an embodiment of the present invention.

[0054] Figure 4 This is a schematic diagram of the self-suggestive retrieval enhancement generation architecture of the textile workshop optimization algorithm recommendation method based on a large language model according to an embodiment of the present invention;

[0055] Figure 5 This is a flowchart illustrating the workflow of the textile workshop optimization algorithm recommendation method based on a large language model, according to an embodiment of the present invention.

[0056] Figure 6 This is a schematic diagram of the iterative correction algorithm of the textile workshop optimization algorithm recommendation method based on a large language model according to an embodiment of the present invention.

[0057] Figure 7 This is a structural block diagram of the textile workshop optimization algorithm recommendation system based on a large language model, according to an embodiment of the present invention. Detailed Implementation

[0058] The present invention will be further described below through specific embodiments.

[0059] like Figure 1 and Figure 2 As shown, the recommendation method for textile workshop optimization algorithm based on large language model has the following specific steps:

[0060] S1. Construct a textile knowledge vector database that includes a first-stage textile modeling knowledge base and a second-stage algorithm code knowledge base.

[0061] To improve the model's practical application effectiveness and enhance its ability to acquire domain-specific knowledge and application cases, a vector database is introduced to enhance knowledge retrieval, enabling the effective storage and reuse of textile-related modeling knowledge and related scheduling optimization algorithms. The knowledge base is constructed in two phases to meet the training needs of different stages. The first-phase knowledge base includes textile technology and equipment knowledge, sourced from authoritative textile industry publications such as *Cotton Spinning Technology* and *Complete Collection of Textiles*, technical parameter manuals from mainstream textile equipment manufacturers such as Jingwei Textile Machinery and Karl Mayer, and textile-related international and national standards such as the *National Basic Safety Technical Specifications for Textile Products*. The second-phase knowledge base includes textile scheduling optimization research papers collected from platforms such as CNKI and IEEE Xplore, anonymized production scheduling cases provided by enterprises, and general optimization algorithm code libraries such as SciPy. All data is organized into feature vectors and labels to adapt to the needs of supervised learning. The knowledge base is categorized as shown in Table 1.

[0062] Table 1: Classification of Knowledge Bases

[0063]

[0064] S2 uses the textile knowledge vector database as a fine-tuning dataset to adapt and fine-tune the large language model to the textile domain, thus obtaining a textile domain model.

[0065] like Figure 3 As shown, this embodiment uses DeepSeek as the base model and performs domain-specific fine-tuning using the LoRA (Low-Rank Adaptation) method. Based on the original parameters of the pre-trained model, a trainable linear layer consisting of low-rank matrices A and B is introduced. This linear layer is trained using textile domain-specific knowledge data to learn domain-specific knowledge representations. After training, the weights of the low-rank matrices are added to and merged with the weights of the original model, ultimately obtaining a fine-tuned model with excellent performance in the textile workshop optimization domain.

[0066] The input vector x is a row vector. The left side shows the original parameter matrix of the large language model. The right side is a low-rank matrix. and The output vector y is a column vector. During fine-tuning, the original parameter matrix of the pre-trained large language model is maintained. With the variable fixed, a trainable low-rank matrix is ​​introduced. and Update matrix ,because Therefore, the number of parameters that need to be trained is significantly reduced. During forward propagation, the intermediate states change from their original values... Become After training, the original parameter matrix The weights obtained from training, A and B, are combined to obtain the fine-tuned weights. ,for dimension.

[0067] S3, based on a textile knowledge vector database, takes the obtained textile workshop scheduling requirements as input and uses a retrieval-enhanced generation method to generate recommendation algorithm code for textile workshop scheduling.

[0068] To address the issues of query ambiguity and insufficient domain knowledge understanding inherent in traditional Retrieval Augmentation (RAG) methods used in textile workshop scheduling scenarios, this embodiment employs a self-suggestive retrieval augmentation architecture. This architecture includes an improved structured thought chain, hybrid vector database retrieval, and reordering combined with high-quality suggestion engineering to achieve efficient semantic understanding and query transformation. The self-suggestive retrieval augmentation architecture is as follows: Figure 4 As shown. Specifically includes:

[0069] Query rewriting and diverse expression generation. In textile workshop scheduling scenarios, user queries are often ambiguous or lack complete domain terminology. This embodiment employs a query rewriting module, leveraging a textile domain knowledge base and the semantic understanding capabilities of a Large Language Model (LLM), to decompose the original query into executable subqueries, eliminate ambiguity, and extract the core intent. Furthermore, this embodiment automatically expands the semantic expression of the query through diverse expression generation, enhancing retrieval recall and ensuring that relevant scheduling optimization algorithm code can still be generated even when user expressions are imprecise.

[0070] Few-shot Thinking Chain (COT) Hints and Pre-answers. Traditional RAG relies on direct semantic matching, which is prone to generating results that deviate from actual needs due to the complex constraints in the textile field. This embodiment introduces few-shot thinking chain hints, combined with typical problem examples in the textile scheduling field, to guide LLM step-by-step reasoning and generate intermediate pre-answers. The pre-answers are refined into core assertions by the key sentence extraction module, serving as strong constraints for subsequent retrieval, avoiding semantic bias caused by keyword retrieval, and improving the accuracy of algorithm recommendations.

[0071] Hybrid retrieval and dynamic reordering. Addressing the heterogeneity of textile workshop scheduling data, this embodiment employs a hybrid retrieval strategy: combining precise retrieval based on word frequency matching with semantic understanding retrieval, and using weighted fusion to select candidate document sets from the textile knowledge vector database. Retrieval constraints are extracted based on structured thought chains, and a reordering model is used to dynamically optimize candidate documents. Based on a comprehensive score of domain terminology matching and semantic relevance, highly relevant content such as "multi-objective optimization algorithm" and "load balancing" is prioritized, ensuring that the algorithm's recommendations accurately match the actual needs of the workshop.

[0072] In the textile field, this document provides suggestions for engineering optimization. To reduce biases caused by ambiguous or vague queries in traditional retrieval methods and improve the accuracy and professionalism of textile scheduling optimization algorithms, this embodiment designs four dedicated suggestions as follows:

[0073] (1) Expert role prompt: Assign textile scheduling expert roles to the textile big language model;

[0074] (2) Textile workshop scheduling task description: Provide operation guidelines for the textile big language model, including extracting scheduling parameters from the textile knowledge base, matching the optimization requirements of user queries, constructing accurate mathematical models and generating executable algorithm code, while avoiding generating irrelevant or duplicate solutions;

[0075] (3) Domain-specific seed words: Set seed words such as “textile technology”, “mathematical model” and “optimization algorithm” to focus the output of the textile big language model on the textile scheduling domain;

[0076] (4) Refusal to answer: Instruct textile LLMs not to generate incorrect answers, not to create content unrelated to textiles, and not to fabricate answers when the knowledge base does not contain relevant information.

[0077] In order to clearly and accurately define and resolve related issues during the optimization of recommendation algorithms, the following definitions are given:

[0078] Definition 1: "Production scheduling demand S" represents a given production scheduling demand for a textile workshop. ,in:

[0079] ;

[0080] ;

[0081] ;

[0082] ;

[0083] Definition 2: "Domain Knowledge Base D" represents the textile knowledge vector database upon which the method of this embodiment relies. ,in, This represents the first-stage modeling knowledge base, including process rule diagrams, typical textile scheduling problems, and their mathematical expressions. This represents a two-stage algorithm knowledge base, including feature descriptions and code templates for optimization algorithms such as NSGA-II and improved genetic algorithms.

[0084] Definition 3: "Standardized mathematical model M" represents the mathematical formalization of the textile workshop scheduling problem, which includes a complete mathematical description of variable definitions, objective functions, and constraints. ,in, This represents the modeling function.

[0085] Definition 4: "Algorithm code file R" refers to the output executable optimized algorithm code file. ,in, Indicates based on Features from The algorithm for searching and recommending in the middle, This represents the code generation function.

[0086] The first stage, based on the actual production scenario of a textile workshop and combining domain knowledge and resource constraints, constructs an optimization mathematical model for the textile workshop, achieving a formal expression of the scheduling problem. Through a "professional domain model" (a fine-tuned DeepSeek model), it integrates textile domain knowledge and problem understanding capabilities, realizing the transformation from natural language description to a mathematical model. The second stage, based on the generated textile scheduling mathematical model, combines algorithmic knowledge retrieval from a vector database with the domain adaptation capabilities of the fine-tuned model to automatically generate executable optimization algorithm code, achieving rapid solution of the scheduling scheme. The overall workflow is as follows: Figure 5 As shown:

[0087] Pre-training phase: Inputting “descriptive terms” (such as “completion time”, “raw material replacement”), “mathematical knowledge” (such as objective function construction, constraint representation), “model data” (equipment parameter samples) from the textile scheduling domain, model description (formal expression of mathematical model), algorithm repository (various optimization algorithm libraries), and code flow (program logic template) gives the model the ability to model textile domain problems and generate code.

[0088] Optimization tasks and objectives: Specific optimization tasks and objectives for textile workshop scheduling problems. Under given machine resources and order tasks, the optimal allocation of production resources can be achieved through reasonable scheduling strategies to achieve different optimization objectives.

[0089] Resource Configuration and Description: Further description of the resource configuration involved in the optimization task is provided to provide more accurate constraints and parameter basis for subsequent textile workshop scheduling modeling, so that the model can accurately reflect order demand and machine characteristics, and thus build a scheduling model that is more in line with the actual production scenario and has better optimization effect.

[0090] Design Phase: Based on the actual workshop production scheduling requirements, key elements (such as order attributes, equipment parameters, process constraints, etc.) are extracted and modeled using a first-stage modeling knowledge base. Search enhancement eliminates terminological ambiguity and yields a structured output table. Based on structured output tables Combined with the first-stage modeling knowledge base Construct a standardized mathematical model for the textile workshop scheduling problem. It includes a complete mathematical description of variables, objective functions, and constraints, realizing the transformation from natural language description to mathematical model. For example... Figure 5 As shown, in one embodiment, the constraints may be: the sum of orders for all machines equals the total number of orders; the production time required for each order; the total production time for each machine; the number of times raw materials are changed for each machine; and non-negativity constraints. The objective function may be the minimum total production time of the machine with the longest total production time, or the minimum number of times raw materials are changed for all machines.

[0091] Generation stage: Input the textile scheduling mathematical model generated in the previous step, and analyze the mathematical model output from the first stage. Extract the objective function, constraints, and variable definitions, and apply them to the two-stage algorithm knowledge base. Search for optimization algorithm cases in the field of textile scheduling and recommend the optimal algorithm. Based on recommendation algorithm It calls a preset algorithm template, combines the objective function and constraints in the mathematical model, and generates an executable recommendation algorithm code file R.

[0092] S4. Use an iterative correction algorithm to correct the generated recommendation algorithm code.

[0093] In scenarios involving code generation, the complexity of the generation process and potential errors can render the generated code unusable immediately. Therefore, this embodiment introduces an iterative optimization mechanism during code generation to address potential quality issues. See details. Figure 6 Algorithm 1, as shown, is performed as follows: First, the generated algorithm code file undergoes multi-dimensional verification, including syntax compliance checks, logical structure verification, and data integrity checks. If the checks pass, the code file is output; otherwise, the RGA (Rule of Global Approach) is invoked to call various rules of the code standard in the algorithm code knowledge base, rigorously comparing key elements such as data structure, keyword usage, and formatting in the file, and correcting erroneous code according to standard requirements. The code is re-checked after each correction until the generated code file is error-free or the maximum set number of iterations is reached.

[0094] like Figure 7 As shown, this invention also discloses a textile workshop optimization algorithm recommendation system based on a large language model, comprising:

[0095] The textile knowledge vector base construction module 701 is used to construct a textile knowledge vector database that includes a first-stage textile modeling knowledge base and a second-stage algorithm code knowledge base. The first-stage textile modeling knowledge base includes equipment parameters, process rules, and order characteristics in the textile workshop. The second-stage algorithm code knowledge base includes algorithm cases and code templates.

[0096] The textile domain model acquisition module 702 is used to use the textile knowledge vector database as a fine-tuning dataset to perform textile domain adaptation and fine-tuning on the large language model to obtain the textile domain model.

[0097] Recommendation algorithm code generation module 703 is used to generate recommendation algorithm code for textile workshop scheduling based on a textile knowledge vector database and the obtained textile workshop scheduling requirements as input, using a retrieval enhancement generation method; specifically:

[0098] Using textile workshop scheduling requirements as the search term, a search enhancement generation method is used to search the first-stage textile modeling knowledge base. The search results are used as prompts for the textile domain model to generate a textile scheduling mathematical model that mathematically formalizes the textile scheduling requirements.

[0099] Using the mathematical model of textile scheduling as the search term, a search enhancement generation method is used to search the two-stage algorithm code knowledge base. The search results are used as prompt words for models in the textile field to generate recommendation algorithm code.

[0100] The recommendation algorithm code correction module 704 is used to correct the generated recommendation algorithm code using an iterative correction algorithm.

[0101] The specific implementation of the textile workshop optimization algorithm recommendation system based on a large language model is the same as the textile workshop optimization algorithm recommendation method based on a large language model, and will not be described again in this embodiment.

[0102] The above are merely specific embodiments of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial modifications made to the present invention using this concept shall be considered as infringing upon the protection scope of the present invention.

Claims

1. A recommendation method for textile workshop optimization algorithm based on a large language model, characterized in that, Includes the following steps: S1, Construct a textile knowledge vector database that includes a first-stage textile modeling knowledge base and a second-stage algorithm code knowledge base; the first-stage textile modeling knowledge base includes equipment parameters, process rules, and order characteristics in the textile workshop; the second-stage algorithm code knowledge base includes algorithm cases and code templates; S2, using the textile knowledge vector database as a fine-tuning dataset, performs textile domain adaptation fine-tuning on the large language model to obtain a textile domain model; S3, based on a textile knowledge vector database, takes the obtained textile workshop scheduling requirements as input and uses a retrieval-enhanced generation method to generate recommendation algorithm code for textile workshop scheduling; specifically: Using textile workshop scheduling requirements as the search term, a search enhancement generation method is used to search the first-stage textile modeling knowledge base. The search results are used as prompts for the textile domain model to generate a textile scheduling mathematical model that mathematically formalizes the textile scheduling requirements. Using the mathematical model of textile scheduling as the search term, a search enhancement generation method is used to search in the two-stage algorithm code knowledge base. The search results are used as prompt words for models in the textile field to generate recommendation algorithm code.

2. The textile workshop optimization algorithm recommendation method based on a large language model according to claim 1, characterized in that, The retrieval enhancement generation method is a self-suggestion retrieval enhancement algorithm, and the specific steps are as follows: Perform query rewriting, breaking down the input search terms into executable subqueries; Generate intermediate pre-response by taking the subquery as input and guiding the textile domain model through step-by-step reasoning with few-shot thought chain prompts to generate intermediate pre-response; Extract key sentences; extract the core assertions from the intermediate pre-response to obtain key sentences. A hybrid search is performed, using subqueries as search terms and key sentences as constraints, to conduct a hybrid search that combines precise retrieval based on word frequency matching with semantic understanding retrieval, and to obtain initial documents from the textile knowledge vector base; The initial documents are re-ranked based on key sentences, with a comprehensive score for domain terminology matching and semantic relevance. The documents are then re-ranked according to the score results, and the highest-ranked result is output as the search result.

3. The textile workshop optimization algorithm recommendation method based on a large language model according to claim 1, characterized in that, The textile domain model is configured with textile domain prompts; these prompts include expert role prompts, textile workshop scheduling task descriptions, domain-specific seed words, and rejection criteria. The expert role prompt assigns textile scheduling expert roles to the textile domain model; The textile workshop scheduling task description provides an operation guide for the textile big language model, including extracting scheduling parameters from the textile knowledge vector database, matching the optimization requirements of user queries, constructing mathematical models and generating executable algorithm code, while avoiding the generation of irrelevant or duplicate solutions. The domain-specific seed words will focus the output of the textile big language model on the textile scheduling domain; The aforementioned refusal to answer guides textile domain models to avoid generating incorrect answers and creating content unrelated to textiles, and to refrain from fabricating answers when the knowledge base does not contain relevant information.

4. The textile workshop optimization algorithm recommendation method based on a large language model according to claim 1, characterized in that, Low-rank adaptive LoRA is used to fine-tune a large language model for textile domain adaptation, as detailed below: Obtain a large language model; Introduce a trainable linear layer consisting of low-rank matrix A and low-rank matrix B; Keeping the weights of the large language model unchanged, the trainable linear layer is trained using the textile knowledge vector database to obtain the weights of the low-rank matrix A and the low-rank matrix B. The weights of the low-rank matrix are added to and combined with the weights of the large language model, and the large language model with combined weights is used as the textile domain model; the weights of the textile domain model are expressed as follows: ; in, Represents the weights of the model in the textile field; This represents the original weights of the pre-trained large language model; This represents the transpose of the low-rank matrix B.

5. The textile workshop optimization algorithm recommendation method based on a large language model according to claim 1, characterized in that, Following S3, it also includes S4, which uses an iterative correction algorithm to refine the generated recommendation algorithm code; the details are as follows: The generated recommendation algorithm code file undergoes multi-dimensional verification, including syntax compliance checks, logical structure verification, and data integrity checks. If the verification passes, the recommendation algorithm code file is output; otherwise, the following steps are executed. The retrieval enhancement generation method is used to call the two-stage algorithm code knowledge base to correct erroneous code; all steps are repeated until the preset number of iterations is reached and the recommended algorithm code file is output.

6. The textile workshop optimization algorithm recommendation method based on a large language model according to claim 1, characterized in that, The equipment parameters include equipment model, dynamic parameters, and compatibility; the process rules include process flow and process constraints; and the order characteristics include delivery date, order size, and priority.

7. The textile workshop optimization algorithm recommendation method based on a large language model according to claim 1, characterized in that, The mathematical model for textile scheduling includes variable definitions, objective functions, and constraints on textile workshop production.

8. A recommendation system for textile workshop optimization algorithm based on a large language model, comprising the following: The textile knowledge vector base construction module is used to construct a textile knowledge vector database that includes a first-stage textile modeling knowledge base and a second-stage algorithm code knowledge base. The first-stage textile modeling knowledge base includes equipment parameters, process rules, and order characteristics in the textile workshop. The second-stage algorithm code knowledge base includes algorithm cases and code templates. The textile domain model acquisition module is used to use the textile knowledge vector database as a fine-tuning dataset to adapt and fine-tune the large language model to the textile domain, thereby obtaining a textile domain model. The recommendation algorithm code generation module is used to generate recommendation algorithm code for textile workshop scheduling based on a textile knowledge vector database and the obtained textile workshop scheduling requirements as input, using a retrieval-enhanced generation method; specifically: Using textile workshop scheduling requirements as the search term, a search enhancement generation method is used to search the first-stage textile modeling knowledge base. The search results are used as prompts for the textile domain model to generate a textile scheduling mathematical model that mathematically formalizes the textile scheduling requirements. Using the mathematical model of textile scheduling as the search term, a search enhancement generation method is used to search the two-stage algorithm code knowledge base. The search results are used as prompt words for models in the textile field to generate recommendation algorithm code.

Citation Information

Patent Citations

  • Electric power professional knowledge intelligent question answering system construction method based on large language model

    CN117609421A

  • Knowledge management question-answering system construction method and device

    CN118446296A

  • Large model application construction method based on configurable workflow and domain knowledge base

    CN120631869A

  • Workshop scheduling optimization method and system based on large and small model collaboration and closed-loop verification

    CN120634171A

  • Iterative context-based generative artificial intelligence

    US20240202464A1

Cited By

  • Scheduling method based on fusion of large language model and improved simulated annealing algorithm

    CN121526267A

  • Scheduling method based on large language model and improved simulated annealing algorithm

    CN121526267B