Case processing load resource automatic allocation method and system
Through the MSHFomer model of multi-scale timing analysis and attention mechanism, the problem of difficult to capture complex laws of case traffic is solved, and accurate prediction of case processing load and improvement of resource allocation is achieved.
Patent Information
- Application Number
- CN202510414927.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-03
- Publication Date
- 2025-07-08
AI Technical Summary
The existing technology is difficult to effectively capture the complex timing laws behind case traffic, resulting in inefficient resource allocation, especially in the lack of joint modeling capabilities of long-term policy effects and short-term emergencies.
A multi-scale timing analysis method is adopted to construct an MSHFomer model for resource allocation prediction by decomposing case trial trends, quarterly fluctuations and emergencies, and combining the attention mechanism dynamically weighted key time nodes.
It realizes accurate prediction of case processing load, improves the efficiency and accuracy of resource allocation, adapts to periodicity and emergencies in different time series, and provides more accurate human scheduling and case diversion support.
Smart Images

Figure CN120278466A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of case resource allocation prediction, and particularly relates to a method and system for automatically allocating case processing load resources. Background Art
[0002] The statements in this part merely provide background technical information related to the present invention, and do not necessarily constitute prior art.
[0003] In case practice, key indicators such as case trial cycle, appeal rate or mediation success rate show obvious time correlation. For example, the monthly case closing volume of grass-roots relevant units is affected by seasonal factors (such as year-end rush to close cases) and policy adjustments (such as the reform of separating complex and simple cases), showing periodic fluctuations and trend changes. Traditional case statistical methods are mostly based on static reports and simple moving averages, which are difficult to capture the complex time series laws behind the case flow, resulting in low resource allocation efficiency. Although deep learning has been applied to case efficiency prediction, the existing models have insufficient ability to jointly model the long-term policy effect and the sudden surge of short-term cases, and the resource allocation efficiency still needs to be improved. Summary of the Invention
[0004] In order to solve at least one of the above technical problems in the background art, the present invention provides a method and system for automatically allocating case processing load resources, which combines multi-scale time series analysis methods to decompose the case trial trend (long-term case reform effect), cycle (quarterly fluctuations) and residuals (emergency events), and combines the attention mechanism to dynamically weight key time nodes (such as the implementation date of new regulations), providing accurate prediction support for the manpower scheduling and case diversion of relevant units.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] The first aspect of the present invention provides a method for automatically allocating case processing load resources, including the following steps:
[0007] Obtain historical case resource allocation data to form historical case resource allocation time series data;
[0008] Based on the preprocessed historical case resource allocation time series data, train a long-term time series prediction model to obtain a trained long-term time series prediction model; wherein, the construction process of the long-term time series prediction model includes:
[0009] Decompose the time series data to obtain case trial trend, quarterly fluctuations and emergency event information;
[0010] Extract case trial trend features at different resolutions based on the case trial trend information;
[0011] Map quarterly fluctuations and emergency event information to the frequency domain space to capture the frequency distribution characteristics of periodic signals;
[0012] Combine the case hearing trend characteristics at different resolutions and the frequency distribution characteristics of periodic signals to predict the prediction results for future time steps;
[0013] Based on the trained long-term time series prediction model, predict the case to be predicted to obtain a resource allocation plan.
[0014] Furthermore, the preprocessing of the historical case resource allocation time series data includes normalizing the sequence and mapping the original data to a distribution with zero mean and unit variance.
[0015] Furthermore, when calculating the case hearing trend, perform a filling operation on the time series, including performing forward filling at the first time points of the sequence, that is, copying the first value of the time series along the time axis and filling it to the start of the sequence to simulate the continuation of the sequence before the time step; performing backward filling at the last
[0016] time points of the sequence, that is, performing the same copy filling on the end value of the time series to maintain the trend consistency at the tail of the sequence.
[0017] For the decomposed case hearing trend information, generate trend representations at different time scales through downsampling operations;
[0018] For the trend representations at different time scales, perform upsampling operations to obtain trend representations at different time scales with restored resolutions;
[0019] Concatenate the trend signals at different scales in the feature dimension to obtain a fused trend signal;
[0020] Input the fused trend signal into a fully connected linear layer for trend prediction to generate a case hearing trend prediction result.
[0021] Furthermore, the mapping of quarterly fluctuations and emergency event information to the frequency domain space to capture the frequency distribution characteristics of periodic signals includes:
[0022] Take quarterly fluctuations and emergency event information as periodic terms, perform a Hartley transform, and extract the periodic feature query H(Q), key H(K), and median value feature H(v) in the frequency domain;
[0023] Obtain the attention weight matrix A according to the similarity between the query H(Q) and the key H(K);
[0024] Perform weighted summation by combining the attention weight matrix A and the median frequency domain feature H(v) to obtain the weighted frequency domain representation H(qkv);
[0025] Convert the weighted frequency domain signal H(qkv) back to the time domain through the Hartley inverse transform to obtain the frequency domain prediction result.
[0026] Furthermore, the loss function during the training of the long-term time series prediction model is as follows:
[0027] L = αL trend + βL season ,
[0028]
[0029]
[0030] where L trend is the loss function of the trend module, L freq is the periodic prediction loss function, α and β are weight coefficients that control the contribution degrees of the trend and periodic errors, and β = 1 - α; is the trend prediction value, y t is the true trend value, is the predicted periodic signal, and H(Y) k is the true periodic signal.
[0031] The second aspect of the present invention provides a case processing load resource automatic allocation system, including:
[0032] A historical data acquisition module, which is used to acquire historical case resource allocation data to form historical case resource allocation time series data;
[0033] A prediction model training module, which is used to train the long-term time series prediction model based on the preprocessed historical case resource allocation time series data to obtain the trained long-term time series prediction model; wherein, the construction process of the long-term time series prediction model includes:
[0034] Decompose the time series data to obtain case trial trends, quarterly fluctuations, and emergency event information;
[0035] Extract case trial trend features at different resolutions based on the case trial trend information;
[0036] Map the quarterly fluctuations and emergency event information to the frequency domain space to capture the frequency distribution characteristics of the periodic signal;
[0037] Combine the case trial trend features at different resolutions and the frequency distribution characteristics of the periodic signal to predict the prediction result at future time steps;
[0038] A prediction module for predicting a case to be predicted based on a trained long-term time series prediction model to obtain a resource allocation plan.
[0039] The third aspect of the present invention provides a computer-readable storage medium.
[0040] A computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the steps in a method for automatically allocating case processing load resources as described above.
[0041] The fourth aspect of the present invention provides a computer device.
[0042] A computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the steps in a method for automatically allocating case processing load resources as described above.
[0043] The fifth aspect of the present invention provides a computer device.
[0044] A program product, which is a computer program product, includes a computer program, and when the computer program is executed by a processor, it implements the steps in a method for automatically allocating case processing load resources as described above.
[0045] Compared with the prior art, the beneficial effects of the present invention are:
[0046] The present invention decomposes time series data to obtain case trial trends, quarterly fluctuations, and emergency event information; captures the frequency distribution characteristics of periodic signals and the case trial trend characteristics at different resolutions based on the case trial trends, quarterly fluctuations, and emergency event information, and combines the attention mechanism to dynamically weight key time nodes (such as the implementation date of new regulations), providing accurate prediction support for the manpower scheduling and case diversion of relevant units.
[0047] The advantages of the additional aspects of the present invention will be partially given in the following description, partially become obvious from the following description, or be understood through the practice of the present invention. Description of the Drawings
[0048] The specification drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention.
[0049] Figure 1 It is a flowchart of a method for predicting a case resource allocation plan provided by an embodiment of the present invention;
[0050] Figure 2 It is a block diagram of a process for predicting a case resource allocation plan provided by an embodiment of the present invention. Detailed implementation manners
[0051] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0052] It should be noted that the following detailed description is illustrative and is intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs.
[0053] It should be noted that the terms used herein are only for describing specific implementation manners and are not intended to limit the exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0054] As mentioned in the background art, traditional case statistics methods are mostly based on static reports and simple moving averages, making it difficult to capture the complex temporal patterns behind case flows, resulting in low resource allocation efficiency. Although deep learning has been applied to case efficiency prediction, the existing models have insufficient ability to jointly model long-term policy effects and short-term sudden case surges. To address this problem, the multi-scale time series analysis method proposed by the present invention can decompose the case trial trend (long-term case reform effect), cycle (quarterly fluctuations), and residuals (emergency events), and combine the attention mechanism to dynamically weight key time nodes (such as the implementation date of new regulations), providing accurate prediction support for the manpower scheduling and case diversion of relevant units.
[0055] The present invention proposes a multi-variable long-term time series prediction model MSHFomer (Multi-scale Trend and Seasonal Hartley Transformer) based on decomposition and time-frequency enhancement, including:
[0056] (1) To address the complex correlation and multi-scale dependence problems existing in multi-variable long-term time series data, the model first uses STL decomposition to split the original sequence into two components: trend and seasonality. For the trend part, the present invention designs a multi-scale trend extraction method. By extracting trend components at different time scales, it can more comprehensively reflect the global and local change characteristics of the data. The multi-scale trend extraction method can not only capture the macro trend of long-term evolution but also reveal short-term fluctuations at different levels, enhancing the adaptability and prediction ability of the model.
[0057] (2) Considering the problem that the periodic characteristics in the time domain are difficult to be completely decoupled, the model maps the decomposed seasonal components to the frequency domain through the Hartley transform. The frequency domain representation can more clearly separate the periodic information with different durations and amplitudes. Subsequently, the cycles with greater contribution to the prediction are enhanced through the frequency domain attention mechanism, effectively improving the model's ability to capture periodic fluctuations and abnormal behaviors.
[0058] (3) To further improve the prediction accuracy and stability of the model, the present invention introduces a composite loss function for trends and cycles. Traditional time series models only calculate errors in the time domain and are difficult to explicitly constrain the accuracy of frequency domain features, resulting in insufficient performance of the model in the frequency domain, especially when capturing periodic and high-frequency features. Therefore, the present invention adopts a composite loss function during the model training process. By calculating errors simultaneously in trends and cycles, dual-space constraints are achieved to ensure the consistency of features of the model in both trends and the frequency domain.
[0059] Embodiment 1
[0060] As Figure 1 and Figure 2 shown, this embodiment provides an automatic allocation method for case processing load resources, including the following steps:
[0061] Step 1: Obtain historical case resource allocation data to form historical case resource allocation time series data;
[0062] In this embodiment, the historical case resource allocation data includes:
[0063] The workload data of judges and trial personnel, including the workload of each judge, prosecutor and other staff (such as the number of cases heard, processing time, etc.). These data usually show certain trends and periodicities over time. For example, the number of cases may surge in specific months or quarters.
[0064] The trial cycle data of cases, the trial time of each case, which involves the time length from case filing to judgment. The historical data can include information such as the type of case, complexity, and judge resources.
[0065] The data of peak and trough periods of cases, the number of cases in different time periods, especially the fluctuations in the number of cases around certain legal holidays.
[0066] The change trend data of case types, the proportion of case types involved in historical cases. For example, criminal cases, civil cases, economic cases, etc. The processing time and resource requirements for different types of cases vary.
[0067] Case delay and backlog data: the number of delayed cases and the records of backlogged cases. The reasons for delays may include resource shortages, overly complex cases, long trial times, etc.
[0068] The resulting time series data can be represented in matrix form:
[0069]
[0070] where represents the value of the i-th variable at time step t, T represents the length of the time series, and M represents the number of multi-variable dimensions.
[0071] During the case processing, the demand for various resources has temporal characteristics, that is, the demand for different resources at different time points changes dynamically. To improve case efficiency and avoid over-allocation or under-allocation of resources, through the analysis of historical data, a time series prediction model can be used to predict future resource demands, and then optimize resource allocation, reduce case backlogs, and improve the handling efficiency of cases.
[0072] Step 2: Preprocess the obtained historical case resource allocation time series data to obtain the preprocessed time series data;
[0073] In time series prediction tasks, the problem of data distribution shift is one of the main challenges affecting model performance. Data distributions (such as mean and variance) often change dynamically over time, which makes time series exhibit non-stationarity. In practical applications, the training set and the test set are usually divided by time, and this way of dividing by time naturally introduces the problem of distribution inconsistency: there may be significant distribution differences between the training set and the test set. In addition, there may be differences in data distributions between different time series samples, which further exacerbates the decline in the model's generalization ability. The above two types of distribution inconsistency problems often significantly affect the prediction accuracy and stability of the model.
[0074] Traditional methods attempt to perform stationary processing on the data, aiming to remove non-stationary information. However, directly eliminating non-stationary components may lead to the loss of valuable time series information, thereby weakening the model's ability to learn data change patterns. For this reason, this embodiment introduces a Reversible Instance Normalization (RevIN) module to alleviate the data distribution shift problem and improve the prediction performance of the model.
[0075] Specifically, it includes the following steps:
[0076] Step 201: First, normalize the sequence to map the original data to a distribution with zero mean and unit variance, so as to eliminate the distribution differences between different samples. The specific calculation process is as follows:
[0077]
[0078] Among them, among them represents the input value of the k-th feature in the i-th sequence at time step t, represents the input value of the k-th feature in the i-th sequence at time step j, T x represents the length of the sequence, that is, the number of time steps of this input data, represents the mean value of the time series data at time step t, represents the variance of the k-th feature in the i-th sequence at time step t, which is used to measure the fluctuation amplitude of this feature, represents the value of the k-th feature in the i-th sequence after normalization at time step t. ò is a very small constant used to prevent division by zero when calculating the variance, usually taking a value close to zero, γ k ,β k ∈R K are learnable parameters, where γ k is a learnable scaling parameter used to adjust the scale of the normalized data, β k is a learnable offset parameter used to adjust the offset of the normalized data. γ k ,β k ∈R K are learnable parameters.
[0079] Step 202: Based on the data processed in Step 201, perform data denormalization, and calculate using the same parameters as in the normalization stage. The specific calculation is as follows:
[0080]
[0081] Among them, represents the predicted result of time step t directly generated by the model for the i-th sequence based on the normalized input, represents the predicted result that has been denormalized and restored to the scale of the original data.
[0082] The RevIN module helps to remove the non-stationarity (such as long-term drift) in the trend term, enabling the model to learn trend features in a more stable space, thereby improving the generalization ability and enabling the model to adapt to different input data features. Finally, the inverse standardization operation is used to restore the original scale of the data to ensure that the trend component can be correctly restored to the prediction result.
[0083] Step 3: Train the long-term time series prediction model based on the preprocessed historical case resource allocation time series data to obtain the trained long-term time series prediction model;
[0084] Different from the univariate long-term time series prediction task, multivariate long-term time series prediction adds variable dependence on the basis of long-term dependence, short-term dependence, and time series dependence. The goal of the long-term time series prediction model is to simplify the time series structure through STL decomposition, highlight the trend changes and periodic transformations, capture the time series dependence through the decoupling and enhancement of the period, capture the variable correlation through the regularization loss, improve the robustness of the model, and achieve high-accuracy multivariate long-term time series prediction. In the long-term time series prediction model, the time series is deconstructed by the STL decomposition module to separate the inherent trend component and periodic component. Among them, the trend component enters the time domain trend capture module to capture the multi-scale trend dependence, and the periodic component enters the frequency domain enhancement module to decouple and enhance different periods.
[0085] In the multivariate time series prediction task, the goal is to use the observed data of the past T time steps to predict the multivariate changes of the future L time steps. Specifically, the goal of the model is to learn a mapping function:
[0086]
[0087] where, represents the prediction results of the future L time steps, F(·) represents the time series prediction model, and θ is the set of learnable parameters of the model.
[0088] Specifically, it includes the following steps:
[0089] Step 301: Decompose the preprocessed historical case resource allocation time series data to obtain case trial trends, quarterly fluctuations, and emergency event information;
[0090] In time series prediction, the original sequence usually contains long-term trends, periodic fluctuations, and short-term fluctuations. Directly modeling the overall sequence often makes it difficult to effectively separate these features, resulting in the model being difficult to capture long-term trends or periodic patterns.
[0091] To solve this problem, this module introduces the STL (Seasonal and Trend decomposition using Loess) decomposition module to preprocess the time series, decompose the input time series data, and obtain three parts: the seasonal component S, the case hearing trend T, and the unexpected event component R. STL decomposition can explicitly separate the trend and the cycle, reduce feature aliasing, help the model separately model the trend and the cycle, and contribute to improving the prediction accuracy and generalization ability of the model. By splitting the time series into a trend term and a cycle term, the prediction result of the model can correspond to specific trend and cycle components, which helps to interpret the time series data more clearly.
[0092] The formula after decomposition is expressed as:
[0093] X t = T t + S t + R t ,
[0094] where, X t is the original time series data, T t is the case hearing trend information, S t is the quarterly fluctuation information, and R t is the unexpected event information.
[0095] The case hearing trend information T t reflects the long-term change trend of the case hearing data, while the seasonal component S t captures the periodic fluctuations, and the unexpected event information R t represents the noise and unpredictable short-term fluctuations.
[0096] In this embodiment, the model omits the unexpected event information item during decomposition and incorporates the unexpected event information item into the cycle item for modeling. The unexpected event information item usually represents noise or short-term perturbations, with relatively small values and limited impacts, and makes a relatively low contribution to the model prediction performance. Incorporating it into the cycle item can simplify the model structure and reduce the number of parameters.
[0097] Among them, the case hearing trend information is obtained by calculating the moving average of the time series. The moving average method can effectively remove short-term fluctuations and highlight the long-term trend changes.
[0098] To adaptively handle seasonal and trend changes in different time series, for example, the monthly case closure volume of grass-roots related units is affected by seasonal factors (such as year-end rush case closures) and policy adjustments (such as the reform of separating simple and complex cases), showing periodic fluctuations and trend changes. In this embodiment, the locally weighted regression (LOESS) algorithm is adopted. By using smoothing techniques to extract the case trial trend (Trend Component), combined with the extraction of moving average and seasonal cycles, it can adaptively handle seasonal and trend changes in different time series.
[0099] Specifically, given a time series x t , the calculation of the case trial trend can be achieved through the following formula:
[0100]
[0101] where k is the size of the sliding window, and this formula calculates the mean within a window. The window size k affects the smoothness of trend extraction.
[0102] To ensure that the moving average can be calculated at all positions in the time series, especially at both ends of the series, it is usually necessary to perform padding operations on the time series.
[0103] Specifically, at the first time points of the series, forward padding is performed, that is, the first value of the time series is copied along the time axis and filled to the start of the series to simulate the continuation of the series before the time step; at the last time points of the series, backward padding is performed, that is, the last value of the time series is copied and filled in the same way to maintain the trend consistency at the tail of the series. This ensures that the sliding window can cover the full window length at both the head and the tail of the series. This padding strategy can effectively avoid boundary effects and ensure the integrity and consistency of the moving average calculation.
[0104] Among them, the periodic term (Seasonal Component) is used to describe the periodic fluctuation characteristics in the time series, reflecting the periodic laws and repeating patterns existing in the series.
[0105] The periodic term is obtained by subtracting the case trial trend information from the original series, that is:
[0106] S t =X t -T t ,
[0107] The separation of the periodic term can effectively reduce the interference of trend changes on periodic modeling, enabling the model to more accurately identify periodic patterns, highlighting the regular fluctuations in the time series, and using them as independent features for subsequent model training and prediction, improving the stability and generalization ability of the model.
[0108] Step 302: Extract case trial trend features at different resolutions based on case trial trend information;
[0109] In the process of time series data modeling, accurately capturing trend information is crucial for improving prediction accuracy. Traditional trend extraction methods often focus on global trends or local fluctuations. However, these methods fail to fully consider trend changes at different time scales, resulting in limitations in capturing long-term trends. In practical applications, the long-term trends in time series data usually change at different speeds on various time scales. Ignoring these changes may reduce the prediction ability of the model. Therefore, designing a module that can effectively capture multi-scale trends has become a key issue in time series data modeling.
[0110] Specifically, it includes the following steps:
[0111] Step 3021: For the decomposed case trial trend information T t , generate trend representations at different time scales through downsampling operations;
[0112] The core purpose of downsampling is to compress the resolution of the signal by reducing the time step, thereby extracting long-term trends. Each downsampling operation halves the time step of the signal, and the sampling factor factor is set to 2. For the original trend signal T0, the sampling process can be represented by the following formula:
[0113] T k = DownSample(X, factor = 2) k = 0, 1, 2,
[0114] Step 3022: For the trend representations at different time scales, perform upsampling operations to obtain trend representations at different time scales with restored resolution;
[0115] After obtaining trend terms at multiple scales through downsampling, restore the trend signal with a higher resolution through upsampling operations. The purpose of the upsampling operation is to map the low-resolution trend signal to a higher-resolution space. The core of the sampling operation is to restore the time step of the low-resolution signal to ensure that the signals at each scale are aligned in the time dimension, so that they can be effectively fused.
[0116] The upsampling operation is implemented through a fully connected layer, and the upsampling restoration formula is as follows:
[0117]
[0118] Among them, T k is the input low-resolution trend signal, W k is the weight of the kth layer, b kis the bias for the k-th layer, is the trend signal restored through the upsampling operation.
[0119] Step 3023: Concatenate the trend signals of different scales in the feature dimension to obtain the fused trend signal;
[0120] Concatenating the trend signals of different scales in the feature dimension, the obtained T fusion signal contains comprehensive trend information captured from multiple time scales, expressed as:
[0121]
[0122] The concatenated trend signal fuses short-term and long-term trend components at the information level, enabling the model to more accurately capture long-term dependencies and detailed changes in the data.
[0123] Step 3024: Input the fused trend signal T fusion into a fully connected linear layer for trend prediction. The role of this linear layer is to map the fused trend signal to the future prediction space and generate the case hearing trend prediction result, specifically expressed as:
[0124]
[0125] where, is the case hearing trend prediction result, W p is the weight of the prediction module, b p is the bias.
[0126] Step 303: Map the seasonal fluctuations and emergency event information to the frequency domain space to capture the frequency distribution characteristics of the periodic signals;
[0127] In time series data, periodic characteristics often manifest as fixed-frequency fluctuation patterns. Traditional time-domain modeling methods are easily restricted by local time windows and are difficult to effectively model long-term periodic characteristics. In addition, when dealing with unstable periodic changes or noise interference, time-domain models are prone to insufficient capture of periodic characteristics by the model.
[0128] To solve this problem, a frequency domain enhancement mechanism is introduced in the periodic term modeling. By mapping the time series to the frequency domain space, the model can capture the frequency distribution characteristics of the periodic signals.
[0129] In this model, the seasonal component is modeled using an attention mechanism based on the Hartley transform. When the Fourier transform is used to represent high-frequency or small-amplitude oscillation signals in the frequency domain, numerical instability is likely to be caused by the rounding errors of complex number operations. The Hartley transform uses real number calculations, which can maintain higher numerical stability on long-sequence time series data and reduce precision loss. The module is based on the attention mechanism in Transformer. The input signal is mapped to the frequency domain through the Hartley transform to capture the sine and cosine information in the signal, thereby enhancing the sensitivity of the model to periodic and local fluctuation features. This mechanism effectively extracts the periodic and oscillatory components of the signal through frequency domain analysis of the signal, providing strong support for modeling seasonal changes in time series data.
[0130] Specifically, it includes the following steps:
[0131] Step 3031: Convert the periodic term from the time domain to the frequency domain to obtain the spectral characteristics of the periodic signal;
[0132] In this embodiment, the Hartley transform is used to convert the signal from the time domain to the frequency domain, and the spectral characteristics of the signal are represented by a combination of sine and cosine functions. The formula for this transform can be expressed as:
[0133]
[0134] where t is the time index in the time series data, x t represents the value at the t-th time step in the time series data, T represents the total length of the time series data, i is the index of the frequency domain signal, representing different frequency components of the signal in the frequency domain, and H(x) i represents the amplitude of the input at the i-th frequency component in the frequency domain after the transformation.
[0135] Perform dimensional embedding on the original input x t to obtain a high-dimensional feature representation:
[0136]
[0137] where Q t , K t , V t are the features after the input is linearly transformed, and W q , W k , W v are their respective parameter matrices, and b q , b k , b v are the biases. The features after the linear transformation are subjected to the Hartley transform, and the input features are converted from the time domain to the frequency domain to extract periodic features:
[0138]
[0139] Among them, H(Q) i , H(K) i , H(V) i are the transformed frequency-domain feature representations.
[0140] Step 3032: Obtain the attention weight matrix A according to the similarity between the query H(Q) and the key H(K);
[0141] The calculation of the attention weight matrix is based on the inner product operation between the query and the key. The inner product result is scaled by a scale factor to obtain a normalized weight matrix, and finally, it is normalized through the softmax function:
[0142]
[0143] where E is the feature dimension, and A is the attention matrix, representing the correlation between the query and the key in the frequency domain space.
[0144] Step 3033: Combine the attention weight matrix and the median feature in the frequency domain for weighted summation to obtain the weighted frequency-domain representation H(qkv), and the formula is as follows:
[0145] H(qkv) = A · H(V),
[0146] This process is equivalent to using the learned attention weights to perform weighted sum and fusion on the signal in the frequency domain space, ensuring that the model pays more attention to the features of the periodic fluctuation part in the output signal, combining the attention mechanism to dynamically weight the key time nodes (such as the implementation date of the new regulation), thereby improving the modeling ability for seasonal components. This part is the extension of the attention mechanism in the frequency domain space. In this way, the model can capture long-term periodic changes while retaining the details of local information, strengthen the modeling ability for seasonal components, and further enhance the accurate prediction of the human resource scheduling and case diversion of relevant units.
[0147] Step 3034: Convert the weighted frequency-domain signal H(qkv) back to the time domain through the Hartley inverse transform to obtain the frequency-domain prediction result y t , and the inverse transform formula is as follows:
[0148]
[0149] where represents the restored time-domain prediction result.
[0150] Step 3035: Add the trend prediction result and the periodic prediction result to obtain the final model prediction result
[0151]
[0152] This process ensures that the output not only contains the periodic information captured in the frequency domain but also can maintain the structure and semantics of the original time-domain data, thus providing a more accurate prediction for further enhancing the manpower scheduling and case diversion of relevant units.
[0153] Step 304: Predict the prediction results for future time steps based on the case hearing trend characteristics and the frequency distribution characteristics of periodic signals at different resolutions;
[0154] Different from the univariate long-term time series prediction task, multivariate long-term time series prediction adds variable dependence on the basis of long-term dependence, short-term dependence, and temporal dependence. The goal of MSHFomer is to simplify the time series structure through STL decomposition, highlight trend changes and periodic transformations, achieve temporal dependence capture through the decoupling and enhancement of periods, capture variable correlations through regularization loss, improve the robustness of the model, and achieve high-accuracy multivariate long-term time series prediction.
[0155] In the MSHFomer model, the time series is deconstructed through the STL decomposition module to separate the inherent trend component and periodic component. Among them, the trend component enters the time-domain trend capture module to capture multi-scale trend dependence, and the periodic component enters the frequency-domain enhancement module to perform decoupling and enhancement of different periods.
[0156] The final time-domain prediction loss function is:
[0157] L = αL trend + βL freq ,
[0158] where L trend is the trend module loss function, L freq is the periodic prediction loss function, and α and β are weight coefficients that control the contribution degrees of trend and seasonal errors, and β = 1 - α;
[0159] The trend module loss function L trend is used to measure the mean square error between the predicted value and the true value in the time domain, expressed as:
[0160]
[0161] The periodic prediction loss function L freq is used to calculate the absolute error corresponding to the predicted signal and the true signal in the season, expressed as:
[0162]
[0163] where is the trend prediction value, y t is the true trend value, is the predicted periodic signal, H(Y) k is the true periodic signal.
[0164] The design of this composite loss function aims to ensure that the model maintains accuracy in the time domain, fully captures periodic information, and reduces distortion in the frequency domain.
[0165] Step 4: Predict the case to be predicted based on the trained long-term time series prediction model to obtain a resource allocation plan.
[0166] The resource allocation plan in this embodiment includes:
[0167] Prediction of the workload of judges and trial personnel, predicting which judges or trial personnel will have an increased workload and which time periods may experience a shortage of personnel in the future. Through the time series model, the number of cases within a certain period can be estimated, and personnel scheduling or additional trial resources can be arranged in advance to avoid overwork or resource waste.
[0168] Trial cycle of cases: Predicting the trial cycle of a certain type of case, for example, predicting the trial time of a specific type of case will help formulate a reasonable case arrangement and resource allocation plan. If the prediction shows that a certain type of case requires more time for trial, the relevant department can make preparations in advance to avoid a backlog of cases with overly long processing times.
[0169] Fluctuation prediction of the number of cases: Predicting the fluctuations in the number of cases to help case agencies predict which time periods will have a large backlog of cases, and then make resource preparations in advance, reasonably arrange the work of trial personnel and other resources to improve the overall business turnover efficiency.
[0170] Change trend of case types: Based on data from the past few months or years, predict the distribution trend of future case types. Through this prediction, the case system can better predict the number of cases that require specific specialties or technologies, and thus reasonably allocate judges or relevant technical personnel.
[0171] Prediction of case delays and backlogs: Predicting possible case delays and backlog situations, and then providing an early warning mechanism for relevant units and case agencies, and taking measures in advance to reduce bottlenecks in case processing.
[0172] Embodiment 2
[0173] This embodiment provides a case processing load resource automatic allocation system, including:
[0174] A historical data acquisition module, which is used to acquire historical case resource allocation data to form historical case resource allocation time series data;
[0175] A prediction model training module, which is used to train a long-term time series prediction model based on the preprocessed historical case resource allocation time series data to obtain a trained long-term time series prediction model; wherein, the construction process of the long-term time series prediction model includes:
[0176] Decompose the time series data to obtain case trial trends, seasonal fluctuations, and emergency event information;
[0177] Extract case trial trend features at different resolutions based on the case trial trend information;
[0178] Map the seasonal fluctuations and emergency event information to the frequency domain space to capture the frequency distribution characteristics of periodic signals;
[0179] Combine the case trial trend features at different resolutions and the frequency distribution characteristics of periodic signals to predict the prediction results for future time steps;
[0180] A prediction module, which is used to predict a case to be predicted based on the trained long-term time series prediction model to obtain a resource allocation plan.
[0181] It should be noted that the specific implementation method of an automatic case processing load resource allocation system according to an embodiment of the present invention is similar to the specific implementation method of an automatic case processing load resource allocation method according to an embodiment of the present invention. For details, please refer to the description in the method part. To reduce redundancy, it will not be elaborated here.
[0182] Embodiment III
[0183] This embodiment provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the steps in an automatic case processing load resource allocation as described above.
[0184] Embodiment IV
[0185] This embodiment provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the steps in an automatic case processing load resource allocation as described above.
[0186] Embodiment V
[0187] This embodiment provides a program product, which is a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps in an automatic case processing load resource allocation as described above.
[0188] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memory and optical memory, etc.) that contain computer-usable program code.
[0189] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate means for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0190] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including instruction means that implement the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0191] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are performed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one or more of the flows Figure 1 or blocks.
[0192] Those of ordinary skill in the art can understand that all or part of the processes in the above-described method embodiments can be completed by instructing relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above-described method embodiments. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0193] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, various modifications and variations can be made to the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. An automatic allocation method for case processing load resources, characterized in that, It includes the following steps: Obtain historical case resource allocation data to form historical case resource allocation time series data; Train a long-term time series prediction model based on the preprocessed historical case resource allocation time series data to obtain a trained long-term time series prediction model; among them, the construction process of the long-term time series prediction model includes: Decompose the time series data to obtain case trial trends, seasonal fluctuations, and emergency event information; Extract case trial trend characteristics at different resolutions based on the case trial trend information; Map the seasonal fluctuations and emergency event information to the frequency domain space to capture the frequency distribution characteristics of periodic signals; Combine the case trial trend characteristics at different resolutions and the frequency distribution characteristics of periodic signals to predict the prediction results for future time steps; Predict the case to be predicted based on the trained long-term time series prediction model to obtain a resource allocation plan.
2. The automatic allocation method of case - handling load resources according to claim 1, wherein, The preprocessing of the historical case resource allocation time series data includes normalizing the sequence and mapping the original data to a distribution with zero mean and unit variance.
3. The automatic allocation method for case processing load resources according to claim 1, wherein, When calculating the case trial trend, a filling operation is performed on the time series, including forward filling at the first several time points of the series. That is, the first value of the time series is copied along the time axis and filled to the start of the series to simulate the continuation of the series before the time step; Backward Backward filling is performed at the subsequent time points, that is, the end value of the time series is copied and filled in the same way to maintain the trend consistency at the tail of the series.
4. The automatic allocation method for case processing load resources according to claim 1, characterized in that , The extraction of case trial trend characteristics at different resolutions based on the case trial trend information includes: For the decomposed case trial trend information, generate trend representations at different time scales through downsampling operations; For the trend representations at different time scales, use upsampling operations to obtain trend representations at different time scales with restored resolutions; Stitch the trend signals at different scales in the feature dimension to obtain a fused trend signal; Input the fused trend signal into a fully connected linear layer for trend prediction to generate a case trial trend prediction result.
5. The automatic allocation method of case - handling load resources according to claim 1, characterized in that, The mapping of the seasonal fluctuations and emergency event information to the frequency domain space to capture the frequency distribution characteristics of periodic signals includes: Take the seasonal fluctuations and emergency event information as periodic terms, perform a Hartley transform, and extract the periodic feature query H(Q), key H(K), and frequency domain median feature H(v); Obtain the attention weight matrix A according to the similarity between the query H(Q) and the key H(K); Combine the attention weight matrix A and the frequency domain median feature H(v) for weighted summation to obtain a weighted frequency domain representation H(qkv); Convert the weighted frequency domain signal H(qkv) back to the time domain through an inverse Hartley transform to obtain a frequency domain prediction result.
6. The automatic allocation method for case processing load resources according to claim 1, characterized in that, The loss function during the training of the long-term time series prediction model is: L = αL trend + βL season , Among them, L trend is the loss function of the trend module, L freq is the loss function of the period prediction, and α and β are the weight coefficients controlling the contribution degrees of the trend and period errors, and β = 1 - α; is the predicted value of the trend, y t is the true value of the trend, is the predicted periodic signal, H(Y) k is the true periodic signal.
7. An automatic allocation system for case processing load resources, characterized in that, It includes: A historical data acquisition module, which is used to obtain historical case resource allocation data to form historical case resource allocation time series data; A prediction model training module, which is used to train a long-term time series prediction model based on the preprocessed historical case resource allocation time series data to obtain a trained long-term time series prediction model; among them, the construction process of the long-term time series prediction model includes: Decompose the time series data to obtain case trial trends, seasonal fluctuations, and emergency event information; Extract case trial trend characteristics at different resolutions based on the case trial trend information; Map the seasonal fluctuations and emergency event information to the frequency domain space to capture the frequency distribution characteristics of periodic signals; Predict the prediction results for future time steps by combining the case trial trend characteristics at different resolutions and the frequency distribution characteristics of periodic signals; A prediction module, which is used to predict the case to be predicted based on the trained long-term time series prediction model to obtain a resource allocation plan.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps in an automatic case processing load resource allocation method as described in any one of claims 1-6.
9. A computer device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in an automatic case processing load resource allocation method as described in any one of claims 1-6.
10. A program product, which is a computer program product and includes a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps in an automatic case processing load resource allocation method as described in any one of claims 1-6.