A process creation method, device and equipment

Through the three-level caching and the second-level caching mechanism, the process instance and node instance are created in parallel, which solves the problem of low performance caused by serial creation of the process engine, and shortens the process instance creation time and timely release of thread resources.

CN113946418BActive Publication Date: 2024-11-19NEUSOFT CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111155385.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2024-11-19
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

Existing process engines use serial creation when creating process instances, node instances and work item instances, resulting in long-term use of thread resources and poor performance.

Method used

Adopt the third-level cache and second-level cache mechanism to create and cache process instances and node instances first. If the creation is not successful, it will be placed in the second-level cache. If necessary during the creation process, it will be called from the cache; create sub-instructions in parallel creation process and allocate Multiple threads to improve resource release speed.

Benefits of technology

It shortens the time for creating process instances, improves the performance of the process engine, timely releases thread resources, and solves the problem of low performance under serial creation method.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113946418B_ABST
    Figure CN113946418B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a process creation method, device and equipment, which creates a first instance according to a process creation instruction. The first instance is a process instance or a node instance, and correspondingly, the second instance is a node instance or a work item instance. The first instance that is successfully created is added to the third-level cache, and the first instance that is not successfully created is added to the second-level cache. If the first instance is needed when the second instance is created, the first instance is called from the third-level cache or the second-level cache. If the second instance needs to be called during the creation of the first instance, and the second instance is not stored in the second-level cache and the third-level cache, the second instance is created. The second instance that is successfully created is added to the third-level cache, and the second instance that is not successfully created is added to the second-level cache. If the second instance is called when the first instance is created, the second instance is called from the third-level cache or the second-level cache. Based on this, the first instance and the second instance can be created in parallel, shortening the creation time of the entire process instance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a process creation method, device and equipment. Background Art

[0002] The process engine is used to create and drive instances to flow according to the fixed process set by the user. Instances include process instances, node instances, and work item instances.

[0003] Usually, after receiving a process creation instruction, the process engine will allocate a thread from the thread pool for the creation of the process, and use this thread to first create all instances involved in the process.

[0004] During the instance creation process, since the node instance is created based on the process instance, and the work item instance is created based on the node instance, currently the process instance, node instance, and work item instance are created in sequence. This creation method is a serial creation method, which can only be executed sequentially in a single thread. The serial creation method takes a long time, resulting in thread resources not being released for a long time and poor process engine performance. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a process creation method, apparatus and device, which can shorten the creation time of the entire process, release thread resources as soon as possible, and improve the performance of the process engine.

[0006] To solve the above problems, the technical solutions provided in the embodiments of the present application are as follows:

[0007] A process creation method, the method comprising:

[0008] According to the process creation instruction, execute the creation of the first instance;

[0009] If the first instance is created successfully, the first instance is added to the third-level cache; if the first instance is not created successfully, the first instance is added to the second-level cache, so that if the first instance is called during the creation of the second instance, the first instance is called from the third-level cache or the second-level cache;

[0010] If the second instance is called during the creation of the first instance, and the second instance does not exist in the second-level cache and the third-level cache, create the second instance;

[0011] If the second instance is created successfully, the second instance is added to the third-level cache; if the second instance is not created successfully, the second instance is added to the second-level cache, so that if the second instance is called during the creation of the first instance, the second instance is called from the third-level cache or the second-level cache;

[0012] The first instance is a process instance and the second instance is a node instance, or the first instance is a node instance and the second instance is a work item instance.

[0013] In a possible implementation, the method further includes:

[0014] After the second instance is added to the L2 cache or L3 cache, if the first instance is created successfully, the first instance is deleted from the L2 cache and the first instance is added to the L3 cache.

[0015] In a possible implementation, if the first instance is created successfully, adding the first instance to the third-level cache, and if the first instance is not created successfully, adding the first instance to the second-level cache, includes:

[0016] If the first instance does not call the second instance, or the second instances called during the creation of the first instance are cached in the second-level cache or the third-level cache, after the first instance is successfully created, the first instance is added to the third-level cache;

[0017] If the second instance called during the creation of the first instance is not cached in the second-level cache and the third-level cache, the first instance is added to the second-level cache.

[0018] In a possible implementation, if the second instance is created successfully, adding the second instance to the third-level cache, and if the second instance is not created successfully, adding the second instance to the second-level cache, includes:

[0019] If the second instance does not call the first instance, or the first instances called during the creation of the second instance are cached in the second-level cache or the third-level cache, after the second instance is successfully created, the second instance is added to the third-level cache;

[0020] If the first instance called during the creation of the second instance is not cached in the second-level cache and the third-level cache, the second instance is added to the second-level cache.

