Intelligent city platform question and answer method and device based on large model, equipment and medium

By constructing a policy scenario database and intent recognition, combined with a large language model, multi-dimensional question-and-answer parsing of the smart city platform was achieved, solving the problem of poor response effect of the existing platform and improving the efficiency and accuracy of question-and-answer.

CN122334517BActive Publication Date: 2026-08-04PEKING UNIV SHENZHEN GRADUATE SCHOOL
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PEKING UNIV SHENZHEN GRADUATE SCHOOL
Filing Date
2026-06-04
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Existing smart city platforms often fail to respond effectively to complex business inquiries, lack analytical dimensions, and are unable to summarize the patterns of urban development. This results in low efficiency and accuracy in answering questions, requiring manual correction.

Method used

By constructing a policy scenario database to store the causal relationships between policy regulation and its effects in urban development, and combining intent recognition and large language models, we can achieve multi-dimensional analysis and accurate answers to user questions. By using pre-structured data to constrain the output of the large model, we can generate accurate answers.

Benefits of technology

It significantly improves the efficiency and accuracy of Q&A on smart city platforms, avoids the illusion problem of large models, requires no manual correction, and provides multi-dimensional support for the laws of urban development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122334517B_ABST
    Figure CN122334517B_ABST
Patent Text Reader

Abstract

This invention provides a question-answering method, apparatus, device, and medium for a smart city platform based on a large model. It can perform intent recognition on the target question text received by the platform to obtain intent recognition results under the corresponding scenario type; acquire a preset policy scenario library, which stores regulatory causal pair data for various policy scenarios; extract target parameters related to smart city policies from the target question text, and determine the target regulatory causal type to which the target parameters belong based on the intent recognition results; retrieve target regulatory causal pair data matching the target parameters from multiple regulatory causal pair data along the target regulatory causal type, and extract text of another regulatory causal type from the target regulatory causal pair data to obtain the target policy text; construct first input data based on the target policy text and input the first input data into the target large language model, outputting the target answer text, thereby improving the efficiency and accuracy of the platform's question-answering function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a question-answering method, apparatus, device, and medium for a smart city platform based on a large model. Background Technology

[0002] Large language models (or simply large models) are a class of pre-trained deep learning models with a large number of parameters, trained on extremely wide range of data, and applicable to a variety of tasks and applications. With the continuous development of large language models, smart cities are becoming increasingly intelligent, and smart city platforms based on large models have emerged. Through question-and-answer consultations on these platforms, city decision-making can become more intelligent.

[0003] However, in related technologies, the current smart city platforms are mainly limited to numerical prediction of future urban development trends, lacking the ability to summarize the laws of urban development. When faced with complex business inquiries, they have poor response effects and single analysis dimensions, often requiring manual correction, thus reducing the efficiency and accuracy of the platform's Q&A. Summary of the Invention

[0004] The main objective of this disclosure is to propose a question-answering method, apparatus, device, and medium for a smart city platform based on a large model, which can improve the efficiency and accuracy of platform question-answering.

[0005] To achieve the above objectives, a first aspect of this disclosure proposes a question-answering method for a smart city platform based on a large model, comprising: The system acquires the target question text received by the smart city platform and performs intent recognition on the target question text to obtain the intent recognition result under the corresponding scenario type. Obtain a preset policy scenario library, which stores regulatory causal pair data under various policy scenarios. Each regulatory causal pair data contains a pair of text of regulatory causal type under the corresponding policy scenario. Extract target parameters related to smart city policies from the target query text, and determine the target regulation causal type to which the target parameters belong by combining the intent recognition results; The target regulation causal pair data matching the target parameter is retrieved from multiple regulation causal pair data along the target regulation causal type, and the text of another regulation causal type in the target regulation causal pair data is extracted to obtain the target policy text; The first input data is constructed based on the target policy text, and then input into the target large language model to output the target answer text.

[0006] In some embodiments, the smart city platform question-answering method based on a large model further includes: Multiple different smart city policy scenarios are pre-defined, and each policy scenario corresponds to a text of a first regulatory causal type. The preset urban computing platform is invoked to perform development simulation calculations on each of the policy scenario conditions, and the development prediction results corresponding to each of the smart city policy scenario conditions are obtained. The development prediction results correspond to the text of the second regulation causal type. Each smart city policy scenario is associated with its corresponding development prediction results to construct the regulation causal pair data under each policy scenario. All the constructed regulatory causal data are structured and stored to form the policy scenario library.

[0007] In some embodiments, extracting target parameters related to smart city policies from the target query text includes: Obtain the standard variable names from the text of each regulatory causal pair data to obtain a set of names; Construct parameter extraction prompts containing the set of names, and combine the target question text with the parameter extraction prompts to obtain the second input data; The second input data is input into the target large language model, so that the variable names in the target question text are automatically matched and converted into the corresponding standard variable names in the name set through the target large language model, and the attribute information associated with the standard variable names is extracted to generate target parameters related to smart city policies.

[0008] In some embodiments, extracting target parameters related to smart city policies from the target query text may further include: When the intent recognition result is a theoretical concept-type intent, the target query text is rewritten to remove contextual information unrelated to smart city policy regulation issues and extract standardized target query text. Extract target parameters related to smart city policies from the target query text.

[0009] In some embodiments, when the target regulation causal type characterizes the target parameter as a development prediction result, the step of retrieving target regulation causal pair data matching the target parameter from multiple regulation causal pair data along the target regulation causal type, and extracting the text of another regulation causal type from the target regulation causal pair data to obtain the target policy text includes: Extract at least one target development prediction indicator from the target parameters; Along the target regulation causal type, retrieve all regulation causal pairs containing at least one of the target development prediction indicators from all the regulation causal pairs data, as multiple target regulation causal pairs data; From each of the target-regulated causal pairs, extract another type of text on the causal regulation type to obtain multiple candidate policy scenario conditions; The candidate policy scenarios are used as the target policy text.

[0010] In some embodiments, the step of constructing first input data based on the target policy text, inputting the first input data into a target large language model, and outputting the target answer text includes: Use at least one of the target development prediction indicators as a label column, and use the policy scenario condition variables corresponding to multiple candidate policy scenario conditions as feature columns. A preset random forest regression model is invoked, with the label column as the output and the feature column as the input, to perform regression calculations on the numerical data in the causal relationship data of the multiple target regulation, and output a score on the importance of each policy scenario condition variable to the target development prediction indicator. The candidate policy scenarios are sorted in descending order of importance scores, and the sorted candidate policy scenarios, their corresponding importance scores, and the target question text are integrated to construct the first input data. The first input data is fed into the target large language model to generate target answer text containing policy scenario priority suggestions.

[0011] In some embodiments, the step of performing intent recognition on the target question text to obtain an intent recognition result under the corresponding scenario type includes: Construct a third input data based on the target question text; The third input data is input into the target large language model to perform intent recognition on the target question text, and the intent recognition result corresponding to the target question text is selected from multiple preset candidate intents of different scenario types.

