Prison condition analysis method and system based on large model assistance

By employing a large-scale model-assisted prison situation analysis method, which utilizes a large language model for deep semantic parsing and reasoning, the system addresses the issues of insufficient information acquisition and decision support in prison situation analysis. This approach enables intelligent and automated prison situation analysis, thereby improving regulatory efficiency.

CN121807931APending Publication Date: 2026-04-07CHENGDU SOBEY DIGITAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing prison situation analysis systems suffer from insufficient information acquisition and expression capabilities, difficulty in identifying deep-seated risk semantics, rigid analytical logic, reliance on human experience, insufficient depth of decision support, and a lack of professional knowledge integration, which limits the improvement of regulatory effectiveness.

Method used

The prison situation analysis method, which employs a large model-assisted approach, utilizes data access, the construction and binding of a professional knowledge base, and deep semantic parsing and reasoning through a large language model to generate structured analysis results, including risk assessment and handling recommendations.

Benefits of technology

It has enabled intelligent and automated prison situation analysis, improved information coverage, the flexibility of analytical logic and decision support capabilities, and enhanced regulatory effectiveness and analytical efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807931A_ABST
    Figure CN121807931A_ABST
Patent Text Reader

Abstract

The invention discloses a prison condition analysis method and system based on large model assistance, and the method comprises the steps: collecting, fusing and storing multi-source heterogeneous data of a prison terminal, constructing a prison knowledge base containing laws and regulations, cases and specifications, carrying out the vectorization storage of the text content, creating a schedulable prison condition intelligent agent based on user configuration, and carrying out the analysis of the prison condition. The intelligent agent is defined through a specified cue word, a data source tool and a knowledge base subset; in response to a user analysis request, calling related unstructured data, and performing deep semantic analysis by using a large language model to extract key information; on the basis of the key information retrieval knowledge base, jointly forming a context input large model by a retrieval result and original data, and generating an analysis result containing risk research, judgment and disposal suggestions; a situation event is automatically judged and generated based on an analysis result, and a deep interpretation report can be further generated. The intelligent and automatic deep analysis of the prison condition is realized, and the analysis efficiency and the decision support capability are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a method and system for prison situation analysis based on large model assistance. Background Technology

[0002] In the field of prison management, prison situation analysis is a core component of ensuring prison security, playing a crucial role in accurately identifying high-risk inmates and key offender groups, as well as preventing emergencies. However, current prison situation analysis methods still have several significant shortcomings, hindering the improvement of supervision effectiveness.

[0003] First, the existing system has significant shortcomings in acquiring and expressing information related to prison situations. For example, while it can record basic event information, it cannot effectively extract deep risk semantics from the texts described by police officers. High-risk details such as "inmate A repeatedly spread retaliatory remarks against B in private" are difficult to identify and structurally record, leading to the omission of key risk elements. Second, the existing analytical logic relies on preset rules, making it difficult to adapt to new or complex patterns of illegal behavior and psychological characteristics. Third, the system relies too heavily on human experience and lacks the ability to effectively transform and integrate analytical wisdom. Experienced police officers can often connect potential premeditated clues from trivial events; however, such experience is difficult to abstract into fixed rules, resulting in insufficient support for long-term correlation analysis and deep behavioral pattern mining.

[0004] A more prominent problem lies in the insufficient depth of decision support provided by current early warning mechanisms. Traditional systems typically only output general risk labels, failing to automatically trace the causes and evolution paths of risks, nor generating actionable recommendations. The authenticity of early warnings still requires manual review of numerous inmate files and meeting minutes, resulting in inefficient processes and a high risk of information omissions. Furthermore, existing technologies lack deep integration with prison management expertise and authoritative support. For example, when faced with incidents of "inmates exhibiting abnormal emotions during high temperatures," the system cannot automatically link relevant clauses of the "Prison High Temperature Management Regulations" or provide similar historical case studies, leading to recommendations lacking standardization and effectiveness. Fundamentally, these deficiencies stem from the inherent contradiction between the mechanical nature of rule engines and the semantic understanding and complex reasoning required for prison situation analysis. Simultaneously, the limitations of natural language processing technology prevent the transformation of large amounts of unstructured text information into analyzable resources. Although some systems have attempted to introduce machine learning methods, their application suffers from high false alarm rates and poor interpretability due to a lack of effective integration with prison professional knowledge systems.

[0005] Therefore, how to build an intelligent analysis system that has the ability to understand the semantics of prison situations, integrates professional rules and experience knowledge, and can simulate judgment logic has become a key technical challenge that urgently needs to be overcome in the current prison supervision field. Summary of the Invention

[0006] The purpose of this application is to overcome the shortcomings of existing technologies and provide a prison situation analysis method and system based on large model assistance. This method effectively solves the problems of incomplete information coverage, rigid rules, reliance on manual labor, and insufficient decision support in traditional prison situation analysis, and significantly improves the intelligence level, standardization, and decision efficiency of prison situation analysis.

[0007] The objective of this application is achieved through the following technical solution: Firstly, this application proposes a prison situation analysis method based on a large model, which is applied to a large language model architecture and includes: Step S1: Collect and merge multi-source heterogeneous data from the monitoring area through the data access interface, and then convert the multi-source heterogeneous data into a unified format event object structure and store it. The multi-source heterogeneous data includes structured data and unstructured data. Step S2: Construct and manage the prison professional knowledge base, bind the knowledge base to the large language model, and convert the text content in the knowledge base into vector form and store it in the vector database. The knowledge base includes a legal and regulatory base, a reference case base, and a management standard base. Step S3: Create and orchestrate the prison situation intelligent agent based on the received user configuration instructions. The configuration instructions include specifying the prompt word template of the analysis intelligent agent, the data source tools that can be called, and the bound knowledge base subset. Step S4: Respond to the analysis request initiated by the user to the analysis agent and obtain the prison situation analysis results; Step S5: Based on the generated prison situation analysis results, the large language model parses the prison scene-specific situation rules defined by natural language, automatically calls and combines a set of MCP tools specifically for prison situation recommendation, performs comprehensive matching analysis through multi-dimensional data sources, and judges whether the event situation triggering standard is met based on dynamic threshold adjustment; if it is met, the situation event is automatically generated and recorded. Step S6: In response to the user's instruction to interpret the situation event, call the large language model to generate an in-depth interpretation report for the situation event. The interpretation report includes an event overview, risk interpretation, cause analysis, and recommended measures.