[0021] In a possible implementation, if the second instance is called during the creation of the first instance, and the second instance does not exist in the second-level cache and the third-level cache, executing the creation of the second instance includes:

[0022] If the second instance is called during the creation of the first instance, and the second instance does not exist in the second-level cache and the third-level cache, the second instance is created by triggering the instance object creation program in the first-level cache.

[0023] In a possible implementation, the method further includes:

[0024] Dividing the process creation instruction into a plurality of process creation sub-instructions, each of the process creation sub-instructions corresponds to executing and creating at least one first instance;

[0025] Start multiple threads, each of which executes instructions according to the process creation, creates a first instance and subsequent steps, wherein the instructions according to the process creation, creates the first instance, including: according to the process creation sub-instruction, creates at least one first instance.

[0026] In a possible implementation, the method further includes:

[0027] When the thread is executed, the thread is released.

[0028] A process creation device, the device comprising:

[0029] A first execution unit, configured to execute creation of a first instance according to a process creation instruction;

[0030] a first adding unit, configured to add the first instance to a level-3 cache if the first instance is successfully created, and to add the first instance to a level-2 cache if the first instance is not successfully created, so that if the first instance is called during the creation of a second instance, the first instance is called from the level-3 cache or the level-2 cache;

[0031] A second execution unit, configured to execute creation of the second instance if the second instance is called during creation of the first instance and the second instance does not exist in the second-level cache and the third-level cache;

[0032] a second adding unit, configured to add the second instance to the L3 cache if the second instance is created successfully, and to add the second instance to the L2 cache if the second instance is not created successfully, so that if the second instance is called during the creation of the first instance, the second instance is called from the L3 cache or the L2 cache;

[0033] The first instance is a process instance and the second instance is a node instance, or the first instance is a node instance and the second instance is a work item instance.

[0034] A process creation device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the process creation method as described above is implemented.

[0035] A computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the process creation method as described above.

[0036] It can be seen that the embodiments of the present application have the following beneficial effects:

[0037] The embodiment of the present application provides a process creation method, device and equipment, which executes the creation of a first instance according to a process creation instruction. Wherein, the first instance is a process instance or a node instance. When the first instance is a process instance, the second instance is a node instance. When the first instance is a node instance, the second instance is a work item instance. When the first instance is successfully created, the first instance is added to the third-level cache, and when the first instance is not successfully created, the first instance is added to the second-level cache. Based on this, if the first instance is needed when the second instance is created, the first instance can be directly called from the third-level cache or the second-level cache. If the second instance needs to be called during the creation of the first instance, and the second instance is not stored in the second-level cache and the third-level cache, the second instance is directly created. If the second instance is successfully created, the second instance is added to the third-level cache, and when the second instance is not successfully created, the second instance is added to the second-level cache. Based on this, if the second instance is called when the first instance is created, the second instance can be directly called from the third-level cache or the second-level cache.

[0038] Based on the method provided in the embodiment of the present application, it is not necessary to create the second instance after the first instance is created. If the first instance is not created, the second instance that needs to call the first instance can also obtain the first instance from the second cache to complete its own creation, and the successfully created second instance is added to the third cache. If the first instance needs to call the second instance to complete its creation, it can directly call the second instance from the third cache to complete its own creation. Compared with the method of creating instances serially, creating the first instance and the second instance in parallel can shorten the creation time of the entire process instance, release thread resources as soon as possible, and improve the performance of the process engine. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of an existing process engine creation instance provided in an embodiment of the present application;

[0040] Figure 2 A schematic diagram of a scenario example provided in an embodiment of the present application;

[0041] Figure 3 A flowchart of a process creation method provided in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of creating an instance according to a process creation sub-instruction provided in an embodiment of the present application;

[0043] Figure 5 A schematic diagram of another scenario example provided for an embodiment of the present application;

[0044] Figure 6 A schematic diagram of the structure of another process creation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0046] To facilitate understanding of the technical solution provided by this application, the background technology involved in this application will be described below.

[0047] The process engine is used to create and drive instances to flow according to the fixed process set by the user. Among them, instances include process instances, node instances and work item instances. For example, if the process is an approval process. The entire approval process is a process instance, specifically the supervisor first approves, followed by the finance department, and finally the manager. The supervisor, finance and manager are nodes, and the supervisor approval, finance approval and manager approval are all node instances. In each node instance, a work item instance will be generated. For example, the supervisor's approval will require the supervisor to sign and stamp. Among them, the signature and stamp are two work item instances under the supervisor's approval.

[0048] Usually, after receiving a process creation instruction, the process engine will allocate a thread from the thread pool to the process, and use this thread to first create all instances involved in the process.

