Instant messaging terminal weather text and image question and answer method

CN122824709APending Publication Date: 2026-09-25JIANGSU METEOROLOGICAL OBSERVATORY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611300511.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-26
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

现有气象服务机器人在实际落地中存在部分产品语义处理架构单一的问题,其通常采用纯规则匹配架构,虽然响应速度快,但是对口语化、模糊化查询的理解能力较弱;另有部分产品通过直接接入通用大语言模型的方式,虽然使得语义理解能力得到有效增强,但是在相应情况下面对高频查询时会存在较高的响应延迟,且调用成本极大;进而现有方式无法同时兼顾响应效率与理解精度;同时,现有的技术方案大多数会将文字问答与GIS空间制图作为两个独立模块拼接运行,进而使得二者数据源、参数口径难以完全统一,该状况下,极易出现时间戳不匹配、极值数值不一致、区域范围偏差等问题,进而直接影响服务可信度;并且,现有技术中的多数气象机器人主要是针对单聊场景而进行设计的,在政务群、社区群、农业服务群等群聊场景下,既存在多用户并发查询时的上下文串扰问题,也无法根据群聊服务对象自适应切换专业研判或民生科普的输出风格,难以满足基层批量服务的实际需求

Benefits of technology

[0043]本发明所达到的有益效果是:本发明通过双通道路由架构方式,针对高频标准查询采用规则快速通道实现秒级响应,针对复杂口语查询采用大模型智能通道保障理解效果,在控制调用成本的同时覆盖了基层用户多样化的查询表达方式;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122824709A_ABST
    Figure CN122824709A_ABST
Patent Text Reader

Abstract

The application discloses an instant messaging terminal meteorological text and picture question and answer method, and belongs to the technical field of large language model natural language processing technology, and the application calculates the intention confidence of a query text through a lightweight intention classifier, and dynamically routes the query request to a quick response channel or an intelligent analysis channel according to a pre-set confidence threshold; the quick response channel matches a pre-set instruction library to output a standardized space-time element triple, and the intelligent analysis channel calls a large language model to analyze the query text and output a standardized space-time element triple; when the standardized space-time element triple is missing parameters, a multi-round dialogue clarification mechanism is triggered to complete the parameters, and a complete space-time element triple is output. Through the dual-channel routing architecture mode, the rule quick channel is adopted for high-frequency standard queries to realize a second-level response, and the large model intelligent channel is adopted for complex spoken language queries to guarantee the understanding effect, so that the diversified query expression modes of basic users are covered while the calling cost is controlled.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of natural language processing technology for large language models, specifically to a weather-based question-and-answer method for instant messaging. Background Technology

[0002] With the increasing demand for grassroots meteorological services, grid-based meteorological services based on instant messaging platforms such as WeChat and Lark have become the mainstream service method for district and county meteorological departments. Existing meteorological service robots suffer from several drawbacks in practical applications. Some products employ a simplistic semantic processing architecture, typically using pure rule-based matching. While this results in fast response times, it weakens the understanding of colloquial and fuzzy queries. Others directly integrate with general-purpose language models, which enhances semantic understanding but leads to high response latency and significant call costs when handling frequent queries. Consequently, existing methods cannot simultaneously balance response efficiency and understanding accuracy. Furthermore, most current solutions treat text-based question answering and GIS spatial mapping as two separate modules, making it difficult to ensure consistency in data sources and parameter definitions. This can easily lead to issues such as timestamp mismatches, inconsistent extreme values, and regional deviations, directly impacting service reliability. Moreover, most existing meteorological robots are designed primarily for one-on-one chat scenarios. In group chats such as government groups, community groups, and agricultural service groups, they suffer from contextual interference issues when multiple users query concurrently and cannot adaptively switch between professional analysis and public science popularization output styles based on the group chat audience, failing to meet the actual needs of large-scale services at the grassroots level. Summary of the Invention

[0003] The purpose of this invention is to provide a weather-related question-and-answer method for instant messaging terminals to solve the problems mentioned in the background art.

[0004] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0005] A weather-related question-and-answer method for instant messaging, comprising the following steps:

[0006] Step S1: Monitor the group chat messages on the instant messaging platform in real time, identify the trigger commands for the meteorological intelligent agent, and extract the query text, group chat identifier, and user identifier.

[0007] Step S2: Calculate intent confidence for the query text using a lightweight intent classifier, and dynamically route the query request to either the fast response channel or the intelligent parsing channel based on a preset confidence threshold; the fast response channel matches a preset instruction library to output standardized spatiotemporal element triples, while the intelligent parsing channel calls a large language model to parse the query text and output standardized spatiotemporal element triples; when parameters are missing in the standardized spatiotemporal element triples, a multi-turn dialogue clarification mechanism is triggered to complete the parameters and output a complete spatiotemporal element triple;

[0008] Step S3: Based on the complete spatiotemporal element triplet, match and retrieve the corresponding time-sensitive multi-source meteorological database, trim the meteorological grid data according to the spatial range in the spatiotemporal element triplet, perform meteorological element statistical operations, and output a structured meteorological statistical data set.

[0009] Step S4: Using the same spatiotemporal element triplet and structured meteorological statistical data set as common inputs, generate meteorological interpretation text and meteorological spatial distribution map in parallel; the meteorological interpretation text is generated by a large language model combined with scene discourse rules, and the meteorological spatial distribution map is generated by a parametric GIS rendering engine matching meteorological element rendering rules.

[0010] Step S5: Perform multi-dimensional consistency verification on the meteorological interpretation text and the meteorological spatial distribution map, unify the description of timestamps, extreme values ​​and regional ranges, and assemble them into an integrated graphic and text response message after the verification is passed;

[0011] Step S6: Retrieve the group chat profile based on the group chat identifier, determine the service scenario type and adaptively switch the output mode, and push the obtained integrated graphic and text response message to the corresponding group chat through the instant messaging robot interface; at the same time, based on the dual dimensions of group chat identifier and operation user identifier, isolate the conversation context of different users, update the query popularity data to iteratively optimize the preset instruction library of the fast response channel.

[0012] Furthermore, the instant messaging platform in step S1 is at least one of WeChat, Lark, and WeChat Work; the trigger command for the meteorological agent is at least one of @meteorological agent message or a specified keyword trigger message.

[0013] Furthermore, in step S2, during the calculation of intent confidence for the query text using a lightweight intent classifier, the intent confidence is calculated by weighted summation of rule matching score and semantic similarity. The rule matching score is a binary result; full score is awarded when the query text matches the regular expression matching rule of any instruction in the preset instruction library, and zero score is awarded when it does not. The semantic similarity is the TF-IDF cosine similarity between the query text and the corresponding candidate instruction text in the preset instruction library, with a value ranging from 0 to 1. The rule matching score and semantic similarity correspond to different preset weight coefficients. The obtained intent confidence is denoted as Conf(Q). The calculation formula is:

[0014] in, The intent confidence is calculated on the query text Q using a lightweight intent classifier; The score is determined by matching the rule; a value of 1 is assigned when a rule in the preset command library is matched, and a value of 0 is assigned when no rule is matched. For the first in the preset instruction library Candidate instruction text; For query text With candidate instructions The TF-IDF cosine similarity, and Corresponding range of values ; , The weighting coefficients and ;

[0015] The preset confidence threshold includes a first threshold. With the second threshold ,and ;when Time routing is directed to the fast response channel, when Time routing is directed to the intelligent resolution channel, when The query was identified as non-meteorological and a guiding response was returned.

[0016] Furthermore, in step S2, the spatiotemporal element triple is denoted as... ,in:

[0017] It is a set of parameters in the time dimension, and Includes start time Termination time Timeliness type ; Including real-time forecasts, short-term forecasts, gridded forecasts, and medium- and long-term forecasts;

[0018] It is a set of spatial dimension parameters, and Includes target area identifier Spatial accuracy level and binary space mask matrix The binary space mask matrix The matrix element in the i-th row and j-th column is denoted as ,and , When the value is 1, it indicates that the corresponding grid cell belongs to the target region;

[0019] It is a set of meteorological element dimensional parameters, and Includes feature types With units of measurement ; Including precipitation, temperature, wind speed, and visibility;