[0008] In one possible implementation, step S4 includes: Step S41: Based on the configuration of the analysis agent, call unstructured data from multi-source heterogeneous data, use a pre-trained large language model as a semantic understanding engine, and perform deep semantic parsing on the unstructured data to extract key entities, sentiment tendencies, behavioral intentions, and potential causal relationships between events as key information. Step S42: Using key information as the search key, retrieve relevant knowledge fragments from the bound knowledge base subset; Step S43: Combine relevant data, key information, and relevant knowledge fragments to form contextual information, and input it into the large language model; Step S44: Use a large language model to perform reasoning analysis and generate prison situation analysis results that include risk assessment and handling suggestions.

[0009] In one possible implementation, the prison expertise base includes a recommended measures database, a holiday interpretation database, and a comprehensive assessment definition database. The construction and management of the prison knowledge base includes: uploading files through a web interface to build the knowledge base, and classifying, tagging, and vectorizing the files.

[0010] In one possible implementation, the retrieval in step S42 employs a retrieval-enhanced RAG generation mechanism, including: Hybrid retrieval is performed based on key information from bound knowledge base subsets, integrating vector retrieval and full-text retrieval; The search results are reordered, and relevant knowledge fragments are filtered out.

[0011] In one possible implementation, the retrieval-enhanced RAG generation mechanism also includes a security enhancement mechanism for automatically filtering sensitive information and recording the knowledge source and generation path at the output stage.

[0012] In one possible implementation, the method further includes task decomposition and collaborative processing using the Model Context Protocol (MCP) framework, including: The analysis request is broken down into multiple sub-tasks, which include calling tools to obtain data, calling knowledge bases to obtain knowledge, calling models to perform comprehensive interpretation, and calling tools to generate reports or visualization results. The results of subtasks are integrated through a dynamic collaboration mechanism to generate a structured report.

[0013] In one possible implementation, the method further includes: in response to a user's operation on an important situational event, creating the situational event as a meeting topic, synchronizing it to the meeting management system via an API interface, generating a meeting topic and binding it to the original situational event.

[0014] In one possible implementation, the large language model adopts the Qwen3-32B model based on the Transformer encoder-decoder architecture, which supports a maximum context window length of 8192 tokens and uses low-rank adaptation LoRA technology for parameter fine-tuning. During the fine-tuning process, the rank of the LoRA adapter is set to 8, and the target module covers all linear transformation layers.

[0015] In one possible implementation, the large language model architecture includes: The large model system service layer provides basic services for large models, API interfaces, MCP framework, RAG framework, workflow services, and AI dialogue services. The large model inference engine includes the ollama framework for embedding model execution and vectorization functions, and the vLLM framework for offline inference; The data infrastructure layer includes Cache for caching model results, VectorDB for vector storage and retrieval, OSS for unstructured data storage, and RMDB for business data persistence.

[0016] Secondly, this application proposes a prison situation analysis system based on a large model, the system comprising: The conversion module is used to collect and merge multi-source heterogeneous data from the monitoring area through the data access interface, and then convert the multi-source heterogeneous data into a unified format event object structure for storage. The multi-source heterogeneous data includes structured data and unstructured data. The building module is used to build and manage the prison professional knowledge base, bind the knowledge base to the large language model, and convert the text content in the knowledge base into vector form and store it in the vector database. The knowledge base includes a legal and regulatory base, a reference case base, and a management standard base. Create an orchestration module for creating and orchestrating prison intelligence agents based on received user configuration instructions. The configuration instructions include specifying the prompt word templates for the analysis intelligence agents, the data source tools that can be invoked, and the bound subset of the knowledge base. The response module is used to respond to analysis requests initiated by users to the analysis agent and obtain prison situation analysis results; The judgment module is used to analyze the generated prison situation results, parse the prison scene-specific situation rules defined by natural language through a large language model, automatically call and combine a set of MCP tools specifically for prison situation recommendation, perform comprehensive matching analysis through multi-dimensional data sources, and judge whether the event situation triggering standard has been met based on dynamic threshold adjustment; if it has been met, the situation event is automatically generated and recorded. The generation module is used to respond to user instructions on interpreting situational events by calling a large language model to generate an in-depth interpretation report for the situational event. The interpretation report includes an event overview, risk interpretation, cause analysis, and recommended measures.

[0017] The main solution and its various further alternatives described above can be freely combined to form multiple solutions, all of which are solutions that can be adopted and are claimed in this application; furthermore, the (non-conflicting alternatives) can also be freely combined with each other and with other alternatives. Those skilled in the art, after understanding the solution of this application, will realize from the prior art and common general knowledge that there are many combinations, all of which are technical solutions to be protected in this application, and will not be exhaustively listed here.

[0018] This application discloses a prison situation analysis method and system based on a large model. It collects, integrates, and stores multi-source heterogeneous data from prison areas, constructs a prison knowledge base including regulations, cases, and standards, and stores its text content in vector form. Based on user configuration, it creates a programmable prison situation intelligent agent, defined by specifying prompt words, data source tools, and subsets of the knowledge base. Responding to user analysis requests, it calls relevant unstructured data and uses a large language model for deep semantic parsing to extract key information. Based on this key information, it retrieves information from the knowledge base, and inputs the retrieval results and original data into the large model to generate analysis results including risk assessment and handling suggestions. Based on the analysis results, it automatically judges and generates situational events, and can further generate in-depth interpretation reports. This achieves intelligent and automated in-depth analysis of prison situations, significantly improving analysis efficiency and decision support capabilities. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 A schematic diagram of the large language model architecture proposed in an embodiment of this application is shown.