[0012] To achieve the above objectives, a second aspect of this disclosure provides a question-answering device for a smart city platform based on a large model, comprising: The intent recognition module is used to acquire the target question text received by the smart city platform, and to perform intent recognition on the target question text to obtain the intent recognition result under the corresponding scenario type. The scenario database acquisition module is used to acquire a preset policy scenario database, which stores regulatory causal pair data under various policy scenarios. Each regulatory causal pair data contains a pair of text of regulatory causal type under the corresponding policy scenario. The regulation causal type confirmation module is used to extract target parameters related to smart city policies from the target question text, and determine the target regulation causal type to which the target parameters belong in combination with the intent recognition results; The scenario database retrieval module is used to retrieve target regulation causal pair data that matches the target parameter from multiple regulation causal pair data along the target regulation causal type, and extract the text of another regulation causal type from the target regulation causal pair data to obtain the target policy text; The answer output module is used to construct first input data based on the target policy text, input the first input data into the target large language model, and output the target answer text.

[0013] To achieve the above objectives, a third aspect of this disclosure provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the question-answering method for a smart city platform based on a large model as described in the first aspect embodiment.

[0014] To achieve the above objectives, a fourth aspect of the present disclosure provides a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the question-answering method for a smart city platform based on a large model as described in the first aspect embodiment.

[0015] The beneficial effects of the embodiments disclosed herein include: By pre-storing a policy scenario library containing causal pairs of policy adjustments under various policy scenarios, the inherent causal laws between policy adjustments and their corresponding effects in urban development are structurally precipitated and systematically summarized, providing systematic support for complex business consultations. Next, intent recognition is performed on the target question text to obtain the intent results corresponding to the scenario type, and target parameters related to smart city policies are accurately extracted from the question. Combined with the intent recognition results, the target adjustment causal type to which the target parameters belong is determined, enabling multi-dimensional in-depth analysis of users' complex business consultations. Then, along the determined target adjustment causal type, matching target adjustment causal pairs are retrieved from the policy scenario library to quickly extract the corresponding target policy text, eliminating the need for time-consuming manual searching and organization of relevant policy evidence, significantly improving question-and-answer response efficiency. Finally, based on the accurately matched target policy text, an input data target large language model is constructed to generate the target answer text. This fully utilizes the natural language generation capabilities of the large model and effectively constrains and guides the output of the large model through pre-structured policy causal data, fundamentally avoiding the illusion problem of the large model. Accurate and reliable answers are generated without manual correction, ultimately improving the question-and-answer efficiency and accuracy of the smart city platform. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of an application environment for the question-answering method for a smart city platform based on a large model provided in this embodiment of the disclosure; Figure 2 This is a flowchart illustrating the question-answering method for a smart city platform based on a large model provided in this embodiment of the disclosure; Figure 3 This is a flowchart illustrating the pre-built policy scenario library provided in an embodiment of this disclosure; Figure 4 yes Figure 2 A flowchart further includes step S103; Figure 5 yes Figure 2 Another process diagram further included in step S103; Figure 6 yes Figure 2 A flowchart further includes step S104; Figure 7 yes Figure 2 A flowchart further includes step S105; Figure 8 yes Figure 2 A flowchart further includes step S101; Figure 9 This is a schematic diagram illustrating the workflow under different policy scenarios provided in the embodiments of this disclosure; Figure 10This is a schematic diagram of the functional modules of the smart city platform question-answering device based on a large model provided in this embodiment of the disclosure; Figure 11 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this disclosure. Detailed Implementation

[0017] The accompanying drawings in the embodiments clearly and completely describe the technical solutions in the embodiments of this disclosure. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments in this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0018] It is understood that in the specific embodiments of this disclosure, the retrieval of target question text, policy scenario library and related data is involved. When the above embodiments of this disclosure are applied to specific products or technologies, permission or consent can be obtained from the target, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards.

[0019] Furthermore, when this embodiment of the disclosure needs to retrieve the target question text, policy scenario library, and related data, it can obtain separate permission or separate consent for the target question text, policy scenario library, and related data through pop-up windows or redirection to a confirmation page. After clearly obtaining separate permission or separate consent for the target question text, policy scenario library, and related data, it can then obtain the necessary target question text, policy scenario library, and related data for the normal operation of this embodiment of the disclosure.

[0020] In this disclosure, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0021] Please see Figure 1 , Figure 1 A schematic diagram of the implementation environment for the question-answering method for a smart city platform based on a large model provided in this embodiment of the disclosure includes: a terminal 11 and a server 12.

[0022] For example, server 12 can obtain the target question text received by the smart city platform from terminal 11, and perform intent recognition on the target question text to obtain the intent recognition result under the corresponding scenario type; obtain a preset policy scenario library, which stores regulatory causal pair data under various policy scenarios, and each regulatory causal pair data contains a pair of regulatory causal types of text under the corresponding policy scenario; extract target parameters related to smart city policies from the target question text, and determine the target regulatory causal type to which the target parameters belong by combining the intent recognition result; retrieve target regulatory causal pair data matching the target parameters from multiple regulatory causal pair data along the target regulatory causal type, and extract the text of another regulatory causal type from the target regulatory causal pair data to obtain the target policy text; construct first input data based on the target policy text, and input the first input data into the target large language model to output the target answer text. Finally, server 12 can send the target answer text to terminal 11 for display.

[0023] Terminal 11 can be a mobile phone, computer, smart voice interaction device, smart wearable device, smart home appliance, vehicle terminal, etc., but is not limited to these. Terminal 11 can also independently execute the question-and-answer method of the smart city platform based on a large model. Terminal 11 and server 12 can be directly or indirectly connected through wired or wireless communication, and this embodiment of the disclosure does not impose any limitations.

[0024] Server 12 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Additionally, server 12 can also be a node server in a blockchain network.

[0025] It should be noted that, Figure 1 The schematic diagram of the implementation environment shown is merely an example. The scenarios described in this disclosure are intended to more clearly illustrate the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided in this disclosure. As those skilled in the art will know, with the evolution of technology and the emergence of new business scenarios, the technical solutions provided in this disclosure are also applicable to similar technical problems.

[0026] Please see Figure 2 , Figure 2This is a flowchart illustrating the question-answering method for a smart city platform based on a large model provided in this disclosure. This question-answering method for a smart city platform based on a large model can be applied to the server in the above embodiments, or can be jointly executed by a terminal and a server. The question-answering method for a smart city platform based on a large model includes steps S101 to S105: Step S101: Obtain the target question text received by the smart city platform, and perform intent recognition on the target question text to obtain the intent recognition result under the corresponding scenario type; Step S102: Obtain a preset policy scenario library. The policy scenario library stores regulatory causal pair data under various policy scenarios. Each regulatory causal pair data contains a pair of regulatory causal type texts under the corresponding policy scenario. Step S103: Extract target parameters related to smart city policies from the target question text, and determine the target regulation causal type to which the target parameters belong by combining the intent recognition results; Step S104: Retrieve target regulation causal pair data that matches the target parameter from multiple regulation causal pair data along the target regulation causal type, and extract the text of another regulation causal type from the target regulation causal pair data to obtain the target policy text; Step S105: Construct the first input data based on the target policy text, input the first input data into the target large language model, and output the target answer text.

[0027] Regarding step S101 above, the smart city platform, in this embodiment of the disclosure, refers to a comprehensive system that integrates urban operational data and uses artificial intelligence technology to provide auxiliary decision support for city managers. This platform may include modules such as data collection, spatiotemporal computing, policy simulation, and intelligent question answering, capable of predicting and answering multi-dimensional factors such as urban traffic, environment, economy, and population. In this embodiment of the disclosure, the smart city platform specifically refers to a question-and-answer system with an urban computing engine and large language model interaction capabilities. Users submit policy inquiries or scenario queries to the platform using natural language, and the platform generates accurate response suggestions through internal scenario database retrieval and machine learning analysis.