[0020] The multi-round dialogue clarification mechanism queries missing parameters in sequence according to the priority of spatial dimension, time dimension, and meteorological element dimension. After each round of completion, the integrity of the triple is verified until the parameters are complete or the maximum number of interaction rounds is reached.

[0021] Furthermore, the multi-source meteorological database in step S3 includes a real-time observation database, a minute-level short-term forecast database, a street-level grid forecast database, and a medium- and long-term forecast database;

[0022] Step S3 involves data scheduling based on timeliness type. Match the corresponding database, and link multiple databases to splice time-series data when a single database cannot cover the query period;

[0023] The statistical operations include the calculation of regional mean, regional extreme values, and cumulative values ​​over a period of time, wherein:

[0024] The regional mean is calculated by summing the meteorological values ​​of all valid grids within the target area and then dividing by the total number of valid grids within the target area. The valid grids are determined using a spatial mask matrix.

[0025] Regional extreme value calculation involves extracting the maximum and minimum values ​​from all valid grid meteorological values ​​within the target area;

[0026] The cumulative amount for a time period is calculated by multiplying the regional average meteorological value corresponding to each time stratum within the query time period by the time step corresponding to that time stratum, and then summing them up layer by layer to obtain the total cumulative amount.

[0027] The specific calculation formulas involved are as follows:

[0028] Regional mean: ,in, This is the regional mean. The matrix corresponding to the meteorological grid data after spatial cropping is the first... Line number Column of grid weather values;

[0029] Regional extreme values: , ;in, The maximum value of meteorological elements within the target area. This represents the minimum value of meteorological elements within the target area.

[0030] Cumulative amount over the period: ,in, This is the cumulative amount over a period of time. To query the number of time-sensitive layers within a given time period, For the first Regional average meteorological values ​​over time, For the first The time step corresponding to the layer's aging period.

[0031] Furthermore, in step S4, the parametric GIS rendering engine has a built-in meteorological element rendering rule library. Each set of rendering rules corresponds to a type of meteorological element, and each set of rendering rules includes a fill color level mapping function, contour vector style, annotation rules, and base map adaptation parameters. After receiving the spatiotemporal element triples, the rendering engine determines the element type based on the... By matching the corresponding rendering rules and combining the cropped meteorological grid data matrix, the grid values ​​are mapped to RGB color values ​​through the color level mapping function to generate a raster-style meteorological spatial distribution map with street-level precision.

[0032] Furthermore, step S5 includes multi-dimensional consistency verification, encompassing temporal consistency, numerical consistency, and spatial consistency verification.

[0033] Time consistency verification involves extracting time descriptions from meteorological interpretation texts and converting them into standard timestamps. These timestamps are then compared with the layer timestamps of the meteorological spatial distribution map. The resulting difference is recorded as follows: The The For text timestamps; For map timestamps; if If the time is less than or equal to the preset time threshold, the time consistency check is deemed to be satisfied; otherwise, the time consistency check is not satisfied.

[0034] Numerical consistency verification involves extracting extreme values ​​from meteorological interpretation texts and calculating the relative deviation rate between these values ​​and the labeled extreme values ​​on meteorological spatial distribution maps. The resulting relative deviation rate is denoted as... , The For text extrema; the stated Mark extreme values ​​on the map; if If the value is less than or equal to the preset numerical deviation threshold, the numerical consistency check is deemed to be satisfied; otherwise, the numerical consistency check is not satisfied.

[0035] Spatial consistency verification involves extracting the regional range described in the meteorological interpretation text and the corresponding spatial range from the meteorological spatial distribution map, converting them into spatial geometric surfaces, and then calculating the intersection-union ratio (IU). The IU is denoted as [reference needed]. , The For text areas, the For the map area, the A function to find the area of ​​a region; if If the spatial overlap threshold is greater than or equal to the preset threshold, the spatial consistency check is deemed to be satisfied; otherwise, the spatial consistency check is not satisfied.

[0036] When all three dimensions pass the verification, the overall verification is considered successful. If any dimension fails the verification, the meteorological interpretation text is corrected based on the parameters of the meteorological spatial distribution map, regenerated, and verified again until it passes.

