Process simulation method based on large language model and retrieval enhancement generation technology

By introducing large language models and retrieval enhancement generation technology, a RAG method adapted to process information is built, which solves the problems of insufficient correlation and poor flexibility in traditional process simulation, and realizes more accurate process simulation and prediction, supporting enterprise process management and optimization.

CN120337712APending Publication Date: 2025-07-18信华信(大连)软件服务股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510316592.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-18
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

Traditional process mining and simulation technologies lack relevance upstream and downstream of processing processes, lack flexibility and accuracy, cannot accurately restore flow charts, and cannot effectively predict business metrics such as customer satisfaction and resource utilization.

Method used

The large language model (LLM) and search-enhanced generation (RAG) technology are used to process retrieve and coding, and event prediction is carried out in combination with LLM, and RAG methods are constructed that are adapted to process information, and similar cases are retrieved using historical log data for simulation prediction.

Benefits of technology

More accurate process simulation is achieved, taking into account the overall structure of the process and multi-dimensional correlation, enhancing the flexibility of the model and the actual business proximity of the simulation results, and supporting process optimization and decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120337712A_ABST
    Figure CN120337712A_ABST
Patent Text Reader

Abstract

The invention discloses a process simulation method based on a large language model and a retrieval enhancement generation technology, which comprises the following steps of: S1, extracting and coding current case information, firstly obtaining all useful information of a current case before predicting a next event of the current case, and obtaining path information of an occurring event, s2, performing process retrieval to retrieve a plurality of similar log cases, performing alignment calculation on historical logs of a current case and a real case under the condition that an event occurs in the current case, and performing calculation to obtain an event code converted from a task name of each event, time consumption and other attribute information; selecting a plurality of first log cases with the highest alignment score; the invention relates to the technical field of process automation, and has the beneficial effects that a set of RAG algorithm framework for process data is created, and the retrieval method is combined with an alignment algorithm of traditional process mining and a modern vector retrieval algorithm adaptive to deep learning coding.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of process automation, and in particular to a process simulation method based on large language models and retrieval augmented generation technology. Background Art

[0002] In the current field of business process management and optimization, process mining and process simulation technologies play a crucial role. Business process simulation (referred to as process simulation for short) is used to analyze, design, and optimize enterprise processes. In practical applications, the acquisition of a process simulation model often requires analyzing relevant historical logs to mine real process information in order to build a process simulation model with practical reference significance. In the past, the process from historical logs to a process simulation model relied on rule-based process discovery algorithms. Such algorithms can directly construct a flowchart from event logs and use basic database rules and simple statistical information to determine the time-consuming distribution of each task in the process and the decision distribution at fork points. Although the process simulation model constructed by this method can reflect the basic structure and some operating characteristics of the process to a certain extent, its limitations are also very obvious.

[0003] First of all, traditional algorithms have significant deficiencies in dealing with the relevance between upstream and downstream processes. They often ignore the complex dependencies that may exist between tasks and how these relationships affect the efficiency and effectiveness of the overall process. Secondly, traditional methods rely too much on simple statistical distribution rules to predict task time-consuming and decision results, which leads to the lack of sufficient flexibility and accuracy of the model when facing specific cases, especially when the attributes of actual cases have a significant impact on time-consuming and decisions. This requires algorithms based on machine learning and artificial intelligence to obtain accurate associations. Moreover, existing process discovery technologies often cannot accurately restore a flowchart that can reflect the original process, which is also one of the important reasons for inaccurate simulation results. Finally, traditional process mining software has limited functions in prediction and simulation, usually only limited to simulating process time-consuming and decision paths, and cannot effectively predict and evaluate other important business indicators, such as customer satisfaction, resource utilization rate, or cost-effectiveness. With the rapid development of artificial intelligence technology, especially the rise of large language models (LLMs) and retrieval augmented generation (RAG) technology, it provides new possibilities for solving the above problems. LLMs, with their powerful language understanding and generation capabilities, can capture rich information contained in text data; while RAG technology further enhances the accuracy and robustness of the model in dealing with complex and open-ended problems by introducing external knowledge bases. Therefore, exploring how to apply these advanced technologies to the field of process mining and simulation to achieve more accurate and comprehensive process simulation and prediction has become a research hotspot. The present invention applies LLM and RAG technologies to process simulation, develops a RAG method adapted to process information, and then retrieves log cases similar to the current case to be predicted from a large amount of historical log data as reference cases for the prediction task. Then, the LLM directly performs simulation prediction based on the reference cases to solve many problems of traditional process simulation, such as inability to handle complex associations, inaccurate flowcharts, difficulty in integrating business logic, single function, and poor flexibility in use. Summary of the Invention