[0028] The target query text refers to the natural language query content entered by the user through the interactive interface of the smart city platform, such as "What will happen in the future if the subway speed is adjusted to 1.2 times the original speed?" or "How to build a city with many jobs and convenient transportation?". Intent recognition refers to the process of analyzing the user's deep purpose in asking the question through a neural network model or a large language model and classifying it into a preset scenario type. There can be multiple preset scenario types, and in this embodiment, they can include at least six categories: scenario prediction, scenario query, policy suggestion, theoretical concept, identity inquiry, and irrelevant questions.

[0029] For example, when a user asks "How will carbon emissions change after the subway speed increases?", the system determines that the user's intention is scenario prediction; when a user asks "What is the city's population under scenario A?", the user's intention is scenario query; when a user asks "How to make the city more livable?", the user's intention is policy recommendation; and when a user asks "How is the city's greening rate calculated?", the user's intention is theoretical concept.

[0030] It should be noted that the embodiments of this disclosure accurately classify the complex and diverse natural language queries of users through intent recognition, providing a basis for decision-making for subsequent invocation of different processing branches, avoiding the inability of a single processing flow to adapt to multiple question types, thereby improving the pertinence and accuracy of the system's response.

[0031] Regarding step S102 above, the policy scenario database is a structured database pre-constructed in this embodiment of the disclosure, which stores causal relationship pairs between various policy regulation measures in urban development and their resulting development outcomes. The regulation causal types are divided into a first regulation causal type and a second regulation causal type, which are corresponding to each other. The first regulation causal type corresponds to the policy scenario conditions, i.e., the input policy adjustment parameters, which is the cause in the causal pair; the second regulation causal type corresponds to the development prediction results, i.e., the future prediction indicators output after simulation by the urban computing platform, such as carbon emissions and population density in 2035, which is the effect in the causal pair. Therefore, each regulation causal pair data provided in this embodiment of the disclosure is essentially a key-value pair, where the key is the text description of the policy scenario conditions, and the value is the text description of the corresponding development prediction result.

[0032] It should be noted that the pre-built policy scenario library in this embodiment can pre-calculate and structurally store complex urban development simulation processes, forming clear causal pairs from policy scenario inputs to effect outputs. This avoids the need to run high-cost urban computing models in real time for each user inquiry, significantly improving question-and-answer response efficiency. Furthermore, this provides reliable factual constraints for the generated results of large models. By retrieving pre-calculated data from the scenario library to support the answer, it fundamentally eliminates the illusions or unreliable values ​​that might arise from direct predictions by large models, ensuring the accuracy and consistency of the answer without manual correction. In addition, this embodiment supports bidirectional causal reasoning, enabling both positive predictions based on user-defined policy queries of future scenarios and reverse deduction of key influencing factors or recommended policy combinations based on user-expected development goals. Traditional database calls often only support unidirectional queries, making it difficult to achieve this level of in-depth urban pattern summarization and decision support.

[0033] It should be noted that, by pre-constructing a policy scenario library, the inherent causal laws between policy adjustments and their effects in urban development are structurally precipitated, forming reusable knowledge assets. This provides a data foundation for quickly matching user queries in the future, avoiding the waste of resources that would otherwise require complex recalculations for each question and answer session.

[0034] Regarding step S103 above, the target parameter refers to the specific policy scenario conditions or development outcome indicators involved in the user's problem, such as the subway operating speed in the policy scenario conditions or the urban carbon emissions in the development forecast results. The extracted target parameters also include the specific values ​​or magnitudes of the parameters, such as 1.2 times, 10%, etc.

[0035] This disclosure allows for various methods to extract target parameters related to smart city policies from user natural language queries. For example, a large language model combined with prompt word constraints can be used. By embedding a set of standard system variable names into the prompt words, the model is guided to automatically map the user's colloquial expression into system-recognizable indicator variables, extracting key attributes such as time, location, and policy adjustment values. Alternatively, a method combining rule matching and named entity recognition can be employed. A policy indicator lexicon and entity recognition model are pre-built to perform structured parsing of the target query text, thereby extracting the target parameters. Another approach is to use intent recognition and parameter slot filling, dynamically defining parameter slots based on the user's intent type to accurately extract the required target parameters from the target query text.

[0036] Based on the intent recognition results, embodiments of this disclosure can determine whether the target parameter belongs to a first regulatory causal type or a second regulatory causal type. For example, if the intent is scenario prediction, the parameters in the user's question are usually policy adjustment parameters, belonging to the first regulatory causal type; if the intent is scenario query, the parameters are usually development prediction result indicators, belonging to the second regulatory causal type.

[0037] It should be noted that the embodiments of this disclosure extract target parameters related to smart city policies from the target query text, thereby achieving automatic mapping between natural language colloquial indicators and standard variables. This greatly reduces the input threshold for users and ensures the accuracy of subsequent searches, avoiding matching failures due to differences in expression.

[0038] Regarding step S104 above, based on the target regulation causal type, this embodiment of the disclosure can perform a reverse search in the policy scenario database. If the target parameter belongs to the first regulation causal type, that is, the corresponding policy scenario condition, then all regulation causal pairs containing the policy scenario condition are retrieved, and then the corresponding second regulation causal type text, that is, the text corresponding to the development prediction result, is extracted from these pairs as the target policy text. Conversely, if the target parameter belongs to the second regulation causal type, that is, the corresponding development prediction result, then all regulation causal pairs containing the prediction indicator are retrieved, and the corresponding first regulation causal type text, that is, the text corresponding to the policy scenario condition, is extracted as the target policy text.

[0039] For example, when a user asks "How will carbon emissions change if the subway speed increases by 10%", the target parameters are "subway speed increases" and "10%", and the type is the first type of regulation causality. The regulation causality pair containing the policy condition is retrieved, and the corresponding carbon emission change prediction text is extracted as the target policy text.

[0040] It should be noted that the embodiments of this disclosure, through a bidirectional retrieval mechanism based on causal types, can answer both the positive prediction question of what result will be obtained if A is done, and the reverse attribution question of what should be done to obtain B. This achieves bidirectional mining of urban decision-making patterns and breaks through the limitation of traditional prediction models that can only output in one direction.

[0041] Regarding step S105 above, the first input data consists of prompts composed of the target policy text, the user's original question, and necessary contextual information. Further, for simple query scenarios, such as a user asking for a specific value under a certain situation, the system can directly integrate the query results and the user's question into the first input data. For complex policy recommendation scenarios, machine learning models such as random forests can be used to rank the importance of multiple candidate policy scenarios. The ranking results, along with the user's question, are then input into a large language model, allowing the model to generate an answer with suggested strategies. The target large language model can be the same model used for intent recognition or a model specifically designed for answer generation. Its function is to absorb structured data and generate fluent text that conforms to human reading habits.

[0042] It should be noted that the embodiments of this disclosure use structured data retrieved from the policy scenario database as input constraints to guide the large language model to generate fact-based answers. This effectively suppresses the illusion problem common in large language models, ensures the authenticity and reliability of the answers, and eliminates the need for manual correction afterward, thereby improving the efficiency and accuracy of question answering.