[0037] Furthermore, the service scenario types in step S6 include professional government affairs scenarios, community livelihood scenarios, and agricultural production scenarios; the corresponding output modes include professional judgment mode and popular livelihood mode. Professional government affairs scenarios are matched with professional judgment mode, and the output includes meteorological professional terms, disaster risk assessment, and prevention work suggestions; community livelihood scenarios and agricultural production scenarios are matched with popular livelihood mode, and the output includes life-like expressions, life tips or agricultural suggestions for the corresponding scenarios.

[0038] Furthermore, in step S6, the query popularity data adopts a popularity value calculation method with time decay. The popularity value of the query sentence is obtained by multiplying the frequency of the sentence's occurrence within the statistical period by the time decay coefficient. The time decay coefficient decreases exponentially as the number of days since the last occurrence of the sentence increases, and a fixed decay parameter is configured.

[0039] Specifically, the formula for calculating the popularity value of the query sentence structure corresponding to the query text is as follows:

[0040]

[0041] in, For query sentence Popularity value; Query syntax within the statistical period Frequency of occurrence For this query statement The number of days since the last occurrence. The time decay coefficient and ;

[0042] The top N most popular query phrases are periodically selected, manually verified, and then added to the preset instruction library of the fast response channel to achieve closed-loop iterative optimization of the instruction library. N is a preset constant.

[0043] The beneficial effects achieved by this invention are as follows: This invention uses a dual-channel routing architecture to achieve a second-level response for high-frequency standard queries using a rule-based fast channel, and to ensure comprehension for complex spoken queries using a large-model intelligent channel, thus covering the diverse query expressions of grassroots users while controlling the calling cost.

[0044] This invention uses a unified spatiotemporal element triple as the common input for generating images and text, and combines it with a multi-dimensional quantitative consistency verification mechanism to ensure that the text interpretation and spatial distribution map are fully matched in the three core dimensions of time, value and region, thereby improving the accuracy and reliability of meteorological services.

[0045] This invention achieves hierarchical adaptation of output modes through group chat profiling, meeting the information needs of different groups such as government officials, ordinary residents, and agricultural producers; the dual-dimensional session isolation mechanism solves the context interference problem of concurrent queries by multiple users in group chats, and can directly support 24 / 7 uninterrupted gridded meteorological services. Attached Figure Description

[0046] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.

[0047] Figure 1 This is a schematic diagram illustrating the steps of a weather-themed question-and-answer method for instant messaging terminals according to the present invention. Detailed Implementation

[0048] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0049] Please see Figure 1 In this first embodiment: This embodiment uses WeChat and Lark as the adaptable carriers, targeting the grassroots grid-based meteorological service scenario of district and county meteorological bureaus, to fully describe the technical solution of the present invention. It provides a meteorological text and image question-and-answer method for instant messaging terminals, which includes the following steps:

[0050] Step S1: Monitor the group chat messages on the instant messaging platform in real time, identify the trigger commands for the meteorological intelligent agent, and extract the query text, group chat identifier, and operation user identifier; after extraction, write the request to the message queue for peak smoothing to avoid message loss in high-concurrency scenarios.

[0051] The instant messaging platform for step S1 is at least one of WeChat, Lark, and WeChat Work; the trigger command for the meteorological agent is at least one of @meteorological agent message or a specified keyword trigger message.

[0052] Step S2: Calculate intent confidence for the query text using a lightweight intent classifier, and dynamically route the query request to either the fast response channel or the intelligent parsing channel based on a preset confidence threshold; the fast response channel matches a preset instruction library to output standardized spatiotemporal element triples, while the intelligent parsing channel calls a large language model to parse the query text and output standardized spatiotemporal element triples; when parameters are missing in the standardized spatiotemporal element triples, a multi-turn dialogue clarification mechanism is triggered to complete the parameters and output a complete spatiotemporal element triple;

[0053] In step S2, a lightweight intent classifier is used to calculate the intent confidence level of the query text. The calculation formula is:

[0054] in, The intent confidence is calculated on the query text Q using a lightweight intent classifier; The score is determined by matching the rule; a value of 1 is assigned when a rule in the preset command library is matched, and a value of 0 is assigned when no rule is matched. For the first in the preset instruction library Candidate instruction text; For query text With candidate instructions The TF-IDF cosine similarity, and Corresponding range of values ; , The weighting coefficients and In this embodiment The value is 0.4. The value is 0.6;

[0055] The preset confidence threshold includes a first threshold. (In this embodiment, 0.85 is used) and the second threshold (In this embodiment, 0.4 is used), and ;when Time routing is directed to the fast response channel, when Time routing is directed to the intelligent resolution channel, when The query was identified as non-meteorological and a guiding response was returned.

[0056] Furthermore, when When the query is identified as a standard high-frequency query, it is routed to the fast response channel. The channel has a pre-set instruction library that stores formatted query templates. It directly extracts time, space, and meteorological element parameters through regular expression matching and outputs standardized spatiotemporal element triples. The response delay is controlled within 100ms.

[0057] when When the query is identified as a complex, conversational query, it is routed to the intelligent parsing channel. The large language model is invoked to extract semantic entities from the query text, identify time expressions, spatial ranges, and meteorological element types, and output standardized triples.

[0058] when If the query is not a meteorological query, the system will return a prompt saying, "Sorry, I can only answer meteorological questions at the moment. You can ask about precipitation, temperature, wind speed, etc."

[0059] In step S2, the spatiotemporal element triplet is denoted as... ,in:

[0060] It is a set of parameters in the time dimension, and Includes start time Termination time Timeliness type ; Including real-time forecasts, short-term forecasts, gridded forecasts, and medium- and long-term forecasts;

[0061] It is a set of spatial dimension parameters, and Includes target area identifier Spatial accuracy level and binary space mask matrix The binary space mask matrix The matrix element in the i-th row and j-th column is denoted as ,and , When the value is 1, it indicates that the corresponding grid cell belongs to the target region;

[0062] It is a set of meteorological element dimensional parameters, and Includes feature types With units of measurement ; Including precipitation, temperature, wind speed, and visibility;

[0063] The multi-round dialogue clarification mechanism queries missing parameters in sequence according to the priority of spatial dimension, time dimension, and meteorological element dimension. After each round of completion, the integrity of the triple is checked until the parameter is complete or the maximum number of interaction rounds is reached (the value is 3 in this example). If the parameter is still not obtained after exceeding the maximum number of interaction rounds, a prompt guiding the user to express the parameter correctly is returned.

[0064] Step S3: Based on the complete spatiotemporal element triplet, match and retrieve the corresponding time-sensitive multi-source meteorological database, trim the meteorological grid data according to the spatial range in the spatiotemporal element triplet, perform meteorological element statistical operations, and output a structured meteorological statistical data set.

[0065] The multi-source meteorological database in step S3 includes a real-time observation database, a minute-level short-term forecast database (0-2 hours), a street-level grid forecast database (within 24 hours), and a medium- and long-term forecast database (within 3-7 days).

[0066] Step S3 involves data scheduling based on timeliness type. Match the corresponding database, and link multiple databases to splice time-series data when a single database cannot cover the query period;

[0067] After data retrieval, the original meteorological grid data matrix is ​​cropped using a binary space mask matrix, retaining only the grid data within the target area. Then, corresponding statistical operations are performed based on the meteorological element type. These statistical operations include calculating the regional mean, regional extreme values, and cumulative values ​​over a time period. The calculation formulas are as follows:

[0068] Regional mean: ,in, This is the regional mean. The matrix corresponding to the meteorological grid data after spatial cropping is the first... Line number Column of grid weather values;

[0069] Regional extreme values: , ;in, The maximum value of meteorological elements within the target area. This represents the minimum value of meteorological elements within the target area.

[0070] Cumulative amount over the period: ,in, This is the cumulative amount over a period of time. To query the number of time-sensitive layers within a given time period, For the first Regional average meteorological values ​​over time, For the first The time step corresponding to the layer's aging period.