[0021] Figure 2 The diagram shows a flowchart of a prison situation analysis method based on a large model, as proposed in an embodiment of this application.

[0022] Figure 3 A flowchart of the prison intelligence agent proposed in an embodiment of this application is shown.

[0023] Figure 4 A schematic diagram of a pre-trained language model is shown. Detailed Implementation

[0024] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0025] Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0026] In the existing technology, in order to address the core defects of existing prison situation analysis systems, such as incomplete information coverage due to reliance on structured data, rigid analysis logic that is difficult to adapt to complex scenarios, and insufficient depth of decision support, this application proposes a prison situation analysis method and system based on large model assistance. It aims to achieve in-depth fusion analysis of unstructured and structured data related to prison situation in the field of prison management through artificial intelligence technology, especially large language models, and automatically generate standardized and targeted in-depth analysis reports and handling suggestions, thereby significantly improving the intelligence level and decision support efficiency of prison situation analysis.

[0027] This application proposes a prison situation analysis method based on a large model, which is applied to a large language model architecture. Figure 1 A schematic diagram of the large language model architecture proposed in an embodiment of this application is shown, including: The large model system service layer provides basic services for large models, API interfaces, MCP framework, RAG framework, workflow services, and AI dialogue services. The large model inference engine includes the ollama framework for embedding model execution and vectorization functions, and the vLLM framework for offline inference; The data infrastructure layer includes Cache for caching model results, VectorDB for vector storage and retrieval, OSS for unstructured data storage, and RMDB for business data persistence.

[0028] The large-scale model system service layer integrates multiple specialized services. Among them, the large-scale model foundation service provides a unified integration and support framework for all upper-layer services. The large-scale model API, as a standardized external interface, encapsulates and exposes core AI capabilities in a RESTful format. The large-scale model MCP framework provides underlying support for collaborative calls between intelligent agents and external tools. The RAG framework is specifically responsible for the entire process of retrieval and augmentation generation by accessing and querying domain knowledge bases. Furthermore, the workflow service is responsible for visualizing or logically orchestrating complex analysis tasks, supporting chained calls and conditional branches to adapt to changing prison situation assessment processes; while the AI ​​dialogue service maintains the context and memory of multi-turn dialogues.

[0029] The large-model inference engine layer employs vLLM as a high-performance offline inference framework for large language models, focusing on handling computational tasks for large models such as Qwen, ensuring low latency and high concurrency response capabilities in the offline environment of the monitoring area. Simultaneously, the Ollam framework is used to deploy and run embedded models, specifically responsible for converting text data into vector representations, providing core vectorization functionality support for knowledge base construction and semantic retrieval in the RAG process.

[0030] The data infrastructure layer provides data storage and access capabilities for the entire system. The cache layer, acting as a high-speed caching layer, significantly reduces the overhead of repetitive computation caused by frequently queried model results. VectorDB, a dedicated vector database, is responsible for storing high-dimensional vectors and performing efficient similarity retrieval. OSS (based on MinIO) object storage service provides a reliable storage solution for the system's massive amounts of unstructured data. Meanwhile, RMDB (using MySQL), a relational database, undertakes the task of persisting all structured business data.

[0031] Please refer to Figure 2 , Figure 2 This paper illustrates a flowchart of a prison situation analysis method based on a large model, as proposed in an embodiment of this application. The method includes: Step S1: Collect and merge multi-source heterogeneous data from the monitoring area through the data access interface, and then convert the multi-source heterogeneous data into a unified format event object structure and store it. The multi-source heterogeneous data includes structured data and unstructured data.

[0032] Through the data access interface, multi-source heterogeneous data from the prison area are automatically collected and integrated, including but not limited to: structured data (such as basic files of inmates, scoring assessments, and violation databases) and unstructured data (such as assessment results, interview records, letter content, and abnormal behavior).

[0033] First, we collected and integrated relevant prison data from various sources. The data sources were broad, including but not limited to: inmate work assignments, inmate basic information, inmate phone calls with family members, unusual events in the prison ward, inmate physical and mental health data, inmate lists, inmate hospitalization records, inmate work point deductions and bonuses, prison ward work logs, inmate seven assessment results, inmate composition, negative events involving inmates, inmate text message records, inmate administrative reward and punishment records, and inmate criminal reward and punishment records.

[0034] Considering that the aforementioned multi-source data may originate from different business systems, with significant differences in data format and structure, the system provides standardized interfaces and format conversion functions to ensure the accuracy and consistency of subsequent analysis. This allows various heterogeneous data to be mapped into a unified event object structure, including standardized fields such as event ID, timestamp, event category, involved personnel, event description, and attachment path. Through this processing, the multi-source heterogeneous data is effectively integrated and stored into a unified data source set, forming data resources with a standardized format.

[0035] Step S2: Construct and manage a prison professional knowledge base, bind the knowledge base to a large language model, and convert the text content in the knowledge base into vector form and store it in a vector database. The knowledge base includes a legal and regulatory base, a reference case base, and a management standard base.

[0036] The prison expertise database includes a recommended measures database, a holiday interpretation database, and a comprehensive assessment definition database. The construction and management of the prison knowledge base includes: uploading files through a web interface to build the knowledge base, and classifying, tagging, and vectorizing the files.

[0037] To overcome the limitations and illusions inherent in the knowledge of specialized domains within large language models, a prison professional knowledge base was introduced. This knowledge base comprises several specialized sub-bases, including: a legal and regulatory database, a reference case database, a management standard database, a recommended measures database, a holiday interpretation database, and a comprehensive assessment definition database. These knowledge bases collectively constitute the key knowledge reserve system supporting the large model's prison situation analysis.

[0038] A dedicated knowledge base management module is provided, allowing police officers to upload various files via a web interface to build and improve the knowledge base. The knowledge base types cover multiple professional categories, including the aforementioned legal and regulatory databases, reference case databases, and management standard databases. The system supports uploading files in various common formats such as PDF, DOCX, TXT, and PPT. Police officers can categorize files according to their content into the corresponding knowledge base categories and add appropriate tags, thereby achieving effective organization and classification management of knowledge. The file content in the knowledge base is converted into vector form and stored in a vector database. A specialized embedding model is used to encode text paragraphs into high-dimensional vectors, establishing a semantic index.