[0043] In summary, this embodiment of the present disclosure, through the execution of the smart city platform question-answering method based on a large model in steps S101 to S105, uses a pre-stored policy scenario library containing causal data of regulation under various policy scenarios to structure and systematically summarize the inherent causal laws between policy regulation and corresponding effects in urban development, providing regular support for complex business consultations. Then, by performing intent recognition on the target question text to obtain the intent result corresponding to the scenario type, and accurately extracting target parameters related to smart city policies from the question, and combining the intent recognition results to determine the target regulation causal type to which the target parameters belong, multi-dimensional in-depth analysis of users' complex business consultations is achieved. By retrieving matching target-control causal pairs from the policy scenario database along the defined target-control causal type, the corresponding target policy text is quickly extracted, eliminating the need for time-consuming manual searching and organization of relevant policy evidence, thus significantly improving the efficiency of question-and-answer response. Finally, based on the accurately matched target policy text, an input data target large language model is constructed to generate the target answer text. This fully utilizes the natural language generation capabilities of the large model and effectively constrains and guides the output of the large model through pre-structured policy causal data, fundamentally avoiding the illusion problem of the large model. Accurate and reliable answers can be generated without manual correction, ultimately improving the question-and-answer efficiency and accuracy of the smart city platform.

[0044] Please see Figure 3 , Figure 3 This is a flowchart illustrating the pre-built policy scenario library provided in this disclosure. In some embodiments, the process of building the policy scenario library may include steps S201 to S204: Step S201: Pre-set multiple different smart city policy scenario conditions, each policy scenario condition corresponding to the first regulatory causal type of text; Step S202: Call the preset city computing platform to perform development simulation calculations for each policy scenario condition, and obtain the development prediction results corresponding to each smart city policy scenario condition. The development prediction results correspond to the text of the second regulation causal type. Step S203: Correlate each smart city policy scenario with the corresponding development prediction results to construct causal data for regulation under each policy scenario. Step S204: All the completed regulatory causal data are stored in a structured manner to form a policy scenario library.

[0045] In the above steps, policy scenario conditions refer to urban development regulation variables that users may be concerned about, such as improving the level of public transportation supply, reducing the proportion of industrial land, and increasing investment in scientific and technological research and development. They can also be specific numerical values ​​involved in these conditional variables, such as percentages or multiples. Each policy scenario condition corresponds to the text of the first regulation causal type. These conditions can come from professional knowledge bases in the field of urban planning or interviews with urban managers. Each condition is described as natural language text to facilitate subsequent interaction with the large language model.

[0046] The urban computing platform is a specialized computing engine for simulating urban development and evolution. Based on input policy scenarios, it uses a multivariate spatiotemporal prediction model to output economic, population, and environmental indicators for multiple future years, yielding development forecasts. These forecasts correspond to text of a second type of regulatory causality. For example, inputting a 20% increase in public transport supply, the platform outputs a 15% increase in public transport share and an 8% reduction in carbon emissions by 2030. The platform can operate on various data sources, such as historical statistics, traffic flow data, and land use data, ensuring the scientific validity and reliability of the forecasts.

[0047] Next, in this embodiment of the disclosure, policy scenario conditions and development forecast results are paired and stored to form a causal pair, ultimately constructing regulatory causal pair data under various policy scenarios. For example, a regulatory causal pair data includes a 20% increase in public transport supply, a 15% increase in public transport modal share by 2030, and an 8% reduction in carbon emissions. These data reflect the direct mapping relationship between cause and effect.

[0048] Structured storage can employ relational databases or key-value databases. Each record contains policy scenario conditions and development forecast result fields, and is indexed for fast retrieval. The database can also store a set of standard variable names related to the policy scenario conditions for subsequent parameter extraction. For example, the policy scenario database can be stored in a file organized in JSON format or in a dedicated vector database to support semantic similarity retrieval.

[0049] It should be noted that the embodiments of this disclosure generate a policy scenario library through offline simulation of the urban computing platform, bringing the complex urban computing process forward. This allows for rapid responses during online question answering simply by retrieving data from the library, eliminating the need to run the computational model in real time, thus significantly reducing inference latency and computational resource consumption. Furthermore, the policy scenario library can be gradually updated over time, and this disclosure does not impose specific limitations on this.

[0050] Please see Figure 4 , Figure 4 yes Figure 2The flowchart further includes step S103. In some embodiments, the process of extracting target parameters related to smart city policies from the target query text may include steps S301 to S303: Step S301: Obtain the standard variable names in the text of each regulatory causal pair data to obtain a name set; Step S302: Construct parameter extraction prompts containing a set of names, and combine the target question text with the parameter extraction prompts to obtain the second input data; Step S303: Input the second input data into the target large language model so that the variable names in the target question text can be automatically matched and converted into the corresponding standard variable names in the name set through the target large language model, and the attribute information associated with the standard variable names can be extracted to generate target parameters related to smart city policies.

[0051] In the above steps, the standard variable name is the unified name of all policy conditions and development forecast indicators in the policy scenario library, such as public transportation supply level, manufacturing ratio, total carbon emissions, population density, etc. In this embodiment of the disclosure, these variable names can be extracted when constructing the policy scenario library to form a deduplicated set, or each record in the policy scenario library can be traversed to extract the variable names from the policy scenario condition text and development forecast result text through natural language processing technology or manual annotation. The resulting name set will contain the standard variable names in the text of each regulatory causal pair data.

[0052] Parameter extraction prompts are instruction texts that guide the large language model to extract policy indicators from user questions according to specified rules. They explicitly limit the range of values ​​that the target large language model can output, ensuring the matching of the extracted results. Further, parameter extraction prompts can be designed as follows: "Please extract the indicator names and parameter values ​​related to smart city policies from the following user question. Note that indicator names can only be found from the following name set {name set}, and variable names must be complete variable names. User question: {user question}". Finally, the target question text is combined with the parameter extraction prompts, and the resulting second input data can be used as input data for the subsequent target large language model.

[0053] After receiving the second input data, the target large language model first understands the colloquial expressions in the user's question. For example, "Is it crowded?" should be converted into "population density" and "Is it congested?" should be converted into "traffic congestion index". Then, it selects the most matching standard variable name from the name set, and then extracts the parameter value or degree description, such as the numbers 1.2 times or 10 percent, or the qualitative words "increase" or "decrease". Finally, it outputs the result according to the format required by the prompt words.

[0054] For example, when a user asks "How much will carbon emissions decrease if the subway speed is increased by 10%", the model outputs {"Indicator": "Subway operating speed", "Value": "10%"} and {"Indicator": "Carbon emissions"}. The final target parameter is a structured object containing standard variable names and quantified values ​​or directions.

[0055] It should be noted that, by leveraging the powerful semantic understanding capabilities of the large language model, this embodiment of the present disclosure achieves seamless conversion from natural language to standardized parameters, greatly reducing the threshold for user input and enabling non-professional users to easily use the platform, while ensuring the accuracy and consistency of subsequent searches.

[0056] Please see Figure 5 , Figure 5 yes Figure 2 Another flowchart further includes step S103. In some embodiments, the process of extracting target parameters related to smart city policies from the target query text may also include steps S401 to S402: Step S401: When the intent recognition result is a theoretical concept type intent, the target query text is rewritten to remove contextual information unrelated to smart city policy regulation issues and extract standardized target query text. Step S402: Extract target parameters related to smart city policies from the target query text.