[0071] Step S4: Using the same spatiotemporal element triplet and structured meteorological statistical data set as common inputs, generate meteorological interpretation text and meteorological spatial distribution map in parallel; the meteorological interpretation text is generated by a large language model combined with scene discourse rules, and the meteorological spatial distribution map is generated by a parametric GIS rendering engine matching meteorological element rendering rules.

[0072] In step S4, the parametric GIS rendering engine has a built-in meteorological element rendering rule library. Each set of rendering rules corresponds to a type of meteorological element, and each set of rendering rules includes a fill color level mapping function, contour vector style, annotation rules, and base map adaptation parameters. After receiving the spatiotemporal element triples, the rendering engine determines the element type based on its characteristics. By matching the corresponding rendering rules and combining the cropped meteorological grid data matrix, the grid values ​​are mapped to RGB color values ​​through the color level mapping function to generate a raster-style meteorological spatial distribution map with street-level precision.

[0073] Step S5: Perform multi-dimensional consistency verification on the meteorological interpretation text and the meteorological spatial distribution map, unify the description of timestamps, extreme values ​​and regional ranges, and assemble them into an integrated graphic and text response message after the verification is passed;

[0074] Step S5 involves multi-dimensional consistency verification, including temporal consistency, numerical consistency, and spatial consistency verification.

[0075] Time consistency check: Calculate the difference between the text timestamp and the map timestamp, denoted as . The The For text timestamps; For map timestamps; if If the time is less than or equal to a preset time threshold (10 minutes in this embodiment), the time consistency check is deemed to be satisfied; otherwise, the time consistency check is not satisfied.

[0076] Numerical consistency verification: Calculate the relative deviation rate between the text extreme values ​​and the map-labeled extreme values, denoted as . , The For text extrema; the stated Mark extreme values ​​on the map; if If the value is less than or equal to the preset numerical deviation threshold (the deviation threshold is 5% in this embodiment), then the numerical consistency check is satisfied; otherwise, the numerical consistency check is not satisfied.

[0077] Spatial consistency check: Calculate the intersection-union ratio (IUU) of the text region and the map region, denoted as . , The For text areas, the For the map area, the A function to find the area of ​​a region; if If the spatial consistency check is greater than or equal to the preset spatial overlap threshold (0.95 in this embodiment), then the spatial consistency check is satisfied; otherwise, the spatial consistency check is not satisfied.

[0078] When all three dimensions pass the verification, the overall verification is considered successful. If any dimension fails the verification, the meteorological interpretation text is corrected based on the parameters of the meteorological spatial distribution map, regenerated, and verified again until it passes.

[0079] Step S6: Retrieve the group chat profile based on the group chat identifier, determine the service scenario type and adaptively switch the output mode, and push the obtained integrated graphic and text response message to the corresponding group chat through the instant messaging robot interface; at the same time, based on the dual dimensions of group chat identifier and operation user identifier, isolate the conversation context of different users, update the query popularity data to iteratively optimize the preset instruction library of the fast response channel.

[0080] The service scenario types in step S6 include professional government affairs scenarios, community livelihood scenarios, and agricultural production scenarios; the corresponding output modes include professional judgment mode and popular livelihood mode. Professional government affairs scenarios are matched with professional judgment mode, and the output includes meteorological professional terms, disaster risk assessment, and prevention work suggestions; community livelihood scenarios and agricultural production scenarios are matched with popular livelihood mode, and the output includes life-like expressions, life tips or agricultural suggestions for the corresponding scenarios.

[0081] In step S6, the query popularity data is calculated using a popularity value with time decay to obtain the popularity value of the query sentence corresponding to the query text. The calculation formula involved is as follows:

[0082]

[0083] in, For query sentence Popularity value; Query syntax within the statistical period Frequency of occurrence For this query statement The number of days since the last occurrence. The time decay coefficient and In this embodiment, the time decay coefficient is 0.1.

[0084] Periodically (in this example, the statistical period is 7 days), the top N query sentences with the highest popularity values ​​(N is 20 in this example) are selected and added to the preset instruction library of the fast response channel after manual verification, so as to realize the closed-loop iterative optimization of the instruction library. N is a preset constant.