[0039] In the practical application of prison situation analysis, the system uses key information extracted from the data layer as search keys to retrieve relevant legal provisions, similar historical cases, and handling procedures from the bound knowledge base subset in real time.

[0040] Step S3: Create and orchestrate the prison situation intelligence agent based on the received user configuration instructions. The configuration instructions include specifying the prompt word template for the analysis intelligence agent, the data source tools that can be invoked, and the bound knowledge base subset.

[0041] This application allows users to customize and arrange various professional types of prison situation intelligence agents. Each intelligence agent serves as a core component and carrier for performing prison situation analysis. Through customized configuration, it can be made to have the characteristics of the prison area and be able to analyze specific prison situations, thereby meeting the needs of prison situation analysis and judgment in different scenarios.

[0042] In the creation and orchestration phase, the configuration instructions include: First, specifying the prompt word template for the analytical agent. Users need to input instruction text to guide the large model in analysis. For example, based on provided inmate data and knowledge base content, analyze the inmate's recidivism risk characteristics, including recent behavioral anomalies, connections with other inmates, and provide a risk level assessment. This prompt word template clearly defines the analysis task, focus area, and output requirements, and supports parameterized settings. Variables such as {inmate's name} and {prison ward} can be inserted into the prompt word, and replaced with specific values ​​during actual use.

[0043] Secondly, configure the data source tools that the intelligent agent can call, that is, specify the data types in the data source tools that the analysis assistant can call, such as querying the basic information of an inmate, querying the inmate's work position, and obtaining abnormal events in the prison area. After binding, the analysis assistant can automatically pull relevant data to ensure that the analysis process is based on the latest and most comprehensive information sources.

[0044] Thirdly, the configuration allows users to select and link subsets of the knowledge base. For example, the recidivism risk analysis assistant can link to a recidivism case database and a regulatory policy database to ensure that the analysis results comply with relevant policy requirements and reference historical cases. After linking, the analysis assistant will prioritize searching the content of these knowledge bases during the analysis process, thereby ensuring the standardization and accuracy of the analysis conclusions.

[0045] Figure 3The flowchart of the prison situation intelligence agent proposed in this application embodiment is shown. It uses a basic model as the underlying general capability foundation and employs three key technologies: Retrieval Enhancement Generation (RAG), Model Context Protocol (MCP), and Fine-tuning. The RAG mechanism primarily injects real-time knowledge into the system, ensuring that the analysis conclusions are based on the latest regulations, cases, and data. The MCP framework mainly empowers the system to handle complex tasks, automating the assessment process through task decomposition and tool invocation. Fine-tuning technology focuses on shaping the model's core capabilities in the prison management field, enabling it to have deep domain adaptability to professional terminology, business processes, and assessment logic. Ultimately, all of the above capabilities are integrated and encapsulated upwards, jointly empowering and shaping the top-level prison situation intelligence agent.

[0046] Step S4: Respond to the analysis request initiated by the user to the analysis agent and obtain the prison situation analysis results; When an analysis request is sent to a configured analytical agent via natural language, the system does not perform simple keyword matching or database queries. Instead, it triggers an integrated, multi-step intelligent analysis process. This process, based on the pre-programmed configuration of the analytical agent, automatically executes a series of operations, including data fusion, semantic understanding, knowledge retrieval, and augmented generation. Ultimately, through the deep reasoning capabilities of a large language model, it fuses and analyzes multi-source heterogeneous data with authoritative domain knowledge, automatically generating a structured prison situation analysis result that includes risk assessment, causal analysis, and treatment recommendations.

[0047] Step S4 includes: Step S41: Based on the configuration of the analysis agent, call unstructured data from multi-source heterogeneous data, use a pre-trained large language model as a semantic understanding engine, and perform deep semantic parsing on the unstructured data to extract key entities, sentiment tendencies, behavioral intentions, and potential causal relationships between events as key information. Step S42: Using key information as the search key, retrieve relevant knowledge fragments from the bound knowledge base subset; Step S43: Combine relevant data, key information, and relevant knowledge fragments to form contextual information, and input it into the large language model; Step S44: Use a large language model to perform reasoning analysis and generate prison situation analysis results that include risk assessment and handling suggestions.

[0048] Based on the configuration of the analytical agent, unstructured data is retrieved from multi-source heterogeneous data. A pre-trained large language model is used as the basic semantic understanding engine to perform deep semantic parsing on the unstructured text data. This process automatically extracts key entities (such as names, locations, and events), emotional tendencies (such as anger, anxiety, and depression), behavioral intentions (such as conspiracy and complaint), and potential causal relationships between events, using this information as key data for subsequent analysis. For example, the system can identify inmate A's depressive mood, specific event background, and implicit potential intentions from keywords such as "hopeless" and "don't want to live" in inmate A's text messages.

[0049] The key information extracted in the above steps is used as the retrieval key to perform real-time retrieval from a specific subset of the knowledge base bound to the analytical agent, obtaining relevant knowledge fragments. This step is crucial in the prison situation analysis process. The system uses key information extracted from the data layer (such as event type, involved personnel, and behavioral descriptions) as the retrieval key to retrieve relevant legal provisions, similar historical cases, and handling procedures from the knowledge base in real time.

[0050] Relevant data from data sources, extracted key information, and retrieved knowledge fragments are combined to form a rich and complementary context, which is then integrated into the input context of the large language model. The large language model then performs deep reasoning analysis based on this context. Leveraging its powerful reasoning capabilities, the large language model conducts multi-dimensional risk assessments (such as the probability of conflict escalation, self-harm risk, and escape tendencies) and deep correlation analysis (such as potential premeditation behind interconnected and dispersed events), ultimately generating a structured analysis report that includes risk levels, causal analysis, evolution predictions, and response recommendations.