[0004] The usage mode of the present invention is as follows: After giving the business information of the process case being simulated, the single prediction algorithm is called cyclically to predict the occurrence of the next event or multiple consecutive events below. After updating the events that have occurred in the current case, if the current case has not ended, the prediction of the next event or multiple consecutive events below is carried out again. Such cyclic prediction is carried out until the case ends. The results of these predictions are random. Specifically, each single prediction uses the method described below and is divided into 5 main steps: Step S1: Extract and encode the current case information; Before predicting the next event of the current case, first obtain all useful information of the current case, including: 1) The path that the current case has passed; 2) The task name and time consumption of each event on the path that the current case has passed; 3) Other event-level attribute information (or conditional information) of each event on the path that the current case has passed; 4) The case-level attribute information of the current case; 5) The log-level attribute information of the current case; Organize the above 2), 3), 4), and 5) into an attribute information sequence. The event information of each event includes the task name, time consumption, and all levels of attribute information. Then, each event information is encoded. An external general encoding model can be used, such as C-MTEB, text-embedding-ada-002 of OpenAI, etc., or a customized encoding model trained by the user for the scenario of process mining. Then, each event of the current case can obtain an encoding in vector form, called event encoding. If no event has occurred in the current case, the event information sequence is empty, but 4) and 5) need to be exported as the current case information. Step S2: Process retrieval; If events have occurred in the current case, then the overall process retrieval has four major steps. The detailed decomposition steps are shown in the appendix Figure 2 , as follows in four major steps; S2-1: First, perform alignment calculation in the field of process mining between the "path already traversed by the current case" in step S1 and the historical logs of real cases. The user needs to have real historical log data, and this log data includes the case number to which each event belongs, the task name of each event, and other useful information of each event. The alignment calculation here has no difference in algorithm from the traditional alignment calculation, but the input variables are as follows: the current case remains unchanged, but for each log case, part or all of the path is extracted as a complete case, thus generating a new log. The extraction rule for log cases is as follows: for each log case, events are extracted sequentially from the first event until the number of extracted events exceeds a certain percentage (such as 20%, which can be adjusted according to the actual situation) of the total number of events in the current case or all events in the log case have been extracted. Such operations are performed on each case to generate a new log. The alignment calculation is a comparison calculation between the current case and each case in the new log. Each case in the new log obtains an alignment score (i.e., the case-level fitness in the process mining alignment algorithm). From the fitness scores of each log case obtained above, select the top L log cases with the highest scores. This L value can be adjusted according to the actual situation. S2-2: After initially selecting L log cases, further screening is required. For each selected log case in step S2-1 and the synchronous move (i.e., the event pairs that are consistent after alignment calculation) with the current case, a comparison of the event encodings of the event pairs needs to be further carried out. The event encoding of each event in the current case has been obtained in step S1. For each event in the selected log case that has a synchronous move with the current case, the event encoding can also be obtained in the same way as in step S1. A similarity value is obtained by comparing the cosine distance of the event encodings between each pair of synchronous move events. The average of the similarity values of all events of each selected log case is taken to obtain the encoding similarity of the log case. The above averaging calculation does not include events without similarity values. S2-3: Multiply the encoding similarity and the fitness score of each log case to obtain the total similarity of the log case. Then, select the top K (K < L) log cases with the largest total similarity according to the total similarities of all log cases. This integer value of K can be set according to the actual situation. S2-4: Restore each of the above-selected K log cases with the largest total similarity to the corresponding log case information when the unextracted part of the events in the source log is restored, as the final K log cases selected as the most similar to the current case. These selected log cases will be used as reference cases in the subsequent prompt construction. Note that if no events have occurred in the current case, then randomly select K log cases as reference cases. Step S3: Prompt construction; The prompt construction of the LLM is divided into the following steps: S3-1: According to the method of constructing prompts based on the RAG framework of LLM commonly used in the AI field, formulate a prompt template for predicting instructions, give a basic scenario description, explain the basic background conditions, basic prediction requirements, whether the current case is at the starting point, the position of the current case information in the text, the position of the reference case information in the text, the number of future events (n) that need to be continuously derived in this prediction, and the format of the output result. This prompt template needs to specify the task name, time consumption, and attribute information sequence of the next event to be predicted. Regarding the selection of n, it can be set by the user. The larger n is, the more it improves the relevance of the entire upstream and downstream processes. The smaller n is, the more it improves the diversity of the case occurrence process. S3-2: Represent all the information of the current case according to a fixed process information template, including the path and event information sequence specified in step S1, as the current case information, and place it in the corresponding position of the prompt. S3-3: Represent the selected K log cases that are most similar to the current case according to the above fixed process information template, including the path and event information sequence specified in step S1, and then add a user-defined case termination flag at the end of the path as the reference case information, and place it in the corresponding position of the prompt. S3-4: Attach any additional restrictive conditions and specific requirements for simulation prediction. Step S4: Obtain the prediction result by LLM inference; During the simulation process, use a fixed LLM for inference. After obtaining the prompt to be input, use this prompt to let the LLM do inference. The temperature of the model is set to T = 1 to obtain randomly diverse possible results. After the LLM exports the result, further extract the corresponding prediction information to obtain the task name, time consumption, and attribute information sequence of the n events that will occur in sequence in the future and convert them into a fixed format. Step S5: Update the status of the current case; The current case is updated by the prediction result obtained in the previous step, adding new events. If it is still affected by external inputs, then update the status according to the external inputs. After adding new events, if the user-defined termination flag does not appear in the prediction result, it is not the end point of the case, and then continue steps 1-5 to predict the next event; if the user-defined termination flag appears in the prediction result, it is the end point of the case, then the simulation of this case ends. After multiple cycles of the above steps, the simulation of a complete case can be completed, unless infinite rework is encountered or the case termination flag never appears. To ensure that there is no infinite loop caused by infinite rework, the upper limit of the number of repetitions of a single task can be set artificially. To prevent the case termination flag from appearing, the upper limit of the total number of events in the case can be specified. The method disclosed in the present invention has many advantages. It not only does not require a flowchart and gets rid of the traditional process discovery method with low accuracy, but also considers the overall structure of the process and the relevance of the preceding and following events in multi-dimensional information during the simulation, takes into account the long-distance event correlation, utilizes the business knowledge obtained by the LLM model, and can significantly improve the prediction accuracy. When users make direct LLM-based predictions, if there are specific restrictions or requirements, they can use prompt engineering to adjust. Especially when the current process of the enterprise has changed compared with the historical process, this feature not only enhances the flexibility of the model but also makes the simulation results closer to the actual business needs, providing strong support for process optimization. In summary, the present invention constructs a new process simulation method by introducing LLM technology and creating a RAG method for process simulation, achieving an important breakthrough in the fields of process mining and process simulation, and providing a more powerful and flexible tool for enterprise process management, optimization, and decision support. Brief Description of the Drawings

