A case data statistical analysis method for the judicial field
By employing a wide-table model, columnar storage, and vectorized computation in the judicial field, combined with the ClickHouse engine and dynamic template technology, the issues of flexibility and efficiency in judicial case data analysis have been resolved, achieving data analysis capabilities with sub-second response times.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING INST OF COMP TECH & APPL
- Filing Date
- 2025-07-10
- Publication Date
- 2026-07-21
AI Technical Summary
Existing case data analysis methods in the judicial field lack flexibility, are unable to quickly respond to new query and analysis needs, and have low query and analysis efficiency.
The data warehouse adopts a wide table model to organize judicial case data, combines columnar data storage and vectorized computing technology, uses the ClickHouse computing engine for data storage and analysis, generates analysis scripts through dynamic templates, and uses microservice technology for model management.
It has achieved flexibility and efficiency in the process of judicial case data analysis, and can respond to analysis needs in seconds, thus improving the flexibility and efficiency of data analysis.
Smart Images

Figure CN120832375B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer big data technology, specifically relating to a method for statistical analysis of case data in the judicial field. Background Technology
[0002] In the field of judicial data analysis, combining specific case analysis indicators to conduct a panoramic and comprehensive analysis of various cases is a core and commonly used function in judicial case handling. It serves as the foundation for data analysis functions such as case quality analysis, case process supervision, case risk monitoring, and case data analysis reports.
[0003] Currently, the data analysis process for judicial cases is mainly based on fixed reports. During calculation, based on a large number of analysis items and indicators associated with fixed reports, the analysis of judicial cases is completed at fixed times every day and month through offline calculation and scheduled operation. This model is mainly used for the annual and monthly case handling statistics and reporting scenarios of judicial organs.
[0004] As society and current events evolve, new hot issues constantly emerge, becoming focal points in the judicial field. Statistical analysis of cases related to these hot issues, and timely adjustments to handling methods and strategies based on the results, have also become increasingly important in the judicial system. However, the rigid report-based analysis model cannot quickly adapt to new judicial case data analysis indicators. On the one hand, new judicial case data analysis needs require new reports, necessitating unified planning, design, development, testing, and deployment of the calculation processes, target data, and analysis results. The current model lacks sufficient flexibility for new judicial case data analysis tasks. On the other hand, with the gradual improvement of national judicial case informatization, judicial case data is becoming increasingly massive. Adopting mainstream big data ad hoc computing and analysis technologies to meet the future data analysis needs of this large volume of judicial case data and improve judicial case efficiency has become a current focus of data analysis in the judicial field.
[0005] In conclusion, while current data analysis methods in the judicial field can assist relevant business analysts in data analysis and statistical work, they lack flexibility, are inconvenient for responding to new query and analysis needs, and are inefficient in terms of query and analysis efficiency. Therefore, a more flexible and efficient method for analyzing and displaying judicial case-handling data is needed. Summary of the Invention
[0006] (a) Technical problems to be solved
[0007] The technical problem this invention aims to solve is how to provide a statistical analysis method for case data in the judicial field, in order to address the current problems of data analysis methods in the judicial field lacking flexibility, being inconvenient to respond to new query and analysis needs, and having low query and analysis efficiency.
[0008] (II) Technical Solution
[0009] To address the aforementioned technical issues, this invention proposes a method for statistical analysis of case data in the judicial field. This method includes: judicial case handling data modeling, selection of a judicial case handling data storage and computing engine, and management method for judicial case handling data analysis models.
[0010] Judicial case handling data modeling: The judicial case handling data is organized using a wide table model from the data warehouse field, ultimately forming a wide table model for case data and a wide table model for personnel data;
[0011] Judicial case data storage and computing engine selection: In terms of data storage, based on the above data model, namely the organization of judicial case data in a wide table format, a columnar data storage architecture is adopted to store the judicial case data; vectorized computing technology is adopted to realize the analysis and computing capabilities of judicial case data; based on the above data storage architecture and data computing architecture, the open-source data computing and storage framework ClickHouse computing engine is adopted.
[0012] Judicial case handling data analysis model management method: adopts dynamic template method to define statistical analysis model. When performing statistical analysis, the analysis model template is combined with analysis parameters to dynamically and in real time generate corresponding analysis scripts, and submit the analysis scripts to the calculation engine, which completes the calculation and analysis; the calculation results are standardized and then sent back to the caller.
[0013] (III) Beneficial Effects
[0014] This invention proposes a statistical analysis method for case data in the judicial field. The beneficial effects of this invention are as follows:
[0015] 1. Flexibility in the Judicial Case Data Analysis Process: The design of the judicial case data analysis model management module in this invention, along with the introduction of Beetl dynamic template engine technology, enables the external configuration of the judicial case data analysis process. Judicial case data analysis tasks can be flexibly configured by changing analysis parameters. It connects to the underlying vectorized computing engine to complete the entire process of analysis task configuration, submission, and standardized result processing. Furthermore, the above process is uniformly encapsulated through microservice technology, ultimately providing judicial case data analysis capabilities to external BI dashboards and other application services via HTTP interfaces. This overall design significantly enhances the flexibility of judicial case data analysis.
[0016] 2. Efficiency and Interactivity Based on Vectorized Computation: To improve the efficiency of judicial case-handling data analysis and achieve interactive judicial case-handling data analysis, this invention combines the characteristics of judicial case-handling data and the characteristics of analysis needs to construct a data model that can meet the requirements of efficient querying and analysis. This model, coupled with a corresponding data storage architecture and computing engine, ultimately achieves a second-level response time in the judicial case-handling data analysis process. Furthermore, the design of the judicial case-handling data analysis model management module in this invention utilizes message queues and concurrent programming, combined with the distributed computing characteristics of the computing engine, to efficiently achieve batch execution of judicial case-handling data analysis tasks. Attached Figure Description
[0017] Figure 1 This is a diagram illustrating the technical architecture and technology selection of the present invention;
[0018] Figure 2 Flowchart of the data analysis model management method for judicial case handling;
[0019] Figure 3 Architecture diagram of the data analysis model management module for judicial case handling;
[0020] Figure 4 A diagram illustrating the overall analysis process;
[0021] Figure 5 A diagram illustrating the rendering process of the analysis model;
[0022] Figure 6 Submit design ideas for the analysis task;
[0023] Figure 7 This is a flowchart illustrating a typical implementation and use of the present invention. Detailed Implementation
[0024] To make the objectives, contents, and advantages of the present invention clearer, the specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples.
[0025] To address the aforementioned issues, this invention proposes a case data statistics method for the judicial field. This method first analyzes case-handling data in the judicial field. Based on the unique characteristics of judicial case-handling data, it proposes a data modeling method, data storage technology, and data computation framework. Combining data governance technology, dynamic template engine technology, and microservice technology, the overall process of judicial case-handling data analysis is designed and implemented. Finally, function calls and overall functional serialization are achieved via an HTTP interface.
[0026] The technical architecture and related technology selections adopted in this invention are as follows: Figure 1 As shown.
[0027] Figure 1The parts highlighted in red are the key aspects of this invention, mainly including: judicial case-handling data modeling, selection of a judicial case-handling data storage and computing engine, and specific implementation methods for formulating the analysis model in the judicial case-handling data analysis model management method. These three parts complement and cooperate in a clever manner, solving the problems of insufficient analytical flexibility and low efficiency in the original case data statistical analysis methods in the judicial field. This invention will provide a detailed explanation of these three key aspects.
[0028] 1. Judicial case handling data modeling
[0029] Through a survey of judicial case handling operations and the corresponding data storage, distribution, and metadata in the judicial case handling OA system, the data in judicial case handling operations has the following characteristics:
[0030] (1) Case data correlation
[0031] In judicial practice, a case is defined as a fact known or discovered by judicial authorities, referred to as "case data." When handling a case, investigators typically go through multiple stages (such as reviewing arrest and reviewing prosecution). The data generated at each stage is called "item data." Case data and item data have a one-to-many relationship.
[0032] In the judicial case data storage architecture, case data is stored using a relational database. Each case data item has a "case" identifier and a "document" identifier. Multiple documents belonging to the same "case" have the same "case" identifier attribute. It can be understood that the "document" identifier is the primary key, distinguishing the case handling stages; the "case" data is the foreign key, establishing a relationship with the case data.
[0033] (2) The data volume is small, but the data types are complex.
[0034] Although the volume of judicial case data is growing rapidly, it is still relatively small compared to e-commerce transaction data and bank statement data currently on the market in the field of big data. In addition, the judicial case handling process is complex. Due to the special nature of the case, a case may involve multiple case handling procedures and stages. For example, when a criminal case involves a minor, the case may initiate the relevant case handling stage of the juvenile prosecution.
[0035] In the process of handling judicial cases, different stages of the same case are initiated and processed by different business departments. That is, the case handling process is carried out around the case handling procedure. In the case handling system, the case data is also stored around the business steps. The data of the same case is stored in multiple tables according to different case handling procedures and stages.
[0036] Based on the characteristics of the aforementioned judicial case-handling data, this invention employs a wide table model (also known as a singleton model) from the data warehouse field to organize the judicial case-handling data, ultimately forming a wide table model for case data, a wide table model for personnel data, etc. In the data warehouse field, compared to star schemas and snowflake schemas, the wide table model can reduce the number of data scans during data analysis, improve the usability of detailed data tables, and thus enhance query performance.
[0037] In the field of judicial case data analysis, on the one hand, the wide table data organization format helps improve data analysis efficiency, avoiding time-consuming cascading analysis during the calculation and analysis process. Judicial business is relatively complex, involving relatively fragmented data, and using the wide table format for data organization can significantly reduce complexity. On the other hand, this invention uses vectorized calculation technology to analyze judicial case data. Vectorized calculation is more efficient when performing calculations on a single table, but less efficient when performing cascading calculations on multiple tables. The wide table organization format can provide positive support for the vectorized analysis process.
[0038] 2. Selection of Data Storage and Computing Engine for Judicial Case Handling
[0039] Regarding data storage, based on the aforementioned data model, namely the organization of judicial case data in a wide table format, this invention adopts a columnar data storage architecture to store judicial case data.
[0040] In broad tables of judicial case data, a large amount of "blank" data is inevitable. For example, if a case record only involves data related to the criminal prosecution—review and arrest stage—and not data related to juvenile prosecution, then the juvenile prosecution-related attributes of that data entry will result in a large amount of "blank space," wasting significant storage space. Columnar data storage can solve this problem. It significantly reduces storage costs through efficient data compression and greatly reduces storage space by leveraging data redundancy and similarity. Furthermore, columnar storage supports vectorized queries, which can significantly improve analysis efficiency for large-scale datasets.
[0041] In terms of computational analysis, this invention employs vectorized computation technology to enable the analysis and computation of judicial case data. Vectorized computation transforms the traditional method of performing operations on a single value at a time into performing operations on a group of values at a time, significantly improving computational efficiency.
[0042] Based on the aforementioned data storage and computation architecture, this invention employs the open-source data computation and storage framework, ClickHouse, to provide storage and computation capabilities for judicial case data. First, the ClickHouse computation engine supports columnar storage of data, meeting the columnar storage requirements of this invention. Second, the ClickHouse computation engine itself supports a vectorized computation execution engine; submitting ordinary SQL to it will allow its query optimizer to decide whether to enable the vectorized execution process. Currently, ClickHouse can respond to queries and process billions of data entries within seconds, a capability that fully covers the current volume of judicial case data. Through the ClickHouse architecture, interactive analysis and query capabilities for judicial case data can be achieved.
[0043] 3. Management Methods for Judicial Case Handling Data Analysis Model
[0044] The judicial case handling data analysis model management method is the core content of this invention for realizing the statistical method of case data in the judicial field. It is mainly achieved through processes such as defining the analysis model, dynamically generating the analysis model execution script, executing the analysis model script, and processing the execution results. Furthermore, to meet the characteristics of combined application of analysis models, it designs analysis model combination methods and combination execution methods. Combining the judicial case handling data model and the judicial case handling data storage and computing engine, it ultimately realizes a highly flexible, configurable, and efficient judicial data statistical analysis method.
[0045] To achieve flexibility and configurability in the statistical analysis of judicial case-handling data, the judicial case-handling data analysis model management method adopts a dynamic template approach. This involves defining the statistical analysis model, and during statistical analysis, the analysis model template, combined with analysis parameters, dynamically and in real-time generates corresponding analysis scripts. These scripts are then submitted to the computing engine for calculation and analysis. To ensure the standardization of the analysis results and facilitate parsing by the user, the model management method performs standardization operations on the calculation results before returning them to the user. The core process of the judicial case-handling data analysis model management method is as follows: Figure 2 As shown.
[0046] This invention realizes a microservice-based approach to manage judicial case-handling data analysis models, namely, by developing and implementing a judicial case-handling data analysis model management system. Through this system, users can define or organize the judicial case-handling data analysis process at any time. Furthermore, the judicial case-handling data analysis model management system provides the ability to execute analysis tasks and process results, and provides services to external application services, BI dashboards, etc., via HTTP interfaces.
[0047] The judicial case handling data analysis model management system comprises an analysis model management module, an analysis model combination module, an analysis task submission module, and an analysis result processing module. The analysis model management module defines analysis models and dynamically generates analysis model scripts. The analysis model combination module combines analysis models according to business dimensions. The analysis task submission module submits analysis model scripts or combinations of analysis models to the computing engine. The analysis result processing module standardizes the analysis results. Its structure is as follows: Figure 3 As shown.
[0048] This invention first provides a serialized description of the overall functions of the judicial case handling data analysis model management system. By describing the judicial case handling data analysis process, it introduces the roles and functions of each functional module in the judicial case handling data analysis model management system. Subsequently, it provides a detailed description of the functional design of each sub-functional module.
[0049] (1) Overall analysis process
[0050] This section describes the overall process of judicial case-handling data analysis, as well as the positioning and capability support of each of the aforementioned functional modules. The prosecutorial data analysis process is as follows: Figure 4 As shown.
[0051] When a judicial case data analysis task is initiated, the caller submits task parameters, including the analysis model identifier or analysis model combination identifier and analysis execution parameter information. The analysis model management module, using the Beetl template engine's rendering function, generates specific analysis statements based on the analysis execution parameters and analysis models, and submits them to the analysis task submission module. Finally, the results are submitted to the ClickHouse calculation engine, where the returned calculation results are standardized and processed by the analysis result processing module before being returned to the caller. When the analysis model management module receives a task to execute an analysis model combination, the analysis model combination module, in conjunction with the analysis execution parameters, calls the analysis model management module to render and submit each analysis model in the combination. Once all analysis models have been executed, the results are merged and returned to the caller.
[0052] When making a call, the caller must follow the HTTP specification and use the POST method.
[0053] (2) Analysis model management function
[0054] The analysis model management module primarily handles the definition, maintenance, and deployment of analysis models. The design and implementation of the analysis model are the core of this invention and the foundation for its other functionalities. In this invention, the analysis model is specifically a script statement conforming to template engine rendering specifications. It follows a JavaScript-like language specification and can contain fixed statements, JavaScript-like code segments, dynamic parameters, and other information, as shown below.
[0055]
[0056] This invention uses the Beetl template engine as the analysis model rendering tool. Therefore, the analysis model scripts defined in this invention must conform to the Beetl template engine specifications. Furthermore, since this invention uses ClickHouse as its underlying data storage and computation engine, the generated analysis SQL statements must conform to the ClickHouse specifications. As shown above, the analysis model is written in a JavaScript-like scripting language. Its dynamic parameters are identified using the ${...} symbol, and the dynamic code is identified using <%...%>. The script involves two parameters: cbdwBm and sfsc. These parameters are passed in by the caller. During the analysis statement rendering process, these two parameters can be passed to the Beetl template engine in JSON format. According to the scripting rules, cbdwBm is a required parameter, and sfsc is an optional parameter. The rendering process and results are as follows: Figure 5 As shown.
[0057] like Figure 5 As shown, during rendering, ${cbdwBm} is replaced with the cbdwBm attribute value from the JSON parameters. Furthermore, if the sfsc parameter exists, the statement AND sfsc = 'y' is appended. This means that by dynamically setting parameters, various executable analysis statements can be generated. This invention simplifies the analysis model definition process; for the same type of prosecutorial data analysis, only one analysis model needs to be defined, and different execution parameters can be used to generate analysis and calculation statements that meet specific requirements.
[0058] Based on the design and implementation of the analysis model, the analysis model management module provides functions for maintaining and publishing the analysis model. For a predefined analysis model, its default execution parameters can be configured, or it can be edited, modified, or deleted through the analysis model management module. For a fully defined analysis model, it can be published or taken offline.
[0059] After the analysis model is published, it can be rendered by the Beetl template engine via an HTTP interface, using analysis parameters and analysis model identifiers as parameters. This process generates, executes, and transcribes the specific analysis statements. This process is described in detail in the analysis task submission function.
[0060] The analysis model management function is the foundation and necessary condition for ensuring the flexibility of judicial case data analysis in this invention. Through this function, when faced with new or changed judicial case data analysis needs, users only need to define or edit the corresponding analysis model, or adjust the execution parameters of the analysis model, to complete the definition of the judicial case data analysis process.
[0061] (3) Analysis model combination function
[0062] For analytical topics with specific needs in judicial practice, such as topics related to minors, public interest litigation, and epidemic-related issues, this invention provides an analytical model combination function. This function allows you to define analytical model combinations, assemble a set of business-related analytical models into a collection, and perform batch execution and analysis processes to meet the specialized analytical needs of a particular topic area.
[0063] Taking the thematic analysis of juvenile criminal prosecution as an example, an analysis combination for juvenile criminal prosecution can be defined, and relevant analysis models (such as the number of family visits, the number of rehabilitation programs, and the number of reconciliations) can be included in this combination and published. When invoked, other application services (such as case data analysis report application services) or BI dashboards can directly submit the unique identifier of this combination and all analysis parameters. The analysis model combination module can then batch generate, submit, and parse the results of this set of analysis models.
[0064] (4) Analyze the task submission function
[0065] The analysis task submission module enables the submission of analysis and calculation statements to the vectorized computing engine for execution. In this invention, to improve the efficiency of judicial case data analysis, the stability of the execution process, and to fully utilize the distributed execution characteristics of the underlying vectorized computing engine, this invention employs message queues, concurrent programming, and other related technologies to achieve parallel submission of analysis tasks. Its design and implementation approach is as follows: Figure 6 As shown.
[0066] The analysis model management module submits tasks to be computed to a message queue. The message queue then forwards these tasks to the analysis task resource pool within the analysis task submission module. The thread pool and ClickHouse connection pool within the resource pool allocate resources to execute the computation tasks. Each analysis task is allocated one thread resource and one ClickHouse connection resource. When the analysis task execution pool is full, the analysis tasks in the message queue wait for resources in order.
[0067] The analysis task submission module is configured with a thread pool of size N and a ClickHouse connection pool. In this invention, the ClickHouse connection pool is managed using a Druid architecture. The size of N is determined by the number of ClickHouse cluster nodes and computing resources. When the number of ClickHouse nodes and resources are large enough, the value of N can be appropriately increased to improve computational concurrency efficiency. The ClickHouse connection pool is mainly used to store ClickHouse connection resources. The analysis task submission module submits analysis computation tasks to ClickHouse through these connection resources, where its vectorized computation engine performs the computation and analysis. After a task is submitted to ClickHouse, the thread resources occupied by the corresponding analysis task are in a waiting state. When the ClickHouse computation engine returns the computation results, the corresponding thread calls the subsequent analysis result processing module and releases its thread occupation state.
[0068] The above design approach can significantly improve efficiency during batch analysis tasks. Combined with the advantages of the underlying vectorized computing with its second-level response, it can significantly improve the performance of judicial case data in batch task analysis.
[0069] (5) Analysis result processing function
[0070] The calculation results returned by the ClickHouse calculation engine are converted and formatted into a unified format by the analysis result processing module. This invention uses JSON format to uniformly encapsulate the analysis results.
[0071] Using JSON format makes it easier for data analysis users (such as BI dashboards and other application services) to parse the calculation results and extract key values.
[0072] Example 1:
[0073] A case data statistics method for the judicial field, its typical implementation and usage process is as follows: Figure 7 As shown in the figure. This section uses the analysis of case-handling data from the procuratorate as an example to elaborate on the description.
[0074] Step 1: Data Modeling
[0075] A thorough investigation and understanding of the data structure and metadata of each business line in the judicial case handling system was conducted to understand the characteristics of judicial case handling data. With case data and personnel data as the core, a wide table model of judicial case handling data was constructed, and data standards and specifications were formulated to define standardized data operations to support the subsequent judicial case handling data governance process.
[0076] This section, based on the criminal prosecution case handling process of the procuratorate, takes the construction of a case broad table model as an example and provides a detailed explanation as follows.
[0077] In the prosecutorial data, the "Unified Case Acceptance Number" is used as the identifier for "Case," and the "Department Case Acceptance Number" is used as the identifier for "Item." Item data with the same "Unified Case Acceptance Number" are all merged into one row. Item data attributes from different stages are prefixed with their source table names in the wide table to identify their attributes and origins. For example, the "Review and Prosecution - Case Name" attribute is named T_TYYW_XJ_YSGS_AJ__AJMC in the wide table, where T_TYYW_XJ_YSGS_AJ is the name of the case card table under the review and prosecution stage. An example of the case wide table model is shown in the table below.
[0078] Table 1. Example of a wide table data model for cases.
[0079]
[0080]
[0081] Step 2: Governance of Judicial Case Handling Data
[0082] Based on the data model developed in the previous step, mainstream data governance technologies and theoretical methods are employed to process judicial case data, ultimately generating case and personnel tables that conform to the broad table model for judicial case data. The data governance process can be broken down into two steps: data collection and data processing. This process must cover all current judicial business data as well as daily incremental data.
[0083] Step 3: Development of a Judicial Case Handling Data Analysis Model Management System
[0084] The development of the judicial case handling data analysis model management module requires the functional development of four sub-modules: analysis model management module, analysis model combination module, analysis task submission module, and analysis result processing module. This invention employs a microservice architecture, designing and implementing each sub-module in a modular manner, and using a relational database to store and maintain the data related to the analysis model.
[0085] After development, this module needs to have relevant visualization operation capabilities. In this invention, a BS architecture is adopted for it, and the configuration and maintenance capabilities of the analysis model are realized based on the browser. At the same time, analysis tasks can be submitted and analysis results can be viewed directly on the browser page, so as to facilitate the testing and debugging of the analysis model.
[0086] In addition, as a stateful microservice, this module can provide prosecutorial data analysis capabilities to external application services via HTTP.
[0087] Step 4: Define the analysis model / Define the combination of analysis models
[0088] After the development of the judicial case handling data analysis model management module is completed, the judicial case handling data analysis business personnel will define the judicial case handling data analysis model, which includes the analysis model's script, default parameters, usage scenarios, application tags, etc., to introduce and clarify how to use the corresponding analysis model, improve the reusability of the analysis model, and avoid repeated development of the same analysis model by different analysts.
[0089] In addition, business analysts can define combinations of analytical models based on the needs of thematic and current affairs analysis, and incorporate a group of related analytical models into the corresponding combination. When an analytical task is invoked, the analytical task can be executed directly on a unit basis of analytical model combination.
[0090] This section uses the definition of the total number of cases handled by a certain procuratorate in the procuratorate's case handling data as an example to define the analysis model, as shown below.
[0091]
[0092] Step 5: Analyze and test / release the model
[0093] After the analysis model and its combination definition are completed, business analysts need to test them to see if the analysis results meet the current business analysis requirements. Once the test is passed, the analysis model can be published. After publication, the analysis model can be shared and used by other analysts. Simultaneously, the judicial case handling data analysis model management module generates an execution identifier for the analysis model. External application systems can invoke the analysis task via HTTP and obtain the analysis results.
[0094] Taking the case data analysis model of a certain procuratorate defined in step 4 as an example, when testing and executing, it is necessary to pass the execution parameters of the analysis model. For example, when calculating the total number of cases of the Beijing Municipal Procuratorate in 2023, the parameters that need to be passed are as follows.
[0095] {"cbdwBm":"110000","startTime":"2023-1-1","endTime":"2024-1-1"}
[0096] The judicial case handling data analysis model management system combines the parameters submitted by the user to render the analysis model and generate a calculation analysis script, as shown below.
[0097]
[0098] After the calculation and analysis script is generated, it is submitted to the ClickHouse calculation engine by the analysis task submission module, and the results calculated by the calculation engine are processed. The results are shown below.
[0099] {“AJ_NUM”:89102}
[0100] The beneficial effects of this invention are as follows:
[0101] 1. Flexibility in the Judicial Case Data Analysis Process: The design of the judicial case data analysis model management module in this invention, along with the introduction of Beetl dynamic template engine technology, enables the external configuration of the judicial case data analysis process. Judicial case data analysis tasks can be flexibly configured by changing analysis parameters. It connects to the underlying vectorized computing engine to complete the entire process of analysis task configuration, submission, and standardized result processing. Furthermore, the above process is uniformly encapsulated through microservice technology, ultimately providing judicial case data analysis capabilities to external BI dashboards and other application services via HTTP interfaces. This overall design significantly enhances the flexibility of judicial case data analysis.
[0102] 2. Efficiency and Interactivity Based on Vectorized Computation: To improve the efficiency of judicial case-handling data analysis and achieve interactive judicial case-handling data analysis, this invention combines the characteristics of judicial case-handling data and the characteristics of analysis needs to construct a data model that can meet the requirements of efficient querying and analysis. This model, coupled with a corresponding data storage architecture and computing engine, ultimately achieves a second-level response time in the judicial case-handling data analysis process. Furthermore, the design of the judicial case-handling data analysis model management module in this invention utilizes message queues and concurrent programming, combined with the distributed computing characteristics of the computing engine, to efficiently achieve batch execution of judicial case-handling data analysis tasks.
[0103] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for statistical analysis of case data in the judicial field, characterized in that, This method includes: judicial case handling data modeling, selection of judicial case handling data storage and computing engine, and management method for judicial case handling data analysis model; Judicial case handling data modeling: The judicial case handling data is organized using a wide table model from the data warehouse field, ultimately forming a wide table model for case data and a wide table model for personnel data; Judicial case data storage and computing engine selection: In terms of data storage, based on the above data model, namely the organization of judicial case data in a wide table format, a columnar data storage architecture is adopted to store the judicial case data; vectorized computing technology is adopted to realize the analysis and computing capabilities of judicial case data; based on the above data storage architecture and data computing architecture, the open-source data computing and storage framework ClickHouse computing engine is adopted. Judicial case handling data analysis model management method: A dynamic template method is adopted to define the statistical analysis model. When performing statistical analysis, the analysis model template, combined with the analysis parameters, dynamically and in real time generates the corresponding analysis script, which is then submitted to the computing engine for calculation and analysis. The computing engine performs standardization operations on the calculation results and then returns them to the caller. in, The data analysis model management method for judicial case handling is realized in a microservice manner, that is, the development and implementation form a data analysis model management system for judicial case handling. Through this system, users can define or organize the data analysis process for judicial case handling at any time. In addition, the data analysis model management system for judicial case handling provides the ability to execute analysis tasks and process results, and provides services to external application services and BI dashboards via HTTP interface. The judicial case handling data analysis model management system includes: an analysis model management module, an analysis model combination module, an analysis task submission module, and an analysis result processing module. The analysis model management module is used to define analysis models and dynamically generate analysis model scripts. The analysis model combination module combines analysis models according to business dimensions. The analysis task submission module submits analysis model scripts or combinations of analysis models to the computing engine. The analysis result processing module standardizes the analysis results. When a judicial case data analysis task is initiated, the caller submits task parameters, including the analysis model identifier or analysis model combination identifier and analysis execution parameter information. The analysis model management module, based on the Beetl template engine's rendering function, generates specific analysis statements using the analysis execution parameters and analysis models, and submits them to the analysis task submission module. Finally, the task is submitted to the ClickHouse calculation engine, where the returned calculation results are standardized and processed by the analysis result processing module before being returned to the caller. When the analysis model management module receives a task to execute an analysis model combination, the analysis model combination module, in conjunction with the analysis execution parameters, calls the analysis model management module to render and submit each analysis model in the combination. When all analysis models have been executed, the results are merged and returned to the caller. When initiating a call, the caller must adhere to HTTP specifications and use the POST method. The analysis model management module is used to define, maintain, and publish analysis models. An analysis model is a script statement that conforms to the template engine rendering specification. It follows the JavaScript-like language specification and contains fixed statements, JavaScript-like code segments, and dynamic parameter information. If Beetl template engine is used as the analysis model rendering tool, the defined analysis model script must conform to the Beetl template engine specification, and the generated analysis SQL statements must conform to the ClickHouse specification. By dynamically setting parameters, multiple executable analysis statements can be generated, thus simplifying the analysis model definition process. That is, for the same type of inspection data analysis, only one analysis model needs to be defined, and analysis and calculation statements that meet specific needs can be generated by different execution parameters.
2. The case data statistical analysis method for the judicial field as described in claim 1, characterized in that, A case is defined as a fact known or discovered by judicial authorities, referred to as "case" data. When handling a case, investigators go through multiple stages, and the data generated at each stage is called "item" data. Case data and item data have a one-to-many relationship. In the judicial case data storage architecture, case data is stored using a relational database. Each case data item has both a "case" identifier and an "item" identifier. Multiple items belonging to the same "case" share the same "case" identifier attribute; the "item" identifier is understood as the primary key, distinguishing the case handling stages. Case data is the foreign key, establishing a relationship with the case data.
3. The case data statistical analysis method for the judicial field as described in claim 1, characterized in that, The analysis model management module provides functions for maintaining and publishing analysis models. After the analysis model is published, it is rendered by the Beetl template engine through an HTTP interface call, using analysis parameters and analysis model identifiers as parameters, to realize the generation, execution and result transcription of specific analysis statements.
4. The case data statistical analysis method for the judicial field as described in claim 1, characterized in that, The analysis model combination module defines the analysis model combination, which combines a group of analysis models with business relevance into a set, and realizes batch execution and analysis processes to meet the special analysis capabilities of a specific topic area.
5. The case data statistical analysis method for the judicial field as described in claim 1, characterized in that, The analysis task submission module utilizes message queues and concurrent programming technologies to achieve parallel submission of analysis tasks; The analysis model management module submits tasks to be computed to the message queue, which then submits the tasks to the analysis task resource pool in the analysis task submission module. The thread pool and ClickHouse connection pool in the resource pool allocate the corresponding resources to execute the computation tasks. Each analysis task is allocated one thread resource and one ClickHouse connection resource. When the analysis task execution pool is full, the analysis tasks in the message queue wait for resources in order. In the analysis task submission module, a thread pool of size N and a ClickHouse connection pool are configured. The ClickHouse connection pool is managed using the Druid architecture. The size of N is determined by the number of ClickHouse cluster nodes and computing resources. When the number of ClickHouse nodes and resources are large enough, the value of N can be appropriately increased to improve computing concurrency efficiency. The ClickHouse connection pool is used to store ClickHouse connection resources. The analysis task submission module submits analysis computing tasks to ClickHouse through ClickHouse connection resources, and its vectorized computing engine performs the computation and analysis. After a task is submitted to ClickHouse, the thread resources occupied by the corresponding analysis task are in a waiting state. When the ClickHouse computing engine returns the calculation results, the corresponding thread calls the subsequent analysis result processing module and releases the thread's occupied state.
6. The case data statistical analysis method for the judicial field as described in claim 1, characterized in that, The analysis results processing module converts the calculation results returned by the ClickHouse calculation engine into a unified format, and uses JSON format to uniformly encapsulate the analysis results; Using JSON format makes it easier for the data analysis users to parse the calculation results and extract key values.