[0051] The retrieval in step S42 employs a retrieval enhancement-based RAG generation mechanism, including: Hybrid retrieval is performed based on key information from bound knowledge base subsets, integrating vector retrieval and full-text retrieval; The search results are reordered, and relevant knowledge fragments are filtered out.

[0052] The RAG process first performs a hybrid retrieval operation, using key information extracted from unstructured data as the retrieval key to search a specific subset of the knowledge base bound to the analytical agent. This hybrid retrieval process does not employ a single retrieval strategy but deeply integrates vector retrieval and full-text retrieval technologies. Vector retrieval relies on semantic similarity matching to deeply understand the user's query intent; while full-text retrieval is based on keyword matching, ensuring the ability to capture precise information such as specific terms and clause numbers. This hybrid mode dynamically generates optimal retrieval requests for different query needs, collectively forming an enhanced retrieval engine.

[0053] After completing the initial retrieval, the mechanism further reorders the search results. The system takes into account multiple factors, such as semantic relevance to the query, keyword matching, and source authority, of the set of candidate knowledge fragments returned by the hybrid retrieval, and performs a filtering and priority reordering step to select the knowledge fragments most relevant to the current analysis from a large number of candidates.

[0054] In one possible implementation, Case 1: Inmate Rehabilitation Assessment, Requirement: Assess the likelihood of inmate A receiving a sentence reduction; RAG process: Search: Zhang San's reward and punishment records + similar cases + the latest policies on sentence reduction and parole.

[0055] Generation: Integrate all retrieved data and analyze it in conjunction with policies on sentence reduction and parole.

[0056] Output: An analysis of the likelihood of Zhang San receiving a reduced sentence, along with a reference to relevant legal provisions.

[0057] In another possible implementation, Case 2: Routine Prison Situation Analysis, Requirement: Analyze fights that occurred in the prison ward this month; RAG process: Search: Search for files, daily logs, and relevant laws and regulations concerning the handling of inmates.

[0058] Generation: Based on the retrieved data, a comprehensive analysis is conducted on the causes of the fights and the methods used to handle them.

[0059] Output: A complete event analysis of the brawl and the corresponding solutions.

[0060] The search-enhanced RAG generation mechanism also includes a security enhancement mechanism, which automatically filters sensitive information and records the knowledge source and generation path in the output stage.

[0061] Security Enhancement Mechanism: In the output stage, a strengthened control mechanism has been implemented, which can automatically filter sensitive information, accurately record the source of knowledge and the generation path, and ensure the security and traceability of the output content.

[0062] The vector model used in the retrieval process of this application is Qwen3-Embedding-4B. This model is specifically designed for text vectorization, capable of converting various types of text in the prison domain into high-dimensional vectors. By calculating the distance between vectors, it measures the semantic similarity of the texts, providing a precise semantic matching foundation for hybrid retrieval.

[0063] In actual retrieval, a similarity threshold of 0.6 is set (which can be dynamically adjusted according to the needs of the prison scenario). When the semantic similarity of the text calculated by the vector model is ≥0.6, it is determined that the retrieval result is effectively related to the user's question and can proceed to the subsequent re-ranking and result output stage; if it is lower than this threshold, it is considered that the semantic matching degree is insufficient and is not included in the core result set for the time being, thereby filtering out low-relevance content and improving the accuracy of retrieval.

[0064] When retrieving multiple knowledge bases simultaneously, the following fusion rules apply: Hybrid retrieval: The Qwen3-Embedding-4B model is invoked to independently perform vector retrieval and full-text retrieval for each knowledge base. A re-ranking step is applied to select the best result that matches the user's question from the two types of query results.

[0065] Weighting: Centered on the semantics of the user's question, the matching degree between candidate documents and the question is recalculated and sorted by adjusting the assigned weights. The documents are then re-sorted using a hybrid logic of "semantic 0.7 + keyword 0.3" (which can be dynamically adjusted according to the needs of the prison scenario). Finally, the results that best meet the user's needs are selected, ensuring efficient integration of information from multiple knowledge bases and covering the diverse needs of prison analysis scenarios.

[0066] Text Segments: Set the TOP K value to 3 for the text segments that are most similar to the user's question. The system will dynamically adjust the number of segments based on the size of the selected model's context window.

[0067] Step S5: Based on the generated prison situation analysis results, the large-scale language model parses the prison scene-specific situation rules defined by natural language, automatically calls and combines a set of MCP tools specifically for prison situation recommendation, performs comprehensive matching analysis through multi-dimensional data sources, and judges whether the event situation triggering standard is met based on dynamic threshold adjustment; if it is met, the situation event is automatically generated and recorded.

[0068] Based on the prison situation analysis results generated by the large model, the system will automatically initiate a situation assessment process, using multiple preset judgment methods to determine whether the analysis results meet the triggering criteria for a situation event. This process relies on the deep understanding and reasoning capabilities of the large model to comprehensively analyze the prison situation analysis results, identify whether they contain risk characteristics with potential for spread, escalation, or typicality, and then make a comprehensive judgment through prison situation assessment logic.

[0069] The method also includes a prison situation recommendation method driven by natural language and based on a large language model and MCP tool.

[0070] Police officers can define situational rules specific to prison scenarios using natural language; at the same time, the system has built a set of MCP tools specifically for prison situational recommendation.

[0071] When using the prison situation analysis assistant, the large model parses the situation rules, automatically calls and combines the MCP tool, matches applicable conditions, determines whether the content of this analysis is a key event, and makes situation recommendations: Natural Language Situation Conditions: Police officers can flexibly configure various prison-specific situation recommendation conditions using natural language based on their professional experience (Example 1: If an inmate sends ≥2 abnormal text messages containing sensitive words this month, it is recommended as a "text message abnormality" key prison situation situation. Sensitive words include "fighting," "boring," "lack of appetite," etc.; Example 2: If an inmate in the prison area has accumulated ≥10 violations this month, it is recommended as a "prison area behavioral risk" key prison situation situation situation).