[0085] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0086] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A weather map and text question-and-answer method for instant messaging terminals, characterized in that, The method includes the following steps: Step S1: Monitor the group chat messages on the instant messaging platform in real time, identify the trigger commands for the meteorological intelligent agent, and extract the query text, group chat identifier, and user identifier. Step S2: Calculate intent confidence for the query text using a lightweight intent classifier, and dynamically route the query request to either the fast response channel or the intelligent parsing channel based on a preset confidence threshold; the fast response channel matches a preset instruction library to output standardized spatiotemporal element triples, while the intelligent parsing channel calls a large language model to parse the query text and output standardized spatiotemporal element triples; when parameters are missing in the standardized spatiotemporal element triples, a multi-turn dialogue clarification mechanism is triggered to complete the parameters and output a complete spatiotemporal element triple; Step S3: Based on the complete spatiotemporal element triplet, match and retrieve the corresponding time-sensitive multi-source meteorological database, trim the meteorological grid data according to the spatial range in the spatiotemporal element triplet, perform meteorological element statistical operations, and output a structured meteorological statistical data set. Step S4: Using the same spatiotemporal element triplet and structured meteorological statistical data set as common inputs, generate meteorological interpretation text and meteorological spatial distribution map in parallel; the meteorological interpretation text is generated by a large language model combined with scene discourse rules, and the meteorological spatial distribution map is generated by a parametric GIS rendering engine matching meteorological element rendering rules. Step S5: Perform multi-dimensional consistency verification on the meteorological interpretation text and the meteorological spatial distribution map, unify the description of timestamps, extreme values ​​and regional ranges, and assemble them into an integrated graphic and text response message after the verification is passed; Step S6: Retrieve the group chat profile based on the group chat identifier, determine the service scenario type and adaptively switch the output mode, and push the obtained integrated graphic and text response message to the corresponding group chat through the instant messaging robot interface; at the same time, based on the dual dimensions of group chat identifier and operation user identifier, isolate the conversation context of different users, update the query popularity data to iteratively optimize the preset instruction library of the fast response channel.

2. The instant messaging weather map and text question-and-answer method according to claim 1, characterized in that, The instant messaging platform for step S1 is at least one of WeChat, Lark, and WeChat Work; the trigger command for the meteorological agent is at least one of @meteorological agent message or a specified keyword trigger message.

3. The instant messaging weather map and text question-and-answer method according to claim 2, characterized in that, In step S2, during the process of calculating the intent confidence of the query text using a lightweight intent classifier, the intent confidence is calculated by weighted summation of rule matching score and semantic similarity; wherein the rule matching score is a binary result, full score is obtained when the query text matches any regular expression matching rule of any instruction in the preset instruction library, and zero score is obtained when it does not match. Semantic similarity is the TF-IDF cosine similarity between the query text and the corresponding candidate instruction text in the preset instruction library; the rule matching score and semantic similarity score correspond to different preset weight coefficients; The preset confidence threshold includes a first threshold. With the second threshold ,and ;when The routing is to the fast response channel, where Conf(Q) represents the obtained intent confidence level. Time routing is directed to the intelligent resolution channel, when The query was identified as non-meteorological and a guiding response was returned.

4. The instant messaging weather map and text question-and-answer method according to claim 1, characterized in that, In step S2, the spatiotemporal element triplet is denoted as... ,in: It is a set of parameters in the time dimension, and Includes start time Termination time Timeliness type ; It is a set of spatial dimension parameters, and Includes target area identifier Spatial accuracy level and binary space mask matrix The binary space mask matrix The matrix element in the i-th row and j-th column is denoted as ,and , When the value is 1, it indicates that the corresponding grid cell belongs to the target region; It is a set of meteorological element dimensional parameters, and Includes feature types With units of measurement ; The multi-round dialogue clarification mechanism queries missing parameters in sequence according to the priority of spatial dimension, time dimension, and meteorological element dimension. After each round of completion, the integrity of the triple is verified until the parameters are complete or the maximum number of interaction rounds is reached.