[0049] During the instance creation process, since the node instance is created based on the process instance, the work item instance is created based on the node instance. Based on this, the process instance, node instance and work item instance are currently created in sequence. Figure 1 , Figure 1 The following is a schematic diagram of an existing process engine creation instance provided in an embodiment of the present application. Figure 1As shown, after the process engine receives a process instruction, it directly applies for thread resources (i.e., threads) from the process pool. If there are idle threads, the thread pool allocates thread resources for the process creation instruction. In the process of creating each instance, there is a mutual calling relationship between the process instance and the node instance, and there is a mutual calling relationship between the node instance and the work item instance. Therefore, the creation of a node instance requires the creation of the work item instance called by the node instance, and the creation of a process instance requires the creation of the node instance called by the process instance. Therefore, after allocating thread resources, it is necessary to create work item instances, node instances, and process instances in series in a specific order. When all instances are created, the thread resources are released.

[0050] visible, Figure 1 The process creation (i.e., process instance creation) shown is a serial creation method, which can only be executed sequentially in a single thread. Generally, the serial creation method takes a long time, resulting in thread resources not being released for a long time and low process engine performance.

[0051] Based on this, the present application embodiment provides a process creation method, device and equipment. In order to facilitate understanding of the process creation method provided by the present application embodiment, the following is combined with Figure 2 See the example scenario shown in the figure. Figure 2 , which is a schematic diagram of the framework of an exemplary application scenario provided by an embodiment of the present application. The method can be applied to a process engine.

[0052] The process engine executes and creates a first instance according to the process creation instruction. The first instance is a process instance or a node instance.

[0053] If the first instance is created successfully, the process engine adds the first instance to the third-level cache. If the first instance is not created successfully, the process engine adds the first instance to the second-level cache. When the second instance needs to call the first instance during the creation process, the process engine can call the first instance from the third-level cache or the second-level cache. When the first instance is a process instance, the second instance is a node instance, and when the first instance is a node instance, the second instance is a work item instance.

[0054] If the second instance is called during the creation of the first instance, and the second instance does not exist in the second-level cache and the third-level cache, the process engine directly creates the second instance.

[0055] If the second instance is created successfully, the process engine adds the second instance to the third-level cache. If the second instance is not created successfully, the process engine adds the second instance to the second-level cache. When the first instance needs to call the second instance during the creation process, the process engine can call the second instance from the third-level cache or the second-level cache.

[0056] Among them, the third-level cache can save successfully created instances, and the second-level cache can save unsuccessfully created instances. Instances that have not been successfully created are saved in the second-level cache in advance, so that other instances that need to call these instances can obtain these instances in advance during the creation process.

[0057] Those skilled in the art will understand that Figure 2 The framework diagram shown is only an example in which the embodiments of the present application can be implemented. The scope of application of the embodiments of the present application is not limited by any aspect of the framework.

[0058] Based on the above description, the process creation method provided by this application will be described in detail with reference to the accompanying drawings.

[0059] See also Figure 3 , which is a flowchart of a process creation method provided in an embodiment of the present application, such as Figure 3 As shown, the method may include S301-S304:

[0060] S301: Create a first instance according to a process creation instruction.

[0061] The first instance may be a process instance or a node instance. When the first instance is a process instance, the second instance is a node instance. When the first instance is a node instance, the second instance is a work item instance. It is understandable that S301-S304 are applicable to creating a process instance and a node instance, and are also applicable to creating a node instance and a work item instance.

[0062] For example, if the process is an approval process, the specific process instance is that the supervisor first approves, followed by the finance department, and finally the manager. Among them, the supervisor, finance department, and manager are nodes, and the supervisor approval, finance approval, and manager approval are all node instances. In each node instance, a work item instance is generated. For example, the supervisor approval includes two work item instances: signature and stamp.

[0063] In practical applications, when the first instance is a process instance, the process creation instruction is specifically a process instance creation instruction. When the first instance is a node instance, the process creation instruction is specifically a node instance creation instruction.

[0064] S302: If the first instance is created successfully, the first instance is added to the third-level cache. If the first instance is not created successfully, the first instance is added to the second-level cache, so that if the first instance is called during the creation of the second instance, the first instance is called from the third-level cache or the second-level cache.

[0065] It should be noted that the cache provided in the embodiment of the present application includes a first-level cache, a second-level cache, and a third-level cache. Among them, the first-level cache stores an instance object creation program for creating instances. The second-level cache is used to store instances that have not been created successfully. The third-level cache is used to store instances that have been created successfully. In actual applications, if an instance needs to be called, the required instance can be first searched from the third-level cache. If it exists, call it directly. If it does not exist, it means that the instance to be called has not been created successfully or has not been created. At this time, search from the second-level cache. If it exists, call it directly. If it does not exist, it means that the instance to be called has not been created. Then use the instance object creation program in the first-level cache to directly create the instance to be called.