[0057] In the above steps, theoretical concept intent refers to user inquiries about knowledge-based questions such as definitions, principles, and calculation methods, for example, what is the urban greening rate and how is the carbon emission coefficient calculated. Query rewriting refers to rewriting the user's follow-up questions or questions containing pronouns into independent and complete query statements, and then removing contextual information that is irrelevant to smart city policy regulation issues.

[0058] For example, a user first asks what the projected urban greening rate of Guangzhou will be in 2025, and then asks how this indicator is calculated. This embodiment of the disclosure identifies that the second question belongs to the category of theoretical concepts and contains the pronoun "indicator". It needs to be replaced with the specific noun "urban greening rate" to obtain how the urban greening rate indicator is calculated. The rewriting can use a large language model or a rule-based pronoun resolution method.

[0059] Next, for theoretical concept questions, the target parameter is usually the concept name or indicator name, such as the urban greening rate. After extraction, a search-enhanced generation method can be used to search for relevant definitions, formulas or principle documents in the scenario library. Then, the search results are combined with the user's question and input into the large language model to generate the answer.

[0060] It should be noted that, through special processing of theoretical concept questions and the use of query rewriting and retrieval enhancement technologies, the embodiments of this disclosure can accurately answer knowledge-based questions in the field of urban expertise, expand the service scope of the platform, meet the diverse information needs of users, and complement the question-and-answer system based on the policy scenario database.

[0061] In some embodiments, when a user's target regulatory causal type belongs to the development prediction outcome, it means that the user expects to achieve a specific urban development goal through some policy means. For example, if a user asks how to build a city with many jobs and convenient transportation, the target parameters provided by the user are expected development outcome indicators such as the job supply-demand ratio and transportation network density, rather than specific policy adjustment parameters. Since the regulatory causal pair data stored in the policy scenario database is essentially a positive mapping relationship from policy scenario conditions to development prediction outcomes, in order to answer inverse questions such as how to achieve a certain outcome, it is necessary to first accurately extract the target development prediction indicators from the user's question to clarify what the user's expected outcome is; then, using this indicator as the search key, reverse search is performed among all causal pairs to find all causal pairs containing this outcome indicator, thereby obtaining all policy scenario conditions that may produce this outcome; finally, the text of another regulatory causal type, i.e., the policy scenario condition, is extracted from each matched causal pair to obtain multiple candidate policy scenario solutions. This process essentially uses the user's expected outcome as a clue to perform reverse indexing in a pre-built causal database, thereby realizing the pattern mining from outcome to cause, providing a data foundation for subsequent policy importance ranking and personalized suggestions, and making up for the shortcomings of traditional prediction models that can only reason in one direction.

[0062] Based on this, please refer to Figure 6 , Figure 6 yes Figure 2 The flowchart further includes step S104. In some embodiments, when the target regulation causal type represents that the target parameter belongs to the development prediction result, in the process of retrieving target regulation causal pair data that matches the target parameter from multiple regulation causal pair data along the target regulation causal type, and extracting the text of another regulation causal type from the target regulation causal pair data to obtain the target policy text, steps S501 to S504 may also be included: Step S501: Extract at least one target development prediction indicator from the target parameters; Step S502: Retrieve all regulatory causal pair data containing at least one target development prediction indicator from all regulatory causal pair data along the target regulation causal type, as multiple target regulation causal pair data; Step S503: Extract another type of text from each target regulation causal pair data to obtain multiple candidate policy scenario conditions; Step S504: Select multiple candidate policy scenario conditions as the target policy text.

[0063] In the above steps, the target development prediction indicators refer to the standardized indicator names corresponding to the urban development results that users expect to achieve, such as reduced carbon emissions, increased population density, and decreased traffic congestion index. In this embodiment of the disclosure, these indicators are obtained from the extracted target parameters.

[0064] Next, this embodiment of the disclosure searches the policy scenario database for causal pairs of records in all development forecast result fields that contain keywords related to the target development forecast indicator. The retrieval can be performed using keyword matching or vector similarity matching. For example, the search retrieves forecast results that include carbon emissions, finding all causal pairs that mention changes in carbon emissions, such as increasing public transportation supply leading to an 8% reduction in carbon emissions, or reducing industrial energy consumption leading to a 5% reduction in carbon emissions. These causal pairs are collected as multiple target regulation causal pair data.

[0065] Then, text of another type of regulatory causality is extracted from the data of each target regulatory causal pair to obtain multiple candidate policy scenario conditions. The other type of regulatory causality here refers to the first type of regulatory causality, i.e., policy scenario conditions. In this embodiment, the policy scenario condition field is extracted from each candidate causal pair, such as increasing public transportation supply by 20% or reducing industrial energy consumption by 10%, forming a candidate policy list. This list represents various policy measures that can generate the user's desired goals. These policy scenario conditions, as target policy texts, will be used for subsequent analysis and ranking.

[0066] It should be noted that, through reverse retrieval, starting from the user's expected result, this embodiment quickly locates the policy control measures that can produce the result in history or simulation, realizing reverse reasoning from result to cause, and providing a candidate pool of policy solutions for urban decision-makers.

[0067] Please see Figure 7 , Figure 7 yes Figure 2 The flowchart further includes step S105. In some embodiments, the process of constructing first input data based on the target policy text, inputting the first input data into the target large language model, and outputting the target answer text may further include steps S601 to S604: Step S601: Use at least one target development prediction indicator as a label column and use the policy scenario condition variables corresponding to multiple candidate policy scenario conditions as feature columns. Step S602: Call the preset random forest regression model, use the label column as output and the feature column as input, perform regression calculation on the numerical data in the causal relationship data of multiple target regulation, and output the importance score of each policy scenario condition variable to the target development prediction indicator. Step S603: Sort the multiple candidate policy scenarios in descending order of importance score, and integrate the sorted multiple candidate policy scenarios, their corresponding importance scores, and the target question text to construct the first input data; Step S604: Input the first input data into the target large language model to generate the target answer text containing policy scenario priority suggestions.

[0068] In the above steps, this embodiment of the disclosure can use at least one target development prediction indicator as a label column and policy scenario condition variables corresponding to multiple candidate policy scenarios as feature columns. The label column refers to the target variable to be predicted in the machine learning regression model; in this embodiment, it is the urban development outcome indicator that users are concerned about, such as the reduction in carbon emissions. The feature column refers to the independent variables used to predict the labels, i.e., the policy adjustment parameters in each candidate policy scenario, such as the adjustment range of public transportation supply level, the reduction ratio of industrial energy consumption, etc. This embodiment of the disclosure can extract the quantitative parameters of each policy from the obtained candidate policy scenario conditions to form a feature matrix; and use the quantitative value of the target development prediction indicator corresponding to each causal pair as the label column.

[0069] Next, a pre-defined random forest regression model is invoked, using the label column as output and the feature column as input. Regression calculations are performed on the numerical data in the causal relationship data of multiple target regulation, outputting a score indicating the importance of each policy scenario condition variable to the target development prediction indicator. Random forest is an ensemble learning algorithm that improves prediction accuracy by constructing multiple decision trees and voting or averaging. In this embodiment, the random forest regression model is trained using the policy adjustment magnitude in the feature column as input and the effect indicator in the label column as output. After training, the model can output an importance score for each feature (i.e., each policy variable) to the prediction target, used to demonstrate the feature importance of the regression random forest. This score can be obtained by averaging the variance reduction caused by each feature splitting across all decision tree nodes. A higher score indicates a greater impact of the policy variable on the target outcome.