[0072] Dynamic Threshold (MCP) Tool: This tool dynamically adjusts thresholds based on key prison scenarios / events. Events exceeding the threshold are classified as high-priority events, triggering a status recommendation. (Example 1: Due to holiday / seasonal adjustments, before the Spring Festival, the number of abnormal inmate text messages in the "Analysis of Abnormal Inmate Text Messages" status was adjusted from ≥2 per month to ≥1 per month; Example 2: Due to environmental factors / major events, during periods of sustained high temperatures, the number of violations in the "Prison Area Behavior Risk" status was adjusted from ≥10 per month to ≥12 per month.) Multi-dimensional data analysis capabilities: The large model can comprehensively match and analyze the current analysis results with various data based on the multi-dimensional data sources provided by the MCP tool. After identifying key events, it will trigger trend recommendations. (For example, key events related to "inmate relationships" need to be analyzed by combining multi-dimensional data such as "inmate mutual supervision group information + inmate reward and punishment records + abnormal events in the prison area").

[0073] Step S6: In response to the user's instruction to interpret the situation event, call the large language model to generate an in-depth interpretation report for the situation event. The interpretation report includes an event overview, risk interpretation, cause analysis, and recommended measures.

[0074] When police officers view the list of situation events and select the situation events that need in-depth analysis, they can initiate an interpretation command by activating the comprehensive interpretation function. The system then calls up the large language model, using the core elements of the situation event (including event background, key risk points, related data and historical context) as input context, and starts a dedicated report generation process.

[0075] The structured in-depth analysis report generated by this process includes multiple professional analytical dimensions, including: an event overview, which systematically reviews the basic situation, personnel involved, and core context of the situational event; risk analysis, which provides a professional analysis of the nature, level, urgency, and possible evolution paths of the identified risks; cause assessment, which deeply explores the root causes and driving factors that led to the situational event based on multi-source data correlation analysis; and recommended measures, which propose specific and actionable handling plans and response strategies by combining prison management regulations and historical case databases.

[0076] This method also includes task decomposition and collaborative processing using the Model Context Protocol (MCP) framework, including: The analysis request is broken down into multiple sub-tasks, which include calling tools to obtain data, calling knowledge bases to obtain knowledge, calling models to perform comprehensive interpretation, and calling tools to generate reports or visualization results. The results of subtasks are integrated through a dynamic collaboration mechanism to generate a structured report.

[0077] In responding to user analytics requests, the framework first breaks down complex analytics requests into multiple atomic, executable subtasks. These subtasks constitute a complete analytics chain, including but not limited to: calling tools to acquire data (e.g., pulling real-time data such as inmate files and event records from various business systems), calling knowledge bases to acquire knowledge (e.g., retrieving relevant knowledge fragments from bound legal and regulatory databases and case databases), calling models for comprehensive interpretation (using large language models to perform deep reasoning and analysis on the collected data and knowledge), and calling tools to generate reports or visualizations (transforming analytical conclusions into structured documents or charts).

[0078] During subtask execution, the MCP framework integrates and iteratively processes the results of each subtask through its dynamic collaboration mechanism. This mechanism intelligently adjusts the execution logic and parameters of downstream subtasks based on the output of upstream subtasks, ensuring the consistency and adaptability of the entire analysis process. Ultimately, the system integrates the results of all subtasks through this framework, automatically generating a complete and logically clear structured report.

[0079] In one possible implementation, Case 1: Inmate Conflict Analysis, Requirement: Analyze the conflict event that occurred in inmate A, MCP execution chain: MCP is broken down into sub-tasks: using tools to acquire data / using tools to perform relationship analysis / using models for comprehensive interpretation / using tools to visualize results.

[0080] Tools used: to obtain basic information about inmates, recent unusual events, and family phone / text message data.

[0081] Use the tool to obtain information on inmate relationships and information on inmates in the same cell / mutual supervision group.

[0082] Model invocation: Compare and analyze data from multiple dimensions, and generate analysis reports.

[0083] Use tools to visualize the data in the report.

[0084] In another possible implementation, Case 2: Rehabilitation Program Optimization, Requirement: Develop a personalized rehabilitation program for inmate A, MCP execution chain: MCP breaks down tasks into sub-tasks: calling tools to obtain data / calling knowledge bases to obtain knowledge / calling models for comprehensive interpretation / calling tools to generate reports.

[0085] Tools used: Obtain basic information about inmates + assessment system data.

[0086] Access the knowledge base: obtain rehabilitation cases of similar inmates and experience knowledge of police officers.

[0087] Model invocation: Compare and analyze data from multiple dimensions to generate analysis results.

[0088] Use the tool to generate a document report from the analysis results.

[0089] The method also includes: in response to user actions on important situational events, creating situational events as meeting topics, synchronizing them to the meeting management system via API, generating meeting topics and binding them to the original situational events.

[0090] For critical situational events deemed by the system or confirmed manually to require collective discussion, police officers can directly initiate a meeting creation process in the prison situational event module, or choose to add the situational event content to the existing meeting agenda. The system calls the meeting agenda creation interface of the meeting management module through an API connection mechanism, automatically synchronizing the constructed meeting information (including the core elements of the situational event, risk analysis, and preliminary conclusions) to the prison situation analysis intelligent auxiliary system, thereby generating standard meeting agendas. For situational events with successfully created agendas, the interface will bind and archive subsequent discussion meetings with the original situational event, and add a discussed status tag to the metadata of the original situational event.

[0091] The large language model adopts the Qwen3-32B model based on the Transformer encoder-decoder architecture, which supports a maximum context window length of 8192 tokens. The parameters are fine-tuned using the low-rank adaptation LoRA technique. During the fine-tuning process, the rank of the LoRA adapter is set to 8, and the target module covers all linear transformation layers.

[0092] The large language model relied upon in this application is named Qwen3:32B. This model is based on the Transformer encoder-decoder architecture, has a scale of 32 billion parameters, natively supports long text processing (maximum context window length is 8192 tokens), and performs well in general natural language understanding, text generation and logical reasoning tasks, providing core AI capability support for prison case analysis.