[0066] By setting the first-level cache, second-level cache, and third-level cache, the successfully created instances can be placed in the third cache, and the unsuccessfully created instances can be placed in the second-level cache. The instance can be created using the instance object creation program in the first-level cache. Based on the cache settings, during the instance creation process, instances can be created by parallel threads. During the parallel instance creation process, the instances that need to be called can be directly obtained from the cache. This can shorten the creation time of the entire process instance, release thread resources as soon as possible, and improve the performance of the process engine.

[0067] Based on this, when creating the first instance, if the first instance is created successfully, the first instance is added to the third-level cache. If the first instance is not created successfully, the first instance is added to the second-level cache, so that when the second instance calls the first instance during the creation process, the first instance can be directly called from the third-level cache or the second-level cache.

[0068] In one possible implementation, an embodiment of the present application provides a specific implementation method of adding the first instance to the third-level cache if the first instance is successfully created, and adding the first instance to the second-level cache if the first instance is not successfully created. Please see A1-A2 below for details.

[0069] S303: If the second instance is called during the creation of the first instance, and the second instance does not exist in the L2 cache and the L3 cache, create the second instance.

[0070] If the first instance needs to call the second instance during the creation process, and the second instance does not exist in the second-level cache and the third-level cache, it means that the second instance has not been created. At this time, the second instance needs to be created.

[0071] In a possible implementation, the embodiment of the present application provides a specific implementation method for creating a second instance if a second instance is called during the creation of a first instance and the second instance does not exist in the second-level cache and the third-level cache, including:

[0072] If the second instance is called during the creation of the first instance, and the second instance does not exist in the second-level cache and the third-level cache, the second instance is created by triggering the instance object creation program in the first-level cache.

[0073] That is, the second instance is created by the instance object creation program in the first-level cache. After the second instance is created, the first instance calls the second instance to complete the creation of the first instance.

[0074] S304: If the second instance is created successfully, the second instance is added to the third-level cache. If the second instance is not created successfully, the second instance is added to the second-level cache, so that if the second instance is called during the creation of the first instance, the second instance is called from the third-level cache or the second-level cache.

[0075] Based on the above description of the first-level cache, the second-level cache, and the third-level cache, when creating the second instance, if the second instance is created successfully, the second instance is added to the third-level cache. If the second instance is not created successfully, the second instance is added to the second-level cache, so that when the first instance calls the second instance during the creation process, the second instance can be directly called from the third-level cache or the second-level cache.

[0076] In one possible implementation, an embodiment of the present application provides a specific implementation method in which if the second instance is successfully created in S304, the second instance is added to the third-level cache, and if the second instance is not successfully created, the second instance is added to the second-level cache. Please see B1-B2 below for details.

[0077] It should be noted that if the first instance needs to call the second instance to complete its own creation, and because the second instance is not in the second-level cache or the third-level cache, the first instance will fail to be created and will be added to the second cache. At this time, the second instance is created and added to the second-level cache (when the second instance is not successfully created) or the third-level cache (when the second instance is successfully created) for the first instance to call. When the first instance calls the second instance and is successfully created, the first instance is deleted from the second-level cache and added to the third-level cache.

[0078] The embodiment of the present application provides a process creation method, which executes the creation of a first instance according to the process creation instruction. Wherein, the first instance is a process instance or a node instance. When the first instance is a process instance, the second instance is a node instance. When the first instance is a node instance, the second instance is a work item instance. When the first instance is successfully created, the first instance is added to the three-level cache, and when the first instance is not successfully created, the first instance is added to the second-level cache. Based on this, if the first instance is needed when the second instance is created, the first instance can be directly called from the three-level cache or the second-level cache. If the second instance needs to be called during the creation of the first instance, and the second instance is not stored in the second-level cache and the third-level cache, the second instance is directly created. If the second instance is successfully created, the second instance is added to the three-level cache, and when the second instance is not successfully created, the second instance is added to the second-level cache. Based on this, if the second instance is called when the first instance is created, the second instance can be directly called from the three-level cache or the second-level cache. Based on the method provided by the embodiment of the present application, the second instance does not need to be created after the first instance is created. If the first instance is not created, the second instance that needs to call the first instance can also obtain the first instance from the second cache to complete its own creation, and the successfully created second instance is added to the third cache. If the first instance needs to call the second instance to complete its creation, it can directly call the second instance from the third cache to complete its own creation. Compared with the method of creating instances serially, creating the first instance and the second instance in parallel can shorten the creation time of the entire process instance, release thread resources as soon as possible, and improve the performance of the process engine.