[0070] It should be noted that the embodiments disclosed herein introduce a random forest model to automatically learn the influence strength of different policy variables on the target outcome from the data, providing an objective and quantitative method for evaluating policy priorities and avoiding the bias of subjective experience judgment.

[0071] Then, the candidate policy scenarios are ranked from highest to lowest importance score. The ranked scenarios, their corresponding importance scores, and the target question text are then integrated to construct the first input data. This ranking makes the policy recommendations clearer, allowing users to intuitively understand which policies are most effective. Furthermore, the ranking result can be a list; for example, the first priority is increasing public transportation supply (0.45 importance), the second is reducing industrial energy consumption (0.30 importance), and the third is increasing green space (0.25 importance).

[0072] The first input data consists of a sorted list, the target question text, and appropriate instructions combined into natural language prompts, such as: "The user wants to achieve {target development prediction indicators}. The following are policy recommendations calculated based on historical data and their importance: 1. Improve public transportation supply, importance 0.45; 2. Reduce industrial energy consumption, importance 0.30; 3. Increase green space, importance 0.25. Please provide the user with specific and actionable policy recommendations based on this information." It should be noted that, by prioritizing candidate policies, this embodiment transforms complex data analysis results into a clear and intuitive priority list, enabling users to quickly grasp the key points and providing valuable material for large language models to generate structured answers.

[0073] Finally, the first input data is fed into the target large language model to generate a target answer text containing policy scenario priority suggestions. After receiving the first input data, the target large language model understands the user's original intent and the results of the quantitative analysis, and then generates a fluent and natural response text. For example, the output might be: "To reduce urban carbon emissions, according to model analysis, the most effective policy is to improve the level of public transportation supply, which has the highest importance and is expected to significantly reduce carbon emissions. Secondly, reducing industrial energy consumption can be considered, and it is recommended to gradually transform high-energy-consuming industries. In addition, increasing urban green space also has a certain auxiliary effect. Specific implementation suggestions are as follows:..." Such an answer provides both priorities and implementation directions, making it more readable and valuable for decision-making than a simple list of numbers.

[0074] It should be noted that the embodiments of this disclosure transform data-driven policy importance information into suggested text that conforms to human communication habits through a large language model, enabling non-professional users to easily understand the data analysis results and realizing a natural language bridge from data to decision-making.

[0075] Please see Figure 8 , Figure 8 yes Figure 2The flowchart further includes step S101. In some embodiments, the process of performing intent recognition on the target question text to obtain the intent recognition result under the corresponding scenario type may also include steps S701 to S702: Step S701: Construct third input data based on the target question text; Step S702: Input the third input data into the target large language model, perform intent recognition on the target question text, and select the intent recognition result corresponding to the target question text from multiple preset candidate intents of different scenario types.

[0076] In the above steps, the third input data refers to the input text composed of a prompt word used to trigger the large language model to classify intent and the user's original question. The prompt word needs to explicitly tell the large language model the intent category to be classified and the output format. For example, the prompt word can be constructed as: "You are an intent classifier for a smart city question-answering system. Please classify the user's question into one of the following six categories: scenario prediction, scenario query, policy suggestion, theoretical concept, identity inquiry, and irrelevant question. Please only output the category name and do not output other explanations. The user's question is: {user question}." The third input data is the complete string obtained by replacing the user question placeholder in the prompt word with the target question text.

[0077] Next, the third input data is fed into the target large language model to perform intent recognition on the target question text and select the intent recognition result corresponding to the target question text from multiple preset candidate intents of different scenario types. After receiving the third input data, the target large language model analyzes the core demand of the user's question based on the instructions in the prompt words and makes a selection from six preset candidate intents. For example, if the user inputs "If the subway speed is adjusted to 1.2 times the original speed, what will happen in the future?", the model outputs a scenario prediction; if the user inputs "What will the city's carbon emissions be under scenario A?", the model outputs a scenario query; if the user inputs "How to build a city with many jobs and convenient transportation?", the model outputs policy suggestions; if the user inputs "How to calculate the city's greening rate?", the model outputs a theoretical concept; if the user inputs "Who are you?", the model outputs an identity inquiry; if the user inputs a question unrelated to the city, such as "How is the weather today?", the model outputs an irrelevant question.

[0078] Furthermore, the output of the target large language model can be in plain text form, and the intent category can be obtained through string matching or keyword parsing. In addition, in order to prevent the model output from being unstable, an output specification mapping can be set in post-processing, such as requiring the output to be a numeric code, or using multiple models to vote. This disclosure embodiment does not impose specific limitations on this.

[0079] It should be noted that, by constructing specialized intent recognition prompts and leveraging the semantic understanding capabilities of a large language model, this embodiment of the present disclosure can accurately classify diverse natural language questions from users into preset intent categories, thereby selecting the correct processing branch for subsequent parameter extraction and context library retrieval. Compared to traditional rule-based keyword matching, this large model-based intent recognition method has stronger generalization ability and robustness, effectively handling vague, colloquial, or structurally complex user questions, avoiding subsequent processes from entering incorrect branches due to classification errors, thus improving the accuracy and user experience of the entire question-answering system.

[0080] In summary, this disclosure provides a question-answering method for smart city platforms based on large models, which can improve the efficiency and accuracy of question-answering on smart city platforms. Finally, please refer to... Figure 9 , Figure 9 This is a schematic diagram illustrating the workflow under different policy scenarios provided in the embodiments of this disclosure. Examples of different scenarios are given below: (1) Scenario prediction example: In a specific application scenario, a user asks the smart city platform, "What will happen if the subway speed is adjusted to 1.2 times its original speed?" The system first categorizes the question as a scenario prediction through intent recognition. Then, it uses parameter extraction prompts to guide the target large language model to extract target parameters from the question, such as the indicator name "subway operating speed" and the adjustment magnitude "1.2 times". Since this parameter belongs to the first type of regulatory causality, that is, policy scenario conditions, the system searches the policy scenario database for all regulatory causal pairs containing policy conditions related to "subway operating speed", and finds causal pairs such as "increase subway operating speed by 20%" and "increase public transport share by 12% and reduce carbon emissions by 5% by 2030". The system extracts the corresponding second-order regulatory causal type text, i.e., the development prediction result, integrates it with the user's question, and inputs it into a large language model to generate a fluent natural language answer, such as: "If the subway speed is increased to 1.2 times, it is estimated that by 2030, the public transport modal share will increase by about 12%, and urban transportation carbon emissions will decrease by about 5%. At the same time, the attractiveness of rail transit will increase, which may alleviate surface traffic congestion." Based on this, users obtain a quantitative prediction of the future impact of policy adjustments.

[0081] (2) Scenario query example: In a specific application scenario, a user asks, "What will urban carbon emissions be like under Scenario A?" The system identifies the intent as a scenario query. The parameter extraction module extracts "Scenario A" as a policy scenario condition identifier and "urban carbon emissions" as a target development prediction indicator. The system uses "Scenario A" as the key to retrieve the corresponding causal pair of regulation in the policy scenario database, matching the prediction result field under Scenario A, for example, "Urban carbon emissions will be 12 million tons in 2030 and 9.8 million tons in 2035." Since the user did not specify a year, the system returns carbon emission prediction data for all years under that scenario. The system combines the query results with the user's question and inputs it into the target large language model to generate the answer: "Under Scenario A, urban carbon emissions are expected to be 12 million tons in 2030 and decrease to 9.8 million tons in 2035, showing a year-on-year improvement trend." Users can quickly obtain the indicator values ​​under a specific policy scenario without having to consult complex tables themselves.