[0005] Figure 1 is a flowchart of the process simulation method described in the present invention. The rectangular boxes in the figure are the data referenced or generated in the calculation, and the rounded rectangular boxes are the core algorithm modules involved in the present invention; Figure 2 is a schematic diagram of the detailed step decomposition required to implement process retrieval in the present invention, for the case where it is not the initial event. Detailed Embodiments

[0006] Taking a procurement process as an example, if one wants to perform process simulation on the procurement process of an enterprise and simulate multiple imaginary random cases to test the procurement success rate, procurement expenditure, and time consumption, it is necessary to use the present invention to simulate multiple different procurement cases. The way the present invention conducts a complete case simulation is as follows: First, the user can prepare the log data of historical real cases, which can be in the form of an Excel spreadsheet, SQL, or any other data source. After giving the business information of the procurement case to be simulated, the simulation of each procurement case starts from the "start case", that is, the initialization state where no events have occurred yet. The prediction method for the occurrence of each subsequent event is as follows: Step S1: Extract and encode the current case information; Before predicting the next event of the current case, it is necessary to first obtain all useful information of the current case, including: 1) The path that the current case has gone through, such as learning requirements -> asking the manufacturer -> obtaining the price -> creating a PO, 2) The task name and time consumption of each event on the path that the current case has gone through, 3) Other event-level attribute information (also known as attribute information) of each event on the path that the current case has gone through, such as business handlers, product pricing, product models, estimated shipping time, etc., 4) The case-level attribute information of the current case, such as the manufacturer, target product type, 5) The log-level attribute information of the current case, such as the department to which the log belongs, Organize the above 2), 3), 4), and 5) into an attribute information sequence. The event information of each event includes the task name, time consumption, and all levels of attribute information. Then, encode each event information. You can use an external general encoding model, such as C-MTEB, text-embedding-ada-002 of OpenAI, etc., or a customized encoding model trained by the user for the scenario of process mining. Then, each event of the current case can obtain an encoding in vector form, called event encoding. If there are no events in the current case, the attribute information sequence is empty, but 4) and 5) need to be exported as the current case information. Step S2: Process retrieval; If there have been events in the current case, then there are four major steps in the overall process retrieval. The detailed decomposed steps are shown in the appendix Figure 2 , as follows in four major steps; S2-1: First, perform an alignment calculation in the field of process mining on the "path that the current case has gone through" in step S1 and the historical logs of real cases. This alignment calculation has no difference in algorithm from traditional alignment calculations, but the input variables are as follows: The current case remains unchanged, but each log case extracts part of the path or the entire path as a complete case, thereby generating a new log. For example, if the current case being simulated has gone through learning requirements -> asking the manufacturer -> obtaining the price -> creating a PO, a total of 4 events, then the first 5 events can be intercepted for each log case. After performing such operations on each case, a new log is generated. The alignment calculation is performed by comparing the current case with each case in the new log. Each case in the new log obtains an alignment score (i.e., the case-level fitness in the process mining alignment algorithm). Based on the fitness scores of each log case obtained above, the top L log cases with the highest scores are selected. This value of L can be adjusted according to the actual situation. Here, a very large value L = 100 can be used. S2-2: After initially selecting L log cases, further screening is required. For each selected log case in step S2-1, the synchronous moves (i.e., event pairs that are consistent after alignment calculation) with the current case need to be further compared in terms of the event encoding of the event pairs. The event encoding of each event in the current case has been obtained in step S1. For each event in the selected log case that has a synchronous move with the current case, the event encoding can also be obtained in the same way as in step S1. The cosine distance between the event encodings of each pair of synchronous move events is calculated to obtain a similarity value. The average of the similarity values for all events of each selected log case is taken to obtain the encoding similarity of the log case. The above averaging calculation does not include events without similarity values. S2-3: Multiply the encoding similarity of each log case by the fitness score to obtain the total similarity of the log case. Then, based on the total similarities of all log cases, the top K (K < L) log cases with the largest total similarities are selected. This integer value of K can be set according to the actual situation. If L = 100, then K can be set to K = 10. S2-4: Each of the above-selected K log cases with the largest total similarities is restored to the corresponding log case information when the unextracted part of the events in the source log was present for that log case, as the final selected K log cases that are most similar to the current case. These selected log cases will be used as reference cases in the subsequent prompt construction. Note that if no events have occurred in the current case yet, then K log cases are randomly selected as reference cases. Step S3: Prompt construction; The construction of the LLM prompt is divided into the following steps: S3-1: According to the method of formulating prompt words for building the RAG framework based on LLM commonly used in the AI field, formulate a prompt word template for predicting instructions, give a basic scenario description, explain the basic background conditions, basic prediction requirements, whether the current case is at the starting point, the position of the current case information in the text, the position of the reference case information in the text, the number of future events (n) that need to be continuously derived in this prediction, and the format of the output result. This prompt word template needs to specify the task name, time consumption, and event information sequence of the next event to be predicted. For example, a simple prompt word template is: "Please predict the next {n} possible events of the current case according to the event occurrence pattern of the reference case, and the prediction output result should be as follows: 'Task name: xx, Time consumption: xx, {Event-level attribute information 1}: xx, {Event-level attribute information 2}: xx,...'. It is not limited to the most likely to occur. The reference cases are: {Reference case 1}, {Reference case 2}... The current case is: {Current case}, S3-2: Represent all the information of the current case according to a fixed process information template, including the path and event information sequence specified in step S1, and add a case termination flag, such as "[[Case termination]]", at the end of the path. As the current case information, place it in the corresponding position of the prompt word. This process information template can be in the format of nested dictionaries in a list in Python programming, S3-3: Represent the selected K log cases that are most similar to the current case according to the fixed process information template in S3-2, including the path and event information sequence specified in step S1, as the reference case information, and place it in the corresponding position of the prompt word, S3-4: Add any additional restrictive conditions and specific requirements for simulation prediction, such as: "In the simulation, avoid approving the purchase of products with too high bids because the current company's finances are tight", Step S4: Obtain the prediction result through LLM inference; During the simulation process, use a fixed LLM for inference. You can choose a general LLM model, or train or fine-tune an LLM that can understand process information by yourself. After obtaining the prompt word to be input, use this prompt word to let the LLM do inference. The temperature of the model is set to T = 1 to obtain random and diverse possible results. After the LLM exports the results, further extract the corresponding prediction information to obtain the task name, time consumption, and event information sequence of the n events that will occur in sequence in the future and convert them into a fixed format. An example of the export of multiple events: For example, in the case where "Learn requirements -> Ask the manufacturer -> Get the price -> Establish a PO" and their respective time consumptions and various-level attribute information have already occurred, if n = 2, then the events that will occur may be "Approved by the leader -> Send a purchase request to the manufacturer", Step S5: Update the status of the current case; The current case is updated with the prediction result obtained in step S4, and new events are added. For example, it is updated from the original "Learn requirements -> Ask the manufacturer -> Get the price -> Create a PO" to "Learn requirements -> Ask the manufacturer -> Get the price -> Create a PO -> Approval by the leader -> Send a purchase request to the manufacturer". If it is still affected by external inputs, the status is updated according to the external inputs. After adding new events, if it is not the end point of the case (the case end flag is not encountered), steps 1 - 5 are continued to predict the next event or multiple following events; if it is the end point of the case (the case end flag is encountered), the simulation of this case ends. After multiple cycles of the above steps, the simulation of the current case can be completed, unless infinite rework occurs or the case termination flag never appears. To ensure that there is no infinite loop caused by infinite rework, the upper limit of the number of repetitions of a single task can be set artificially. To prevent the case termination flag from appearing, the upper limit of the total number of events in the case can be specified.