[0079] In a possible implementation, the embodiment of the present application provides a specific implementation of adding the first instance to the third-level cache if the first instance is successfully created in S302, and adding the first instance to the second-level cache if the first instance is not successfully created, including:

[0080] A1: If the first instance does not call the second instance, or the second instance called during the creation of the first instance is cached in the L2 cache or L3 cache, after the first instance is successfully created, the first instance is added to the L3 cache.

[0081] During the process of creating the first instance, the first instance may not call the second instance. In this case, if the first instance is directly created successfully, the successfully created first instance will be added to the third-level cache, so that when the second instance needs to call the first instance during the creation process, it can directly call the successfully created first instance from the third-level cache.

[0082] During the process of creating the first instance, if the first instance needs to call the second instance, there is at least one second instance, and the second instances are cached in the second-level cache or the third-level cache, the second instance can be directly called to successfully create the first instance. The successfully created first instance is added to the third-level cache, so that when the second instance needs to call the first instance during the creation process, the successfully created first instance can be directly called from the third-level cache.

[0083] A2: If the second instance called during the creation of the first instance is not cached in the L2 cache and the L3 cache, the first instance is added to the L2 cache.

[0084] During the process of creating the first instance, if the first instance needs to call the second instance, if the second instance is not cached in the second-level cache and the third-level cache, the first instance will fail to be created.

[0085] At this time, the first instance is added to the secondary cache so that when the second instance needs to call the first instance during the creation process, the first instance can be directly called from the secondary cache. It should be noted that although the first instance in the secondary cache is not created successfully, calling the first instance that is not created successfully can also complete the creation of the second instance.

[0086] Based on the contents of A1-A2, it can be known that no matter whether the first instance is created successfully or not, it can be placed in the cache so that the second instance that calls the first instance can call it through the cache. This makes it unnecessary to create the second instance after the first instance is created, which can improve the efficiency of creating instances.

[0087] In a possible implementation, the embodiment of the present application provides a specific implementation of adding the second instance to the third-level cache if the second instance is successfully created in S304, and adding the second instance to the second-level cache if the second instance is not successfully created, including:

[0088] B1: If the second instance does not call the first instance, or the first instances called during the creation of the second instance are cached in the L2 cache or L3 cache, after the second instance is successfully created, the second instance is added to the L3 cache.

[0089] During the process of creating the second instance, the second instance may not call the first instance. In this case, if the second instance is directly created successfully, the successfully created second instance will be added to the third-level cache, so that when the first instance needs to call the second instance during the creation process, the successfully created second instance can be directly called from the third-level cache.

[0090] During the process of creating the second instance, if the second instance needs to call the first instance, there is at least one first instance, and the first instances are cached in the second-level cache or the third-level cache, the first instance can be directly called to successfully create the second instance. The successfully created second instance is added to the third-level cache, so that when the first instance needs to call the second instance during the creation process, the successfully created second instance can be directly called from the third-level cache.

[0091] B2: If the first instance called during the creation of the second instance is not cached in the second-level cache and the third-level cache, the second instance is added to the second-level cache.

[0092] During the process of creating the second instance, if the second instance needs to call the first instance, if the first instance is not cached in the second-level cache and the third-level cache, the second instance will fail to be created.

[0093] At this time, the second instance is added to the secondary cache so that when the first instance needs to call the second instance during the creation process, the second instance can be directly called from the secondary cache. It should be noted that although the second instance in the secondary cache is not created successfully, calling the unsuccessful second instance can also complete the creation of the first instance.

[0094] Based on the contents of B1-B2, it can be known that no matter whether the second instance is created successfully or not, the created second instance can be placed in the cache so that the first instance that calls the second instance can call it through the cache.

[0095] Since the creation of an instance is implemented according to a process creation instruction, a process creation instruction needs to be generated before the instance is created. In actual applications, there are many instances that need to be created under the process creation instruction, resulting in a slow thread release speed.

[0096] Based on this, in a possible implementation, the embodiment of the present application further provides another process creation method, which, in addition to the above S301-S304, further includes:

[0097] C1: Divide the process creation instruction into a plurality of process creation sub-instructions, each process creation sub-instruction corresponds to executing and creating at least one first instance.

[0098] The process creation instruction can be a process instance creation instruction or a node instance creation instruction. When there are many instances to be created under the process creation instruction or the instances to be created are complex, the process creation instruction can be divided into multiple process creation sub-instructions. Each process creation sub-instruction corresponds to the execution and creation of at least one first instance. The instances to be created under the process creation instruction are assigned to multiple process creation sub-instructions for creation. The parallel execution of multiple process creation sub-instructions can increase the thread release speed.