[0082] (3) Implementation examples of policy recommendations: In a specific application scenario, a user inquires: "How to build a city with abundant job opportunities and convenient transportation?" The intent is identified as a policy recommendation. The system extracts the target development prediction indicators "job supply-demand ratio" and "transportation network density" from the question. These two indicators belong to the second type of regulatory causality. The system performs a reverse search in the policy scenario database, looking for all regulatory causal pairs corresponding to development prediction results containing these two indicators, obtaining multiple candidate policy scenario conditions, such as "increasing the proportion of high-tech industries," "increasing public transportation route density," and "optimizing the ratio of residential and employment land." Subsequently, the system uses the target indicators as label columns and each policy variable as feature columns, calling a random forest regression model to calculate the importance score of each policy variable to the target indicator, and sorts them by score. The sorted list of policy recommendations is integrated with the user's question and input into the target large-scale language model for target analysis. After summarizing the content, an answer is generated: "To build a city with abundant job opportunities and convenient transportation, it is recommended to prioritize increasing the proportion of high-tech industries (importance score 0.52); secondly, increase public transportation route density (importance score 0.33); and simultaneously optimize the ratio of residential and employment land (importance score 0.15). Specific measures can be implemented as follows..." The user receives a clear policy priority and implementation direction.

[0083] (4) Theoretical concept implementation examples: In a specific application scenario, a user asks, "How is the urban greening rate calculated?" The intent is identified as a theoretical concept. The system first performs query rewriting on the pronouns in the question, replacing "this indicator" with the specific noun "urban greening rate," resulting in the standardized query "How is the urban greening rate calculated?" Subsequently, the system uses retrieval enhancement technology to search for relevant information. It performs vector similarity searches in a pre-built policy scenario database or other knowledge bases to find relevant document fragments, such as "Urban green coverage rate refers to the ratio of urban green coverage area to urban area. Calculation formula: Urban green coverage rate (%) = (Vertical projection area of ​​all green plantings in the city ÷ Urban area) × 100%." ​​The system inputs the retrieved knowledge content along with the user's question into a large language model to generate an accurate and professional answer, indicating the source of the knowledge. Users receive clear concept definitions and calculation formulas, allowing for quick understanding without needing to consult professional literature.

[0084] (5) Examples of identity inquiries and irrelevant questions: In a specific application scenario, when the intent recognition result is an identity inquiry or an irrelevant question, the system can directly call the target large language model to generate the corresponding response content without going through the policy scenario database retrieval or parameter extraction process. Identity inquiries refer to questions from users asking about the system's identity, functions, and capabilities, such as "Who are you?", "What can you do?", and "What are your data sources?". Irrelevant questions refer to questions completely unrelated to smart city planning, policies, or indicators, such as "How's the weather today?" or "Tell me a joke." For identity inquiries, the system clarifies its identity and core functions through preset prompts or fixed response templates, such as responding with "I am a smart city policy Q&A assistant, providing you with urban decision-making support services such as policy scenario prediction, development result query, and policy suggestions." For irrelevant questions, the system also uses the target large language model to understand the user's intent, politely informing the user of its capability boundaries, and guiding the user to ask questions related to smart cities, such as responding with "Sorry, I specialize in policy consultation in the field of smart cities. Do you have any questions about urban planning, transportation, or the environment?" It should be noted that, through the specific processing of identity inquiries and irrelevant questions, this embodiment of the disclosure, on the one hand, allows users to quickly understand the platform's functional positioning and improves user experience; on the other hand, it avoids irrelevant requests from wasting policy scenario library retrieval and random forest computing resources, and prevents the target large language model from generating idle chat content unrelated to city policies under unrestrained circumstances, thereby ensuring that the platform focuses on core business scenarios.

[0085] (6) Recommended Implementation Example: In a specific application scenario, after completing the question-and-answer session and outputting the target answer text, the system can automatically generate several related follow-up questions based on the user's original question and the current response, guiding the user to explore further. The system first obtains the user's target question text and the system-generated target answer text, constructing question recommendation prompts. For example, the prompts could be designed as: "Generate follow-up questions based on the user's query and the system's response." Then, the prompts are input into the target large language model, which outputs recommended questions. For instance, if a user asks, "What will happen if the subway speed is increased to 1.2 times its original speed?", the system might recommend questions such as "How to balance economic development and environmental protection in urban planning?", "What impact will increasing subway speed have on property prices along the line?", and "Can reducing subway speed reduce carbon emissions?". The system displays these recommended questions on the user interface as interactive buttons or text links, which users can click to automatically fill in and initiate new questions and answers. It should be noted that, through the question recommendation function, this embodiment of the disclosure proactively provides users with a path to further exploration, reducing the mental burden on users to conceive subsequent questions. At the same time, it can guide users to focus on other important policy dimensions related to the current issue, which helps to form a coherent decision-making consultation chain and improves the platform's user stickiness and knowledge mining depth.

[0086] Please see Figure 10 This disclosure also provides a question-answering device for a smart city platform based on a large model, which can implement the above-mentioned question-answering method for a smart city platform based on a large model. The question-answering device for a smart city platform based on a large model includes: The intent recognition module 1001 is used to acquire the target question text received by the smart city platform, and to perform intent recognition on the target question text to obtain the intent recognition result under the corresponding scenario type. The scenario library acquisition module 1002 is used to acquire a preset policy scenario library. The policy scenario library stores regulatory causal pair data under various policy scenarios. Each regulatory causal pair data contains a pair of text of regulatory causal type under the corresponding policy scenario. The regulation causal type confirmation module 1003 is used to extract target parameters related to smart city policies from the target question text and determine the target regulation causal type to which the target parameters belong by combining the intent recognition results; The scenario database retrieval module 1004 is used to retrieve target regulation causal pair data that matches the target parameter from multiple regulation causal pair data along the target regulation causal type, and extract the text of another regulation causal type from the target regulation causal pair data to obtain the target policy text; The answer output module 1005 is used to construct the first input data based on the target policy text, input the first input data into the target large language model, and output the target answer text.

[0087] In summary, the smart city platform question-answering device based on a large model executes the smart city platform question-answering method based on a large model in the above embodiments. By pre-setting a policy scenario library containing data on the causal relationships of regulation under various policy scenarios, it structurally precipitates and systematically summarizes the inherent causal laws between policy regulation and its corresponding effects in urban development, providing regular support for complex business consultations. Then, by performing intent recognition on the target question text to obtain the intent result of the corresponding scenario type, it accurately extracts the target parameters related to smart city policies from the question, and determines the target regulation causal type to which the target parameters belong by combining the intent recognition results, thus realizing multi-dimensional in-depth analysis of users' complex business consultations. Next, by searching the policy scenario database for matching target-control causal pairs along the determined target-control causal type, the corresponding target policy text is quickly extracted, eliminating the need for time-consuming manual searching and organization of relevant policy evidence, thus significantly improving the efficiency of question-and-answer response. Finally, based on the accurately matched target policy text, a target language model is constructed to generate the target answer text. This fully utilizes the natural language generation capabilities of the large model and effectively constrains and guides the output of the large model through pre-structured policy causal data, fundamentally avoiding the illusion problem of the large model. Accurate and reliable answers can be generated without manual correction, ultimately improving the efficiency and accuracy of question-and-answer on the smart city platform.