Claims

1. A process simulation method based on large language models and retrieval-augmented generation technology, characterized in that Including the following steps: Step S1. Extract and encode the current case information: Before predicting the next event of the current case, first obtain all useful information of the current case, obtain the path information of the events that have occurred, and then obtain an event encoding converted from each event task name, duration, and other attribute information; Step S2. Process retrieval: To retrieve multiple similar log cases. When events have occurred in the current case, first align and calculate the current case with the historical logs of the real cases, and select the top several log cases with the highest alignment scores; then obtain the event encoding for each event that is the same between the selected log cases and the current case using the encoding model in Step S1; then further screen based on the similarity of the corresponding event encodings, and further select the top several log cases with the highest overall similarity as reference cases from the already selected log cases; if no events have occurred in the current case, randomly select several log cases as reference cases; Step S3. Prompt construction: According to the prompt template of the prediction instruction, combine the current case information and the reference case information to construct a prompt for LLM inference; Step S4. Obtain the prediction result by LLM inference: Use a fixed LLM model to perform inference according to the constructed prompt to obtain the task name, duration, and sequence of event attribute information of one or more events that will occur successively in the future; Step S5. Update the status of the current case: Update the current case according to the prediction result. If the case end point is not reached, repeat Steps S1 to S5 to predict the next event until the case ends.