[0099] As an optional example, whether to divide the process creation instruction is determined according to the complexity of the process creation instruction. The higher the complexity of the process creation instruction, the more instances need to be created under the process creation instruction or the more complex the instances need to be created. In this case, the process creation instruction needs to be divided. In specific implementation, a complexity threshold is set, and when the complexity of the process creation instruction is greater than the complexity threshold, the process creation instruction is divided.

[0100] It is understandable that the complexity threshold is determined according to the requirements of the actual application scenario, and the complexity threshold is not limited here. In addition, the specific division result of the process creation instruction to be divided can be determined according to the actual situation and the specific algorithm.

[0101] C2: Start multiple threads, each thread executes the process creation instruction, creates the first instance and subsequent steps, wherein the process creation instruction executes the creation of the first instance, including: according to the process creation sub-instruction, executes the creation of at least one first instance.

[0102] In S201 of the above embodiment, a thread is allocated for each process creation instruction. In the embodiment of the present application, since multiple instances can be created at the same time, multiple threads are started, and each thread executes the process creation instruction to create the first instance and subsequent steps.

[0103] Furthermore, when the process creation instruction is divided into a plurality of process creation sub-instructions, creation of the first instance is executed according to the process creation instruction, specifically, creation of at least one first instance is executed according to the process creation sub-instructions.

[0104] When a process creation instruction is divided into multiple process creation sub-instructions, it is necessary to allocate threads to each process creation sub-instruction. Figure 4 As shown, Figure 4 A schematic diagram of creating an instance according to a process creation sub-instruction provided in an embodiment of the present application. Figure 4 In the process creation instruction, the process creation instruction is divided into multiple process creation sub-instructions, which are sub-instructions 1 to sub-instructions N. After the process creation is started, sub-instructions 1 to sub-instructions N apply for thread resources from thread pools 1 to thread pools N respectively, and then thread pools 1 to thread pools N allocate thread resources to sub-instructions 1 to sub-instructions N respectively. Sub-instructions 1 to sub-instructions N are executed in parallel at the same time. Taking sub-instruction 1 as an example, sub-instruction 1 executes the creation of process instances, node instances and work item instances. The creation of instances under each sub-instruction according to S201-S204 can not only realize parallel creation, but also solve the problem of mutual references between instances.

[0105] When a process creation sub-instruction is executed, that is, the corresponding instance is created, the corresponding thread resources are released. When all process creation sub-instructions are executed, that is, all instances under the sub-instructions are created, the entire process creation is completed.

[0106] Understandably, Figure 4 This is only used as an example and is not limited to this in actual applications.

[0107] Based on the content of C1-C2, we can know that the highly complex process creation instruction is decomposed into multiple process creation sub-instructions, and threads are allocated to each process creation sub-instruction, that is, more thread resources are allocated to the highly complex process creation instruction. The simultaneous execution of multiple threads improves the thread release speed and resource utilization, and improves the execution efficiency of the process engine.

[0108] It should be noted that when the thread is executed, the thread is released. When each thread is executed, the thread is released so that the thread resources can be recycled.

[0109] In order to facilitate understanding of the process creation method provided in the embodiment of the present application, Figure 5 See the example of another scenario shown in Figure 5 , Figure 5 A schematic diagram of another scenario example provided for an embodiment of the present application.

[0110] The contents of steps S301-S304 can be applied to node instances and work item instances. In the embodiment of the present application, the scenario example is described with the first instance being process instance A and the second instance being node instance B. Assume that process instance A (hereinafter referred to as "instance A" for simplicity) needs to reference node instance B (hereinafter referred to as "instance B" for simplicity) during the creation process, and node instance B needs to reference process instance A during the creation process.

[0111] like Figure 5 As shown, instance A and instance B are created in parallel. When creating instance A, it is determined that the creation of instance A depends on instance B, so instance B is called, that is, instance B is obtained. First, check whether there is a completed instance B in the third-level cache. If not, check whether there is an uncompleted instance B in the second-level cache. If not, it means that instance B has not been created. Then it is necessary to create instance B using the instance object creation program from the first cache. At this time, since there is no callable instance B, instance A is not created successfully, and the unsuccessful instance A is placed in the second-level cache.

[0112] During the process of creating instance B, it is determined that the creation of instance B depends on instance A, so instance A is called. First, check whether there is a completed instance A in the third-level cache. If not, check whether there is an unsuccessful instance A in the second-level cache. If it is confirmed to exist, the unsuccessful instance A is called from the second-level cache. Instance B is created using the successfully created instance A, and the created instance B is placed in the third-level cache. At this time, the successfully created instance B is called from the third-level cache, so that instance A is created successfully. The successfully created instance A is placed in the third-level cache, and the unsuccessful instance A placed in the second-level cache is deleted.

