AI intelligent assistant for meteorological service system
By locally deploying Python large language model and Java backend functions, the problem of immature application of large language model in the field of meteorological professionals is solved, and the safe and stable operation and intelligent services of AI intelligent assistants in the meteorological service system are realized, and the access and processing of privatized knowledge bases are supported, which improves the linkage and scalability of the system.
Patent Information
- Application Number
- CN202510119766.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-25
- Publication Date
- 2025-05-27
AI Technical Summary
The application practice of large language models in the field of meteorological professionals is immature and lacks support for professional field knowledge and intelligent services.
The Python large language model localization deployment and API interface module are adopted, combined with Java back-end function fusion and front-end interface display module, semantic recognition and user intention judgment are realized, and through multi-source meteorological data processing and model training unit and intelligent AIAgent construction unit, the access and processing of the privatized knowledge base is supported.
It realizes the safe and stable operation of AI intelligent assistants in the meteorological service system, supports the access and processing of the privatized knowledge base, improves the linkage and scalability of the system, and provides intelligent services with high security and stable operation.
Smart Images

Figure CN120045264A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent system services, and in particular, to an AI intelligent assistant for a meteorological service system. Background Art
[0002] Natural language processing is an important research direction in the field of artificial intelligence. It integrates knowledge from multiple disciplinary fields such as linguistics, computer science, machine learning, mathematics, and cognitive psychology. It is an interdisciplinary subject integrating computer science, artificial intelligence, and linguistics. It includes two main aspects: natural language understanding and natural language generation. The research content includes various levels such as characters, words, phrases, sentences, paragraphs, and chapters. It is a bridge for communication between machine language and human language. Its aim is to enable machines to understand, interpret, and generate human language, and to achieve effective communication between humans and machines. Large language models such as GPT are important research achievements in natural language processing technology.
[0003] A large language model refers to a deep learning model trained using a large amount of text data, which can generate natural language text or understand the meaning of language text. Large language models can handle various natural language tasks, such as text classification, question answering, dialogue, etc. They are an important way to artificial intelligence. In recent years, large language models have developed rapidly in the general field, and many large model products have emerged on the market. However, their application practice in sub - fields such as the meteorological field is not yet mature. On the one hand, the models lack in - depth knowledge in the meteorological professional field, and on the other hand, there is a lack of applications of using large language models to achieve intelligent services in meteorological service systems.
[0004] In view of these problems, how to provide an AI intelligent assistant for a meteorological service system has become a technical problem that needs to be urgently solved by those skilled in the art. Summary of the Invention
[0005] In view of this, the purpose of the present invention is to provide an AI intelligent assistant for a meteorological service system, which is fully locally deployed with high security and stable operation, supports the access and processing of a private knowledge base, and realizes the linkage and integration of the AI intelligent assistant with the entire system.
[0006] The present invention adopts the following technical solutions to solve the technical problems:
[0007] An AI intelligent assistant for a meteorological service system includes: a Python large language model local deployment and api interface module, a Java backend function integration and api interface module, and a front - end interface display module;
[0008] The front - end interface display module is used for user interaction display, receiving user instructions and feeding back the background output;
[0009] The Java back-end function integration and API interface module is mainly responsible for the bottom-layer implementation of the Python large language model algorithm. As the center of the entire system, it not only integrates and packages the Python large language model algorithm but also directly interacts with the front-end interface display module. At the same time, it is responsible for the user management and database management of the entire system;
[0010] The Python large language model local deployment and API interface module is used for semantic recognition to judge the user's intention and, at the same time, make question recommendations according to the user's question.
[0011] Furthermore, the specific method for judging the user's intention and making question recommendations according to the user's question is as follows: Select the system function according to the result of judging the user's intention by the AI Agent. When it is judged as the Q&A dialogue function, answer the corresponding question; when it is judged as a function other than the Q&A dialogue, return the link to the corresponding function, and the user can quickly jump to the corresponding system function through the link.
[0012] Furthermore, the Python large language model local deployment and API interface module includes a multi-source meteorological data processing and model training unit, an intelligent AI Agent building unit, and a function API interface;
[0013] The multi-source meteorological data processing and model training unit is used to sort and classify the collected meteorological data and train the open-source large language model;
[0014] The intelligent AI Agent building unit is used to build an intelligent AI Agent according to the trained open-source large language model;
[0015] The function API interface is used to realize the data interaction between the Python large language model local deployment and API interface module and the Java back-end function integration and API interface module.
[0016] Furthermore, the implementation method of the multi-source meteorological data processing and model training unit includes:
[0017] S1, Sort and classify the collected meteorological data;
[0018] S2, For the large-scale long text data in the meteorological data, first split it into paragraphs with a length not exceeding 1000, and then extract the Q&A pairs through the pre-trained open-source large model;
[0019] S3, For the numerical table data, use the manual processing method to convert the table data into natural language form, and then use the method in S2 to extract the Q&A pairs;
[0020] S4. Further screen and clean the Q&A pairs obtained in S2 and S3 to obtain the final training data;
[0021] S5. Use the fine-tuning method to train the open-source large language model with the obtained training data.
[0022] Furthermore, the fine-tuning method adopted in S5 is as follows:
[0023] The open-source large language model contains a large number of deep network layers. First, select the target layers for applying LoRA in the pre-trained neural network model; select the query Q and key K matrices in the self-attention mechanism layer and the final MLP fully connected layer;
[0024] For each deep network layer, its parameter matrix is W, and after one training, the parameter becomes W'. There is the following formula:
[0025] W' = W + A * B,
[0026] where W is a d*k matrix, A is a d*r matrix, and B is an r*k matrix, and r is much smaller than min(d,k);
[0027] In this way, only the two matrices A and B can be updated during the training process, while locking the parameters of the W matrix. In this way, the number of parameters to be updated during the training process will be greatly reduced, which not only reduces the hardware configuration requirements but also improves the training speed.
[0028] Furthermore, the implementation method of the intelligent AI Agent building unit is as follows:
[0029] V1. Locally deploy the fine-tuned and trained large language model; use the python3.10 version and complete the deployment based on the langchain, xinference, and pytorch libraries. After deployment, provide interface services externally through the http protocol;
[0030] V2. Through prompt engineering, customize prompts and continuously interact with the model for testing to obtain the optimal prompt template;
[0031] V3. Combine the prompt template in V2 with the user's instruction, process it through the interface service of the locally deployed large language model to obtain the return result, judge the user's intention, and then call the subsequent corresponding modules for processing to complete the conversation or function navigation function.
[0032] Furthermore, the function api interface includes:
[0033] The conversation interface of the large language model, which is used to directly call the large language model for conversation;
[0034] Network search interface for conducting network searches via bing-search;
[0035] Web crawler interface for obtaining text content from specified web pages;
[0036] Weather query interface for querying real-time weather;
[0037] Knowledge base Q&A interface for searching for content related to questions in the local knowledge base and then organizing and answering through large language models;
[0038] Graph plotting interface for plotting some meteorological-related charts required by the system.
[0039] Furthermore, the front-end interface display module includes an animation module and a system subscription center module;
[0040] The animation module realizes real-time drawing of the assistant animation and obtains the dynamic assistant messages through even-datasource;
[0041] The system subscription center module realizes message broadcasting to the entire system and realizes the calling and linkage of other modules through the assistant to achieve the calling of the menu function by the assistant text.
[0042] Advantages of the present invention:
[0043] Aiming at the problems that the model lacks in-depth knowledge in the meteorological professional field and the application of using large language models to realize intelligent services in meteorological service systems is lacking, the present invention provides a secure, stable and highly extensible AI intelligent assistant for meteorological service systems, which is completely locally deployed with high security and stable operation, supports the access and processing of private knowledge bases, and realizes the linkage and integration of the AI intelligent assistant with the entire system. Description of the drawings
[0044] Figure 1 Is the flowchart of the implementation method of the present invention;
[0045] Figure 2 Is the daily Q&A effect diagram of the present invention;
[0046] Figure 3 Is the meteorological Q&A effect diagram of the present invention;
[0047] Figure 4 Is the intelligent retrieval effect diagram of the content of the present invention;
[0048] Figure 5 Is the intelligent navigation effect diagram of the content;
[0049] Figure 6 Is the quick question jump effect diagram. Detailed implementation manners
[0050] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0051] The present invention provides an AI intelligent assistant for a meteorological service system, including: a Python large language model local deployment and API interface module, a Java backend function integration and API interface module, and a front-end interface display module;
[0052] The front-end interface display module is used for user interaction display, receiving user instructions, and feedbacking the background output;
[0053] The Java backend function integration and API interface module is mainly responsible for the bottom-layer implementation of the Python large language model algorithm. As the center of the entire system, it not only integrates and packages the Python large language model algorithm but also directly interacts with the front-end interface display module. At the same time, it is responsible for the user management and database management of the entire system;
[0054] The Python large language model local deployment and API interface module is used for semantic recognition, judging user intentions, and making question recommendations according to user questions.
[0055] Further, the specific method for judging user intentions and making question recommendations according to user questions is: selecting system functions according to the results of judging user intentions by the AI Agent. When it is judged as the Q&A dialogue function, corresponding questions are answered; when it is judged as a function other than the Q&A dialogue, the link of the corresponding function is returned, and the user can quickly jump to the corresponding system function through the link.
[0056] Further, the Python large language model local deployment and API interface module includes a multi-source meteorological data processing and model training unit, an intelligent AI Agent building unit, and a function API interface;
[0057] The multi-source meteorological data processing and model training unit is used for sorting and classifying the collected meteorological data and training an open-source large language model;
[0058] The intelligent AI Agent building unit is used for building an intelligent AI Agent according to the trained open-source large language model;
[0059] The described functional API interface is used to implement the local deployment of the Python large language model, the integration of the API interface module with the Java backend functions, and the data interaction of the API interface module.
[0060] Furthermore, the implementation method of the multi-source meteorological data processing and model training unit includes:
[0061] S1. Sort and classify the collected meteorological data.
[0062] S2. For the large-scale long text data (such as meteorological books and literature) in the meteorological data, first perform splitting processing to process it into paragraphs with a length not exceeding 1000, and then extract question-answer pairs through a pre-trained open-source large model.
[0063] S3. For numerical table data, adopt the method of manual processing to convert the table data into natural language form, and then use the method in S2 to extract question-answer pairs.
[0064] S4. Further screen and clean the question-answer pairs obtained in S2 and S3 to obtain the final training data.
[0065] S5. Use the fine-tuning method to train the open-source large language model with the obtained training data. The model used here is chatglm-4-9b, which is a lightweight open-source large model with relatively low hardware requirements and is easier to train and locally deploy.
[0066] The fine-tuning method specifically uses LoRA (Low-Rank Adaptation). The core idea of LoRA is to adjust these parameter matrices in a low-rank manner. Mathematically, low-rank means that a matrix can be approximated by multiplying two smaller matrices.
[0067] The fine-tuning method is as follows:
[0068] The open-source large language model contains a large number of deep network layers. First, select the target layers for applying LoRA in the pre-trained neural network model; these layers are usually related to specific tasks. We select the query Q and key K matrices in the self-attention mechanism layer and the final MLP fully connected layer;
[0069] For each deep network layer, its parameter matrix is W, and after one training, the parameter becomes W'. There is the following formula:
[0070] W' = W + A * B,
[0071] where W is a d*k matrix, A is a d*r matrix, and B is an r*k matrix, and r is much smaller than min(r,k);
[0072] Then, during the training process, only the A and B matrices can be updated, while the W matrix parameters are locked. This greatly reduces the number of parameters that need to be updated during the training process, which not only reduces the hardware configuration requirements, but also increases the training speed.
[0073] The implementation method of the intelligent AIAgent building unit is:
[0074] V1. Local deployment of fine-tuned trained large language models; use Python 3.10 version, based on langchain, xinference, pytorch and other libraries to complete the deployment, after deployment, the interface service can be provided to the outside through the http protocol;
[0075] V2. Through the prompt word engineering, the customized prompt words are constantly tested with the model to obtain the optimal prompt word template; here we use the Few-shot Prompting method, that is, adding a small number of examples to the prompt words for prompting. First, it is explained that as an AI agent, what kind of judgments need to be made on user instructions: question and answer or function navigation or other customized functions, and add specific instructions for each function in the prompt words.
[0076] V3. Combine the prompt word template in V2 with the user instruction and process it through the locally deployed large language model interface service to obtain the return result, determine the user's intention, and then call the subsequent corresponding module for processing to complete the dialogue or function navigation or other customized functions.
[0077] The functional API interfaces include: a conversation interface of a large language model, which is used to directly call the large language model for conversation; a network search interface, which is used to search the network through bing-search; a web crawler interface, which is used to obtain the text content in a specified web page; a weather query interface, which is used to query real-time weather; a knowledge base question and answer interface, which is used to search for question-related content from the local knowledge base and then sort and answer it through the large language model; a drawing interface, which is used to draw some weather-related charts required by the system, etc. The above interfaces are completed by the python backend.
[0078] The front-end interface display module includes an animation module and a system subscription center module; the animation module realizes the real-time drawing of the assistant animation and obtains the assistant message dynamics through even-datasource; the system subscription center module realizes the message broadcast to the whole system, and through the assistant's call linkage to other modules, the assistant text calls out the menu function, such as map data loading, etc. The front-end interface display module has the characteristics of fast response speed, smooth animation, low coupling, etc.
[0079] In view of the problems that the model lacks in-depth knowledge in the meteorological professional field and the application of using large language models to achieve intelligent services in meteorological service systems is lacking, the present invention provides an AI intelligent assistant for meteorological service systems that is safe, stable, and highly scalable. It is fully locally deployed with high security and stable operation, supports the access and processing of private knowledge bases, and realizes the linkage and integration of the AI intelligent assistant with the entire system.
[0080] Reference Figures 1-6 , the working mode of the present invention is as follows:
[0081] (1) Intent recognition: The user inputs a question through the AI intelligent assistant interface, and the front end receives the question and passes it to the back end. The back end first performs semantic recognition through the AI Agent to judge the user's intent, and at the same time makes question recommendations based on the user's question. Then, according to the result of the AI Agent's judgment of the user's intent, system functions are selected. When it is judged as a dialogue function such as Q&A, corresponding questions are answered; when it is judged as other functions of the system, a link to the corresponding function is returned, and the user can quickly jump to the corresponding system function through the link. The implementation method of the AI Agent here is: using a custom prompt plus the user's question as the input to the large language model, and the large language model performs semantic analysis and user intent judgment.
[0082] The following is the prompt word template corresponding to the AI Agent. The prompt words can be modified according to the specific functions included in the system. The user's question is used to replace the user's question content, and the prompt word filled with the user's question is used as the input to the large language model. After being processed by the model, the name of the system function judged by the model will be returned. For example, when the user asks: "What is a storm surge?", after the above steps, "Meteorological Q&A" will be output. In this way, the function of intelligently identifying the user's intent is realized.
[0083] (2) Search and Q&A: The user's question is searched on the Internet, and then the user's question and the searched content are integrated through a custom prompt word, and then the large language model api is called to process the prompt word to make an answer.
[0084] 1) Intent recognition to the corresponding search and Q&A for the user's question;
[0085] 2) Perform a network search api search on the user's question to collect the searched text content;
[0086] 3) Integrate the user's question and the searched text content through the prompt word template, and replace {{context}} in the following prompt word template with the searched text content and {{question}} with the user's question;
[0087] 4) Use the processed prompt word as the model input, call the large language model for processing, and return the final answer.
[0088] (3) Meteorological Q&A: This part uses a local meteorological knowledge base and is implemented using the RAG architecture. The text corpus in the local meteorological knowledge base is segmented into short text chunks, and then each text chunk is processed into a vector representation through an embedding model, which is used as the index of the text chunk. Then, the similarity between the vector representation of the question and the index vector is calculated to find the most relevant text chunks. Finally, these text chunks and the question are integrated through a custom prompt, and the large language model api is called to process the prompt to give an answer. The specific implementation is similar to that in (2).
[0089] (4) Popular science article writing: By customizing the prompt, specifying the format and writing style of the article, and calling the large language model api to generate the corresponding popular science article.
[0090] (5) Weather query: The real-time weather information is obtained by calling the weather query api, and then through a custom prompt, the large language model api is called to organize the real-time weather information and return the result. The specific steps are as follows:
[0091] 1) Conduct a weather api query according to the user's question, such as "What's the weather like in Beijing today?"
[0092] 2) After the query, weather data in dictionary format will be obtained, as exemplified below:
[0093] 3) Integrate the user's question and the queried weather data in combination with the prompt template.
[0094] 4) Use the processed prompt as the model input, call the large language model for processing, and return the final answer.
[0095] (6) Poster generation: Through web search and web crawler interfaces, obtain the element information required in the poster, extract the specific information required through the large language model api and custom prompts, and provide chart materials by calling the chart drawing interface for poster production.
[0096] (7) Conversation history management: Store and manage the conversation history through a database.
[0097] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An AI intelligent assistant for a meteorological service system, characterized in that: include: Python large language model localization deployment and API interface module, Java backend function integration and API interface module and front-end interface display module; The front-end interface display module is used for user interactive display, receiving user instructions and feedback background output; The Java backend function integration and API interface module is mainly responsible for the bottom-level implementation of the Python large language model algorithm. As the hub of the entire system, it not only integrates and packages the Python large language model algorithm but also interacts directly with the front-end interface display module. It is also responsible for user management and database management of the entire system. The Python large language model localization deployment and API interface module are used to perform semantic recognition, determine user intent, and recommend questions based on user questions.
2. The AI intelligent assistant for a meteorological service system according to claim 1, characterized in that: The specific method for judging user intention and recommending questions based on user questions is as follows: select system functions based on the result of AI Agent judging user intention, and answer corresponding questions when it is judged to be a question-and-answer dialogue function; when it is judged to be a function other than question-and-answer dialogue, return a link to the corresponding function, and the user can quickly jump to the corresponding system function through the link.
3. An AI intelligent assistant for a meteorological service system according to claim 1 or 2, characterized in that: The Python large language model local deployment and API interface module includes multi-source meteorological data processing and model training units, intelligent AIAgent building units and functional API interfaces; The multi-source meteorological data processing and model training unit is used to organize and classify the collected meteorological data and train the open source large language model; The intelligent AI Agent building unit is used to build an intelligent AI Agent based on the trained open source large language model; The functional api interface is used to realize the localized deployment of the Python large language model, the integration of the api interface module with the Java backend functions, and the data interaction of the api interface module.
4. The AI intelligent assistant for a meteorological service system according to claim 3, characterized in that: The implementation method of the multi-source meteorological data processing and model training unit includes: S1, sort and classify the collected meteorological data; S2: For large-scale long text data in meteorological data, it is first split and processed into paragraphs with a length of no more than 1,000, and then question-answer pairs are extracted through a pre-trained open source large model; S3, for numerical table data, manual processing is used to convert the table data into natural language form, and then the question-answer pairs are extracted using the method in S2; S4, further screening and cleaning the question-answer pairs obtained in S2 and S3 to obtain the final training data; S5, uses the fine-tuning method to train the open source large language model using the obtained training data.
5. The AI intelligent assistant for a meteorological service system according to claim 4, characterized in that: The fine-tuning method used in S5 is as follows: The open source large language model contains a large number of deep network layers. First, select the target layer for applying LoRA in the pre-trained neural network model; select the query Q and key K matrices in the self-attention mechanism layer and the final MLP fully connected layer; For each deep network layer, its parameter matrix is W. After one training, the parameter becomes W', which has the following formula: W'=W+A*B, Where W is a d*k matrix, A is a d*r matrix, and B is an r*k matrix, where r is much smaller than min(r,k); In this way, only the A and B matrices can be updated during the training process, while the W matrix parameters are locked. This greatly reduces the number of parameters that need to be updated during the training process, which not only reduces the hardware configuration requirements but also increases the training speed.
6. The AI intelligent assistant for a meteorological service system according to claim 5, characterized in that: The implementation method of the intelligent AIAgent building unit is: V1. Local deployment of fine-tuned trained large language models; use Python 3.10 version, based on langchain, xinference, and pytorch libraries to complete deployment, and provide interface services to the outside world through HTTP protocol after deployment; V2. Through the prompt word engineering, the customized prompt words are continuously tested interactively with the model to obtain the optimal prompt word template; V3. Combine the prompt word template in V2 with the user instruction and process it through the locally deployed large language model interface service to obtain the return result, determine the user's intention, and then call the subsequent corresponding module for processing to complete the dialogue or function navigation function.
7. The AI intelligent assistant for a meteorological service system according to claim 6, characterized in that: The functional API interface includes: The conversation interface of the large language model is used to directly call the large language model for conversation; Web search interface, used to search the web through bing-search; Web crawler interface, used to obtain the text content of a specified web page; Weather query interface, used to query real-time weather; The knowledge base question-answering interface is used to search for question-related content from the local knowledge base and then organize and answer it using a large language model; Drawing interface, used to draw some meteorological related charts required by the system.
8. The AI intelligent assistant for a meteorological service system according to claim 1 or 7, characterized in that: The front-end interface display module includes animation module and system subscription center module; The animation module realizes the real-time drawing of the assistant animation and obtains the assistant message dynamics through even-datasource; The system subscription center module realizes message broadcasting to the whole system, and the assistant calls other modules to realize the calling out of the menu function by the assistant text.
Citation Information
Cited By
South China region intelligent weather forecast assistant system based on artificial intelligence technology
CN121562767A