Construction method of user-defined dynamic process engine
By building business flow charts and analyzing images using image recognition technology, the problem of difficulty in customizing and transforming existing process engines is solved, and a low-cost and high-flexible custom dynamic process engine is realized, supporting complex business process approval.
Patent Information
- Application Number
- CN202411760257.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-02-25
AI Technical Summary
Existing process engines, such as flowable, have high learning and development costs, are difficult to transform, and are difficult to meet the needs of customized processes, parent-child task flow, circular process signing and dynamic designated approval personnel.
By building a business flow chart, image recognition methods are used to analyze images, recognition results are obtained, and process engines are built based on the recognition results. The specific steps include image preprocessing, line and rectangle processing, OCR text recognition, and finally, combining the state design pattern to build a process engine.
It realizes the low-cost and high-flexibility construction of a custom dynamic process engine, supporting complex business process approvals, including custom processes, circular processes and dynamic approvals.
Smart Images

Figure CN119515316A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of business requirements related to approval flow, and in particular to a method for constructing a custom dynamic process engine. Background Art
[0002] In ToB software development projects, there are often business requirements related to approval flows, such as leave approval, procurement approval, etc.
[0003] Conventional approval flow solution: Use the open source flowable process engine to configure and develop approval flows.
[0004] Disadvantages of existing technologies: For developers, the existing flowable process engine has high learning and development costs and is difficult to transform.
[0005] From a business perspective, clear start and end conditions are required to preset process templates to control the flow of data. It is difficult to meet the requirements of customizing the middle page of the process, multi-task flow between parents and children, counter-signature of circular processes, and dynamic designation of individual personnel for approval. Summary of the invention
[0006] In view of the above problems, the present invention is proposed to provide a method for constructing a custom dynamic process engine that overcomes the above problems or at least partially solves the above problems.
[0007] According to one aspect of the present invention, a method for constructing a custom dynamic process engine is provided, the method comprising:
[0008] Build business process diagrams;
[0009] Analyzing the business process diagram using an image recognition method to obtain a recognition result;
[0010] A process engine is constructed according to the recognition result.
[0011] Optionally, the constructing of the business process diagram specifically includes:
[0012] According to the flowchart, adopt the key contents in the image processing, object detection and optical character recognition flowchart;
[0013] The text content in the rectangle is the approval node, and the text content on the line is the approval action.
[0014] Optionally, the adopting an image recognition method to parse the business process diagram to obtain a recognition result specifically includes:
[0015] Preprocess the image;
[0016] Line processing, including: edge detection and line detection;
[0017] Rectangle processing, including: rectangle detection, rectangle area cropping, text area positioning and OCR text recognition.
[0018] Optionally, the preprocessing of the image specifically includes:
[0019] Use the OpenCV library to load images and perform preprocessing, including conversion to grayscale, binarization, resizing, and denoising.
[0020] Optionally, the edge detection and the line detection specifically include:
[0021] The edge detection is to detect the edge in the image using an edge detection algorithm, where the edge represents the edge of a line or text;
[0022] The line detection is to identify line segments in the image using Hough transform or line detection algorithm;
[0023] The line segments constitute the boundaries of text lines or the separators within text.
[0024] Optionally, the rectangle detection, rectangle area cropping, text area positioning and OCR text recognition specifically include:
[0025] The rectangle detection is to use image processing technology to identify all rectangular areas in the picture;
[0026] The rectangular area cropping is to crop each detected rectangular area from the original image;
[0027] The text area positioning is based on the line detection result combined with other image processing technologies to locate the text area;
[0028] The OCR text recognition is to perform text recognition on each cropped rectangular area using the OCR technology.
[0029] Optionally, the step of constructing a process engine according to the recognition result specifically includes:
[0030] The content of the recognized rectangular area is used as the role list, and the text content on the line is used as the action;
[0031] Combine the state design pattern to build the process engine.
[0032] Optionally, the combining of the state design pattern to construct the process engine specifically includes:
[0033] Define states, define all states that exist in the process, identify the contents of the rectangular area as a list of roles, and define the state and name for each role;
[0034] Define events, which are external or internal stimuli that trigger state transitions;
[0035] Define transitions, which define the path from one state to another, and the events required to trigger the transition.
[0036] The present invention provides a method for constructing a custom dynamic process engine, the method comprising: constructing a business process diagram; parsing the business process diagram using an image recognition method to obtain a recognition result; and constructing a process engine according to the recognition result. A custom process engine code is constructed through a process image, and highly flexible business process approval is achieved at a low cost.
[0037] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0039] Figure 1 A flowchart of a method for constructing a custom dynamic process engine provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0041] The terms "comprises" and "having" and any variations thereof in the description embodiments, claims and drawings of the present invention are intended to cover non-exclusive inclusions, for example, including a series of steps or units.
[0042] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0043] like Figure 1 As shown, a method for building a custom dynamic process engine includes:
[0044] First, we build a business process diagram: According to the flow chart, we use image processing, target detection and optical character recognition to identify the key contents in the flow chart. The text content in the rectangle is the approval node, and the text content on the line is the approval action.
[0045] Image recognition parsing flowchart: basic methods implemented using Python and common libraries such as OpenCV and PaddleOCR or Tesseract OCR;
[0046] Image preprocessing: Perform necessary preprocessing on the image, such as resizing, denoising, etc.
[0047] Line processing:
[0048] Edge Detection: Use edge detection algorithms such as the Canny edge detector to detect edges in the image, which may represent the edges of lines or text.
[0049] Line detection: Use Hough Transform or other line detection algorithms to identify line segments in the image. These straight line segments may constitute the boundaries of text lines or the separators within the text.
[0050] Rectangle processing:
[0051] Rectangle detection: Use image processing techniques to identify all rectangular areas in the image.
[0052] Rectangular region cropping: Cropping each detected rectangular region from the original image.
[0053] Text region localization: Based on the line detection results, other image processing techniques (such as connected component analysis, region growing, etc.) are combined to locate the text regions. These regions should contain the text content on the lines.
[0054] OCR text recognition: Use OCR technology to perform text recognition on each cropped rectangular area.
[0055] Specific implementation steps:
[0056] Image preprocessing
[0057] Use OpenCV and other libraries to load images and perform necessary preprocessing, such as converting to grayscale and binarization, to facilitate subsequent processing.
[0058] 2.2.2 Rectangle Detection
[0059] Color-based methods: If the color of the rectangular area is in sharp contrast with the background (such as a red rectangle), a color segmentation method (such as HSV color space segmentation) can be used to identify the rectangle. This method requires defining a suitable color range.
[0060] Shape-based methods: Use edge detection (such as Canny edge detection) and Hough Transform to detect straight lines and then identify rectangles. Alternatively, more advanced image processing techniques such as contour detection (findContours) combined with morphological operations (such as erosion and dilation) can be used to identify rectangles.
[0061] 2.2.3 Rectangular Region Cropping
[0062] Use OpenCV's boundingRect function to get the coordinates and size of each rectangular area, and then use this information to crop the corresponding area from the original image.
[0063] 2.2.4OCR Text Recognition
[0064] Select OCR engine: You can choose OCR engines such as PaddleOCR and Tesseract OCR for text recognition.
[0065] Installation dependencies: Install the corresponding Python libraries and dependencies based on the selected OCR engine.
[0066] Recognize text: Use the OCR engine to perform text recognition on each cropped rectangular area.
[0067] 2.2.5 Post-processing and result integration
[0068] Result correction: Correct the OCR recognition results to eliminate possible errors or omissions. This may require human intervention or the use of natural language processing (NLP) technology to improve the recognition results.
[0069] Result integration: Integrate the text content on all recognized lines or the recognition results of each rectangular area to form the final recognition result.
[0070] Build a process engine based on the recognition results: use the recognized rectangular area content as the role list, the text content on the line as the action, and combine the state design pattern to build the process engine.
[0071] 3.1 Define the state
[0072] First, you need to define all possible states in the process. A state represents a "snapshot" of the process at a specific moment. The content of the rectangular area identified in the second step is used as a list of roles, and the state and name defined for each role
[0073] 3.2 Defining Events
[0074] An event is an external or internal stimulus that triggers a state transition. In a business process, an event may include "approval by the head of an organization", etc. Each role adds a button attribute to define the button that the current role sees. The button sets an action, and the transition logic is triggered by the action event.
[0075] 3.3 Defining Transformations
[0076] A transition defines the path from one state to another, and the events required to trigger the transition. Each transition is also associated with one or more actions, which are executed when the transition occurs. For example, when an order transitions from the "Institution Head" approved state to the "Investment Management Division" approved state, actions such as "Institution Head Approved" may be executed.
[0077] The state, event, and transition are stored in the database as three tables. According to different business types, the role of the current node of the business is returned to the button, and the button click event triggers the transition logic. The flow of business state is controlled by the transition logic.
[0078] Beneficial effects: Customized process engine code is built through process images, achieving highly flexible business process approval at low cost;
[0079] Highly customized, with different processes depending on the business type;
[0080] There are subtasks under the task, and there are intermediate pages according to different links, which can be processed in batches;
[0081] The process is loopy, with multiple people signing off on it at the same time, and no fixed end condition;
[0082] Dynamic process, the sub-items of the same process task can be partially forward and partially reverse.
[0083] The above specific implementation methods further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above are only specific implementation methods of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for constructing a custom dynamic process engine, characterized in that: The construction method comprises: Build business process diagrams; Analyzing the business process diagram using an image recognition method to obtain a recognition result; A process engine is constructed according to the recognition result.
2. A method for constructing a custom dynamic process engine according to claim 1, characterized in that: The construction of the business process diagram specifically includes: According to the flowchart, adopt the key contents in the image processing, object detection and optical character recognition flowchart; The text content in the rectangle is the approval node, and the text content on the line is the approval action.
3. The method for constructing a custom dynamic process engine according to claim 1, characterized in that: The adopting of the image recognition method to analyze the business process diagram and obtain the recognition result specifically includes: Preprocess the image; Line processing, including: edge detection and line detection; Rectangle processing, including: rectangle detection, rectangle area cropping, text area positioning and OCR text recognition.
4. A method for constructing a custom dynamic process engine according to claim 3, characterized in that: The preprocessing of the image specifically includes: Use the OpenCV library to load images and perform preprocessing, including conversion to grayscale, binarization, resizing, and denoising.
5. The method for constructing a custom dynamic process engine according to claim 3, characterized in that: The edge detection and the line detection specifically include: The edge detection is to detect the edge in the image using an edge detection algorithm, where the edge represents the edge of a line or text; The line detection is to identify line segments in the image using Hough transform or line detection algorithm; The line segments constitute the boundaries of text lines or the separators within text.
6. The method for constructing a custom dynamic process engine according to claim 3, characterized in that: The rectangle detection, rectangle area cropping, text area positioning and OCR text recognition specifically include: The rectangle detection is to use image processing technology to identify all rectangular areas in the picture; The rectangular area cropping is to crop each detected rectangular area from the original image; The text area positioning is based on the line detection result combined with other image processing technologies to locate the text area; The OCR text recognition is to perform text recognition on each cropped rectangular area using the OCR technology.
7. The method for constructing a custom dynamic process engine according to claim 1, characterized in that: The step of constructing a process engine according to the recognition result specifically includes: The content of the recognized rectangular area is used as the role list, and the text content on the line is used as the action; Combine the state design pattern to build the process engine.
8. The method for constructing a custom dynamic process engine according to claim 7, characterized in that: The construction of a process engine by combining the state design pattern specifically includes: Define states, define all states that exist in the process, identify the contents of the rectangular area as a list of roles, and define the state and name for each role; Define events, which are external or internal stimuli that trigger state transitions; Define transitions, which define the path from one state to another, and the events required to trigger the transition.