A process instance next event prediction method and system based on log sampling
By sampling event logs and combining them with deep learning network models, the problem of low efficiency of deep learning models in predicting the next event in a business process is solved, achieving efficient and accurate prediction of the next event and adapting to the dynamic requirements of business processes.
Patent Information
- Application Number
- CN202210906894.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-29
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-07-29
AI Technical Summary
Existing deep learning models are inefficient at predicting the next event in a business process, cannot meet the dynamic requirements of the business process, and are limited by hardware devices, resulting in excessively long training times.
We adopt a log-sampling-based event prediction method for process instances. We use the LogRank++ algorithm to sample event logs, reducing the amount of training data. We also combine deep learning network models for training and validation, and optimize model parameters to improve prediction efficiency and accuracy.
It enables the rapid training of high-precision prediction models with reduced data volume, improving prediction efficiency and accuracy, and adapting to the dynamic needs of business processes.
Smart Images

Figure CN115328866B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of process mining, in particular to a process instance next event prediction method and system based on log sampling, which can predict the next event of the current event and improve the prediction efficiency through log sampling technology. BACKGROUND
[0002] Business process management includes methods, techniques and tools to support the design, management and analysis of business processes, one of the main tasks of which is process monitoring, the goal of which is to be able to gain insight into the overall process. One of the purposes of process monitoring is to detect unexpected deviations in the execution of the process. Process monitoring can be online or offline, and offline process monitoring is achieved through traditional monitoring methods, the idea of which is to provide a data set containing a complete process instance as input, and the discovered unexpected deviations are output.
[0003] The main tasks of predictive process monitoring include business process remaining time prediction and next event prediction, and the main purpose of next event prediction is to allocate reasonable resources in advance for the subsequent events and prevent possible deviations from affecting the business process. Traditional model-based prediction methods and machine learning-based prediction methods, such as stochastic Petri nets, causal diagram shortest path, decision tree, support vector machine, etc., when facing large amounts of data, it takes a lot of time to manually extract the features of the input data. With the wide application of deep learning, researchers have abandoned the way of manually extracting features and used various deep learning models to complete the prediction task, such as Long Short-Term Memory (LSTM), etc., whose recursive architecture can adapt to data sequences of arbitrary length, but using deep learning models to train event logs usually requires a large amount of data to reach the fitting state, because a large amount of data contains more feature information needed for model learning, but due to the limitation of hardware devices, the above process often takes too long to train, making the model prediction efficiency low, which does not meet the dynamic requirements of business processes.
[0004] Sampling event logs is an instance selection process, the purpose of which is to reduce the original data to an acceptable range while ensuring the quality of the data set, and to improve the efficiency of process discovery. If a deep connection between the trajectory prefix and the next event in the log can be mined through a sampling method, then the small amount of event logs after sampling can be considered to contain sufficient feature information, so that the deep learning algorithm can quickly train a prediction model with high precision through part of the data. Therefore, in order to better control the overall business process and avoid the risk of violating the process operation, and improve decision-making efficiency, an efficient business process remaining event prediction scheme is needed. SUMMARY
[0005] The first object of the present application is to overcome the low efficiency problem of predicting the next event by using the deep learning model at present, and provide a process instance next event prediction method based on log sampling, which can realize efficient prediction of the next event of the business process, quickly and accurately obtain the next most likely event of the current ongoing event, and avoid the risks that may occur in the business process.
[0006] The second object of the present application is to provide a process instance next event prediction system based on log sampling.
[0007] The first object of the present application is realized by the following technical scheme: a process instance next event prediction method based on log sampling, comprising the following steps:
[0008] 1) obtaining and preprocessing a real original event log, which records all information of the business process, including business process events and event attributes, the preprocessing is for the next event prediction demand of the business process, retaining the event and time attributes to obtain a standard event log;
[0009] 2) dividing the standard event log obtained in step 1) into a training set, a validation set and a test set according to a proportion in a track unit;
[0010] 3) using the training set divided in step 2), using the LogRank++ algorithm to sample the event log according to a specific sampling rate to obtain a sampled training set;
[0011] 4) inputting the sampled training set obtained in step 3) and the validation set divided in step 2) which is not sampled into a deep learning network model for training and validation of the next event prediction, obtaining a trained and validated deep learning network model and a ratio of the sum of the training and validation time and the event log sampling time after sampling to the training and validation time before sampling;
[0012] 5) inputting the test set divided in step 2) which is not sampled into the deep learning network model trained and validated in step 4) for testing, obtaining the test accuracy of the next event prediction task;
[0013] 6) adjusting the parameters of the trained and validated deep learning network model according to the test accuracy of the next event prediction task obtained in step 5), the ratio of the sum of the training and validation time and the event log sampling time after sampling to the training and validation time before sampling obtained in step 4) and the sampling rate set in step 3), thereby optimizing the model, obtaining the optimal deep learning network model, and subsequently inputting the next event prediction task into the optimal deep learning network model, so as to obtain accurate prediction results.
[0014] Further, in step 1), initial data, i.e. original event logs, are acquired, and after the original event logs are acquired, pre-processing is performed to eliminate irrelevant attributes in the original event logs and only keep events and time attributes of events related to event prediction, so as to obtain standard event logs for predicting next events of a business process;
[0015] The events in the event prediction are a set composed of all events in the event logs, referred to as an event set ε, and the execution of each event e is represented as e = (a1, a2,..., am) ∈ ε, where am represents the mth attribute of the event. m )∈ε represents the mth attribute of the event. m
[0016] Further, in step 2), different training sets, validation sets and test sets are divided according to the standard event logs of next events of the prediction process instance obtained in step 1), and the specific steps are as follows:
[0017] 2.1) In the standard event logs of next events of the prediction process instance, a specific proportion of training sets, validation sets and test sets is set;
[0018] 2.2) According to the proportion set in step 2.1), the length of the track and the number of the standard event logs are acquired, the number of tracks contained in the training sets, the validation sets and the test sets is calculated, and the random division is performed according to the track number in the track unit;
[0019] 2.3) The training sets, the validation sets and the test sets divided according to the proportion in step 2.2) are saved in three documents respectively;
[0020] The track is an ordered sequence composed of n events, contains event and attribute information, and represents the complete execution of a business process, also referred to as a process instance.
[0021] Further, in step 3), the training set obtained in step 2) is sampled according to a specific sampling rate, and the specific steps are as follows:
[0022] 3.1) According to the size of the training set obtained in step 2) and the expected efficiency improvement, the sampling rate S is set in advance, wherein the smaller the sampling rate, the smaller the data set obtained after sampling;
[0023] 3.2) The importance of each event in the track and the importance of the direct following event relationship are calculated through the LogRank++ algorithm;
[0024] The importance of the event is obtained by calculating the number of tracks containing the event a in the event logs, and the formula of the importance of the event is:
[0025]
[0026] where a is an event, L is an event log, |L| is the number of traces contained in the event log, sig(a) is the importance of event a, σ i represents the i-th trace in the event log L;
[0027] The importance of the direct follow event relationship is calculated by counting the number of traces containing the direct follow event relationship <a, b>, and the formula of the importance of the direct follow event relationship is:
[0028]
[0029] where a and b are events, <a, b> is a direct follow event relationship, and sig(a, b) is the importance of the direct follow event relationship;
[0030] 3.3) According to the importance of each event obtained in step 3.2) and the importance of the direct follow event relationship, the importance of each trace in the event log is obtained, and the formula for calculating the importance of the trace is as follows:
[0031]
[0032] where sig(σ) is the importance of the trace, and the greater the value of sig(σ) represents the more important the trace;
[0033] 3.4) According to the importance of the trace calculated in step 3.3), all traces in the training set are sorted in descending order of trace importance, and the top S traces in the training set are selected according to the sampling rate S set in step 3.1) to obtain the sampled training set.
[0034] Further, in step 4), the sampled training set obtained in step 3) and the validation set divided in step 2) are input into the deep learning network model for training, and the specific steps are as follows:
[0035] 4.1) Extract and copy the trace prefix of the event log of the sampled training set obtained in step 3), and input the trace prefix into the feature extraction stage of the deep learning network model for feature extraction to obtain the features and event information of the trace;
[0036] 4.2) According to the feature information of the event log of the sampled training set obtained in step 4.1), the next event of the trace prefix is predicted, and the accuracy acc is calculated; wherein the prediction result of the next event has four different types, which are true positive TP, false positive FP, true negative TN, and false negative FN, and the accuracy acc is selected as the evaluation index of the algorithm, and the calculation method is as follows:
[0037]
[0038] The accuracy of the prediction results can be reflected by calculating the accuracy acc of the next event prediction results in the validation set. The larger the acc is, the more accurate the next event prediction results are.
[0039] 4.3) Calculate the cross-entropy loss of the deep learning network model and the prediction accuracy of the next event based on the trajectory prefix obtained in step 4.2). Perform cross-validation using a validation set to improve the prediction accuracy, thus obtaining a well-trained and validated deep learning network model. Here, the trajectory prefix represents the sequence of the first k ordered events of a trajectory, denoted as σ(k) = <e1,e2,...,e k ,...,e n >,k∈[1,n),e k Let K be the k-th event in the trajectory; the cross-entropy is a measure of the difference between the predicted probability distribution and the actual probability distribution of the next event, and it can represent the prediction effect. The smaller the cross-entropy value, the better the model effect.
[0040] Evaluating the performance of an event prediction method requires not only assessing its accuracy but also analyzing its time consumption. To evaluate prediction efficiency, the ratio R of the training and validation time after sampling to the event log sampling time before sampling is set as an indicator of time performance. Let T be the time spent on training and validation in the original dataset before sampling. P The sampling phase takes T seconds. S The training and validation time on the sampled dataset is T′. P T ALL The average total time for each training, validation, and sampling step is calculated. To reduce errors introduced during model training, validation, and sampling, the average is taken from five iterations. The calculation method is as follows:
[0041]
[0042] In the formula, j represents the number of times the model is sampled and trained / validated; the time performance metric R is calculated as follows:
[0043]
[0044] The larger the value of R, the higher the prediction efficiency after sampling the event log.
[0045] Furthermore, in step 5), the unsampled test set obtained in step 2) is input into the deep learning network model trained and validated in step 4) to test the final effect of the model. The accuracy acc in the test set can reflect the accuracy of the prediction results. The larger the acc, the more accurate the prediction.
[0046] Further, in step 6), the prediction accuracy of the test set obtained in step 5) and the prediction accuracy of the training and validation obtained in step 4) and the ratio of the sum of the training and validation time after sampling and the event log sampling time to the training and validation time before sampling are used to further adjust the model, the batch_size and iteration parameters are adjusted to reduce the training time of the deep learning network model, and the sampling rate is adjusted to control the size of the training set, so as to obtain an optimal deep learning network model. The next event prediction task is input into the optimal deep learning network model, and an accurate prediction result can be obtained; wherein the batch_size is the batch size of the data set during the training of the deep learning network model, which means that the training set takes batch_size training samples for training each time; and the iteration is the number of iterations during the training.
[0047] The second object of the application is achieved by the following technical scheme: a process instance next event prediction system based on log sampling, comprising a data acquisition and preprocessing module, a data division module, a log sampling module, a deep learning model training module, a prediction result output module and an adjustment and optimization module.
[0048] The data acquisition and preprocessing module is used for acquiring, analyzing and preprocessing event logs.
[0049] The data division module is used for dividing the preprocessed event logs into training sets, validation sets and test sets according to a proportion.
[0050] The log sampling module is used for log sampling on the training set after division according to a sampling rate.
[0051] The deep learning model training module is used for training a deep learning network model as a next event prediction model, and verifying it by using the validation set, so as to obtain a trained and verified deep learning network model and the ratio of the sum of the training and validation time after sampling and the event log sampling time to the training and validation time before sampling.
[0052] The prediction result output module is used for testing the next event prediction model result and recording its accuracy.
[0053] The adjustment and optimization module is used for further adjusting the model according to the test result, the training and verification result, the sampling rate and the ratio of the sum of the training and verification time after sampling and the event log sampling time to the training and verification time before sampling.
[0054] Further, the data acquisition and preprocessing module specifically performs the following operations:
[0055] Obtaining initial data, i.e. original event logs, and performing preprocessing after obtaining the original event logs to remove irrelevant attributes in the original event logs and only keep events and time attributes of events related to event prediction, thereby obtaining standard event logs for predicting next events of a business process.
[0056] Further, the data division module specifically performs the following operations:
[0057] In the standard event logs for predicting next events of a process instance, a specific proportion of training set, validation set and test set is set, the length of a track and the number of tracks of the standard event logs are obtained, the number of tracks contained in the training set, the validation set and the test set is calculated, and the tracks are randomly divided according to the number of tracks, and the training set, the validation set and the test set divided by the proportion are saved in three documents respectively.
[0058] Further, the log sampling module specifically performs the following operations:
[0059] The sampling rate S is set in advance through the size of the training set and the expected efficiency improvement, wherein the smaller the sampling rate is, the smaller the obtained sampled data set is;
[0060] The importance of each event in a track and the importance of a direct following event relationship are calculated through the LogRank++ algorithm;
[0061] The importance of an event is obtained by calculating the number of tracks containing the event a in the event log, and the formula of the importance of the event is:
[0062]
[0063] In the formula, a is an event, L is an event log, |L| is the number of tracks contained in the event log, sig(a) is the importance of the event a, and σ i represents the i-th track in the event log L;
[0064] The importance of a direct following event relationship is calculated by calculating the number of tracks containing the direct following event relationship <a, b>, and the formula of the importance of the direct following event relationship is:
[0065]
[0066] In the formula, a and b are events, <a, b> is a direct following event relationship, and sig(a, b) is the importance of the direct following event relationship;
[0067] According to the obtained importance of each event and the importance of the direct following event relationship, the importance of each track in the event log is obtained, and the formula for calculating the importance of the track is as follows:
[0068]
[0069] In the formula, sig(σ) is the track importance, and the greater the value of sig(σ) represents the more important the track is;
[0070] All the tracks in the training set are sorted in descending order of track importance, and the first S tracks in the training set are selected according to the set sampling rate S to obtain the sampled training set.
[0071] Further, the deep learning model training module specifically performs the following operations:
[0072] The event log of the obtained sampled training set is extracted and copied for track prefix, and the track prefix is input into the feature extraction stage of the deep learning network model for feature extraction to obtain the features and event information of the track. The next event of the track prefix is predicted, and the accuracy acc is calculated. The prediction result of the next event has four different types, which are true positive TP, false positive FP, true negative TN, and false negative FN. The accuracy acc is selected as the evaluation index of the algorithm, and the calculation method is as follows:
[0073]
[0074] By calculating the accuracy acc of the next event prediction result of the track prefix in the validation set, the accuracy of the prediction result can be reflected. The greater the acc is, the more accurate the next event prediction result is;
[0075] The cross-entropy loss of the deep learning network model and the accuracy of the next event prediction of the track prefix are calculated, and the cross-validation is performed through the validation set to improve the prediction accuracy, and the trained and validated deep learning network model is obtained.
[0076] The evaluation process not only needs to evaluate the accuracy of the next event prediction method, but also needs to analyze it from the time cost angle. To evaluate the prediction efficiency, the ratio R of the training and validation time of the sampled data set and the training and validation time before sampling is set as the evaluation index of the time performance. The time consumption of the unsampled training and validation in the original data set is T P , the time consumption in the sampling stage is T S , and the time consumption of the training and validation in the sampled data set is T' P , T ALL is the average total time consumption of each training, validation and sampling. In order to reduce the error caused by model training, validation and sampling, the average of 5 times is taken, and the calculation method is as follows:
[0077]
[0078] In the formula, j is the number of times of sampling and training, validation model; and the calculation method of the evaluation time performance index R is:
[0079]
[0080] Wherein, the larger R represents the higher prediction efficiency of the event log sampling.
[0081] Further, the prediction result output module specifically performs the following operations:
[0082] The test set without sampling is input into the trained and verified deep learning network model, and the final effect of the model is tested.
[0083] Further, the adjustment optimization module specifically performs the following operations:
[0084] According to the obtained prediction accuracy of the test set and the training, verification prediction accuracy and the ratio of the sum of the training, verification time after sampling and the event log sampling time to the training, verification time before sampling, the model is further adjusted, the batch_size and iteration parameters are adjusted to reduce the deep learning network model training time, the training set size is adjusted by adjusting the sampling rate, and the optimal deep learning network model is obtained.
[0085] Compared with the prior art, the present application has the following advantages and beneficial effects:
[0086] 1. The present application makes up for the shortcomings of not pre-processing the event log in the current next event prediction, and realizes the demand that the processed event log is more suitable for the next time prediction task.
[0087] 2. Compared with simply using a deep learning network model for prediction, the present application reduces the training amount and greatly improves the prediction time efficiency.
[0088] 3. The present application uses log sampling technology to reduce the number of trajectories with a target, increase the correlation between events, improve prediction accuracy, and ensure the accuracy and reliability of process monitoring.
[0089] 4. The present application can be freely combined in log sampling technology and deep learning network model training, and has the advantages of simple operation, strong adaptability and providing an efficient and feasible prediction method.
[0090] 5. The present application has a wide application space in the next event prediction task of the business process, and has a broad prospect in predictive process monitoring. BRIEF DESCRIPTION OF DRAWINGS
[0091] Figure 1 is a logical flowchart of the method of the present application.
[0092] Figure 2 is a fragment of a graph of the Road Traffic Fine Management Process event log.
[0093] Figure 3 is a structure graph of the deep learning network model.
[0094] Figure 4 is a graph of the efficiency improvement of the data sets at 10% sampling rate.
[0095] Figure 5 is a graph of the ratio of the time taken to sample and train the deep learning model for the Helpdesk, BPC_2012_A data sets at 10%, 20%, 30% sampling rate.
[0096] Figure 6 is a graph of the ratio of the time taken to sample and train the deep learning model for the BPC_2012_O, Prepaid_Travel_Costs data sets at 10%, 20%, 30% sampling rate.
[0097] Figure 7 is a graph of the ratio of the time taken to sample and train the deep learning model for the Hospital, RTFM data sets at 10%, 20%, 30% sampling rate.
[0098] Figure 8 is a system framework graph of the present application. DETAILED DESCRIPTION
[0099] The present application will be further described by examples and with reference to the accompanying drawings, but the embodiments of the present application are not limited thereto.
[0100] Example 1
[0101] As Figure 1As shown, the embodiment discloses a process instance next event prediction method based on log sampling. First, an original event log is acquired, which records all information of a business process, including business process events and event attributes. For the next event prediction requirement of the process instance, irrelevant attributes in the original event log are removed, and only events and time attributes related to event prediction are retained to obtain a standard event log for predicting the next event of the business process. Second, the obtained standard event log is divided into a training set, a validation set and a test set according to a proportion. The divided training set is sampled at a certain sampling rate to obtain a sampled training set. The obtained sampled training set and the divided validation set without sampling are input into a deep learning network model for next event prediction to obtain a trained and validated deep learning network model. Finally, the divided test set without sampling is input into the trained and validated deep learning network model for testing to obtain a next event prediction task test result. The deep learning network model is adjusted according to the result to optimize the model.
[0102] An original event log is acquired, which records all information of a business process, including business process events and event attributes. As shown in Table 1, a fragment of a Road_Traffic_Fine_Management_Process(RTFM) event log is shown. For the next event prediction requirement of the business process, event and time attributes are retained to obtain a prediction event log, the detailed information of which is shown in Table 2. Figure 2 A fragment diagram of the Road Traffic Fine Management Process event log is shown.
[0103] Table 1: Fragment of Road_Traffic_Fine_Management_Process event log
[0104]
[0105]
[0106] The event in the event prediction is a set composed of all events in the event log, referred to as an event set ε. The execution of each event e is represented as e = (a1, a2,..., am) ∈ ε, where am represents the mth attribute of the event. m m The mth attribute of the event.
[0107] 2) The standard event log for predicting the next event of the business process obtained according to step 1) is divided into different training sets, validation sets and test sets, and the specific steps are as follows:
[0108] 2.1) In the standard event log of predicting the next event of the business process, set the proportion of 7:2:1 of the training set, the validation set and the test set;
[0109] 2.2) According to the proportion set in step 2.1), obtain the length of the track and the number of the standard event log, calculate the number of tracks contained in the training set, the validation set and the test set, and randomly divide them by track number;
[0110] 2.3) Save the training set, the validation set and the test set divided by the proportion in step 2.2) to RTFM_train.txt, RTFM_val.txt and RTFM_test.txt respectively. The information of the data set after division is shown in Table 2.
[0111] Table 2 Information of event log after division
[0112]
[0113]
[0114] 3) Sample the event log according to a certain sampling rate according to the training set obtained in step 2), and the specific operation is as follows:
[0115] 3.1) According to the size of the training set obtained in step 2) and the expected efficiency, set the sampling rate in advance. The smaller the sampling rate, the smaller the data set after sampling. In order to explore the influence of the sampling rate on the next event prediction accuracy, first set the sampling rate to 10%;
[0116] 3.2) Calculate the importance of each event in the track and the importance of the direct following event relationship through the LogRank++ algorithm;
[0117] The importance of event a in the event log is calculated by calculating the number of tracks containing event a. The formula of event importance is:
[0118]
[0119] In the formula, a is the event, L is the event log, |L| is the number of tracks contained in the event log, sig(a) is the importance of event a, σ i represents the i-th track in the event log L;
[0120] The importance of the direct following event relationship is calculated by calculating the number of tracks containing the direct following event relationship <a, b>. The formula of the importance of the direct following event relationship is:
[0121]
[0122] wherein a, b are events, <a, b> is direct following event relationship, sig(a, b) is the importance of direct following event relationship;
[0123] 3.3) According to the importance of each event obtained in step 3.2) and the importance of direct following event relationship, the importance of each trajectory in the event log is obtained, and the formula for calculating the importance of trajectory is as follows:
[0124]
[0125] wherein sig(σ) is the importance of trajectory, and the greater the value of sig(σ) represents the more important the trajectory is;
[0126] 3.4) According to the importance of trajectory obtained in step 3.3), all trajectories in the training set are sorted in descending order of importance of trajectory, and the top S trajectories in the training set are selected according to the sampling rate S set in step 3.1) to obtain the sampled training set.
[0127] 4) The sampled training log obtained in step 3) and the verification set divided in step 2) are input into the deep learning network model for training, and the structure of the deep learning network model used is as shown in Figure 3 The specific steps are as follows:
[0128] 4.1) The event log of the sampled training set obtained in step 3) is extracted and copied for trajectory prefix, and the trajectory prefix is input into the feature extraction stage of the deep learning network model for feature extraction to obtain the features and event information of the trajectory;
[0129] 4.2) According to the feature information of the event log of the sampled training set obtained in step 4.1), the next event of the trajectory prefix is predicted, and the accuracy acc is calculated; wherein the prediction result of the next event has four different types, which are true positive (TP), false positive (FP), true negative (TN) and false negative (FN), and the accuracy (acc) is selected as the evaluation index of the algorithm in this paper, and the calculation method is as follows:
[0130]
[0131] By calculating the accuracy acc of the next event prediction result of the trajectory prefix in the verification set, the accuracy of the prediction result can be reflected, and the greater the acc is, the more accurate the next event prediction result is;
[0132] 4.3) Calculate the cross-entropy loss of the deep learning network model and the prediction accuracy of the next event based on the trajectory prefix obtained in step 4.2). Perform cross-validation using a validation set to improve the prediction accuracy, thus obtaining a well-trained and validated deep learning network model. Here, the trajectory prefix represents the sequence of the first k ordered events of a trajectory, denoted as σ(k) = <e1,e2,...,e k ,...,e n >,k∈[1,n),e k Let be the k-th event in the trajectory; the cross-entropy is a measure of the difference between the predicted probability distribution and the actual probability distribution of the next event, and can represent the prediction effect to a certain extent. The smaller the cross-entropy value, the better the model effect.
[0133] Evaluating the performance of an event prediction method requires not only assessing its accuracy but also analyzing its time consumption. To evaluate prediction efficiency, the ratio R of the training and validation time after sampling to the event log sampling time before sampling is set as an indicator of time performance. Let T be the time spent on training and validation in the original dataset before sampling. P The sampling phase takes T seconds. S The training and validation time on the sampled dataset is T′. P T ALL The average total time for each training, validation, and sampling step is calculated. To reduce errors introduced during model training, validation, and sampling, the average is taken from five iterations. The calculation method is as follows:
[0134]
[0135] In the formula, j represents the number of times the model is sampled and trained / validated; the time performance metric R is calculated as follows:
[0136]
[0137] The larger the value of R, the higher the prediction efficiency after sampling the event log.
[0138] 5) Input the unsampled test set obtained in step 2) into the deep learning network model trained and validated in step 4) for testing to obtain the test accuracy of the next event prediction task and test the final effect of the model. By calculating the accuracy acc in the test set, the accuracy of the prediction result can be reflected. The larger the acc, the more accurate the prediction.
[0139] 6) The prediction accuracy of the test set obtained according to step 5) and the prediction accuracy of the training and validation obtained in step 4) are further adjusted to the model, and the ratio of the sum of the training and validation time after sampling and the event log sampling time to the training and validation time before sampling is adjusted, the training time of the deep learning network model is reduced by adjusting the batch_size and iteration parameters, the training set size is controlled by adjusting the sampling rate, and the optimal deep learning network model is obtained, and the next event prediction task is input into the optimal deep learning network model, and the accurate prediction result can be obtained; wherein the batch_size is the batch size of the data set during the training of the deep learning network model, which means that the training set takes batch_size training samples for training each time; the iteration is the number of iterations during training. Finally, the accuracy is shown in Table 3, which improves the efficiency as shown in Table 4. Figure 4
[0140] Table 3 Prediction accuracy of next event under different sampling methods (10% sampling rate)
[0141] Sampling method Helpdesk BPIC_2012_A BPIC_2012_O Prepaid_Travel_Costs Hospital RTFM NoSampling 0.8169 0.851 0.7635 0.8713 0.8813 0.7754 LogRank 0.6724 0.9067 0.7762 0.7961 - - LogRank+ 0.8132 0.8752 0.8082 0.9079 0.8328 0.8155 Variant-Last 0.8012 0.8692 0.7799 0.8883 0.8434 0.7767 Variant-Frenctly 0.8012 0.8683 0.7751 0.8745 0.832 0.7767 Instances-Last 0.7997 0.8726 0.7729 0.8726 0.841 0.7762 LogRank++ 0.8053 0.9994 0.8435 0.9939 0.8450 0.8272
[0142] In the table, LogRank, LogRank+, Variant-Last, Variant-Frenctly, In-Last, and LogRank++ represent six different sampling methods. As shown in Table 3, the LogRank++ sampling method improves the prediction accuracy of the Road Traffic Fine Management Process data set, the Prepaid_Travel_Costs data set, the BPIC_2012_A data set, and the BPIC_2012_O data set. In particular, the accuracy of the Prepaid_Travel_Costs data set and the BPIC_2012_A data set increased most significantly, while the accuracy of the Helpdesk data set and the Hospital Billing data set decreased slightly.
[0143] To further explore the effectiveness and superiority of the above-mentioned business process next event prediction method based on log sampling in business process prediction tasks, further experiments were conducted according to 20% and 30% sampling rates, as follows:
[0144] Table 4 Prediction accuracy of next event under different sampling methods and different sampling rates
[0145]
[0146] At each sampling rate, the R-value of each sampling method in completing the prediction task is negatively correlated with the sampling rate. This is because the time spent in the sampling phase is much smaller than the time spent in the prediction phase in the entire prediction task, while the training process in the prediction phase takes a long time. The sampling operation is only performed on the training set. At a high sampling rate, the training set will retain more trajectories and events, which leads to increasing the sampling rate while also increasing T′. P Increased exponentially, indirectly increasing T ALL This reduces the ratio R. Figure 5 , Figure 6 , Figure 7 The results in the graph showing the ratio of the time spent training deep learning models on the Helpdesk, BPC_2012_A, BPC_2012_O, Prepaid_Travel_Costs, Hospital, and RTFM datasets at sampling rates of 10%, 20%, and 30% also show that the event prediction method based on log sampling has the highest R-value at all sampling rates. The experiment further demonstrates that this method effectively and significantly improves the model's prediction efficiency.
[0147] This demonstrates that the method of sampling event logs before using a deep learning network model to complete the next event prediction task is feasible. It shows that in the next event prediction task, simply relying on a large amount of data cannot enable the deep learning network model to learn the feature information in the logs better. On the contrary, it is easily interfered with by noise information. By retaining a certain number of important trajectories and activities, the combination of deep learning methods can complete the prediction task better.
[0148] Example 2
[0149] This embodiment discloses an event prediction system for a process instance based on log sampling, such as... Figure 8 As shown, it includes a data acquisition and preprocessing module, a data partitioning module, a log sampling module, a deep learning model training module, a prediction result output module, and an adjustment and optimization module.
[0150] The data acquisition and preprocessing module specifically performs the following operations:
[0151] Obtain initial data, i.e., raw event logs. After obtaining the raw event logs, preprocess them to remove irrelevant attributes and retain only events related to event prediction and their time attributes to obtain standard event logs for predicting the next event in the business process.
[0152] The data partitioning module specifically performs the following operations:
[0153] In the standard event log of predicting the next event of the process instance, a certain proportion of the training set, the validation set and the test set are set, the length and the number of the standard event log are obtained, the number of trajectories contained in the training set, the validation set and the test set are calculated, and the trajectories are randomly divided according to the number of trajectories, and the training set, the validation set and the test set divided by the proportion are saved in three documents respectively.
[0154] The log sampling module specifically performs the following operations:
[0155] The sampling rate S is set in advance through the size of the training set and the expected efficiency improvement, wherein the smaller the sampling rate is, the smaller the sampled data set obtained is;
[0156] The importance of each event in the trajectory and the importance of the direct following event relationship are calculated by the LogRank++ algorithm.
[0157] The importance of the event is obtained by calculating the number of trajectories containing the event a in the event log, and the formula of the importance of the event is:
[0158]
[0159] In the formula, a is an event, L is an event log, |L| is the number of trajectories contained in the event log, sig(a) is the importance of the event a, and σ i represents the i-th trajectory in the event log L.
[0160] The importance of the direct following event relationship is calculated by calculating the number of trajectories containing the direct following event relationship <a, b>, and the formula of the importance of the direct following event relationship is:
[0161]
[0162] In the formula, a and b are events, <a, b> is a direct following event relationship, and sig(a, b) is the importance of the direct following event relationship.
[0163] According to the importance of each event and the importance of the direct following event relationship obtained, the importance of each trajectory in the event log is obtained, and the formula for calculating the importance of the trajectory is as follows:
[0164]
[0165] In the formula, sig(σ) is the importance of the trajectory, and the larger the value of sig(σ) is, the more important the trajectory is.
[0166] All trajectories in the training set are sorted according to the importance of the trajectory from high to low, S trajectories in the training set are selected according to the set sampling rate S, and the sampled training set is obtained.
[0167] The deep learning model training module specifically performs the following operations:
[0168] The event log of the obtained post-sampling training set is subjected to trajectory prefix extraction and copying, and the trajectory prefix is input into the feature extraction stage of the deep learning network model for feature extraction to obtain the features and event information of the trajectory. The next event of the trajectory prefix is predicted, and the accuracy acc is calculated. The prediction result of the next event has four different types, namely, true positive (TP), false positive (FP), true negative (TN), and false negative (FN). In this paper, the accuracy (acc) is selected as the evaluation index of the algorithm, and the calculation method is as follows:
[0169]
[0170] By calculating the accuracy acc of the next event prediction result of the trajectory prefix in the validation set, the accuracy of the prediction result can be reflected. The larger the acc is, the more accurate the next event prediction result is.
[0171] The cross-entropy loss of the deep learning network model and the accuracy of the next event prediction of the trajectory prefix are calculated. Cross-validation is performed on the validation set to improve the prediction accuracy, and a trained and validated deep learning network model is obtained.
[0172] The evaluation process of the next event prediction method needs to evaluate not only the accuracy of the prediction, but also the time cost. To evaluate the prediction efficiency, the ratio R of the training and validation time after sampling, the event log sampling time, and the training and validation time before sampling is set as the evaluation index of the time performance. The time consumed for training and validation without sampling in the original data set is T P , the time consumed in the sampling stage is T S , the time consumed for training and validation in the data set after sampling is T′ P , and T ALL is the average total time consumed for each training, validation, and sampling. To reduce the error caused by model training, validation, and sampling, the average of 5 calculations is taken, and the calculation method is as follows:
[0173]
[0174] In the formula, j is the number of times of sampling and training, validation model; the calculation method of the evaluation time performance index R is as follows:
[0175]
[0176] The larger R is, the higher the prediction efficiency of the event log after sampling is.
[0177] The prediction result output module specifically performs the following operations:
[0178] The unsampled test set is input into the trained and verified deep learning network model, and the final effect of the model is tested. The accuracy acc in the test set is calculated to reflect the accuracy of the prediction result. The larger the acc is, the more accurate the prediction is.
[0179] The adjustment optimization module specifically performs the following operations:
[0180] According to the obtained prediction accuracy of the test set and the training, verification prediction accuracy, and the ratio of the sum of the sampling time and the event log sampling time to the training and verification time before sampling, the model is further adjusted. The batch_size and iteration parameters are adjusted to reduce the deep learning network model training time, and the sampling rate is adjusted to control the training set size. An optimal deep learning network model is obtained. The next event prediction task is input into the optimal deep learning network model, and an accurate prediction result can be obtained.
[0181] In summary, after using the above scheme, the application provides a new method and system for the next event prediction task of the business process. The prediction efficiency is improved while completing the next event prediction task, which has practical promotion value and is worth promoting.
[0182] The above embodiments are the preferred embodiments of the application, but the embodiments of the application are not limited by the above embodiments. Any changes, modifications, substitutions, combinations, simplifications made without departing from the spirit and principles of the application are equivalent replacement methods and are included in the protection scope of the application.
Claims
1. A process instance next event prediction method based on log sampling, characterized in that, The method comprises the following steps: 1) obtaining and preprocessing a real original event log, wherein all information of a business process is recorded, including business process events and event attributes, the preprocessing is for next event prediction requirements of the business process, event and time attributes are retained, and a standard event log is obtained; 2) dividing the standard event log obtained in step 1) into a training set, a validation set and a test set in proportion according to a track; 3) using the training set divided in step 2), using a LogRank++ algorithm to sample the event log according to a specific sampling rate, obtaining a sampled training set, and the specific steps are as follows: 3.1) setting a sampling rate S in advance according to the size of the training set obtained in step 2) and the expected efficiency improvement, wherein the smaller the sampling rate, the smaller the sampled data set obtained; 3.2) calculating the importance of each event in the track and the importance of the direct following event relationship through the LogRank++ algorithm; the importance of the event is obtained by calculating the number of tracks containing the event a, and the formula of the importance of the event is as follows: where a is an event, L is an event log, |L| is the number of traces contained in the event log, sig(a) is the significance of event a, σ i represents the i-th trace in the event log L; the importance of the direct following event relationship is calculated by calculating the number of tracks containing the direct following event relationship <a, b>, and the formula of the importance of the direct following event relationship is as follows: in the formula, a and b are events, <a, b> is a direct following event relationship, and sig(a, b) is the importance of the direct following event relationship; 3.3) obtaining the importance of each track in the event log according to the importance of each event and the importance of the direct following event relationship obtained in step 3.2), and the formula for calculating the importance of the track is as follows: in the formula, sig(σ) is the importance of the track, and the greater the value of sig(σ), the more important the track is; 3.4) according to the track importance calculated in step 3.3), all tracks in the training set are sorted in descending order of track importance, and the first S tracks in the training set are selected according to the sampling rate S set in step 3.1), and a sampled training set is obtained; 4) inputting the sampled training set obtained in step 3) and the validation set not sampled after step 2) into a deep learning network model for training and verification of next event prediction, obtaining a trained and verified deep learning network model, and a ratio of the sum of the training and verification time after sampling and the event log sampling time to the training and verification time before sampling; 5) inputting the test set not sampled after step 2) into the deep learning network model trained and verified in step 4) for testing, and obtaining the test accuracy of the next event prediction task; 6) adjusting the parameters of the trained and verified deep learning network model according to the test accuracy of the next event prediction task obtained in step 5), the ratio of the sum of the training and verification time after sampling and the event log sampling time to the training and verification time before sampling and the sampling rate set in step 3), thereby optimizing the model, obtaining an optimal deep learning network model, and inputting the next event prediction task into the optimal deep learning network model, so as to obtain an accurate prediction result.
2. The process instance next event prediction method based on log sampling according to claim 1, characterized in that, In step 1), initial data, i.e. original event logs, are acquired, and after the original event logs are acquired, preprocessing is performed to eliminate irrelevant attributes in the original event logs and only keep events and time attributes of events related to event prediction, thereby obtaining standard event logs for predicting next events of a business process; The events in the event prediction are the set of all events in the event log, called the event set ε. The execution of each event e is represented by e = (a1, a2, ..., a...). m )∈ε represents, where a m This is represented as the m-th property of the event.
3. The method of claim 2, wherein the method further comprises: In step 2), different training sets, validation sets and test sets are divided according to the standard event logs of next events of the prediction process instance obtained in step 1), and the specific steps are as follows: 2.1) In the standard event logs of next events of the prediction process instance, a specific proportion of training sets, validation sets and test sets is set; 2.2) According to the proportion set in step 2.1), the length of the track and the number of the standard event logs are acquired, the number of tracks contained in the training sets, validation sets and test sets is calculated, and the tracks are randomly divided according to the number of tracks; 2.3) The training sets, validation sets and test sets divided according to the proportion in step 2.2) are saved in three documents respectively; The track is an ordered sequence composed of n events, contains event and attribute information, and represents the complete execution of a business process, also known as a process instance.
4. The method of claim 3, wherein the method further comprises: In step 4), the sampled training set obtained in step 3) and the validation set divided in step 2) are input into the deep learning network model for training, and the specific steps are as follows: 4.1) The event logs of the sampled training set obtained in step 3) are extracted and copied for track prefix, and the track prefix is input into the feature extraction stage of the deep learning network model for feature extraction to obtain the features and event information of the track; 4.2) According to the feature information of the event logs of the sampled training set obtained in step 4.1), the next event of the track prefix is predicted, and the accuracy acc is calculated; wherein the prediction result of the next event has four different types, which are true positive TP, false positive FP, true negative TN and false negative FN, and the accuracy acc is selected as the evaluation index of the algorithm, and the calculation method is as follows: By calculating the accuracy acc of the prediction result of the next event of the track prefix in the validation set, the accuracy of the prediction result can be reflected, and the larger the acc is, the more accurate the prediction result of the next event is; 4.3) Calculate the cross-entropy loss of the deep learning network model and the prediction accuracy of the next event based on the trajectory prefix obtained in step 4.2). Perform cross-validation using a validation set to improve the prediction accuracy, thus obtaining a well-trained and validated deep learning network model. Here, the trajectory prefix represents the sequence of the first k ordered events of a trajectory, denoted as σ(k) = <e1,e2,...,e k ,...,e n >,k∈[1,n),e k Let K be the k-th event in the trajectory; the cross-entropy is a measure of the difference between the predicted probability distribution and the actual probability distribution of the next event, and it can represent the prediction effect. The smaller the cross-entropy value, the better the model effect. To evaluate the pros and cons of the next event prediction method of the process instance, not only the accuracy of the prediction needs to be evaluated, but also the time cost needs to be analyzed; to evaluate the prediction efficiency, the ratio R of the training and validation time after sampling and the training and validation time before sampling is set as the index of evaluating the time performance; the time cost of training and validation without sampling in the original data set is T P , the time cost in the sampling stage is T S , the time cost of training and validation in the data set after sampling is T' P , T ALL is the average total time cost of each training, validation and sampling, and the average of 5 calculations is taken to reduce the error caused by model training, validation and sampling, and the calculation method is as follows: In the formula, j is the number of times of sampling and training and validating the model; the calculation method of the time performance evaluation index R is: Wherein, the larger R represents the higher prediction efficiency of the event log after sampling.
5. The method of claim 4, wherein the method further comprises: In step 5), the divided test set without sampling obtained in step 2) is input into the deep learning network model trained and validated in step 4) to test the final effect of the model, and by calculating the accuracy acc in the test set, the accuracy of the prediction result can be reflected, and the larger the acc is, the more accurate the prediction is.
6. The method of claim 5, wherein the method further comprises: In step 6), the prediction accuracy of the test set obtained in step 5) and the prediction accuracy of the training and validation obtained in step 4) are used to further adjust the model, the training time of the deep learning network model is reduced by adjusting the batch_size and iteration parameters, the training set size is controlled by adjusting the sampling rate, and the optimal deep learning network model is obtained. The next event prediction task is input into the optimal deep learning network model, and accurate prediction results can be obtained; wherein the batch_size is the batch size of the data set during the training of the deep learning network model, which means that the training set takes batch_size training samples each time; the iteration is the number of iterations during training.
7. A log-based sampling process instance next event prediction system, comprising: The method comprises a data acquisition and preprocessing module, a data division module, a log sampling module, a deep learning model training module, a prediction result output module and an adjustment and optimization module. The data acquisition and preprocessing module is used for acquiring, analyzing and preprocessing event logs. The data division module is used for dividing the preprocessed event logs into training sets, validation sets and test sets according to a proportion; The log sampling module is used for sampling the training set according to a sampling rate, and specifically performs the following operations: The sampling rate S is set in advance according to the size of the training set and the expected efficiency improvement, wherein the smaller the sampling rate, the smaller the sampled data set; The importance of each event in the trajectory and the importance of the direct following event relationship are calculated by the LogRank++ algorithm. The importance of event a in the event log is calculated by counting the number of trajectories containing event a, and the formula for the importance of event a is: where a is an event, L is an event log, |L| is the number of traces contained in the event log, sig(a) is the significance of event a, σ i represents the i-th trace in the event log L; The importance of the direct following event relationship is calculated by counting the number of trajectories containing the direct following event relationship <a, b>, and the formula for the importance of the direct following event relationship is: Where a and b are events, <a, b> is a direct following event relationship, and sig(a, b) is the importance of the direct following event relationship. According to the importance of each event and the importance of the direct following event relationship, the importance of each trajectory in the event log is obtained, and the formula for calculating the importance of the trajectory is as follows: Where sig(σ) is the importance of the trajectory, and the larger the value of sig(σ), the more important the trajectory is. All trajectories in the training set are sorted according to the importance of the trajectory from high to low, and the first S trajectories of the training set are selected according to the set sampling rate S to obtain the sampled training set. The deep learning model training module is used to train a deep learning network model as a next event prediction model, and the validation set is used for validation to obtain a trained and validated deep learning network model and the ratio of the sum of the sampling time of the event log and the training and validation time after sampling to the training and validation time before sampling; The prediction result output module is used to test the next event prediction model result and record its accuracy. The adjustment optimization module is configured to further adjust the model according to test results, training and verification results, a sampling rate, and a ratio of a sum of training and verification times after sampling and event log sampling times to training and verification times before sampling.
8. The log-based sampling process instance next event prediction system of claim 7, wherein: The data acquisition and preprocessing module specifically performs the following operations: Obtain initial data, i.e., original event logs, and perform preprocessing after obtaining the original event logs to remove irrelevant attributes in the original event logs and only keep events and time attributes of events related to event prediction, thereby obtaining standard event logs for predicting next events in a business process; The data division module specifically performs the following operations: In the standard event logs for predicting next events in a process instance, set a specific proportion of training sets, verification sets, and test sets, obtain lengths of trajectories of the standard event logs and numbers of the trajectories, calculate numbers of trajectories included in the training sets, the verification sets, and the test sets, and randomly divide the trajectories according to the numbers of the trajectories in units of the trajectories, and save the training sets, the verification sets, and the test sets divided according to the proportion to three documents respectively.
9. The log-based sampling process instance next event prediction system of claim 7, wherein: The deep learning model training module specifically performs the following operations: Extract and copy the event logs of the obtained training sets after sampling for trajectory prefixes, input the trajectory prefixes into a feature extraction stage of a deep learning network model for feature extraction, obtain features of the trajectories and event information, predict next events of the trajectory prefixes, and calculate an accuracy acc; the prediction results of the next events have four different types, i.e., true positive TP, false positive FP, true negative TN, and false negative FN, and the accuracy acc is selected as an evaluation index of the algorithm, and the accuracy acc is calculated as follows: The accuracy acc of the prediction results of the next events of the trajectory prefixes in the verification sets can reflect accuracy of the prediction results, and the greater the acc, the more accurate the prediction results of the next events are; Calculate a cross-entropy loss of the deep learning network model and the accuracy of the prediction results of the next events of the trajectory prefixes, perform cross-validation through the verification sets to improve the prediction accuracy, and obtain a trained and verified deep learning network model; To evaluate the pros and cons of the next event prediction method of the process instance, not only the accuracy of the prediction needs to be evaluated, but also the time cost needs to be analyzed; to evaluate the prediction efficiency, the ratio R of the training and validation time after sampling and the training and validation time before sampling is set as the index of evaluating the time performance; the time cost of training and validation without sampling in the original data set is T P , the time cost of the sampling stage is T S , the time cost of training and validation in the data set after sampling is T' P , T ALL is the average total time cost of each training, validation and sampling, and the average of 5 calculations is taken to reduce the error caused by model training, validation and sampling, and the calculation method is as follows: In the formula, j is a number of times of sampling and training and verification of the model, and the evaluation time performance index R is calculated as follows: The greater the R, the higher the prediction efficiency of the event logs after sampling is; The prediction result output module specifically performs the following operations: Input the test sets without sampling to the trained and verified deep learning network model, test a final effect of the model, calculate the accuracy acc in the test sets, and reflect accuracy of the prediction results, and the greater the acc, the more accurate the prediction is; The adjustment optimization module specifically performs the following operations: According to the prediction accuracy of the obtained test set and the training and validation prediction accuracy, the ratio of the sum of the training and validation time after sampling and the event log sampling time to the training and validation time before sampling, the model is further adjusted, the batch_size and iteration parameters are adjusted to reduce the training time of the deep learning network model, the sampling rate is adjusted to control the size of the training set, and the optimal deep learning network model is obtained. Subsequently, the next event prediction task is input into the optimal deep learning network model, and an accurate prediction result can be obtained.