5. A weather map and text question-and-answer method for instant messaging terminals according to claim 4, characterized in that, The multi-source meteorological database in step S3 includes a real-time observation database, a minute-level short-term forecast database, a street-level grid forecast database, and a medium- and long-term forecast database. Step S3 involves data scheduling based on timeliness type. Match the corresponding database, and link multiple databases to splice time-series data when a single database cannot cover the query period; The statistical operations include the calculation of regional mean, regional extreme values, and cumulative values ​​over a period of time, wherein: The regional mean is calculated by summing the meteorological values ​​of all valid grids within the target area and then dividing by the total number of valid grids within the target area. The valid grids are determined using a spatial mask matrix. Regional extreme value calculation involves extracting the maximum and minimum values ​​from all valid grid meteorological values ​​within the target area; The cumulative amount for a time period is calculated by multiplying the regional average meteorological value corresponding to each time stratum within the query time period by the time step corresponding to that time stratum, and then summing them up layer by layer to obtain the total cumulative amount.

6. A weather map and text question-and-answer method for instant messaging terminals according to claim 5, characterized in that, In step S4, the parametric GIS rendering engine has a built-in meteorological element rendering rule library. Each set of rendering rules corresponds to a type of meteorological element, and each set of rendering rules includes a fill color level mapping function, contour vector style, annotation rules, and base map adaptation parameters. After receiving the spatiotemporal element triples, the rendering engine determines the element type based on its characteristics. By matching the corresponding rendering rules and combining the cropped meteorological grid data matrix, the grid values ​​are mapped to RGB color values ​​through the color level mapping function to generate a raster-style meteorological spatial distribution map with street-level precision.

7. A weather map and text question-and-answer method for instant messaging terminals according to claim 1, characterized in that, Step S5 involves multi-dimensional consistency verification, including temporal consistency, numerical consistency, and spatial consistency verification. Time consistency verification involves extracting time descriptions from meteorological interpretation texts and converting them into standard timestamps. These timestamps are then compared with the layer timestamps of the meteorological spatial distribution map. The resulting difference is recorded as follows: ,like If the time is less than or equal to the preset time threshold, the time consistency check is deemed to be satisfied; otherwise, the time consistency check is not satisfied. Numerical consistency verification involves extracting extreme values ​​from meteorological interpretation texts and calculating the relative deviation rate between these values ​​and the labeled extreme values ​​on meteorological spatial distribution maps. The resulting relative deviation rate is denoted as... ,like If the value is less than or equal to the preset numerical deviation threshold, the numerical consistency check is deemed to be satisfied; otherwise, the numerical consistency check is not satisfied. Spatial consistency verification involves extracting the regional range described in the meteorological interpretation text and the corresponding spatial range from the meteorological spatial distribution map, converting them into spatial geometric surfaces, and then calculating the intersection-union ratio (IU). The IU is denoted as [reference needed]. ,like If the spatial overlap threshold is greater than or equal to the preset threshold, the spatial consistency check is deemed to be satisfied; otherwise, the spatial consistency check is not satisfied. When all three dimensions pass the verification, the overall verification is considered successful. If any dimension fails the verification, the meteorological interpretation text is corrected based on the parameters of the meteorological spatial distribution map, regenerated, and verified again until it passes.

8. A weather map and text question-and-answer method for instant messaging terminals according to claim 1, characterized in that, The service scenario types in step S6 include professional government affairs scenarios, community livelihood scenarios, and agricultural production scenarios; the corresponding output modes include professional judgment mode and popular livelihood mode. Professional government affairs scenarios are matched with professional judgment mode, while community livelihood scenarios and agricultural production scenarios are matched with popular livelihood mode.

9. A weather map and text question-and-answer method for instant messaging terminals according to claim 1, characterized in that, In step S6, the popularity data is calculated using a popularity value with time decay. The popularity value of the query sentence is obtained by multiplying the frequency of the sentence's occurrence within the statistical period by the time decay coefficient. The time decay coefficient decreases exponentially as the number of days since the last occurrence of the sentence increases, and a fixed decay parameter is configured. The top N most popular query phrases are periodically selected, manually verified, and then added to the preset instruction library of the fast response channel to achieve closed-loop iterative optimization of the instruction library. N is a preset constant.