Intelligent interaction and analysis method based on combination of open source large model and database, electronic equipment and storage medium
By combining the intelligent assistant with the capacity prediction system, and using an intelligent interaction and analysis method based on open source large models and databases, the problem of low intelligence of the lithium battery production line is solved, and efficient production data information query and data matching analysis is achieved, which improves production efficiency and reduces costs.
Patent Information
- Application Number
- CN202411622211.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-04
AI Technical Summary
In the prior art, the degree of intelligence of lithium battery production lines is low, and the combination of intelligent assistants and capacity prediction systems is lacking, resulting in low efficiency in production data information query and data matching analysis.
Using an intelligent interaction and analysis method based on the combination of open source big models and databases, an intelligent assistant and capacity prediction system are combined, and data analysis reports are automatically generated through the selection of open source big models, the fine-tuning of data sets, the construction of prompt word engineering, the selection of user-to-big interaction methods, and the combination of big models and databases.
It realizes efficient query of relevant production data information in the intelligent production of lithium batteries and data matching analysis of actual capacity and predicted capacity, and generates detailed production line data analysis reports, which improves production efficiency and reduces personnel maintenance and use costs.
Smart Images

Figure CN119557591A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for intelligent interaction and analysis, and in particular to a method, electronic device and storage medium for intelligent interaction and analysis based on an open source large model combined with a database. Background Art
[0002] With the continuous deepening of lithium battery research, the research and development of lithium battery production lines are also deepening, which has promoted the development and application of the lithium battery industry. However, the current lithium battery production lines still have many disadvantages, such as low intelligence. However, with the continuous advancement of artificial intelligence and natural language processing technology, more and more fields are beginning to apply these technologies to improve work efficiency and accuracy. In the process of intelligent production of lithium batteries, if it is possible to interact with the capacity prediction system through an intelligent assistant, relevant production data information can be queried at any time, and data matching analysis can be performed on the actual capacity and predicted capacity of production, and a production line data analysis report can be generated to provide feasibility suggestions for production. This not only reduces the difficulty of using the system, but also allows people who do not know data analysis to get the desired analysis report and specific values, thereby improving production efficiency and reducing personnel maintenance costs and usage costs. However, in the prior art, there are no reports on combining intelligent assistants with capacity prediction systems and applying them to intelligent production of lithium batteries, so improvements are needed. Summary of the invention
[0003] In view of the shortcomings of the prior art, the present invention proposes a method, electronic device, and storage medium based on open source large models and databases combined with intelligent interaction and analysis. The intelligent assistant can be combined with the capacity prediction system and applied to the intelligent production of lithium batteries. Users can operate the system under the guidance of the intelligent assistant, reducing the workload of implementation personnel, and can automatically generate data analysis reports to comprehensively analyze and summarize the production line situation.
[0004] To implement the above technical solution, the present invention provides a method based on open source big model and database combined with intelligent interaction and analysis, which specifically includes the following steps:
[0005] S1: Selection of open source large models;
[0006] S2: Construction of fine-tuning dataset and model fine-tuning;
[0007] S3: Prompt word engineering construction;
[0008] S4: Choice of interaction method between user and large model;
[0009] S5: The large model is combined with the database to generate an analysis report.
[0010] Preferably, in step S1, the selection of open source big models includes domestic open source big models and foreign open source big models, wherein the domestic open source big models include Tongyi Qianwen series, Baichuan Intelligent series, Zhipu AI series, and Zero One Everything series, and the foreign open source big models include llama series and Gemini series, and a combination of one or more of these big models is used when selecting a model.
[0011] Preferably, in step 2, the fine-tuning data set is constructed by collecting problems occurring on the production line and constructing an internal knowledge data set of the enterprise, and the data set format is in the form of questions and answers.
[0012] Preferably, in step 2, the model fine-tuning methods include full parameter fine-tuning and efficient parameter fine-tuning, wherein the efficient parameter fine-tuning methods include LoRA, QLoRA, P-Tuning, P-Tuning-V2, Prefix-Tuning, and Prompt-Tuning.
[0013] Preferably, in step S3, the prompt word engineering construction method includes:
[0014] S31, Zero-shot: by simply inputting instructions or questions;
[0015] S32, Few-shot: The model is given a small number of samples during inference, but weight updates are not allowed;
[0016] S33. Use thinking chain COT prompts: First, ask the model a question that requires reasoning; then, guide the model to identify the key information in the question, and then gradually develop reasoning based on this information, prompting the model to begin to form a thinking chain; then, in the thinking chain, the model explicitly outputs each intermediate reasoning step; finally, when the thinking chain is complete, the model derives the final answer based on these intermediate steps.
[0017] Preferably, in step S4, the user and the big model interaction mode includes: the user directly interacts with the big model through question and answer, knowledge query, and the user uses the big model to query database data.
[0018] Preferably, in step S5, the step of combining the big model with the database to generate an analysis report includes intelligently diagnosing and analyzing the capacity prediction system of the lithium battery production line through the four parts of planning, memory, tools, and actions of the big model to generate a data analysis report.
[0019] Preferably, in step S5, when the large model automatically generates a data analysis report in combination with the database, it will actively identify the user's intention to decide to generate different types of reports, and break down complex tasks into different subtasks, execute them step by step, and consider adjusting the tools to be called in the next step, and finally form an analysis report.
[0020] The present invention also provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by a processor, they are used to implement the above-mentioned method based on intelligent interaction and analysis combined with an open source big model and a database.
[0021] The present invention also provides an electronic device, comprising a processor and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the above-mentioned method based on intelligent interaction and analysis combined with an open source large model and a database.
[0022] The beneficial effects of the method, electronic device, and storage medium based on the open source big model combined with the database for intelligent interaction and analysis provided by the present invention are: the present invention successfully combines the intelligent assistant with the capacity prediction system and applies it to the intelligent production of lithium batteries, and the intelligent interaction and analysis are all based on the open source big model combined with the database, and can query relevant production data information at any time, as well as perform data matching analysis on the actual capacity and predicted capacity of production, generate production line data analysis reports, and provide feasibility suggestions for production, which not only reduces the difficulty of using the system, but also allows people who do not know data analysis to obtain the desired analysis reports and specific values, thereby improving production efficiency and reducing personnel maintenance costs and usage costs. Users operate the system under the guidance of the intelligent assistant, reducing the workload of the implementation personnel, and can automatically generate data analysis reports to comprehensively analyze and summarize the situation of the production line. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 It is the overall flow chart of the present invention.
[0024] Figure 2 Flowchart of the intelligent agent system driven by the large model of this method.
[0025] Figure 3 This is a flow chart of the interaction between the intelligent assistant and the database system.
[0026] Figure 4 Flowchart of different interaction modes of the smart assistant. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary persons in the art without creative work are within the scope of protection of the present invention.
[0028] Embodiment 1: A method based on open source big model and database combined with intelligent interaction and analysis.
[0029] Figure 1 The present invention is a schematic diagram of the overall process of the intelligent query and analysis method based on the open source big model and database. The present invention is implemented based on an electronic device, such as a computer device, and the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The computer program can be applied on a server. When the processor executes the program, the intelligent query and analysis method based on the open source big model and database can be implemented, wherein the method includes the following steps:
[0030] 1. Selection of open source large models:
[0031] Domestic large models can choose Tongyi Qianwen series, Baichuan Intelligent series, Zhipu AI series, Zero One Wanwu series, etc. Foreign large models can choose llama series, Gemini series, etc. When selecting a model, you can use the effect of one or more large model combinations.
[0032] 2. Construction of fine-tuning dataset and model fine-tuning:
[0033] The fine-tuning dataset is constructed by collecting common problems in the production line and building a fine-tuning dataset based on the internal knowledge of the enterprise. The dataset format is in the form of question and answer. The fine-tuning format of different large models is slightly different. The parameter amounts that can be selected for the open source large model are 7B, 8B, 9B, 13B, etc.
[0034] You can also choose full parameter fine-tuning (FFT) or parameter efficient fine-tuning (PEFT) when choosing fine-tuning algorithms. Full parameter fine-tuning will lose diversity, cause catastrophic forgetting, and make downstream deployment and maintenance cumbersome. Therefore, efficient fine-tuning has low requirements on hardware facilities, retains the capabilities of the original large model, and can learn domain knowledge. The available fine-tuning methods include LoRA, QLoRA, P-Tuning, P-Tuning-V2, Prefix-Tuning, Prompt-Tuning, etc. You can use the fine-tuning dataset to select different fine-tuning methods for verification testing.
[0035] The working principles, specific implementation steps, advantages and related formulas of LoRA, QLoRA, P-Tuning, P-Tuning-V2, Prefix-Tuning and Prompt-Tuning fine-tuning methods are explained as follows:
[0036] 1. LoRA (Low-Rank Adaptation)
[0037] Working principle: LoRA achieves fine-tuning by adding a low-rank matrix (i.e., the product of two smaller matrices) to the parameter matrix of the pre-trained model. The number of parameters of this low-rank matrix is far less than that of the original model, which significantly reduces the computational and storage costs.
[0038] Implementation steps: Freeze the original parameters of the pre-trained model; add low-rank matrices as increments in specific layers of the model (such as fully connected layers, attention layers, etc.); train these low-rank matrices while keeping the original parameters unchanged; after fine-tuning, use the low-rank matrices in combination with the original parameters for inference.
[0039] Its advantages are that it significantly reduces computing and storage costs. It requires fewer parameters for fine-tuning, making it easier to deploy and share. Different low-rank matrices can be trained for different tasks.
[0040] LoRA trains two low-rank matrices A and B so that their product ΔW approximates the change in the original parameter matrix W. That is:
[0041] ΔW≈AB
[0042] Among them, the dimension of A is r×m, the dimension of B is n×r, and r is much smaller than n and m.
[0043] 2.QLoRA (Quantized Low-Rank Adaptation)
[0044] Working principle: QLoRA further reduces the storage requirements and computational complexity of the model by quantizing the low-rank matrix in LoRA (i.e. mapping continuous floating-point numbers to a finite set of discrete values).
[0045] Implementation steps: Add and train low-rank matrices according to the LoRA method; quantize the trained low-rank matrices; use the quantized low-rank matrices for inference.
[0046] The advantage is that the model size can be further reduced through quantization. The quantized model can be executed faster on the hardware.
[0047] 3.P-Tuning
[0048] Working principle: P-Tuning converts the traditional fixed prompt into a learnable embedding layer and processes these embeddings through the transformer network structure, thereby automatically optimizing the prompt during training.
[0049] Implementation steps: Convert Prompt to a learnable Embedding layer; use network structures such as transformer to process Prompt Embedding; combine the processed Prompt Embedding with the model input for training.
[0050] Its advantages: Automatically optimize Prompt and improve the adaptability of the model to different tasks. By adjusting PromptEmbedding, the model behavior can be flexibly controlled.
[0051] 4.P-Tuning-V2
[0052] How it works: P-Tuning-V2 further improves on P-Tuning by applying continuous prompts to every layer of the pre-trained model, not just the input layer, to capture deeper semantic information.
[0053] Implementation steps: Insert continuous prompt embeddings in each layer of the pre-trained model; use appropriate network structures (such as transformers) to process these embeddings; train the entire model to optimize the prompt embeddings of all layers.
[0054] Its advantages: It captures more semantic information and improves model performance. It is suitable for a variety of downstream tasks.
[0055] 5.Prefix-Tuning
[0056] How it works: Prefix-Tuning fine-tunes the pre-trained model by adding a series of trainable "virtual tokens" as prefixes before the model input layer. These virtual tokens are optimized during the training process to guide the model output.
[0057] Implementation steps: Add virtual label embeddings before the model input layer; use training data to optimize these virtual label embeddings; use the optimized virtual labels together with the model input for inference.
[0058] Its advantage is that model fine-tuning can be achieved by adjusting only a small number of virtual markers.
[0059] 3. Construction of prompt word project:
[0060] The ways to construct the prompt word project include:
[0061] 1. Zero-shot guides the model to output the desired result by simply inputting instructions or questions (which can include context information and output format, etc.). The main advantage is its speed and convenience, which allows us to easily try new tasks and verify new ideas.
[0062] 2. The model is given a small number of samples at inference time, but no weight updates are allowed. Few-shot works by providing K samples and then expecting the model to generate the corresponding results. The main advantage of Few-shot is that it greatly reduces the need for task-specific data and reduces the learning of overly narrow distributions from fine-tuning datasets. In addition, a small amount of task-specific data is still required.
[0063] 3. Use the Chain-of-Thought (COT) prompt method, which mainly includes the following steps:
[0064] a. Problem formulation: First, we ask the model a question that requires reasoning.
[0065] b. Thinking chain guidance: Next, we prompt the model to start forming a thinking chain. This usually means that we need to guide the model to identify the key information in the problem and then gradually develop reasoning based on this information.
[0066] c. Intermediate step reasoning: In the thinking chain, the model needs to explicitly output each intermediate reasoning step. These steps should be logically coherent and clear, and can gradually guide the model to the final answer.
[0067] d. Final answer: When the thinking chain is complete, the model derives the final answer based on these intermediate steps. In this way, the thinking chain COT prompt method not only improves the model's reasoning ability, but also makes the reasoning process more transparent and explainable. Users can understand how the model gradually arrives at the answer by viewing the intermediate reasoning steps of the model, thereby increasing their trust in the model's decision.
[0068] 4. Choice of interaction method between users and large models:
[0069] The ways in which users interact with the big model include: users directly interacting with the big model through question and answer, knowledge query, and users using the big model to query database data.
[0070] 5. The large model combines with the database to automatically generate analysis reports:
[0071] The present invention uses the four parts of the big model, namely, planning, memory, tools, and action, to perform intelligent diagnosis and analysis on the capacity prediction system of the lithium battery production line to generate a data analysis report. When the big model automatically generates a data analysis report in combination with the database, it will actively identify the user's intention to decide to generate different types of reports, and decompose complex tasks into different subtasks, execute them step by step, and consider adjusting the tools to be called in the next step, and finally form an analysis report.
[0072] The process of generating a detailed data analysis report using the present invention takes into account the scalability, stability of the system and the fluency of user interaction. The capacity prediction AI intelligent analysis platform realizes the long-term memory function by maintaining a detailed data dictionary and indicator dictionary. These dictionaries contain business logic, data source information and historical queries, which help the system better understand the user's query intent and provide accurate data analysis results. The platform has the ability to decompose complex data analysis tasks into multiple subtasks, each of which is easier to manage and execute. This task decomposition capability is based on the platform's reasoning and logical thinking ability, and can efficiently arrange and optimize the query process. The platform is designed with an advanced SQL parser that is compatible with different data service interfaces. For complex data analysis needs, the platform can support advanced data processing and visualization functions through built-in or external code libraries. Finally, the relevant data analysis report is generated.
[0073] Three different interaction methods are evaluated. 1. In the process of users directly interacting with the big model, the accuracy of the information returned after fine-tuning the model and the real information is mainly considered. The RAGAS evaluation framework is used, with a loyalty score of 0.91, an answer relevance score of 0.92, a contextual accuracy of 0.92, and a contextual recall rate of 0.94. 2. Users interact with the database through intelligent queries through the big model, and the evaluation is based on whether the returned values are consistent with the database data. The accuracy of single-table data is 100%, and the accuracy of related queries between two tables and multiple tables can reach 95%. 3. The quality evaluation of the big model in generating data analysis reports can reach 98% in terms of data accuracy. The data also covers various aspects of the problem, and the key issues and trends are fully discussed and reasoned. The analysis method is also in line with the characteristics of the production line. There are charts to display the data, and reasonable suggestions are given for the production situation, which optimizes the production line production situation and has great reference significance for discovering production line production problems.
[0074] By applying the method of the present invention based on the open source big model and database combined with intelligent interaction and analysis to the intelligent agent assistant, the following improvements are made to the traditional capacity prediction system:
[0075] 1. Intelligent agent assistants can automatically perform data query tasks, quickly extract required information from large amounts of data, and reduce the time cost of manual query. Agents can more accurately locate key data and reduce query errors.
[0076] 2. The intelligent agent assistant uses statistical knowledge, machine learning and other technologies to conduct in-depth analysis of the battery's actual capacity and predicted capacity data, discover potential patterns or anomalies, realize real-time data analysis, and provide support for quick decision-making.
[0077] 3. Intelligent agents can automatically generate detailed data analysis reports, including trend forecasting, anomaly detection, etc., to improve work efficiency. According to user needs, personalized report content can be generated to meet diverse analysis needs.
[0078] 4. Users can interact with the intelligent agent through natural language, query data, obtain analysis results, and improve user experience. The combination of the intelligent agent assistant and the lithium battery capacity prediction system has shown significant advantages in all aspects of data processing, greatly improving work efficiency and the depth and breadth of data analysis. Compared with traditional systems, it is more intelligent, efficient, and user-friendly.
[0079] The present invention successfully combines the intelligent assistant with the capacity prediction system and applies it to the intelligent production of lithium batteries. The intelligent interaction and analysis are all based on the combination of open source large models and databases. It can query relevant production data information at any time, and perform data matching analysis on the actual production capacity and predicted capacity, generate production line data analysis reports, and provide feasibility suggestions for production. It not only reduces the difficulty of using the system, but also allows people who do not know data analysis to get the desired analysis reports and specific values, thereby improving production efficiency and reducing personnel maintenance costs and usage costs. Users operate the system under the guidance of the intelligent assistant, reducing the workload of implementation personnel, and can automatically generate data analysis reports to comprehensively analyze and summarize the situation of the production line.
[0080] Embodiment 2: A computer-readable storage medium
[0081] A computer-readable storage medium stores one or more programs, which, when executed by a processor, are used to implement the method of intelligent interaction and analysis based on an open source big model combined with a database in the above-mentioned embodiment 1.
[0082] Embodiment 3: An electronic device
[0083] An electronic device includes a processor and a memory arranged to store computer executable instructions. When the executable instructions are executed, the processor executes the method of intelligent interaction and analysis based on an open source big model and a database in the above-mentioned embodiment 1.
[0084] The above description is only a preferred embodiment of the present invention, but the present invention should not be limited to the contents disclosed in the embodiment and the drawings, so any equivalent or modification completed without departing from the spirit disclosed in the present invention shall fall within the scope of protection of the present invention.
Claims
1. A method based on open source big model and database combined with intelligent interaction and analysis, characterized by The specific steps include: S1: Selection of open source large models; S2: Construction of fine-tuning dataset and model fine-tuning; S3: Prompt word engineering construction; S4: Choice of interaction method between user and large model; S5: The large model is combined with the database to generate an analysis report.
2. The method based on open source big model and database combined with intelligent interaction and analysis as claimed in claim 1, characterized in that: In step S1, the selection of open source big models includes domestic open source big models and foreign open source big models, among which the domestic open source big models include Tongyi Qianwen series, Baichuan Intelligent series, Zhipu AI series, and Zero One Everything series, and the foreign open source big models include llama series and Gemini series. When selecting a model, a combination of one or more of these big models is used.
3. The method based on open source big model and database combined with intelligent interaction and analysis as claimed in claim 1, characterized in that: In step 2, the fine-tuning data set is constructed by collecting problems occurring on the production line and constructing an internal knowledge data set of the enterprise, and the data set format is a question-and-answer format.
4. The method based on open source big model and database combined with intelligent interaction and analysis as claimed in claim 3, characterized in that: In step 2, the model fine-tuning methods include full parameter fine-tuning and parameter efficient fine-tuning, wherein the parameter efficient fine-tuning methods include LoRA, QLoRA, P-Tuning, P-Tuning-V2, Prefix-Tuning, and Prompt-Tuning.
5. The method based on open source big model and database combined with intelligent interaction and analysis as claimed in claim 1, characterized in that: In step S3, the method of constructing the prompt word project includes: S31, Zero-shot: by simply inputting instructions or questions; S32, Few-shot: The model is given a small number of samples during inference, but weight updates are not allowed; S33. Use thinking chain COT prompts: First, ask the model a question that requires reasoning; then, guide the model to identify the key information in the question, and then gradually develop reasoning based on this information, prompting the model to begin to form a thinking chain; then, in the thinking chain, the model explicitly outputs each intermediate reasoning step; finally, when the thinking chain is complete, the model derives the final answer based on these intermediate steps.
6. The method based on open source big model and database combined with intelligent interaction and analysis as claimed in claim 1, characterized in that: In step S4, the user and the big model interact in the following ways: the user directly conducts question-and-answer interaction and knowledge query with the big model, and the user uses the big model to query database data.
7. The method based on open source big model and database combined with intelligent interaction and analysis as claimed in claim 1, characterized in that: In step S5, the step of combining the big model with the database to generate an analysis report includes intelligently diagnosing and analyzing the capacity prediction system of the lithium battery production line through the four parts of planning, memory, tools and actions of the big model to generate a data analysis report.
8. The method based on open source big model and database combined with intelligent interaction and analysis as claimed in claim 7, characterized in that: In step S5, when the large model automatically generates a data analysis report in combination with the database, it will actively identify the user's intention to decide to generate different types of reports, and break down complex tasks into different subtasks, execute them step by step, and consider adjusting the tools to be called in the next step, and finally form an analysis report.
9. A computer-readable storage medium storing one or more programs, characterized in that: When one or more programs are executed by a processor, they are used to implement the method based on open source big model and database combined with intelligent interaction and analysis as described in any one of claims 1-8.
10. An electronic device comprising a processor and a memory arranged to store computer executable instructions, characterized in that: When the executable instructions are executed, the processor executes the method based on open source big model and database combined with intelligent interaction and analysis as described in any one of claims 1-8.