2. The business process simulation algorithm according to claim 1, characterized in that In Step S1, it is necessary to extract the process path that the current case has passed, and at the same time encode the relevant information of each occurred event. The relevant information of the event includes the task name, duration, and other attribute information. The encoding is obtained through an external general natural language encoding model or a customized natural language encoding model trained for the process mining scenario; In Step S2, selecting the top several log cases with the highest alignment scores is based on the fitness scores obtained from the alignment; the further screening is based on the similarity values obtained from the cosine distance comparison of the encodings of each corresponding event between the current case and the initially selected log cases.

3. The business process simulation algorithm according to claim 1, wherein In Step S3, the prompt template includes basic scenario descriptions, background conditions, prediction requirements, the location of the current case information, the location of the reference case information, the number of future events that need to be continuously derived, and the output result format. A user-defined case termination flag should also be added at the end of the path of each reference case information.

4. The business process simulation algorithm according to claim 1, wherein In Step S4, the prediction of the future events of the current case is directly predicted by the LLM model through the information of the reference cases and the current case. The temperature of the LLM model is set to T = 1 to obtain random and diverse possible results. The prediction result of the LLM includes the task name, duration, and sequence of attribute information of one or more events that will occur successively in the future.

5. The business process simulation algorithm according to claim 1, wherein In the step S5, the status of the current case is updated according to the result newly obtained from step S5, and when it has not reached the completion of the current case, it re-enters step S1, and steps S1 - S5 are cycled in this way until the current case ends. The basis for judging the end is that a user-defined termination flag appears in the prediction result.

6. The business process simulation algorithm according to claim 1, wherein In the step S2, the alignment calculation here has no algorithmic difference from the alignment calculation for consistency checking in the traditional process mining field, but the input variables are as follows: the current case remains unchanged, but for each log case, a certain length of the front part of the path or the entire path is intercepted as a complete case, so as to be comparable with the path size of the current case, thereby generating a new log.