[0093] When using large models, task guidance typically relies on prompts. However, due to the inherent context length constraints of large models, complex tasks often require longer prompts. This not only significantly increases inference costs (time and computational power) but may even exceed the model's processing limits, leading to a decline in output quality. Furthermore, when repeated prompt tuning still fails to meet requirements, model fine-tuning becomes a necessary solution. This application adopts a progressive strategy based on actual conditions to achieve optimal results: First, prompt engineering is used to address 80% of common requirements; second, RAG technology is used to handle knowledge updates; third, the MCP architecture is used to handle complex tasks; and fourth, the model is fine-tuned to overcome bottlenecks in core scenarios.

[0094] Low-rank adaptation (LoRA) technique is used to fine-tune the parameters of the Qwen3-32B large language model. Compared with the traditional full-parameter training method, this method can significantly reduce computational resources and memory overhead, improve training efficiency, and at the same time ensure the customized performance of the model in the context of prison business.

[0095] Fine-tuning the construction method: First, for prison business scenarios, regulations, internal management standards, business process documents, and historical Q&A data are collected as training corpora, and then structured and anonymized to ensure data security and compliance. Next, based on this domain-specific corpus, a lightweight adaptation layer is superimposed on the original model parameters using LoRA technology, enabling the model to quickly absorb and solidify professional knowledge specific to the prison scenario. Finally, through continuous verification and iteration, the stability of the model's output results in terms of correctness, compliance, and traceability is ensured.

[0096] LoRA fine-tuning method: A bypass is added next to the original PLM (Pre-trained Language Model) to perform a dimensionality reduction and then increase operation to simulate the so-called intrinsic rank. During training, the PLM parameters are fixed, and only the dimensionality reduction matrix A and the dimensionality increase matrix B are trained. The input and output dimensions of the model remain unchanged; the output is the superposition of BA and PLM parameters. A is initialized with a random Gaussian distribution, and B is initialized with a zero matrix, ensuring that the bypass matrix is ​​still a zero matrix at the beginning of training.

[0097] Figure 4The diagram illustrates a pre-trained language model. For example, to fine-tune a pre-trained language model for a downstream task, the pre-trained model parameters need to be updated using the following formula: ,in These are the initialization parameters for the pre-trained model. These are the parameters that need to be updated. Assume the pre-trained matrix is... Its update can be represented as: , where rank In the process of moving forward, and All inputs are multiplied by the same input x, and then summed. .

[0098] During the fine-tuning process, key technical parameters were optimized: Setting the rank of the LoRA adapter to 8 provides ample room for model tuning while maintaining low parameter overhead. The target module covers all linear transformation layers, including the Q, K, V, and O projection layers of the attention mechanism and the gate, up, and down layers of the feedforward network, ensuring that all components of the model fully participate in the fine-tuning process.

[0099] Regarding training hyperparameters, the learning rate was set to 2e-4, which balances convergence stability and training efficiency, avoiding overfitting or underconvergence.

[0100] The training iterations are planned for 8000 steps. The overall configuration achieves a good balance between computational resource consumption, training efficiency, and model performance, making it suitable for customized training of large models with limited GPU resources. It is expected to reduce GPU memory usage by more than 80% compared to full parameter fine-tuning.

[0101] Compared with the prior art, the embodiments of this application have the following beneficial effects: First, by deeply integrating unstructured text data through large models, hidden clues that are difficult for traditional systems to capture can be mined, significantly improving the coverage of prison risk identification.

[0102] Secondly, by introducing the RAG mechanism, prison expertise is integrated into the analysis process, ensuring that the conclusions comply with regulatory standards, effectively avoiding AI illusions, and improving the accuracy of the analysis.

[0103] Third, by using programmable analytical swarms, individual police officers’ experience can be transformed into configurable and reusable system capabilities, thereby achieving standardization of the analysis process and the transfer of experience.

[0104] Fourth, it automatically generates in-depth analysis reports and handling recommendations, reducing analysis time from hours to minutes, and cites legal cases to enhance the scientific rigor and persuasiveness of the recommendations.

[0105] Fifth, each prison ward can customize its own analysis assistant based on management priorities, avoiding a one-size-fits-all approach and significantly improving personalized management capabilities and the relevance of solutions.

[0106] Sixth, the intelligent agent supports periodic automatic execution, reducing repetitive operations in periodic prison situation analysis (such as summer high temperature analysis and inmate ideological analysis during holidays).

[0107] The following describes a prison situation analysis system based on a large model, and its possible implementation. This system executes the various steps and achieves the corresponding technical effects of the prison situation analysis method shown in the above embodiments and possible implementations. The system includes: The conversion module is used to collect and merge multi-source heterogeneous data from the monitoring area through the data access interface, and then convert the multi-source heterogeneous data into a unified format event object structure for storage. The multi-source heterogeneous data includes structured data and unstructured data. The building module is used to build and manage the prison professional knowledge base, bind the knowledge base to the large language model, and convert the text content in the knowledge base into vector form and store it in the vector database. The knowledge base includes a legal and regulatory base, a reference case base, and a management standard base. Create an orchestration module for creating and orchestrating prison intelligence agents based on received user configuration instructions. The configuration instructions include specifying the prompt word templates for the analysis intelligence agents, the data source tools that can be invoked, and the bound subset of the knowledge base. The response module is used to respond to analysis requests initiated by users to the analysis agent and obtain prison situation analysis results; The judgment module is used to analyze the generated prison situation results, parse the prison scene-specific situation rules defined by natural language through a large language model, automatically call and combine a set of MCP tools specifically for prison situation recommendation, perform comprehensive matching analysis through multi-dimensional data sources, and judge whether the event situation triggering standard has been met based on dynamic threshold adjustment; if it has been met, the situation event is automatically generated and recorded. The generation module is used to respond to user instructions on interpreting situational events by calling a large language model to generate an in-depth interpretation report for the situational event. The interpretation report includes an event overview, risk interpretation, cause analysis, and recommended measures.

