Government affair work order intelligent processing method and system based on space-time semantic clustering and large language model
Through the improved DBSCAN algorithm and large language model, combined with the GIS platform, intelligent processing of government work orders is achieved, solving the problems of low clustering accuracy, inaccurate priority assessment, single disposal suggestions and lack of feedback loop, and improving the efficiency of government work order processing and user satisfaction.
Patent Information
- Application Number
- CN202511333257.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2045-09-18
AI Technical Summary
The existing government work order processing system lacks intelligent clustering analysis capabilities, resulting in confused clustering of work orders for "same location, different issues" or "colleagues in different locations", inaccurate priority assessment, single handling suggestions, and a lack of feedback loop, making it difficult to respond to emergencies and improve user satisfaction.
An improved DBSCAN algorithm with a weighted spatiotemporal semantic three-dimensional distance measurement formula is used for joint clustering, and a large language model is combined to generate diversified disposal suggestions. A dynamic priority evaluation and feedback loop is established, and visual interactive analysis is achieved through a GIS platform.
It significantly improved the accuracy of work order classification and emergency event identification capabilities, achieved efficient resource allocation and diversified handling suggestions, reduced the complaint return rate, and improved user satisfaction.
Smart Images

Figure CN120821848A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent processing of government work orders, and specifically to a method and system for intelligent processing of government work orders based on spatiotemporal semantic clustering and a large language model. Background Art
[0002] With the acceleration of urbanization and the deepening digital transformation of government services, the daily number of work orders received by government hotline platforms continues to rise. Existing government work order processing systems mostly rely on static rule engines and manual processing, which has the following technical problems: (1) Lack of intelligent clustering analysis capabilities. Existing clustering methods (such as DBSCAN based on spatial Euclidean distance or text similarity threshold method) cannot effectively integrate multi-dimensional features such as spatiotemporal semantics, and lack a weight adjustment mechanism, resulting in confusing clustering of work orders for "same location, different tasks" or "colleagues in different locations", affecting clustering accuracy and handling efficiency; (2) The lack of an emergency response mechanism. In emergency scenarios such as natural disasters, insufficient system throughput can easily lead to a backlog of work orders. (3) Priority assessment models often use static rules or simple threshold scoring models, which make it difficult to dynamically integrate multiple factors such as complaint volume, sentiment intensity, urgency, and timeliness, and are unable to quickly identify high-risk and urgent work orders; (4) The disposal suggestion generation module lacks intelligent assistance. The generation of disposal suggestions mostly relies on the operator's experience and cannot realize intelligent and diversified disposal suggestion push based on historical cases. (5) The feedback loop is missing. For work orders that citizens are dissatisfied with, there is a lack of automatic reconstruction and priority reallocation capabilities, which easily leads to a backflow of complaints.
[0003] To sum up, the existing government work order processing technology has a series of technical bottlenecks such as low clustering accuracy, inaccurate priority assessment, single handling suggestions and insufficient user satisfaction response. It is urgent to build a new work order intelligent processing method and system that integrates multi-dimensional feature modeling, AI intelligent decision-making and dynamic feedback optimization to improve the processing efficiency, response speed and user satisfaction of government services. Summary of the Invention
[0004] The purpose of the present invention is to overcome the shortcomings of the existing technology and provide a government work order intelligent processing method system based on spatiotemporal semantic clustering and large language model to achieve efficient classification, intelligent scheduling and diversified disposal suggestion generation of massive multi-dimensional government work order data.
[0005] The present invention adopts the following technical solutions to achieve the above-mentioned purpose. The present invention provides an intelligent processing method for government work orders based on spatiotemporal semantic clustering and a large language model, comprising: S1. Unify the data feature modeling of the work orders to be processed, and perform the improved DBSCAN clustering algorithm on the work orders using the weighted spatiotemporal semantic three-dimensional distance measurement formula to achieve joint clustering of spatial, temporal and semantic features; S2. Weight-based scoring Calculate the ticket priority, where is the current number of clustered work orders, For emotional intensity, For urgency, is the aging coefficient, , , , is the weight of the corresponding item; S3. Dynamically allocate processing resources based on cluster size and work order priority; S4, Retrieval-Augmented Generation (RAG) technology based on the RAG framework and the FAISS (Facebook AI Similarity Search) vector retrieval library, matches historically similar tickets, generates few-shot learning cases, and generates two differentiated resolution plans by controlling the temperature parameters of the large language model. S5. Visual display and interactive analysis of work order clustering are achieved through an interactive GIS platform; S6. Establish a quality feedback loop for work order reconstruction.
[0006] Furthermore, in step S1, the weighted spatiotemporal semantic three-dimensional distance measurement formula is: ; Where R is the characteristic radius of the city, , T is the time window, set according to the government affairs processing cycle, is the weight coefficient, satisfying , Indicates the work order Semantic vectors for text encoding, Indicates the work order Semantic vectors for text encoding, Represents work orders respectively UNIX timestamp when ticket j was published.
[0007] Execute the improved DBSCAN clustering algorithm to achieve joint clustering of spatial, temporal and semantic features. Specifically include: In the spatial dimension, the work order address is first converted into the longitude and latitude coordinates of the WGS84 coordinate system through geocoding, and then transformed into a standardized plane coordinate system through UTM projection. In the time dimension, the work order submission time is converted into the WGS84 coordinate system. Convert it into UNIX timestamp format. In the semantic dimension, a pre-trained text representation model is used to encode the work order text into a 384-dimensional semantic vector.
[0008] Furthermore, for any work order in the work order set D , when satisfied Work Order The number exceeds the preset threshold hour, , then these work orders are marked as the same spatiotemporal semantic cluster, that is: ; Where, Indicates a work order The candidate set, and The two parameters are determined through historical data training and optimization. Indicates a work order fields, Indicates the preset threshold; For new work orders , follow these steps to process: calculate 3D distance to all processed work orders , filter out The work orders constitute the candidate set ; like All work orders in the are not classified, then when When Create new clusters for cores, otherwise Temporarily marked as noise point; like If there are classified work orders in In the classified work order The nearest work order ,Will Classification The cluster to which it belongs; If there are cases that cannot be classified and the domain does not have sufficient density, 𝑞 is temporarily marked as a noise point and re-evaluated in the subsequent clustering cycle.
[0009] Furthermore, in step S2, Reflects the number of complaints about the current type of problem, The sentiment value of the appeal text is quantified through the pre-trained sentiment analysis model. The urgency of the work order is determined by combining the large language model with predefined rules. The timeliness coefficient is the normalized value of the work order retention time. The calculation formula is: ,in is the attenuation factor, The duration of the work order retention.
[0010] Furthermore, step S3 specifically includes: According to cluster size Compared with the preset single-person handling capability threshold Calculate the number of handlers required , , and select the one with the least amount of work to do from the pool of handlers A working group is composed of 100 handlers; For new work orders, they are assigned to members of the work group in a round-robin manner. The polling rule is to assign them in the order of members. If the member load reaches the threshold, it will be skipped to ensure load balancing.
[0011] Furthermore, step S4 specifically includes: Based on the RAG framework and the FAISS vector retrieval library, we use cosine similarity to retrieve the top-K cases from the historical case library. The cosine similarity calculation formula is as follows: ; Where, and are the semantic vector representations of the current work order and the historical case work order, Indicates pending work orders and historical case tickets The cosine similarity of Filter the cases that are satisfied with the feedback from the retrieved cases. The satisfaction criteria are determined by the user ratings. The filtered cases are sorted in descending order of similarity to construct a few-shot learning example set and add it to the prompt words. The final structured prompt words The composition is: =Clustering Summary description + work order q content + few-shot learning example set of historical work orders + output structure, and finally by controlling the temperature parameters The large language model generates two sets of differentiated treatment recommendations A and B: ; ; Where, 、 Represent the recommended options A and B respectively, Represents a large language model, Represents the temperature parameter.
[0012] Furthermore, step S5 specifically includes: Use the Dash-Leaflet library to create an interactive map containing the following layers: Basic maps, including integration of Tiandi Map or OpenStreetMap services as basemap support; Real-time work orders are clustered and displayed in a point feature layer to show their spatial distribution. The size and urgency of the clusters are displayed by size and color. A gradient circle with a corresponding diameter pixel is selected to represent the cluster size. Urgency is mapped in the HSV color space, and a linear mapping from cool to warm tones is established. Cool tones indicate low urgency, and warm tones indicate high urgency. The point symbol size is adaptively adjusted based on the cluster size, and the color gradient is mapped to the HSV color space according to the priority level and urgency, achieving a visual comparison of high and low urgency. The panel displays the specific information of the queried work order in real time, and displays recommended solutions A and B. A double-buffered data pipeline is established. The front-end maintains the current frame visualization status. The back-end multi-threaded task automatically pulls the latest work order status data every set time and updates the memory cache. The front-end view switches to the new data buffer without perception during each refresh cycle.
[0013] Furthermore, in step S6, if the feedback is satisfactory, the work order is closed and added to the historical work order database. If the feedback is unsatisfactory, the work order reconstruction process is automatically triggered. The reconstruction process includes: extracting the original work order content, processing process records and citizen feedback, merging the extracted original work order content, processing process records and citizen feedback according to structured data to generate a new work order data entity, and automatically re-execute the dynamic priority scoring process for the newly generated work order, and increase the urgency and timeliness factors in the weight coefficient, and give priority to assigning it to the original processing department for processing; Real-time monitoring of the repeated complaint rate of the same work order. If the same work order receives multiple consecutive unsatisfactory feedbacks, the early warning mechanism will be automatically triggered, and the alarm information will be pushed to the management to prompt manual intervention.
[0014] The present invention also provides a government work order intelligent processing system based on spatiotemporal semantic clustering and a large language model, which is used to implement the above-mentioned government work order intelligent processing method based on spatiotemporal semantic clustering and a large language model. The system includes: The spatiotemporal semantic 3D clustering module is used to uniformly model the data features of pending work orders. It uses a weighted spatiotemporal semantic 3D distance metric to perform an improved DBSCAN clustering algorithm on the work orders, achieving joint clustering of spatial, temporal, and semantic features. Priority assessment module for scoring based on weights Calculate the ticket priority, where For weight scoring, is the current number of clustered work orders, For emotional intensity, For urgency, is the aging coefficient, , , , is the weight of the corresponding item; Real-time allocation and scheduling module, used to dynamically allocate scheduling resources based on cluster size and work order priority; The intelligent response generation module uses retrieval-enhanced generation technology based on the RAG framework and the FAISS vector retrieval library to match historically similar work orders, generate few-shot learning cases, and generate two sets of differentiated response plans by controlling the temperature parameters of the large language model. Interactive GIS visualization module, used to realize the visualization and interactive analysis of work order clustering through the interactive GIS platform; The quality feedback module is used to establish a quality feedback closed loop for work order reconstruction.
[0015] The beneficial effects of the present invention are: This paper uses an improved DBSCAN algorithm to cluster work orders. By integrating geographic coordinates, timestamps, and text semantic features to build a unified distance measurement model, it achieves intelligent identification of cross-dimensional related work orders. This solves the problems of low clustering accuracy and cross-category misclustering in the existing technology, significantly improving the purity of work order classification and the ability to identify emergencies. The present invention establishes a dynamic priority assessment system that integrates cluster size, sentiment intensity, urgency, and timeliness coefficient. It uses a quantitative scoring algorithm to improve the accuracy of emergency event recognition, overcoming the static and slow response defects of existing priority assessment models, and achieving rapid identification and early warning of high-priority events. The present invention is based on a government work order intelligent reply generation mechanism based on retrieval-enhanced generation and few-shot learning. Through structured prompt words and temperature parameter regulation, it automatically generates differentiated handling plans, realizing the diversified, personalized and context-adaptive generation of government work order handling suggestions by a large language model, effectively solving the problems of single content and poor reference value of existing generation methods.
[0016] The present invention designs a dynamic scheduling load balancing algorithm that is adaptive to cluster scale, and combines dynamic perception of handler load, flexible configuration of workgroups and polling load balancing to achieve efficient resource allocation and flow scheduling for work orders of different scales and multiple priorities, significantly improving system throughput and handling resource utilization.
[0017] This invention builds a GIS visualization front-end interface that supports multi-channel interaction, establishes a hierarchical interaction paradigm of "macro-clustering-meso-work orders-micro-details", realizes the real-time dynamic display of work order data, and effectively improves users' real-time control over the status of government work order processing; This invention establishes a closed-loop quality management approach encompassing evaluation collection, work order feedback, and alert escalation, ensuring continuous tracking of problem resolution. It supports automatic reconstruction, priority re-scoring, secondary assignment, and feedback alerts for "unsatisfactory" work orders. This overcomes the existing system's reliance on manual processing of user satisfaction and its lack of automated tracking and optimization, effectively reducing complaint feedback rates and improving citizen satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 This is a flow chart of a method for intelligently processing government work orders based on spatiotemporal semantic clustering and a large language model, provided by an embodiment of the present invention; Figure 2 This is an architecture diagram of an intelligent processing system for government work orders based on spatiotemporal semantic clustering and a large language model provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0019] To make the objectives, technical solutions and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0020] The present invention provides a method for intelligent processing of government work orders based on spatiotemporal semantic clustering and large language models, such as Figure 1 As shown, including: S1. Unify the data feature modeling of the work orders to be processed, and perform the improved DBSCAN clustering algorithm on the work orders using the weighted spatiotemporal semantic three-dimensional distance measurement formula to achieve joint clustering of spatial, temporal and semantic features; The weighted spatiotemporal semantic three-dimensional distance measurement formula is: ; Where R is the characteristic radius of the city, , T is the time window, set according to the government affairs processing cycle, is the weight coefficient, satisfying , Indicates the work order Semantic vectors for text encoding, Indicates the work order Semantic vectors for text encoding, Indicates a work order The three-dimensional distance from work order j, Indicates a work order The plane coordinates of represents the plane coordinates of work order j, Represents work orders respectively UNIX timestamp when ticket j was published.
[0021] Execute the improved DBSCAN clustering algorithm to achieve joint clustering of spatial, temporal and semantic features. Specifically include: In the spatial dimension, the work order address is first converted into the longitude and latitude coordinates of the WGS84 coordinate system through geocoding, and then transformed into a standardized plane coordinate system through UTM projection. In the time dimension, the work order submission time is converted into the WGS84 coordinate system. Convert it into UNIX timestamp format. In the semantic dimension, a pre-trained text representation model is used to encode the work order text into a 384-dimensional semantic vector.
[0022] For any work order in the work order set D , when satisfied Work Order The number exceeds the preset threshold hour, , then these work orders are marked as the same spatiotemporal semantic cluster, that is: ; Where, Indicates a work order The candidate set, and The two parameters are determined through historical data training and optimization. Indicates a work order fields, Indicates the preset threshold; For new work orders , follow these steps to process: calculate 3D distance to all processed work orders , filter out The work orders constitute the candidate set ; like All work orders in the are not classified, then when When Create new clusters for cores, otherwise Temporarily marked as noise point; like If there are classified work orders in In the classified work order The nearest work order ,Will Classification The cluster to which it belongs; If there are cases that cannot be classified and the domain does not have sufficient density, 𝑞 is temporarily marked as a noise point and re-evaluated in the subsequent clustering cycle.
[0023] S2. Weight-based scoring Calculate the ticket priority, where is the current number of clustered work orders, For emotional intensity, For urgency, is the aging coefficient, , , , is the weight of the corresponding item; For each work order cluster or individual work order, the following key features are extracted: Number of complaints : Obtained by counting the number of work orders within the work order cluster to measure the social impact of the event.
[0024] emotional intensity Quantify the sentiment of the appeal text using a sentiment analysis model (preferably a pre-trained sentiment analysis model based on the BERT architecture) (e.g., anger = 1.0, anxiety = 0.7, neutral = 0.2). Higher values reflect a higher subjective urgency of the issue.
[0025] Urgency :Based on the large language model inference engine, the work order content is extracted, keywords are classified, and semantic reasoning is performed. It automatically determines whether it involves high-risk factors such as life safety, property loss, and public safety, and outputs an emergency level score with a value range of [0,1]. The weight of emergency events is significantly increased. Determine the threat level of life and property (e.g., "fire" = 1.0, "water leak" = 0.3) Aging coefficient : The normalized value of the work order retention time is calculated using the time decay function. The calculation formula is: ; in Current time - work order submission time, It is a decay factor that controls the timeliness sensitivity. It means the decay rate of the timeliness of the work order. The value range is 0.01 to 0.1, and is preferably 0.05. The larger the value, the faster the timeliness of the work order decays. It can actually be trained and optimized based on historical completion cycle data.
[0026] The ticket priority score is then calculated according to the formula: ; Tickets are sorted by priority score to ensure that high priority incidents are handled first. 、 、 、 are the weight coefficients of each feature, which must satisfy The value range and determination principle of the weight coefficient are as follows: , , , The specific value can be set through historical data training, expert experience or dynamic adjustment based on business scenarios, where the urgency weight This is usually set to the maximum value to ensure that emergency events are handled first.
[0027] S3. Dynamically allocate scheduling resources based on cluster size and work order priority; In order to solve the technical problems existing in the existing government work order allocation mechanism, such as manual static scheduling, uneven resource utilization, and inability to respond to changes in work order priorities in real time, the present invention dynamically calculates the required resource allocation based on the work order clustering scale, priority score, current load status of the handler, and the single-person handling capacity threshold, and performs intelligent matching of multiple work orders and multiple personnel in real time.
[0028] For each newly formed cluster work order : According to its scale Determine the allocation plan: ; in The preset single-person handling capability threshold (such as = 50 pieces / day, because the typical configuration is 50 pieces / person / day), The number of working groups required.
[0029] Sort the handlers in the pool from the lowest to the highest number of tasks to be completed and select the one with the least amount of tasks to be completed. Disposal officer.
[0030] For subsequent clustering New work orders are assigned to the workgroup members bound to the cluster in a round-robin manner. The system dynamically monitors each worker's current task queue length and average processing speed, skipping members who have reached their maximum load threshold to achieve a balanced distribution of task flows. The system also monitors each worker's load in real time and dynamically adjusts the distribution.
[0031] The system monitors the overall load status in real time. When it detects that any workgroup member has a backlog of tasks, processing delays, or resource shortages within a short period of time, the rescheduling mechanism is automatically triggered to dynamically transfer tasks to idle handlers to ensure smooth overall task execution and timely response.
[0032] S4, retrieval enhancement generation technology based on the RAG framework and FAISS vector retrieval library, matches historically similar work orders, generates few-shot learning cases, and generates two sets of differentiated disposal plans by controlling the temperature parameters of the large language model; To address the technical issues in the existing process of generating suggestions for handling government work orders, such as content homogeneity, lack of historical case support, single generation scheme and lack of pertinence, the intelligent response generation method implemented in the present invention is as follows: For the clustering of currently pending work orders , using a large language model to generate a summary description of the event. Any pending work order , retrieve the Top-K most similar cases from the historical work order case library by calculating vector similarity (cosine similarity calculation): ; Where, and are the semantic vector representations of the current work order and the historical case work order, Indicates pending work orders and historical case tickets The cosine similarity of Filter the cases that are satisfied with the feedback from the retrieved cases. The satisfaction criteria are determined by the user ratings. The filtered cases are sorted in descending order of similarity to construct a few-shot learning example set and add it to the prompt words. The final structured prompt words The composition is: =Clustering Summary description + work order q content + few-shot learning example set of historical work orders + output structure, and finally by controlling the temperature parameters The large language model generates two sets of differentiated treatment recommendations A and B: ; ; Where, 、 Represent the recommended options A and B respectively, Represents a large language model, Represents the temperature parameter.
[0033] Solution A, with its lower temperature parameter, is more conservative and is the optimized solution based on the most similar case. Solution B, with its higher temperature parameter, is more innovative. The two resulting solutions, A and B, are returned to the front-end via the API and displayed simultaneously in the work order details area of the interactive GIS visualization platform for staff to evaluate and select.
[0034] S5. Visual display and interactive analysis of work order clustering are achieved through an interactive GIS platform; To address technical issues in existing government work order processing systems, such as insufficient visualization layers, weak situational awareness, and limited spatial filtering capabilities, the interactive GIS visualization implemented in this paper uses the Dash-Leaflet architecture to enable dynamic visualization and intelligent interactive analysis of the spatiotemporal distribution characteristics of government work orders. Its technical implementation method includes the following core aspects: (1) Basic maps (including but not limited to integrating Tiandi Map or OpenStreetMap services as basemap support); (2) Real-time work order clustering is displayed in a point feature layer to show spatial distribution. The size and urgency of the cluster are displayed by size and color. In the scale dimension, the cluster size is represented by a gradient circle with a diameter of 5-20 pixels (preferably 5 pixels for <5 work orders, 20 pixels for >50 work orders, and linear interpolation for intermediate values). In the urgency dimension, the HSV color space mapping is used to establish a linear mapping from cold tones (low urgency) to warm tones (high urgency). The point symbol size is adaptively adjusted based on the cluster size, and the color gradient is mapped to the HSV color space according to the priority level and urgency, realizing a visual comparison of high and low urgency.
[0035] (3) The real-time dashboard displays the specific information of the queried work order, the recommended processing solutions A and B displayed in the large model, and additional solutions that allow users to enter.
[0036] A double-buffered data pipeline is established. The front-end maintains the current frame visualization state. The back-end multi-threaded task automatically pulls the latest work order status data every 10 seconds and updates the memory cache. The front-end view switches to the new data buffer without perception during each refresh cycle, achieving a smooth, low-latency, and flicker-free visualization experience. The following intelligent interactive functions are implemented: Supports map zooming and panning.
[0037] Click the cluster symbol to expand it into a discrete work order point set; double-click a single work order point to display the work order information card, which contains structured information such as work order ID, problem type, specific problem, processing progress, etc.
[0038] Implement the following interactive filtering: Time dimension uses interactive time series slider to select time range The spatial dimension supports drawing polygons / circles / rectangles and other geometric range filters.
[0039] The business dimension provides multiple-select filters such as department and work order type.
[0040] S6. Establish a quality feedback loop for work order reconstruction.
[0041] When the operator completes the work order response, the response and satisfaction rating request are automatically sent to the citizen. If the citizen is satisfied with the feedback, the work order is closed and added to the historical work order database for future retrieval.
[0042] If citizen feedback indicates dissatisfaction, the subsequent work order reconstruction process is automatically triggered. The following three elements are automatically extracted from the PostgreSQL database: 1) the original work order content; 2) the processing process and disposition steps; and 3) the citizen feedback text. Natural language processing technology is used to extract key information, semantically integrate, and format the data from these three types of data to automatically generate a new work order entity.
[0043] The newly generated work order automatically re-executes the dynamic priority scoring process and increases the urgency and timeliness factors in the weight coefficient (such as multiplying the original priority score by 1.5 times) to improve the priority of secondary processing and give priority to assigning the reconstructed work order to the original handler.
[0044] Real-time monitoring of the repeated complaint rate of the same work order. If the same work order receives multiple consecutive unsatisfactory feedbacks, the early warning mechanism will be automatically triggered, and the alarm information will be pushed to the management to prompt manual intervention.
[0045] The present invention also provides an intelligent processing system for government work orders based on spatiotemporal semantic clustering and a large language model, comprising: The spatiotemporal semantic 3D clustering module is used to uniformly model the data features of pending work orders. Using a weighted spatiotemporal semantic 3D distance metric, it applies an improved DBSCAN clustering algorithm to the work orders, achieving joint clustering of spatial, temporal, and semantic features. It implements an improved multidimensional feature weighted clustering method that integrates the spatial coordinates, submission time, and text semantic vector features of the work order, achieving unified modeling of multidimensional information through a custom weighted distance metric model. Compared to existing methods based on single spatial clustering or semantic similarity, this module effectively improves the purity of work order classification and the ability to distinguish between multiple events.
[0046] Priority assessment module for scoring based on weights Calculate the ticket priority, where For weight scoring, is the current number of clustered work orders, For emotional intensity, For urgency, is the aging coefficient, , , , The priority assessment module builds a dynamic weight scoring model based on multi-dimensional indicators such as cluster size, sentiment intensity, urgency, and work order retention time, achieving a dynamic quantitative assessment of the urgency of work order handling.
[0047] The real-time allocation and scheduling module dynamically allocates resources based on cluster size and work order priority. Based on the priority score, it sets a preset threshold for individual handling capacity and dynamically calculates the number of personnel required. It also uses load balancing and round-robin mechanisms to quickly allocate resources to high-priority work orders, avoiding uneven resource allocation.
[0048] The intelligent response generation module is used to match historically similar work orders using retrieval enhancement generation technology based on the RAG framework and the FAISS vector retrieval library, generate few-sample learning cases, and generate two sets of differentiated handling plans by controlling the temperature parameters of the large language model.
[0049] This intelligent response generation module, for the first time, applies a dual-control mechanism of retrieval-enhanced generation and temperature parameters to the generation of government work order resolution suggestions. By retrieving the top-K satisfactory cases from a historical case library, combining few-shot learning examples with the current work order content, it constructs a multi-layered prompting vocabulary. Using different temperature parameters, it controls a large language model to generate differentiated resolution suggestions, enhancing the diversity and relevance of automatically generated resolution suggestions.
[0050] The interactive GIS visualization module, implemented based on the Dash-Leaflet architecture, supports real-time visualization and intelligent interactive screening of multi-dimensional features such as the spatial distribution and priority levels of work orders, enhancing decision makers' awareness of the overall situation of work orders.
[0051] The quality feedback module establishes a closed-loop mechanism of evaluation-reconstruction-priority redistribution. For work orders that users evaluate as unsatisfactory, the system automatically performs feature extraction, content reconstruction, and priority adjustment, and triggers a secondary processing flow, effectively reducing the complaint return rate.
[0052] The following is an explanation with reference to specific cases.
[0053] The government work order intelligent processing system disclosed in this embodiment adopts a microservice architecture based on Python language, is deployed on a cloud platform, and achieves high availability and scalability through containerization technology. Figure 2 As shown, the details are as follows: Application and service layer: Reverse proxy (Nginx): As the unified entrance of the system, it is responsible for receiving and load balancing external HTTP requests and forwarding them to the backend Web service.
[0054] Web Service (FastAPI): Provides a high-performance RESTful API interface to handle front-end synchronous requests (such as user requests, data queries, and data displays), and acts as a task producer to distribute time-consuming computing tasks to asynchronous task queues.
[0055] Asynchronous Task Workers (Celery): Serves as the core of distributed task scheduling, consuming tasks from the message broker. All time-consuming computational tasks (such as spatiotemporal semantic clustering, priority evaluation, vector retrieval, large oracle model inference, and intelligent response generation) are submitted to the task queue as asynchronous tasks and processed in parallel by multiple Worker nodes to prevent main service thread blocking.
[0056] Data and storage layer: Relational database (PostgreSQL + PostGIS): Serves as the primary business database, persistently storing structured data such as work order details, user data, processing records, clustering results, and priority scores. The PostGIS extension provides powerful geospatial data processing capabilities.
[0057] Cache and Message Broker (Redis): This serves a dual purpose. As a message broker, it acts as Celery's task queue middleware; as a cache, it stores hot data to accelerate API responses.
[0058] Vector storage (FAISS): Stores the semantic vectors of historical work order text content, providing efficient similarity retrieval support for the retrieval enhancement generation function of the intelligent response generation module.
[0059] Display panel and user interaction layer: Interactive GIS visualization module (Dash + Dash Leaflet): Builds the front-end interface of the data dashboard, responsible for the geospatial visualization of work order data, statistical chart display, and interactive operations with users.
[0060] Computing and Deployment Layer: To improve the efficiency of AI reasoning and semantic vector encoding, the system is deployed in a hybrid CPU and GPU server environment. CPU nodes are responsible for I / O-intensive tasks such as web and database operations, while GPU nodes are dedicated to AI compute-intensive tasks such as large language model reasoning and text vectorization. All application components are containerized using Docker and integrated with Kubernetes for automated deployment, elastic scaling, and fault tolerance, ensuring system stability and scalability.
[0061] When the system receives a new work order, it will automatically and intelligently process it according to the following steps: S1: When a new work order enters the system through FastAPI, an asynchronous clustering task is created and pushed to Redis. A Celery Worker retrieves the task and begins executing it: S11: Data Preprocessing: Use the Pandas and GeoPandas libraries to clean and transform work order data. This involves using a geocoding service to convert address text into WGS84 longitude and latitude coordinates, then transforming to planar coordinates using a UTM projection; converting work order submission times into UNIX timestamps; and using pre-trained text representation models (such as the Sentence-Transformers library or the Wenxin Yiyan Embedding-V1 model) to encode the work order text into 384-dimensional semantic vectors.
[0062] S13: Work order clustering is implemented using the DBSCAN algorithm from the scikit-learn library, employing a spatiotemporal semantic three-dimensional distance metric. This formula combines geographic distance, temporal difference, and the cosine distance of semantic vectors. The clustering results (the cluster IDs to which the work orders belong) are updated back to the corresponding work order records in the PostgreSQL database.
[0063] S2: After the work orders are clustered, the system automatically triggers the priority evaluation task. The Celery Worker performs the following operations: S21: Extract clustering features (such as the number of work orders in a cluster, Q) from PostgreSQL and combine them with sentiment analysis models (calculating sentiment intensity, E), large language model rules (determining urgency, U), and retention time (calculating the timeliness coefficient, A) to quantify all indicators.
[0064] S22: Applying a dynamic priority scoring formula , calculate the final priority score and store the result in PostgreSQL.
[0065] S3: Based on the calculated cluster size and priority, the system performs the allocation and scheduling tasks: S31: The system queries PostgreSQL for available operator information (including the number of pending tickets, average handling time, areas of expertise, etc.) to ensure that ticket allocation does not overload certain operators. For high-priority ticket clusters, the system prioritizes assigning them to operators with high processing efficiency and relatively low current load.
[0066] S32: The final assignment result (including the operator ID, work order ID, assignment time, etc.) is recorded in the work order assignment table in PostgreSQL. The work order status is updated to "Assigned" and the task is added to the operator's task flow.
[0067] S4: Implementation of the intelligent response generation module. This module is triggered when a user clicks on a specific work order in the front-end interface and is a direct reflection of the search-enhanced generation architecture: S41: Case Retrieval: After receiving a request from the frontend, FastAPI triggers a Celery task. This task first retrieves the current work order details from PostgreSQL, then uses its semantic vector to perform an efficient k-nearest neighbor search in the FAISS vector library to retrieve the top-K most similar historical success cases.
[0068] S42: Augment: Combine the detailed information of the current work order with the structured information of the K retrieved historical cases (problem description, solution, etc.) into a prompt word.
[0069] S43: Response Generation: The Celery Worker carries this enhanced prompt word and initiates two requests to the large language model (LLM) deployed on the GPU server or called through the API: one request uses a lower temperature parameter (such as 0.2) to generate a conservative solution A based on historical experience and rigorous logic; the other request uses a higher temperature parameter (such as 0.8) to generate a more divergent and innovative improved solution B.
[0070] S5: Implementation of interactive GIS visualization module. The user front end of this system is a web application built based on Dash and DashLeaflet libraries.
[0071] S51: The main interface of the application is an interactive map. It uses the dash_leaflet.GeoJSON component to pull geospatial data for work orders in real time and renders the work order points as clusters. Users can zoom and pan the map, and click on a cluster to expand it to view the individual work orders within it.
[0072] S52: Below the map are several statistical dashboards, drawn using Plotly Express, such as a bar chart showing the number of work orders per hour and data on the distribution of work orders by category.
[0073] S53: Interactive Analysis: (1) When a user clicks a single work order point on the map, the "Work Order Details" panel on the right will be updated immediately, showing the work order title, time, content, etc. At the same time, this click event will trigger the S4 process, asynchronously loading and displaying Plan A and Plan B in the "Large Model Recommended Plan" area below. (2) In addition, users can use the drawing tool (dash_leaflet.EditControl) on the map to draw a polygon, and the system will immediately query and list all work orders in the area in a table format.
[0074] S6: Implementation of the quality feedback module. When the responder adopts the suggestions and completes the work order, the system performs the following steps: S61: After FastAPI receives the work order completion request, it immediately updates the work order status in PostgreSQL to "Completed" and records the completion time. Simultaneously, the system sends a satisfaction rating link to citizens via SMS or WeChat mini-program push. The rating options include "Satisfied," "Average," and "Unsatisfied."
[0075] S62: After the citizen submits the evaluation, the system stores the evaluation results in the satisfaction evaluation table of PostgreSQL, which includes fields such as work order ID, evaluation level, evaluation time, citizen contact, specific opinion text, etc.
[0076] S63: When an unsatisfactory review is detected, FastAPI automatically creates a new Celery task. This task performs the following operations: (1) extracts all the information of the original work order from PostgreSQL (work order content, processing records, handling personnel information, etc.); (2) generates a new work order description based on the new opinions of the citizens, and sets a higher priority coefficient (such as multiplying the original priority score by 1.5); (3) marks the new work order as "related work order" and establishes a foreign key relationship with the original work order. S64: Newly created related tickets automatically trigger the full S1-S5 process, including re-clustering, priority assessment, dispatch scheduling, and response generation. The system prioritizes assigning tickets to operators with experience handling similar issues or those who are different from the original responder, ensuring optimal resolution.
[0077] The foregoing description is merely a preferred embodiment of the present invention. It should be understood that the present invention is not limited to the form disclosed herein and should not be construed as excluding other embodiments. Rather, the present invention can be used in various other combinations, modifications, and environments and can be modified within the scope of the concept described herein through the above teachings or techniques or knowledge in the relevant field. Modifications and variations made by those skilled in the art that do not depart from the spirit and scope of the present invention are intended to be protected by the appended claims.
Claims
1. An intelligent processing method for government work orders based on spatiotemporal semantic clustering and large language models, characterized by: include: S1. Unify the data feature modeling of the work orders to be processed, and perform the improved DBSCAN clustering algorithm on the work orders using the weighted spatiotemporal semantic three-dimensional distance measurement formula to achieve joint clustering of spatial, temporal and semantic features; S2. Weight-based scoring Calculate the ticket priority, where For weight scoring, is the current number of clustered work orders, For emotional intensity, For urgency, is the aging coefficient, , , , is the weight of the corresponding item; S3. Dynamically allocate scheduling resources based on cluster size and work order priority; S4, retrieval enhancement generation technology based on the RAG framework and FAISS vector retrieval library, matches historically similar work orders, generates few-shot learning cases, and generates two sets of differentiated disposal plans by controlling the temperature parameters of the large language model; S5. Visual display and interactive analysis of work order clustering are achieved through an interactive GIS platform; S6. Establish a quality feedback loop for work order reconstruction.
2. The method for intelligent processing of government work orders based on spatiotemporal semantic clustering and large language model according to claim 1 is characterized in that: In step S1, the weighted spatiotemporal semantic three-dimensional distance measurement formula is: ; Where R is the characteristic radius of the city, , T is the time window, set according to the government affairs processing cycle, is the weight coefficient, satisfying , Indicates the work order Semantic vectors for text encoding, Indicates the work order Semantic vectors for text encoding, Indicates a work order The three-dimensional distance from work order j, Indicates a work order The plane coordinates of represents the plane coordinates of work order j, Represents work orders respectively UNIX timestamp with which ticket j was published; Execute the improved DBSCAN clustering algorithm to achieve joint clustering of spatial, temporal and semantic features. Specifically include: In the spatial dimension, the work order address is first converted into the longitude and latitude coordinates of the WGS84 coordinate system through geocoding, and then transformed into a standardized plane coordinate system through UTM projection. In the time dimension, the work order submission time is converted into the WGS84 coordinate system. Convert it into UNIX timestamp format. In the semantic dimension, a pre-trained text representation model is used to encode the work order text into a 384-dimensional semantic vector.
3. The method for intelligent processing of government work orders based on spatiotemporal semantic clustering and large language model according to claim 2 is characterized in that: For any work order in the work order set D , when satisfied Work Order The number exceeds the preset threshold , these work orders are marked as the same spatiotemporal semantic cluster, namely: ; Where, Indicates a work order The candidate set, and The two parameters are determined through historical data training and optimization. Indicates a work order fields, Indicates the preset threshold; For new work orders , follow these steps to process: calculate 3D distance to all processed work orders , filter out The work orders constitute the candidate set ; like All work orders in the are not classified, then when When Create new clusters for cores, otherwise Temporarily marked as noise point; like If there are classified work orders in In the classified work order The nearest work order ,Will Classification The cluster to which it belongs; If there are cases that cannot be classified and the domain does not have sufficient density, 𝑞 is temporarily marked as a noise point and re-evaluated in the subsequent clustering cycle.
4. The method for intelligent processing of government work orders based on spatiotemporal semantic clustering and large language model according to claim 1 is characterized in that: In step S2, Reflects the number of complaints about the current type of problem, The sentiment value of the appeal text is quantified through the pre-trained sentiment analysis model. The urgency of the work order is determined by combining the large language model with predefined rules. The timeliness coefficient is the normalized value of the work order retention time. The calculation formula is: ,in is the attenuation factor, The duration of the work order retention.
5. The method for intelligent processing of government work orders based on spatiotemporal semantic clustering and large language model according to claim 1 is characterized in that: Step S3 specifically includes: According to cluster size Compared with the preset single-person handling capability threshold Calculate the number of handlers required , , and select the one with the least amount of work to do from the pool of handlers A working group is composed of 100 handlers; For new work orders, they are assigned to members of the work group in a round-robin manner. The polling rule is to assign them in the order of members. If the member load reaches the threshold, it will be skipped to ensure load balancing.
6. The method for intelligent processing of government work orders based on spatiotemporal semantic clustering and large language model according to claim 1 is characterized in that: Step S4 specifically includes: Based on the RAG framework and the FAISS vector retrieval library, we use cosine similarity to retrieve the top-K cases from the historical case library. The cosine similarity calculation formula is as follows: ; Where, and are the semantic vector representations of the current work order and the historical case work order, Indicates pending work orders and historical case tickets The cosine similarity of Filter the cases that are satisfied with the feedback from the retrieved cases. The satisfaction criteria are determined by the user ratings. The filtered cases are sorted in descending order of similarity to construct a few-shot learning example set and add it to the prompt words. The final structured prompt words The composition is: =Clustering Summary description + work order q content + few-shot learning example set of historical work orders + output structure, and finally by controlling the temperature parameters The large language model generates two sets of differentiated treatment recommendations A and B: ; ; Where, 、 Represent the recommended options A and B respectively, Represents a large language model, Represents the temperature parameter.
7. The method for intelligent processing of government work orders based on spatiotemporal semantic clustering and large language model according to claim 6 is characterized in that: Step S5 specifically includes: Use the Dash-Leaflet library to create an interactive map containing the following layers: Basic maps, including integration of Tiandi Map or OpenStreetMap services as basemap support; Real-time work orders are clustered and displayed in a point feature layer to show their spatial distribution. The size and urgency of the clusters are displayed by size and color. A gradient circle with a corresponding diameter pixel is selected to represent the cluster size. Urgency is mapped in the HSV color space, and a linear mapping from cool to warm tones is established. Cool tones indicate low urgency, and warm tones indicate high urgency. The point symbol size is adaptively adjusted based on the cluster size, and the color gradient is mapped to the HSV color space according to the priority level and urgency, achieving a visual comparison of high and low urgency. The panel displays the specific information of the queried work order in real time, and displays recommended solutions A and B. A double-buffered data pipeline is established. The front-end maintains the current frame visualization status. The back-end multi-threaded task automatically pulls the latest work order status data every set time and updates the memory cache. The front-end view switches to the new data buffer without perception during each refresh cycle.
8. The method for intelligent processing of government work orders based on spatiotemporal semantic clustering and large language model according to claim 1 is characterized in that: In step S6, if the feedback is satisfactory, the work order is closed and added to the historical work order database. If the feedback is unsatisfactory, the work order reconstruction process is automatically triggered. The reconstruction process includes: extracting the original work order content, processing process records and citizen feedback, merging the extracted original work order content, processing process records and citizen feedback according to structured data, and generating a new work order data entity. The newly generated work order automatically re-executes the dynamic priority scoring process, and increases the urgency and timeliness factors in the weight coefficient, and preferentially assigns it to the original processing department for processing; Real-time monitoring of the repeated complaint rate of the same work order. If the same work order receives multiple consecutive unsatisfactory feedbacks, the early warning mechanism will be automatically triggered, and the alarm information will be pushed to the management to prompt manual intervention.
9. An intelligent processing system for government work orders based on spatiotemporal semantic clustering and a large language model, for implementing the intelligent processing method for government work orders based on spatiotemporal semantic clustering and a large language model as described in any one of claims 1 to 8, characterized in that: include: The spatiotemporal semantic 3D clustering module is used to uniformly model the data features of pending work orders. It uses a weighted spatiotemporal semantic 3D distance metric to perform an improved DBSCAN clustering algorithm on the work orders, achieving joint clustering of spatial, temporal, and semantic features. Priority assessment module for scoring based on weights Calculate the ticket priority, where For weight scoring, is the current number of clustered work orders, For emotional intensity, For urgency, is the aging coefficient, , , , is the weight of the corresponding item; Real-time allocation and scheduling module, used to dynamically allocate scheduling resources based on cluster size and work order priority; The intelligent response generation module uses retrieval-enhanced generation technology based on the RAG framework and the FAISS vector retrieval library to match historically similar work orders, generate few-shot learning cases, and generate two sets of differentiated response plans by controlling the temperature parameters of the large language model. Interactive GIS visualization module, used to realize the visualization and interactive analysis of work order clustering through the interactive GIS platform; The quality feedback module is used to establish a quality feedback closed loop for work order reconstruction.
Citation Information
Patent Citations
Intelligent government affair hotline group appeal analysis and detection method
CN120373828A
Natural language query generation for feature stores using zero shot learning
US12373425B1
Lower-dimensional subspace approximation of a dataset
US20180107716A1
Cited By
Social governance event dynamic clustering and real-time early warning method and system based on large model
CN121071154A
Work order processing method based on big data
CN121503989A
A big data-based work order processing method
CN121503989B
Three-dimensional design collaborative annotation intelligent summarization method and system based on artificial intelligence
CN121544217A
An artificial intelligence-based three-dimensional design collaborative annotation intelligent aggregation method and system
CN121544217B