[0088] The specific implementation of the large-model-based smart city platform question-answering device is basically the same as the specific embodiment of the large-model-based smart city platform question-answering method described above, and will not be repeated here. Subject to meeting the requirements of the embodiments of this disclosure, the large-model-based smart city platform question-answering device may also be equipped with other functional modules to implement the large-model-based smart city platform question-answering method described above.

[0089] This disclosure also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned question-answering method for a smart city platform based on a large model. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0090] Please see Figure 11 , Figure 11 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 1101 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this disclosure. The memory 1102 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1102 can store operating devices and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1102 and is called and executed by the processor 1101 to implement the question-answering method for a smart city platform based on a large model, as described in this disclosure. Input / output interface 1103 is used to implement information input and output; The communication interface 1104 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 1105 transmits information between various components of the device (e.g., processor 1101, memory 1102, input / output interface 1103, and communication interface 1104); The processor 1101, memory 1102, input / output interface 1103 and communication interface 1104 are connected to each other within the device via bus 1105.

[0091] This disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described question-answering method for a smart city platform based on a large model.

[0092] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0093] The embodiments described in this disclosure are for the purpose of more clearly illustrating the technical solutions of this disclosure and do not constitute a limitation on the technical solutions provided by this disclosure. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by this disclosure are also applicable to similar technical problems.

[0094] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this disclosure, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0095] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0096] Those skilled in the art will understand that all or some of the steps, apparatuses, or functional modules / units in the methods disclosed above can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0097] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such orders can be interchanged where appropriate so that embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion, for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.

[0098] It should be understood that in this disclosure, "at least one item" means one or more, and "more than one" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0099] In the several embodiments provided in this disclosure, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, and the division of the units described above is only a logical functional division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0100] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0101] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0102] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0103] The preferred embodiments of the present disclosure have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present disclosure. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and spirit of the present disclosure shall be within the scope of the claims of the present disclosure.

Claims

1. A large model-based smart city platform question and answer method, characterized in that, include: The system acquires the target question text received by the smart city platform and performs intent recognition on the target question text to obtain the intent recognition result under the corresponding scenario type. A preset policy scenario library is obtained, which stores regulatory causal pair data under various policy scenarios. Each regulatory causal pair data contains a pair of texts of regulatory causal type under the corresponding policy scenario. The policy scenario library is pre-set with multiple different smart city policy scenario conditions. Each policy scenario condition corresponds to a text of the first regulatory causal type. A preset urban computing platform is called to perform development simulation calculations on each policy scenario condition to obtain the development prediction result corresponding to each smart city policy scenario condition. The development prediction result corresponds to a text of the second regulatory causal type. Each smart city policy scenario condition is then associated with the corresponding development prediction result to construct the regulatory causal pair data under each policy scenario. All the constructed regulatory causal pair data are then stored in a structured manner. Extract target parameters related to smart city policies from the target query text, and determine the target regulation causal type to which the target parameters belong by combining the intent recognition results; The target regulation causal pair data matching the target parameter is retrieved from multiple regulation causal pair data along the target regulation causal type, and the text of another regulation causal type in the target regulation causal pair data is extracted to obtain the target policy text; Based on the target policy text, first input data is constructed, and the first input data is input into the target large language model to output the target answer text; When the target regulation causal type characterizes the target parameter as a development prediction result: The process involves retrieving target regulatory causal pair data that matches the target parameter from multiple regulatory causal pair data along the target regulatory causal type, and extracting text of another regulatory causal type from the target regulatory causal pair data to obtain the target policy text, including: Extract at least one target development prediction indicator from the target parameters; retrieve all regulatory causal pairs containing the at least one target development prediction indicator from all the regulatory causal pairs along the target regulatory causal type, as multiple target regulatory causal pairs; extract text of another regulatory causal type from each target regulatory causal pair to obtain multiple candidate policy scenario conditions; use the multiple candidate policy scenario conditions as the target policy text; The step of constructing first input data based on the target policy text, inputting the first input data into the target large language model, and outputting the target answer text includes: At least one of the target development prediction indicators is used as a label column, and the policy scenario condition variables corresponding to multiple candidate policy scenario conditions are used as feature columns. A preset random forest regression model is invoked, with the label column as the output and the feature column as the input, to perform regression calculations on the numerical data in the multiple target regulation causal pair data, and output the importance score of each policy scenario condition variable to the target development prediction indicator. The multiple candidate policy scenario conditions are sorted in descending order of importance score, and the sorted multiple candidate policy scenario conditions, the corresponding importance scores, and the target question text are integrated to construct the first input data. The first input data is input into the target large language model to generate the target answer text containing policy scenario priority suggestions.

2. The large model-based smart city platform Q&A method of claim 1, wherein, The extraction of target parameters related to smart city policies from the target query text includes: Obtain the standard variable names from the text of each regulatory causal pair data to obtain a set of names; Construct parameter extraction prompts containing the set of names, and combine the target question text with the parameter extraction prompts to obtain the second input data; The second input data is input into the target large language model, so that the variable names in the target question text are automatically matched and converted into the corresponding standard variable names in the name set through the target large language model, and the attribute information associated with the standard variable names is extracted to generate target parameters related to smart city policies. 3.The large model-based smart city platform Q&A method of claim 1, wherein, The extraction of target parameters related to smart city policies from the target query text includes: When the intent recognition result is a theoretical concept-type intent, the target query text is rewritten to remove contextual information unrelated to smart city policy regulation issues and extract standardized target query text. Extract target parameters related to smart city policies from the target query text. 4.The large model-based smart city platform Q&A method of claim 1, wherein, The process of performing intent recognition on the target question text to obtain intent recognition results under the corresponding scenario type includes: Construct a third input data based on the target question text; The third input data is input into the target large language model to perform intent recognition on the target question text, and the intent recognition result corresponding to the target question text is selected from multiple preset candidate intents of different scenario types. 5.A smart city platform question and answer device based on a large model, characterized in that, For implementing the large-model-based smart city platform question-answering method according to any one of claims 1 to 4, the large-model-based smart city platform question-answering device comprises: The intent recognition module is used to acquire the target question text received by the smart city platform, and to perform intent recognition on the target question text to obtain the intent recognition result under the corresponding scenario type. The scenario database acquisition module is used to acquire a preset policy scenario database, which stores regulatory causal pair data under various policy scenarios. Each regulatory causal pair data contains a pair of text of regulatory causal type under the corresponding policy scenario. The regulation causal type confirmation module is used to extract target parameters related to smart city policies from the target question text, and determine the target regulation causal type to which the target parameters belong in combination with the intent recognition result; The scenario database retrieval module is used to retrieve target regulation causal pair data that matches the target parameter from multiple regulation causal pair data along the target regulation causal type, and extract the text of another regulation causal type from the target regulation causal pair data to obtain the target policy text; The answer output module is used to construct first input data based on the target policy text, input the first input data into the target large language model, and output the target answer text.

6. An electronic device, comprising: The electronic device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements the question-answering method for a smart city platform based on a large model as described in any one of claims 1 to 4.

7. A computer readable storage medium, the storage medium having stored thereon a computer program, characterized in that, When the computer program is executed by the processor, it implements the question-answering method for a smart city platform based on a large model as described in any one of claims 1 to 4.