[0108] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A prison situation analysis method based on a large model, characterized in that, The method is applied to a large language model architecture, and the method includes: Step S1: Collect and merge multi-source heterogeneous data from the monitoring area through the data access interface, and then convert the multi-source heterogeneous data into a unified format event object structure and store it. The multi-source heterogeneous data includes structured data and unstructured data. Step S2: Construct and manage the prison professional knowledge base, bind the knowledge base to the large language model, and convert the text content in the knowledge base into vector form and store it in the vector database. The knowledge base includes a legal and regulatory base, a reference case base, and a management standard base. Step S3: Create and orchestrate the prison situation intelligent agent based on the received user configuration instructions. The configuration instructions include specifying the prompt word template of the analysis intelligent agent, the data source tools that can be called, and the bound knowledge base subset. Step S4: Respond to the analysis request initiated by the user to the analysis agent and obtain the prison situation analysis results; Step S5: Based on the generated prison situation analysis results, the large language model parses the prison scene-specific situation rules defined by natural language, automatically calls and combines a set of MCP tools specifically for prison situation recommendation, performs comprehensive matching analysis through multi-dimensional data sources, and judges whether the event situation triggering standard is met based on dynamic threshold adjustment; if it is met, the situation event is automatically generated and recorded. Step S6: In response to the user's instruction to interpret the situation event, call the large language model to generate an in-depth interpretation report for the situation event. The interpretation report includes an event overview, risk interpretation, cause analysis, and recommended measures.

2. The prison situation analysis method as described in claim 1, characterized in that, Step S4 includes: Step S41: Based on the configuration of the analysis agent, call unstructured data from multi-source heterogeneous data, use a pre-trained large language model as a semantic understanding engine, and perform deep semantic parsing on the unstructured data to extract key entities, sentiment tendencies, behavioral intentions, and potential causal relationships between events as key information. Step S42: Using key information as the search key, retrieve relevant knowledge fragments from the bound knowledge base subset; Step S43: Combine relevant data, key information, and relevant knowledge fragments to form contextual information, and input it into the large language model; Step S44: Use a large language model to perform reasoning analysis and generate prison situation analysis results that include risk assessment and handling suggestions.

3. The prison situation analysis method as described in claim 1, characterized in that, The prison expertise database includes a recommended measures database, a holiday interpretation database, and a comprehensive assessment definition database. The construction and management of the prison knowledge base includes: uploading files through a web interface to build the knowledge base, and classifying, tagging, and vectorizing the files.

4. The prison situation analysis method according to claim 2, characterized in that, The retrieval in step S42 employs a retrieval enhancement-based RAG generation mechanism, including: Hybrid retrieval is performed based on key information from bound knowledge base subsets, integrating vector retrieval and full-text retrieval; The search results are reordered, and relevant knowledge fragments are filtered out.

5. The prison situation analysis method according to claim 4, characterized in that, The search-enhanced RAG generation mechanism also includes a security enhancement mechanism, which automatically filters sensitive information and records the knowledge source and generation path in the output stage.

6. The prison situation analysis method according to claim 1, characterized in that, The method also includes task decomposition and collaborative processing using the Model Context Protocol (MCP) framework, including: The analysis request is broken down into multiple sub-tasks, which include calling tools to obtain data, calling knowledge bases to obtain knowledge, calling models to perform comprehensive interpretation, and calling tools to generate reports or visualization results. The results of subtasks are integrated through a dynamic collaboration mechanism to generate a structured report.

7. The prison situation analysis method according to claim 1, characterized in that, The method further includes: in response to user operations on important situational events, creating situational events as meeting topics, synchronizing them to the meeting management system via API interface, generating meeting topics and binding the original situational events.

8. The prison situation analysis method according to claim 1 or 2, characterized in that, The large language model adopts the Qwen3-32B model based on the Transformer encoder-decoder architecture, which supports a maximum context window length of 8192 tokens. The parameters are fine-tuned using the low-rank adaptation LoRA technique. During the fine-tuning process, the rank of the LoRA adapter is set to 8, and the target module covers all linear transformation layers.

9. The prison situation analysis method according to claim 1, characterized in that, The architecture of a large language model includes: The large model system service layer provides basic services for large models, API interfaces, MCP framework, RAG framework, workflow services, and AI dialogue services. The large model inference engine includes the ollama framework for embedding model execution and vectorization functions, and the vLLM framework for offline inference; The data infrastructure layer includes Cache for caching model results, VectorDB for vector storage and retrieval, OSS for unstructured data storage, and RMDB for business data persistence.

10. A prison situation analysis system based on a large model, characterized in that, The system includes: The conversion module is used to collect and merge multi-source heterogeneous data from the monitoring area through the data access interface, and then convert the multi-source heterogeneous data into a unified format event object structure for storage. The multi-source heterogeneous data includes structured data and unstructured data. The building module is used to build and manage the prison professional knowledge base, bind the knowledge base to the large language model, and convert the text content in the knowledge base into vector form and store it in the vector database. The knowledge base includes a legal and regulatory base, a reference case base, and a management standard base. Create an orchestration module for creating and orchestrating prison intelligence agents based on received user configuration instructions. The configuration instructions include specifying the prompt word templates for the analysis intelligence agents, the data source tools that can be invoked, and the bound subset of the knowledge base. The response module is used to respond to analysis requests initiated by users to the analysis agent and obtain prison situation analysis results; The judgment module is used to analyze the generated prison situation results, parse the prison scene-specific situation rules defined by natural language through a large language model, automatically call and combine a set of MCP tools specifically for prison situation recommendation, perform comprehensive matching analysis through multi-dimensional data sources, and judge whether the event situation triggering standard has been met based on dynamic threshold adjustment; if it has been met, the situation event is automatically generated and recorded. The generation module is used to respond to user instructions on interpreting situational events by calling a large language model to generate an in-depth interpretation report for the situational event. The interpretation report includes an event overview, risk interpretation, cause analysis, and recommended measures.