[0113] Based on the above content, the parallel creation of instance A and instance B is completed.

[0114] Based on the method provided in the embodiment of the present application, it is not necessary to create instance B after instance A is created. If instance A is not created, instance B that needs to call instance A can also obtain instance A from the second cache to complete its own creation, and the successfully created instance B is added to the third cache. If instance A needs to call instance B to complete its creation, it can directly call instance B from the third cache to complete its own creation. Compared with the method of creating instances serially, creating instance A and instance B in parallel can not only solve the problem of mutual references between instances, but also shorten the creation time of the entire process instance, release thread resources as soon as possible, and improve the performance of the process engine.

[0115] Based on the process creation method provided in the above method embodiment, the embodiment of the present application also provides a process creation device, which will be described below in conjunction with the accompanying drawings.

[0116] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of another process creation device provided in an embodiment of the present application. Figure 6 As shown, the process creation device includes:

[0117] A first execution unit 601 is used to execute creation of a first instance according to a process creation instruction;

[0118] A first adding unit 602 is configured to add the first instance to a level 3 cache if the first instance is successfully created, and to add the first instance to a level 2 cache if the first instance is not successfully created, so that if the first instance is called during the creation of a second instance, the first instance is called from the level 3 cache or the level 2 cache;

[0119] A second execution unit 603 is configured to execute creation of the second instance if the second instance is called during the creation of the first instance and the second instance does not exist in the second-level cache and the third-level cache;

[0120] A second adding unit 604 is configured to add the second instance to the L3 cache if the second instance is created successfully, and to add the second instance to the L2 cache if the second instance is not created successfully, so that if the second instance is called during the creation of the first instance, the second instance is called from the L3 cache or the L2 cache;

[0121] The first instance is a process instance and the second instance is a node instance, or the first instance is a node instance and the second instance is a work item instance.

[0122] In a possible implementation manner, the device further includes:

[0123] A deleting unit is used to, after adding the second instance to the second-level cache or the third-level cache, if the first instance is created successfully, delete the first instance from the second-level cache and add the first instance to the third-level cache.

[0124] In a possible implementation, the first adding unit 602 includes:

[0125] A first adding subunit is configured to add the first instance to the third-level cache after the first instance is successfully created if the first instance does not call the second instance, or the second instances called during the creation of the first instance are cached in the second-level cache or the third-level cache;

[0126] The second adding subunit is used to add the first instance to the second-level cache if the second instance called during the creation process of the first instance is not cached in the second-level cache and the third-level cache.

[0127] In a possible implementation, the second adding unit 604 includes:

[0128] a third adding subunit, configured to add the second instance to the third-level cache after the second instance is successfully created, if the second instance does not call the first instance, or the first instances called during the creation of the second instance are cached in the second-level cache or the third-level cache;

[0129] The fourth adding subunit is used to add the second instance to the second-level cache if the first instance called during the creation of the second instance is not cached in the second-level cache and the third-level cache.

[0130] In a possible implementation, the second execution unit 603 is specifically:

[0131] If the second instance is called during the creation of the first instance, and the second instance does not exist in the second-level cache and the third-level cache, the second instance is created by triggering the instance object creation program in the first-level cache.

[0132] In a possible implementation manner, the device further includes:

[0133] A division unit, used for dividing the process creation instruction into a plurality of process creation sub-instructions, each of which corresponds to executing and creating at least one first instance;

[0134] A startup unit is used to start multiple threads, each of which executes instructions based on the process creation, creates a first instance and subsequent steps, wherein the instructions based on the process creation, creates the first instance, including: creating sub-instructions based on the process, and creates at least one first instance.

[0135] In a possible implementation manner, the device further includes:

[0136] The release unit is used to release the thread when the thread is executed.

[0137] In addition, an embodiment of the present application also provides a process creation device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the process creation method described in any of the above embodiments.

[0138] In addition, an embodiment of the present application further provides a computer-readable storage medium, in which instructions are stored. When the instructions are executed on a terminal device, the terminal device executes the process creation method described in any of the above embodiments.

