Flow chart optimization method and device, storage medium and terminal equipment
By optimizing the topology of the flowchart, deleting exclusive nodes and reconnecting the active nodes, complex flowchart management and maintenance problems are solved, and the flowchart simplification and efficient management are achieved.
Patent Information
- Application Number
- CN202411919107.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-15
AI Technical Summary
In the prior art, the complex structure of the flow chart leads to high success in management and maintenance, making it difficult for users to ensure correctness and consistency when designing the flow chart, and the complex flow chart increases maintenance and training costs.
By obtaining the topological structure information of the original flowchart, traversing the nodes and performing optimization processing, deleting the exclusive nodes and their connection lines, and reconnecting the active nodes to form a linear flowchart.
Simplify the process structure, reduce the risk of design errors, improve the clarity and maintainability of the flowchart, reduce maintenance and training costs, and improve business execution efficiency.
Smart Images

Figure CN119831311A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of UI design, and in particular to a flowchart optimization method, device, storage medium and terminal device. Background Art
[0002] In today's era of rapid development of information technology, enterprises have an increasing demand for business process management (BPM), which aims to improve work efficiency, reduce operating costs, and enhance the market competitiveness of enterprises by automating and optimizing business processes. In order to achieve this goal, the process platform, as the core component of the business process management system, plays a vital role. The process platform provides a graphical process design environment, allowing users to define and manage business processes in an intuitive way. Among them, the Business Process Model and Notation (BPMN) as an international standard, especially the BPMN 2.0 version, has become the mainstream choice in the industry due to its powerful expression ability and wide applicability.
[0003] The BPMN 2.0 specification not only defines a wealth of process elements, such as events, tasks (including manual activities), gateways (used to control the flow of processes, such as single branches, multi-way branches, parallel branches, etc.), sub-processes, etc., but also supports the construction of complex process structures, such as joint approval (requiring joint approval by multiple participants), serial approval (approval in sequence), and other advanced activity nodes. These features enable the process platform to flexibly respond to the diverse business process needs of enterprises, from simple linear processes to highly complex parallel and nested process structures.
[0004] However, with the increasing complexity of business processes, the challenges users face when designing flowcharts using process platforms are becoming increasingly significant. Especially when dealing with flowcharts that contain multiple branches, multiple nested levels, and a large number of primitives (process elements), how to ensure the correctness and consistency of process design becomes a key issue. Incorrect process design may lead to business execution failure, waste of resources, and even affect the normal operation of the enterprise. In addition, complex flowcharts also bring considerable difficulties to subsequent maintenance, optimization, and training of new employees, increasing management and maintenance costs. Summary of the invention
[0005] The embodiments of the present application provide a flowchart optimization method, device, storage medium and terminal device, which can solve the problem of complex flowchart structure leading to high management and maintenance success in the prior art. The technical solution is as follows:
[0006] Acquire topological structure information of the original flowchart; the topological structure information indicates the node type and connection relationship of each node in the original flowchart;
[0007] Traversing each node of the original flow chart according to the topological structure information;
[0008] During the traversal process, the topological structure of the original flowchart is optimized to obtain a straight-line flowchart, wherein the optimization process includes: deleting each exclusive node in the original flowchart, and deleting the upstream connection line and the downstream connection line of each exclusive node; obtaining at least one active node associated with the exclusive node of each branch function in the downstream direction, serially connecting the at least one active node according to a preset rule, and connecting the first active node of the at least one active node to the active node closest to the upstream direction, and connecting the last active node of the at least one active node to the active node closest to the downstream direction.
[0009] In a second aspect, an embodiment of the present application provides a flow chart optimization device, the device comprising:
[0010] Acquire topological structure information of the original flowchart; the topological structure information indicates the node type and connection relationship of each node in the original flowchart;
[0011] Traversing each node of the original flow chart according to the topological structure information;
[0012] During the traversal process, the topological structure of the original flowchart is optimized to obtain a straight-line flowchart, wherein the optimization process includes: deleting each exclusive node in the original flowchart, and deleting the upstream connection line and the downstream connection line of each exclusive node; obtaining at least one active node associated with the exclusive node of each branch function in the downstream direction, serially connecting the at least one active node according to a preset rule, and connecting the first active node of the at least one active node to the active node closest to the upstream direction, and connecting the last active node of the at least one active node to the active node closest to the downstream direction.
[0013] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0014] In a fourth aspect, an embodiment of the present application provides a terminal device, which may include: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0015] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0016] By deleting the exclusive nodes and their connecting lines in the original flowchart and reconnecting the related activity nodes, this technical solution can simplify the process structure, reduce unnecessary branches and nested levels, and thus reduce the risk of process design errors. The optimized straight-line flowchart structure is clearer, which helps users to more intuitively understand and verify the correctness of the process design, and ensure the accuracy and consistency of the business execution process.
[0017] The complex branch structure and multi-level nesting in the original flowchart often increase the difficulty of later maintenance. This technical solution converts the complex flowchart into a straight line form through optimization processing, reducing the number of graphic elements and the complexity of the connection relationship, thereby reducing maintenance costs. The structure of the straight line flowchart is concise and clear, which makes it easy for new employees to quickly grasp and understand the business process and reduces training costs.
[0018] The optimized flowchart reduces unnecessary process nodes and connecting lines, simplifies the process path, and thus improves the efficiency of process execution. By reducing redundant and repeated operations, this technical solution helps reduce resource waste in the business execution process and improve the operational efficiency of the enterprise.
[0019] The structure of the linear flowchart makes it easier to modify and adjust business processes. When an enterprise needs to update or expand a business process, it can make changes directly on the optimized flowchart without having to redesign the entire flowchart. This flexibility helps enterprises respond quickly to market changes and improve their competitiveness. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 It is a schematic diagram of the network architecture provided by the embodiment of the present application;
[0022] Figure 2 It is a flowchart diagram of a method for optimizing the flowchart provided in an embodiment of the present application;
[0023] Figure 3 It is a schematic diagram of optimizing the original flow chart provided in the embodiment of the present application to generate a straight line flow chart;
[0024] Figure 4 It is another schematic diagram of optimizing the original flow chart provided in the embodiment of the present application to generate a straight line flow chart;
[0025] Figure 5is a schematic diagram of a dynamic activity configuration table provided in an embodiment of the present application;
[0026] Figure 6 is a schematic diagram of a dynamic process configuration table provided in an embodiment of the present application;
[0027] Figure 7 It is a structural schematic diagram of a flow chart optimization device provided in this application;
[0028] Figure 8 It is a structural diagram of a terminal device provided by this application. DETAILED DESCRIPTION
[0029] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0030] It should be noted that the flowchart optimization method provided in the present application is generally executed by a terminal device, and correspondingly, the flowchart optimization device is generally set in the terminal device.
[0031] Figure 1 An exemplary system architecture that can be applied to the optimization method of the flowchart or the optimization device of the flowchart of the present application is shown.
[0032] like Figure 1 As shown, the system architecture may include: a terminal device 101 and a server 102. The terminal device 101 and the server 102 may communicate via a network, and the network is used as a medium for providing communication links between the above-mentioned units. The network may include various types of wired communication links or wireless communication links, for example: a wired communication link includes an optical fiber, a twisted pair or a coaxial cable, etc., and a wireless communication link includes a Bluetooth communication link, a wireless fidelity (WIreless-FIdelity, Wi-Fi) communication link or a microwave communication link, etc.
[0033] The server 102 stores data of the original flowchart, and the terminal device 101 reads the data and displays the original flowchart, optimizes the topological structure of the original flowchart, and reduces the complexity of its structure.
[0034] It should be noted that the terminal device 101 and the server 102 can be hardware or software. When the terminal device 101 and the server 102 are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the terminal device 101 and the server 102 are software, they can be implemented as multiple software or software modules (for example, to provide distributed services), or as a single software or software module, which is not specifically limited here.
[0035] Various communication client applications can be installed on the terminal device of the present application, such as: video recording applications, video playback applications, voice interaction applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0036] The terminal device can be hardware or software. When the terminal device is hardware, it can be various terminal devices with a display screen, including but not limited to smart phones, tablet computers, laptops, and desktop computers. When the terminal device is software, it can be installed in the terminal devices listed above. It can be implemented as multiple software or software modules (for example: used to provide distributed services), or it can be implemented as a single software or software module, which is not specifically limited here.
[0037] When the terminal device is hardware, a display device and a camera may be installed thereon. The display device may be any device capable of realizing a display function, and the camera is used to collect video streams; for example, the display device may be a cathode ray tube display (CR), a light-emitting diode display (LED), an electronic ink screen, a liquid crystal display (LCD), a plasma display panel (PDP), etc. The user may use the display device on the terminal device to view displayed text, pictures, videos and other information.
[0038] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be used as required.
[0039] The following will be combined with the attached Figure 2 , the optimization method of the flowchart provided in the embodiment of the present application is described in detail. Among them, the optimization device of the flowchart in the embodiment of the present application can be Figure 1 The terminal equipment shown.
[0040] See also Figure 2 , which is a flowchart diagram of a flowchart optimization method provided in an embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps:
[0041] S201. Obtain topological structure information of the original flow chart.
[0042] Among them, the terminal device first loads the XML file of the BPMN2.0 specification or parses the BPMN file in other formats (such as JSON). Use the BPMN parsing library (such as Camunda BPM, Activiti, etc.) to parse the file content and extract the elements and connection relationships of the flowchart. Traverse the parsed elements and identify the type of each node (such as start event node, activity node, exclusive node, etc.). Build a data structure (such as an adjacency list or adjacency matrix) to store the nodes and the connection relationships between them. The terminal device stores the identified node types and connection relationships in memory or files for use in subsequent steps.
[0043] S202: Traverse each node of the original flow chart according to the topological structure information.
[0044] Among them, the terminal device creates a queue or stack to manage the traversal order of the nodes (usually using depth-first search DFS or breadth-first search BFS). Add the start event node to the traversal queue or stack. Take the node from the queue or stack, check its type and perform the corresponding operation. Add all unvisited neighbor nodes of the current node to the queue or stack. Repeat this process until all nodes are visited. During the traversal process, the access order and path of each node can be recorded for subsequent optimization processing.
[0045] S203, optimizing the topological structure of the original flowchart during the traversal process to obtain a straight line flowchart.
[0046] The optimization process includes: when an exclusive node is encountered during the traversal process, the exclusive node is removed from the node list.
[0047] At the same time, all the upstream and downstream connections of the node are deleted, and the exclusive node may perform a branch function or a merge function.
[0048] For each deleted branch function exclusive node, the terminal device identifies all active nodes associated with it in the downstream direction.
[0049] Connect these active nodes in series according to a preset rule (such as serial connection in order). Usually, this means connecting the output of the first active node to the input of the second active node, and so on. Connect the first active node after the serial connection to the active node closest to the upstream direction. This usually means finding the source node of the upstream connection line of the branch function exclusive node and connecting it to the first active node after the serial connection. Similarly, connect the last active node after the serial connection to the active node closest to the downstream direction. This may involve finding the next node in the process after the branch and connecting it to the last active node.
[0050] It should be noted that the nodes associated with the branch function may not all be active nodes, and may also be exclusive nodes or other types of nodes, which are processed according to the above rules. For at least one active node (all active nodes) associated with the exclusive node of the branch function, the number of active nodes may be one or more.
[0051] The terminal device generates a new straight-line flowchart based on the reconnected nodes and connecting lines. The nodes in the straight-line flowchart are arranged in serial order, and there are no exclusive nodes with branch functions and exclusive nodes with merge functions. The optimized straight-line flowchart is output in BPMN2.0 format or other visual formats (such as PNG, SVG, etc.). The optimized flowchart can be displayed on the display interface of the terminal device or saved to a storage device.
[0052] In some embodiments of the present application, the activity nodes are arranged in ascending order according to the user position levels associated with them, and then the sorted activity nodes are connected in series.
[0053] Among them, the terminal device first needs to obtain all relevant activity nodes from the dynamic activity configuration table. Each activity node should be associated with a user position level, which can be pre-defined, such as director, supervisor, specialist, etc., or a specific number or level identifier. Sorting according to user position level: The terminal device needs to implement a sorting algorithm that can sort the activity nodes in ascending order according to the user position level. If the position level is a text description (such as director, supervisor, specialist), the terminal device needs to convert these text descriptions into comparable numerical values or level orders. This can be achieved through custom sorting rules or mapping tables. The sorting algorithm can be a simple bubble sort, selection sort, insertion sort, etc., or a more efficient sorting algorithm, such as quick sort, merge sort, etc. After the sorting is completed, the terminal device needs to connect the activity nodes in series in the sorted order. Serial connection means that each activity node has an input and an output, and the output of the previous node will be connected to the input of the next node. The terminal device needs to maintain a node connection table or data structure to record the input and output connection relationship of each node.
[0054] For example, see Figure 3As shown, the original flowchart before optimization has a branch structure. The optimization processing of the original flowchart includes: deleting the exclusive gateway node of the branch function and the exclusive gateway node of the merge function in the original flowchart, and deleting the uplink and downlink lines of the exclusive gateway node, and determining that the activity nodes associated with the exclusive gateway stage of the branch function are: the leader node in charge, the department manager node and the central leader node, and then arranging the above three activity nodes in ascending order according to the level of the position, and obtaining the department manager node, the leader node in charge, and the central leader node, and then connecting the three arranged activity nodes in series, and connecting the node "filling form connection node" closest to the department manager node in the uplink direction, and connecting the node "finance node" closest to the central leader node in the downlink direction, and finally obtaining the optimized DC flowchart.
[0055] For example, see Figure 4 As shown, the original flowchart before optimization has a nested structure. The optimization process of the original flowchart includes: deleting the exclusive nodes of the two branch functions and the exclusive nodes of the two merge functions in the original flowchart, and deleting the upward connection lines and downward connection lines of the above exclusive nodes. For the exclusive node of the first branch function, the active node associated with it in the downward direction is the "department manager node", and the department manager node is connected to the nearest form filling node in the upward direction. For the exclusive node of the second branch function, it is associated with two active nodes in the downward direction: the leader node in charge and the central leader node, which are sorted and serially connected according to the position level. The leader in charge is connected to the "department manager node" closest to the upward direction, and the central leader node is connected to the "finance node" closest to the downward direction. Finally, the optimized DC flowchart is obtained.
[0056] Further, in some embodiments of the present application, for each deleted branch function exclusive node, the terminal device identifies all the active nodes associated with it in the downstream direction, and marks these active nodes as dynamic active nodes. The terminal device creates a record for each dynamic active node, and writes the node name and user information (including user position role and user identification) into the dynamic activity configuration table. This configuration table is used to store user information and configuration related to dynamic active nodes. For each dynamic active node, the terminal device also needs to record its judgment condition (i.e., the condition that causes the node to be selected) and the condition name. This information is written into the dynamic process configuration table, which records the node name, judgment condition and condition name of each dynamic active node in the process, and is used to dynamically select the path when the process is executed. After completing the node traversal of the original flow chart, the terminal device determines the order of each dynamic active node in the straight line flow chart according to the dynamic activity configuration table and the dynamic process configuration table. This process involves parsing and evaluating the judgment condition to determine which dynamic active nodes should be executed under a specific process execution path. After identifying the dynamic activity nodes, the terminal device can mark these dynamic activity nodes in the execution flow chart, and the marking method can be to display annotation text, change the font color, etc.
[0057] For example, see Figure 5 A schematic diagram of the dynamic activity configuration table, wherein the dynamic activity configuration table has a total of 5 rows, each row corresponds to a dynamic activity node, the first row stores the node name, organization, job role and user ID of the dynamic activity node detected for the first time, and the second row stores the relevant attribute values of the dynamic activity node detected for the second time.
[0058] See also Figure 6 The schematic diagram of the dynamic process configuration table shown in FIG. 1 shows a total of 3 rows in the dynamic process configuration table, each row corresponding to a dynamic activity node. The first row stores the condition name, judgment condition and node name of the dynamic activity node detected for the first time, and the second row stores the condition name, judgment condition and node name of the dynamic activity node detected for the second time. The data lines in the dynamic activity configuration table and the dynamic process configuration table are mapped one by one.
[0059] When displaying the optimized execution flow chart, the terminal device reads the dynamic activity node configuration table and the dynamic process configuration table, and determines the sequence of the dynamic activity nodes according to the sequence of the rows in the table.
[0060] Furthermore, in some embodiments of the present application, it also includes: the terminal device performs operations of adding data rows, deleting data rows, adjusting the position of data rows, or modifying the data in the data rows on the dynamic activity configuration table and the dynamic process configuration table, and updates the execution flowchart according to the above modifications.
[0061] Among them, the terminal device provides controls such as buttons, drop-down menus or input boxes on the user interface, allowing users to perform operations such as adding, deleting, adjusting positions or modifying data rows. For external systems, the terminal device provides an API interface, allowing the system to operate the configuration table through HTTP requests and other methods. When the user performs an operation through the UI control, the terminal device captures the user's input and selection and generates a corresponding operation request. For the API interface, the terminal device receives HTTP requests from the external system and parses the operation type and parameters in the request. The terminal device verifies the received operation request to ensure that the request is legal and complies with business rules. Verification may include checking user permissions, verifying data format and integrity, etc.
[0062] Based on the verified operation requests, the terminal device performs corresponding operations on the dynamic activity configuration table and / or dynamic process configuration table. The operations may include adding new data rows (inserting new records), deleting data rows (deleting records), adjusting the position of data rows (updating the order of records), or modifying the data in data rows (updating the field values of records). The terminal device maintains a copy of the dynamic activity configuration table and the dynamic process configuration table in memory for fast access and updating. After performing the operation, the terminal device updates the copy of the configuration table in memory to reflect the latest configuration. If the configuration table is stored in a database, the terminal device persists the updated configuration table to the database, which involves executing SQL statements or calling database APIs to update records.
[0063] Based on the updated dynamic activity configuration table and dynamic process configuration table, the terminal device regenerates or updates the straight line flowchart. The regeneration process may involve parsing the configuration table, building a set of nodes and connecting lines of the flowchart, and rendering the flowchart to the user interface. If only part of the configuration has changed, the terminal device may only update the affected nodes and connecting lines instead of regenerating the entire straight line flowchart.
[0064] Further, the operation process of the straight-line flow chart of the present application is described as follows: running the straight-line flow chart;
[0065] When the current node is a dynamic activity node, determine whether the pending approval item meets the judgment condition associated with the dynamic activity node. If yes, push the pending approval item to the user associated with the dynamic activity node for processing; if yes, skip the dynamic activity node and transfer the pending approval item to the next node.
[0066] Among them, the terminal device loads and initializes the straight-line flowchart, including all nodes, connecting lines and related configuration information. The flowchart execution engine starts running and processes the pending items from the starting node. The flowchart execution engine traverses each node in turn according to the connection order in the flowchart. For each node, the execution engine checks its type (whether it is a dynamic active node). If the current node is a dynamic active node, the execution engine enters the dynamic processing logic. If the current node is not a dynamic active node, the execution engine processes according to conventional logic (for example, executes the operation of the node, and then transfers the pending items to the next node). For dynamic active nodes, the execution engine obtains the judgment condition associated with the node (for example, whether the amount meets a certain numerical range). The execution engine parses the judgment condition and evaluates whether the condition is met based on the actual data of the pending items (for example, the amount of the document).
[0067] If the judgment condition is met (for example, the amount of the document is within the specified numerical range), the execution engine pushes the pending approval item to the user associated with the dynamic activity node for to-do. This involves updating the to-do item record in the database, sending notifications (such as emails, SMS or system notifications) to relevant users, or displaying the to-do item on the user interface.
[0068] If the judgment condition is not met, the execution engine skips the dynamic activity node and does not push the pending approval items to the associated users of the node, but directly transfers the pending approval items to the next node.
[0069] After each node is processed, the execution engine records the execution status of the process, including the current node, processed nodes, and nodes to be processed, which helps track the progress of the process and perform rollback or recovery operations when necessary.
[0070] The execution engine continues to traverse the nodes in the flowchart until it reaches the end node or encounters other termination conditions (such as the user manually stopping the process). If the process ends successfully, the execution engine may also need to perform some cleanup work, such as updating database records, sending notifications, etc.
[0071] The technical solution of this application specifically includes the following beneficial effects:
[0072] By deleting the exclusive nodes and their connecting lines in the original flowchart and reconnecting the related activity nodes, this technical solution can simplify the process structure, reduce unnecessary branches and nested levels, and thus reduce the risk of process design errors. The optimized straight-line flowchart structure is clearer, which helps users to more intuitively understand and verify the correctness of the process design, and ensure the accuracy and consistency of the business execution process.
[0073] The complex branch structure and multi-level nesting in the original flowchart often increase the difficulty of later maintenance. This technical solution converts the complex flowchart into a straight line form through optimization processing, reducing the number of graphic elements and the complexity of the connection relationship, thereby reducing maintenance costs. The structure of the straight line flowchart is concise and clear, which makes it easy for new employees to quickly grasp and understand the business process and reduces training costs.
[0074] The optimized flowchart reduces unnecessary process nodes and connecting lines, simplifies the process path, and thus improves the efficiency of process execution. By reducing redundant and repeated operations, this technical solution helps reduce resource waste in the business execution process and improve the operational efficiency of the enterprise.
[0075] The structure of the linear flowchart makes it easier to modify and adjust business processes. When an enterprise needs to update or expand a business process, it can make changes directly on the optimized flowchart without having to redesign the entire flowchart. This flexibility helps enterprises respond quickly to market changes and improve their competitiveness.
[0076] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0077] See also Figure 7 , which shows a schematic diagram of the structure of an optimization device of a flowchart provided by an exemplary embodiment of the present application, hereinafter referred to as device 7. The device 7 can be implemented as all or part of the terminal device through software, hardware or a combination of both. The device 7 includes: an acquisition unit 701, a search unit 702, and an optimization unit 703.
[0078] An acquisition unit, used to acquire topological structure information of the original flowchart; the topological structure information indicates the node type and connection relationship of each node in the original flowchart;
[0079] A search unit, configured to traverse each node of the original flow chart according to the topology information;
[0080] An optimization unit is used to optimize the topological structure of the original flowchart during the traversal process to obtain a straight-line flowchart, wherein the optimization process includes: deleting each exclusive node in the original flowchart, and deleting the upstream connection line and the downstream connection line of each exclusive node; obtaining at least one active node associated with the exclusive node of each branch function in the downstream direction, serially connecting the at least one active node according to a preset rule, and connecting the first active node of the at least one active node to the active node closest to the upstream direction, and connecting the last active node of the at least one active node to the active node closest to the downstream direction.
[0081] In one or more possible embodiments, the optimizing the topological structure of the original flowchart to obtain a straight-line flowchart during the traversal process includes:
[0082] Identify at least one active node associated with the exclusive node of each branch function in the downstream direction as a dynamic active node, write the node name and user information of each identified dynamic active node into a dynamic activity configuration table, and write the node name, judgment condition and condition name of each dynamic active node into a dynamic process configuration table; the user information includes: user position role and user identification;
[0083] After completing the node traversal of the original flow chart, the sequence of each dynamic activity node in the linear flow chart is determined according to the dynamic activity configuration table and the dynamic process configuration table.
[0084] In one or more possible embodiments, it further includes:
[0085] The modification unit is used to perform operations of adding new data rows, deleting data rows, adjusting the positions of data rows, or modifying the data in the data rows on the dynamic activity configuration table and the dynamic process configuration table, and to update the execution flow chart according to the above modifications.
[0086] In one or more possible embodiments, it further includes:
[0087] An operating unit, used for operating the straight-line flow chart;
[0088] When the current node is a dynamic activity node, determine whether the pending approval item meets the judgment condition associated with the dynamic activity node. If yes, push the pending approval item to the user associated with the dynamic activity node for processing; if yes, skip the dynamic activity node and transfer the pending approval item to the next node.
[0089] In one or more possible embodiments, the step of serially connecting the at least one active node according to a preset rule includes:
[0090] The activity nodes are sorted in ascending order according to the user position levels associated with them, and then the sorted activity nodes are connected in series.
[0091] In one or more possible embodiments, the node types in the original flow chart include: a start event node, an activity node, an exclusive node of a branch function, an exclusive node of a merge function, and an end event node.
[0092] In one or more possible embodiments, the original flowchart is traversed using a depth-first search (DFS) or a breadth-first search (BFS).
[0093] It should be noted that, when the device 7 provided in the above embodiment executes the optimization method of the flowchart, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above functions. In addition, the optimization device of the flowchart provided in the above embodiment and the optimization method embodiment of the flowchart belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0094] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0095] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 2 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 2 The specific description of the illustrated embodiment will not be repeated here.
[0096] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the optimization method of the flowchart described in the above embodiments.
[0097] See also Figure 8 , which is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Figure 8 As shown, the terminal device 800 may include: at least one processor 801 , at least one network interface 804 , a user interface 803 , a memory 805 , and at least one communication bus 802 .
[0098] The communication bus 802 is used to realize the connection and communication between these components.
[0099] The user interface 803 may include a display screen (Display) and a camera (Camera), and the optional user interface 803 may also include a standard wired interface and a wireless interface.
[0100] The network interface 804 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0101] Among them, the processor 801 may include one or more processing cores. The processor 801 uses various interfaces and lines to connect various parts within the entire terminal device 800, and executes various functions and processes data of the terminal device 800 by running or executing instructions, programs, code sets or instruction sets stored in the memory 805, and calling data stored in the memory 805. Optionally, the processor 801 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 801 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 801, and it can be implemented separately through a chip.
[0102] Among them, the memory 805 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 805 includes a non-transitory computer-readable storage medium. The memory 805 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 805 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 805 may optionally be at least one storage device located away from the aforementioned processor 801. As Figure 8 As shown, the memory 805 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an application program.
[0103] exist Figure 8In the terminal device 800 shown in FIG. 1 , the user interface 803 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 801 can be used to call the application stored in the memory 805 and specifically execute the following steps: Figure 2 The specific process can be referred to Figure 2 As shown, no further description is given here.
[0104] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0105] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for optimizing a flow chart, characterized in that: include: Obtain the topological structure information of the original flow chart; The topology information indicates the node type and connection relationship of each node in the original flow chart; Traversing each node of the original flow chart according to the topological structure information; During the traversal process, the topological structure of the original flowchart is optimized to obtain a straight-line flowchart, wherein the optimization process includes: deleting each exclusive node in the original flowchart, and deleting the upstream connection line and the downstream connection line of each exclusive node; obtaining at least one active node associated with the exclusive node of each branch function in the downstream direction, serially connecting the at least one active node according to a preset rule, and connecting the first active node of the at least one active node to the active node closest to the upstream direction, and connecting the last active node of the at least one active node to the active node closest to the downstream direction.
2. The method according to claim 1, characterized in that The topological structure of the original flow chart is optimized during the traversal process to obtain a straight line flow chart, including: Identify at least one active node associated with the exclusive node of each branch function in the downstream direction as a dynamic active node, write the node name and user information of each identified dynamic active node into a dynamic activity configuration table, and write the node name, judgment condition and condition name of each dynamic active node into a dynamic process configuration table; the user information includes: user position role and user identification; After completing the node traversal of the original flow chart, the sequence of each dynamic activity node in the linear flow chart is determined according to the dynamic activity configuration table and the dynamic process configuration table.
3. The method according to claim 2, characterized in that Also includes: The operations of adding a new data row, deleting a data row, adjusting the position of a data row, or modifying the data in the data row are performed on the dynamic activity configuration table and the dynamic process configuration table, and the execution flow chart is updated according to the above modifications.
4. The method according to claim 2 or 3, characterized in that: Also includes: Running the straight-line flow chart; When the current node is a dynamic activity node, determine whether the pending approval item meets the judgment condition associated with the dynamic activity node, and if so, push the pending approval item to the user associated with the dynamic activity node for processing; If yes, skip the dynamic activity node and transfer the pending approval items to the next node.
5. The method according to claim 1, 2 or 3, characterized in that: The step of serially connecting the at least one active node according to a preset rule comprises: The activity nodes are sorted in ascending order according to the user position levels associated with them, and then the sorted activity nodes are connected in series.
6. The method according to claim 5, characterized in that The node types in the original flow chart include: start event nodes, activity nodes, exclusive nodes of branch functions, exclusive nodes of merge functions and end event nodes.
7. The method according to claim 1 or 2 or 3 or 6, characterized in that: The original flowchart is traversed using a depth-first search (DFS) or a breadth-first search (BFS).
8. A flow chart optimization device, characterized in that: include: An acquisition unit, used for acquiring topological structure information of the original flow chart; The topology information indicates the node type and connection relationship of each node in the original flow chart; A search unit, configured to traverse each node of the original flow chart according to the topology information; An optimization unit is used to optimize the topological structure of the original flowchart during the traversal process to obtain a straight-line flowchart, wherein the optimization process includes: deleting each exclusive node in the original flowchart, and deleting the upstream connection line and the downstream connection line of each exclusive node; obtaining at least one active node associated with the exclusive node of each branch function in the downstream direction, serially connecting the at least one active node according to a preset rule, and connecting the first active node of the at least one active node to the active node closest to the upstream direction, and connecting the last active node of the at least one active node to the active node closest to the downstream direction.
9. A computer storage medium, characterized in that The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 7.
10. A terminal device, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 7.