[0139] The embodiment of the present application provides a process creation device and equipment, which executes the creation of a first instance according to the process creation instruction. Wherein, the first instance is a process instance or a node instance. When the first instance is a process instance, the second instance is a node instance. When the first instance is a node instance, the second instance is a work item instance. When the first instance is successfully created, the first instance is added to the three-level cache, and when the first instance is not successfully created, the first instance is added to the second-level cache. Based on this, if the first instance is needed when the second instance is created, the first instance can be directly called from the three-level cache or the second-level cache. If the second instance needs to be called during the creation of the first instance, and the second instance is not stored in the second-level cache and the third-level cache, the second instance is directly created. If the second instance is successfully created, the second instance is added to the three-level cache, and when the second instance is not successfully created, the second instance is added to the second-level cache. Based on this, if the second instance is called when the first instance is created, the second instance can be directly called from the three-level cache or the second-level cache. Based on the method provided in the embodiment of the present application, the second instance does not need to be created after the first instance is created. If the first instance is not created, the second instance that needs to call the first instance can also obtain the first instance from the second cache to complete its own creation, and the successfully created second instance is added to the third cache. If the first instance needs to call the second instance to complete its creation, it can directly call the second instance from the third cache to complete its own creation. Compared with the method of creating instances serially, creating the first instance and the second instance in parallel can shorten the creation time of the entire process instance, release thread resources as soon as possible, and improve the performance of the process engine.

[0140] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0141] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0142] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0143] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0144] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A process creation method, characterized in that: The method comprises: According to the process creation instruction, execute the creation of the first instance; If the first instance is created successfully, the first instance is added to the third-level cache; if the first instance is not created successfully, the first instance is added to the second-level cache, so that if the first instance is called during the creation of the second instance, the first instance is called from the third-level cache or the second-level cache; If the second instance is called during the creation of the first instance, and the second instance does not exist in the second-level cache and the third-level cache, create the second instance; If the second instance is created successfully, the second instance is added to the third-level cache; if the second instance is not created successfully, the second instance is added to the second-level cache, so that if the second instance is called during the creation of the first instance, the second instance is called from the third-level cache or the second-level cache; The first instance is a process instance and the second instance is a node instance, or the first instance is a node instance and the second instance is a work item instance.

2. The method according to claim 1, characterized in that The method further comprises: After the second instance is added to the L2 cache or L3 cache, if the first instance is created successfully, the first instance is deleted from the L2 cache and the first instance is added to the L3 cache.

3. The method according to claim 1, characterized in that If the first instance is successfully created, adding the first instance to the third-level cache, and if the first instance is not successfully created, adding the first instance to the second-level cache, includes: If the first instance does not call the second instance, or the second instances called during the creation of the first instance are cached in the second-level cache or the third-level cache, after the first instance is successfully created, the first instance is added to the third-level cache; If the second instance called during the creation of the first instance is not cached in the second-level cache and the third-level cache, the first instance is added to the second-level cache.

4. The method according to claim 1, characterized in that If the second instance is successfully created, adding the second instance to the third-level cache, and if the second instance is not successfully created, adding the second instance to the second-level cache, comprises: If the second instance does not call the first instance, or the first instances called during the creation of the second instance are cached in the second-level cache or the third-level cache, after the second instance is successfully created, the second instance is added to the third-level cache; If the first instance called during the creation of the second instance is not cached in the second-level cache and the third-level cache, the second instance is added to the second-level cache.

5. The method according to claim 1, characterized in that If the second instance is called during the creation of the first instance, and the second instance does not exist in the second-level cache and the third-level cache, executing the creation of the second instance includes: If the second instance is called during the creation of the first instance, and the second instance does not exist in the second-level cache and the third-level cache, the second instance is created by triggering the instance object creation program in the first-level cache.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Dividing the process creation instruction into a plurality of process creation sub-instructions, each of the process creation sub-instructions corresponds to executing and creating at least one first instance; Start multiple threads, each of which executes instructions according to the process creation, creates a first instance and subsequent steps, wherein the instructions according to the process creation, creates the first instance, including: according to the process creation sub-instruction, creates at least one first instance.

7. The method according to claim 6, characterized in that The method further comprises: When the thread is executed, the thread is released.

8. A process creation device, characterized in that: The device comprises: A first execution unit, configured to execute creation of a first instance according to a process creation instruction; a first adding unit, configured to add the first instance to a level-3 cache if the first instance is successfully created, and to add the first instance to a level-2 cache if the first instance is not successfully created, so that if the first instance is called during the creation of a second instance, the first instance is called from the level-3 cache or the level-2 cache; A second execution unit, configured to execute creation of the second instance if the second instance is called during creation of the first instance and the second instance does not exist in the second-level cache and the third-level cache; a second adding unit, configured to add the second instance to the L3 cache if the second instance is created successfully, and to add the second instance to the L2 cache if the second instance is not created successfully, so that if the second instance is called during the creation of the first instance, the second instance is called from the L3 cache or the L2 cache; The first instance is a process instance and the second instance is a node instance, or the first instance is a node instance and the second instance is a work item instance.

9. A process creation device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the process creation method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device executes the process creation method according to any one of claims 1 to 7.