Workflow construction method and device, computer device, and storage medium

By obtaining the workflow component configuration file, automatically initializing the workflow canvas and building nodes and connections, the problem of complex workflow construction process is solved and efficient workflow construction is achieved.

CN111667199BActive Publication Date: 2025-10-17TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202010611466.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-30
Publication Date
2025-10-17
Estimated Expiration
2040-06-30

AI Technical Summary

Technical Problem

In the existing technology, the workflow construction process is complex and the operation chain is lengthy, resulting in low construction efficiency.

Method used

By obtaining the workflow component configuration file, initializing the workflow canvas, and automatically building workflow nodes and connections based on the node and connection data sources, the node and connection display properties are used to determine the style, reducing the complexity of operations.

Benefits of technology

It improves the efficiency of workflow construction and reduces the operation complexity and operation links.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111667199B_ABST
    Figure CN111667199B_ABST
Patent Text Reader

Abstract

The application relates to big data and provides a workflow construction method and device, computer equipment and a storage medium. The method comprises the following steps: obtaining a workflow component configuration file; initializing a workflow canvas according to the workflow component configuration file; obtaining node data sources and connection line data sources; determining a node style corresponding to each node data in the node data sources according to a node display attribute in the workflow component configuration file, and constructing a corresponding workflow node on the workflow canvas according to the each node data and the corresponding node style; and constructing a corresponding workflow connection line on the workflow canvas according to a connection line display attribute in the workflow component configuration file, each connection line data in the connection line data sources and a workflow node corresponding to the each connection line data, so as to obtain a corresponding workflow. The method can improve the workflow construction efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computers, in particular to a workflow construction method and device, computer equipment and storage medium. BACKGROUND

[0002] A workflow is a node set that can be visually displayed and used to intuitively represent the association relationship between different workflow nodes. The workflow is widely used in medical treatment, finance, government affairs, transportation, industry, logistics and artificial intelligence, and is widely used in various application scenarios such as task dependency relationship, data dependency relationship, inheritance relationship and blood relationship. Therefore, how to construct a workflow is a problem worth paying attention to. At present, the manual drawing of the workflow is usually based on jquery (a JavaScript framework) and dom (Document Object Model, Document Object Model). However, this kind of workflow construction method has a complex construction process and a long operation link, thereby having the problem of low workflow construction efficiency. SUMMARY

[0003] Therefore, it is necessary to provide a workflow construction method, device, computer equipment and storage medium capable of improving the workflow construction efficiency in view of the above technical problems.

[0004] A workflow construction method, the method comprising:

[0005] obtaining a workflow component configuration file;

[0006] initializing a workflow canvas according to the workflow component configuration file;

[0007] obtaining a node data source and a connection line data source;

[0008] determining a node style corresponding to each node data in the node data source according to a node display attribute in the workflow component configuration file, and constructing a corresponding workflow node on the workflow canvas according to the each node data and the corresponding node style;

[0009] constructing a corresponding workflow connection line on the workflow canvas according to a connection line display attribute in the workflow component configuration file, each connection line data in the connection line data source, and a workflow node corresponding to the each connection line data, to obtain a corresponding workflow.

[0010] A workflow construction device, the device comprising:

[0011] a first obtaining module configured to obtain a workflow component configuration file;

[0012] a canvas construction module, configured to initialize a workflow canvas according to the workflow component configuration file;

[0013] a second acquisition module, configured to acquire node data sources and connection data sources;

[0014] a node construction module, configured to determine a node style corresponding to each node data in the node data sources according to a node display attribute in the workflow component configuration file, and construct a corresponding workflow node on the workflow canvas according to the each node data in a corresponding node style;

[0015] a workflow construction module, configured to construct a corresponding workflow connection on the workflow canvas according to a connection display attribute in the workflow component configuration file, each connection data in the connection data sources, and a workflow node corresponding to the each connection data, to obtain a corresponding workflow.

[0016] A computer device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0017] acquiring a workflow component configuration file;

[0018] initializing a workflow canvas according to the workflow component configuration file;

[0019] acquiring node data sources and connection data sources;

[0020] determining a node style corresponding to each node data in the node data sources according to a node display attribute in the workflow component configuration file, and constructing a corresponding workflow node on the workflow canvas according to the each node data in a corresponding node style;

[0021] constructing a corresponding workflow connection on the workflow canvas according to a connection display attribute in the workflow component configuration file, each connection data in the connection data sources, and a workflow node corresponding to the each connection data, to obtain a corresponding workflow.

[0022] A computer readable storage medium, having a computer program stored thereon, the computer program being executed by a processor to implement the following steps:

[0023] acquiring a workflow component configuration file;

[0024] initializing a workflow canvas according to the workflow component configuration file;

[0025] acquiring node data sources and connection data sources;

[0026] According to the node display attribute in the workflow component configuration file, a node style corresponding to each node data in the node data source is determined, and a corresponding workflow node is constructed on the workflow canvas according to the node data and the corresponding node style.

[0027] According to the line display attribute in the workflow component configuration file, each line data in the line data source, and the workflow node corresponding to the line data, a corresponding workflow line is constructed on the workflow canvas, and a corresponding workflow is obtained.

[0028] The workflow construction method, device, computer device, and storage medium described above automatically initialize the workflow canvas according to the workflow component configuration file obtained in advance, determine the node style according to the node display attribute in the workflow component configuration file for the obtained node data source and line data source, automatically construct the corresponding workflow node on the initialized workflow canvas according to each node data in the node data source and the corresponding node style, further automatically construct the corresponding workflow line on the workflow canvas according to the line display attribute in the workflow component configuration file and each line data in the line data source, and connect the corresponding workflow nodes through the workflow line to obtain the constructed workflow. In this way, the workflow canvas is automatically initialized based on the workflow component configuration file, and the workflow is automatically constructed on the workflow canvas based on the node display attribute and the line display attribute and the node data source and the line data source, which can reduce the operation complexity and operation link, thereby improving the workflow construction efficiency. BRIEF DESCRIPTION OF DRAWINGS

[0029] Figure 1 An application environment diagram of the workflow construction method in an embodiment;

[0030] Figure 2 A flowchart of the workflow construction method in an embodiment;

[0031] Figure 3 A workflow node grouping diagram in an embodiment;

[0032] Figure 4 A principle diagram of constructing a workflow based on a node display attribute and a line display attribute in an embodiment;

[0033] Figure 5 A principle diagram of managing a workflow based on an event in an embodiment;

[0034] Figure 6 A principle diagram of updating optimization of a workflow based on local update and function throttling in an embodiment;

[0035] Figure 7 Fig. 8 is a schematic diagram illustrating the effect of updating the workflow based on local update in one embodiment;

[0036] Figure 8 Fig. 9 is a schematic diagram illustrating the flow of the workflow construction method in another embodiment;

[0037] Figure 9 Fig. 10 is a schematic diagram illustrating the principle of the whole life cycle management of the workflow in one embodiment;

[0038] Figure 10 Fig. 11 is a schematic diagram illustrating the interface of the workflow component in one embodiment;

[0039] Figure 11 Fig. 12 is a schematic diagram illustrating the effect of expanding the workflow according to the workflow node in one embodiment;

[0040] Figure 12 Fig. 13 is a schematic diagram illustrating the effect of automatic arrangement of the workflow in one embodiment;

[0041] Figure 13 Fig. 14 is a schematic diagram illustrating the effect of quick operation of the workflow in one embodiment;

[0042] Figure 14 Fig. 15 is a schematic diagram illustrating the effect of updating the node style in one embodiment;

[0043] Figure 15 Fig. 16 is a schematic diagram illustrating the display interface of the workflow component when there are mass workflow nodes in one embodiment;

[0044] Figure 16 Fig. 17 is a structural block diagram of the workflow construction apparatus in one embodiment;

[0045] Figure 17 Fig. 18 is an internal structure diagram of the computer device in one embodiment. DETAILED DESCRIPTION

[0046] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0047] The workflow construction method provided by the present application can be applied to, for example, Figure 1The application environment is shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 obtains the workflow component configuration file, initializes the workflow canvas according to the workflow component configuration file, obtains the node data source and the connection data source, determines the node style according to the node display attribute in the workflow component configuration file, constructs the corresponding workflow node on the workflow canvas according to the corresponding node style of each node data in the node data source, and constructs the corresponding workflow connection on the workflow canvas according to the connection display attribute in the workflow component configuration file, each connection data in the connection data source, and the corresponding workflow node of each connection data, so as to connect the corresponding workflow node through the constructed workflow connection, and obtain the corresponding workflow. Among them, the terminal 102 can obtain the workflow component configuration file, the node data source and the connection data source from the server 104, and can also store the constructed workflow to the server 104. Among them, the terminal 102 can be various personal computers, notebook computers, smart phones, tablet computers and portable wearable devices, and the server 104 can be realized by an independent server or a server cluster composed of multiple servers.

[0048] In one embodiment, the server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and basic cloud computing services such as big data and artificial intelligence platforms. The terminal 102 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited thereto. The terminal 102 and the server 104 can be directly or indirectly connected through wired or wireless communication, which is not limited in the present application.

[0049] In one embodiment, as shown in Figure 2 , a workflow construction method is provided. Taking the terminal in Figure 1 as an example, the method includes the following steps:

[0050] Step 202, obtaining a workflow component configuration file.

[0051] The workflow component configuration file refers to a configuration file corresponding to the workflow component. The workflow component configuration file can include program code and tools supporting the workflow component to implement construction and management of the workflow, and can specifically include node display attributes and connection display attributes, and can further include multiple workflow events and an event response function corresponding to each workflow event. The workflow component is a component or tool used to construct a workflow. It can be understood that a component is a combination of a series of componentized functions in the front end, and when developing the front end, the development of a page can be quickly completed through simple component combination.

[0052] Specifically, the terminal dynamically detects a workflow construction triggering operation of a user, and when detecting the workflow construction triggering operation, acquires a corresponding workflow component configuration file according to the detected workflow construction triggering operation. The workflow construction triggering operation refers to an operation for triggering a workflow construction process, and specifically can be a user request to access a browser or a webpage in the browser used to construct a workflow, that is, a user request to the terminal to load and display the browser or the webpage in the browser used to construct the workflow.

[0053] In an embodiment, the terminal acquires the workflow component configuration file from a server. If the terminal locally pre-stores the workflow component configuration file, the terminal can also acquire the locally pre-stored workflow component configuration file. The workflow component configuration file is dynamically configured in a configuration process of the workflow component.

[0054] In an embodiment, the environment requirements involved in the configuration process of the workflow component include: a MacOS system (an operating system running on an Apple computer) of version 10 or later, or a Windows system (a Microsoft operating system) of version win7 or later, and the memory of a configuration device used to configure the workflow component needs to be greater than or equal to 2G. The software or tools involved include Nodejs (a running / development environment), an Npm package management tool / library (Node Package Manager, a program package management and distribution management tool), VSCode (Visual Studio Code, a lightweight code editor), and React (a front-end framework based on javascript, supporting multiple types of dom or mobile device UI (User Interface) node output). The environment setup process involved in the workflow component configuration process can include: creating and opening a folder, initializing package dependency configuration and project directories through the vscode editor, installing dependent packages, running the development environment, and creating component files under the folder.

[0055] In one embodiment, the workflow component configuration file can also be understood as a component library, and the component library can be introduced into a page by operations such as installing the component library and introducing the component, so as to initialize the workflow component based on the component library.

[0056] In step 204, the workflow canvas is initialized according to the workflow component configuration file.

[0057] The workflow canvas is a canvas for constructing a workflow. Specifically, after the terminal obtains the workflow component configuration file, the terminal initializes the workflow canvas by obtaining and running the canvas construction instance in the workflow component configuration file. The canvas construction instance is a program code for constructing a canvas.

[0058] In one embodiment, the terminal determines the canvas size according to the browser size and the correspondence between the browser size and the canvas size, and initializes the workflow canvas according to the workflow component configuration file according to the determined canvas size.

[0059] In one embodiment, the initialization of the workflow canvas and the construction of the workflow are implemented based on svg, that is, the svg is used as a graphical visualization basis to construct the workflow canvas and the workflow. The svg is a vector graphics format that can be displayed on web pages and various devices, supports xml structure and attribute configuration, and is a high-configurable, vector-supported, lossless image format. Using svg to construct the workflow can ensure lossless display when the workflow performs operations such as scaling and dragging.

[0060] In step 206, the node data source and the connection data source are obtained.

[0061] The node data source includes one or more node data, and each node data corresponds to a workflow node. The connection data source includes one or more connection data, and each connection data corresponds to a workflow connection.

[0062] Specifically, the terminal obtains the data source from an online network or a server according to the detected workflow construction trigger operation. The data source obtained by the terminal includes the node data source and the connection data source, or the terminal obtains the corresponding node data source and connection data source by analyzing the obtained data source.

[0063] In one embodiment, the data source obtaining path can be specified in advance in the workflow component configuration file, so that the terminal obtains the corresponding data source according to the data source obtaining path. It can be understood that the workflow component can be applied to different application scenarios, and the corresponding data source obtaining path can be distributed and configured in the workflow component configuration file for different application scenarios.

[0064] In one embodiment, each node data includes a node identifier, a node title and node data content, and can further include node coordinates, which can include x-coordinate and y-coordinate. Each connection data includes a start node identifier and an end node identifier, and is used to construct a workflow connection that connects the workflow nodes corresponding to the start node identifier and the end node identifier.

[0065] At step 208, according to the node display attribute in the workflow component configuration file, the node style corresponding to each node data in the node data source is determined, and according to each node data, the corresponding workflow node is constructed on the workflow canvas according to the corresponding node style.

[0066] The node display attribute is an attribute feature or attribute data representing the display style of the workflow node. The node display attribute can be understood as a workflow node template, and specifically as a workflow node style template, which is used to determine the node style of the workflow node when the workflow node is visually displayed on the workflow canvas. The node style refers to the display style or form of the workflow node. For example, the node display attribute specifies that the node style of the workflow node includes a rectangular frame, the upper and lower edge centers of the rectangular frame are respectively provided with circular connection points, a label image is displayed in the rectangular frame, and the rectangular frame can be used to display text content, etc.

[0067] Specifically, the terminal extracts the node display attribute from the workflow component configuration file and extracts each node data from the node data source, and determines the node style corresponding to each node data according to the extracted node display attribute. The terminal constructs the corresponding workflow node in the workflow canvas according to each node data according to the determined corresponding node style, so as to construct the workflow node corresponding to each node data on the workflow canvas.

[0068] In one embodiment, the workflow component configuration file includes a plurality of node display attributes. The terminal extracts the node display attribute matched with the current application scenario from the workflow component configuration file according to the current application scenario, and determines the corresponding node style based on the node display attribute.

[0069] In one embodiment, the terminal determines the data type of each node data in the node data source, extracts the node display attribute matched with each data type from the workflow component configuration file, and determines the node style corresponding to the node data of the data type according to the node display attribute matched with the data type. It can be understood that the corresponding node display attribute can be pre-configured for each data type in different application scenarios, so as to obtain the node display attribute used to determine the node style corresponding to the node data according to the application scenario and the data type of the node data. Taking the application scenario of the logistics industry as an example, the data type of the node data includes but is not limited to factory information, logistics transfer information, and logistics loading information. In this way, different node styles of the workflow node are constructed on the workflow canvas for different data types, so that the corresponding data information can be intuitively understood through the node style.

[0070] In one embodiment, the node data source includes one or more node data, each node data includes a node identifier, a node title, and node data content, and can also include node coordinates, the node coordinates can include x coordinates and y coordinates. After the terminal determines the node style corresponding to each node data in the above manner, the terminal can construct a node framework at the corresponding position of the workflow canvas according to the node style and the node coordinates corresponding to each node data, and fill the node identifier and / or the node title of each node data into the node framework to obtain the corresponding workflow node. The node data content corresponding to each node data can be filled into the corresponding node framework for direct display, or can be hidden and displayed in the hidden box corresponding to the node framework, so that when the cursor is at the node framework corresponding to the workflow node, the hidden box corresponding to the node framework and the node data content in the hidden box will be displayed on the corresponding position of the node framework on the workflow canvas. Taking the data type of the node data as the logistics transfer information as an example, the node title corresponding to the node data is, for example, Shenzhen, and the node data content corresponding to the node data is, for example, No. 3388, XX Road, Nanshan District, Shenzhen.

[0071] In one embodiment, during the workflow component configuration process, each node display attribute is encapsulated into a corresponding node template instance, so that during the workflow construction process, the terminal can determine the corresponding node style by obtaining and running the node template instance.

[0072] Step 210, according to the connection display attribute in the workflow component configuration file, each connection data in the connection data source, and the workflow node corresponding to each connection data, a corresponding workflow connection is constructed on the workflow canvas to obtain a corresponding workflow.

[0073] The line display attribute is a property feature or property data representing a display style of the workflow line. The line display attribute is also used to determine a line path of the workflow line between two workflow nodes. The display style of the workflow line, i.e., the line style, includes a display style or form of the workflow line, such as a solid line, a dashed line, a straight line, or a curved line, etc. The line path is dynamically determined based on the line display attribute and positions of the workflow nodes corresponding to the line data on the workflow canvas. Each line data includes a start node identifier and an end node identifier.

[0074] Specifically, the terminal extracts the line display attribute from the workflow component configuration file and extracts each line data from the line data source. According to the start node identifier and the end node identifier in each line data, the terminal determines the workflow nodes corresponding to the line data on the workflow canvas. According to the positions of the workflow nodes corresponding to each line data on the workflow canvas and the extracted line display attribute, the terminal constructs the workflow line corresponding to the line data on the workflow canvas to associate the corresponding workflow nodes by the workflow line. The terminal constructs the corresponding workflow line for each line data to obtain the workflow constructed based on the node data source and the line data source.

[0075] In an embodiment, during the workflow component configuration process, the node display attribute and the line display attribute are constructed based on an xml format of an svg image. Specifically, the node display attribute and the line display attribute can be constructed based on an svg <g> 、 <rect> 、 <text> 、 <circle>With five kinds of labels to build node display attributes, and based on svg <g>With <path>two kinds of labels to construct the connection display attribute, and the node display attribute constructed can also be combined with the connection display attribute through <g>The labels (packet labels) are managed uniformly. Among them, <g>The tags are used to manage the packets, <rect>The tag is used to create a rectangle, The tag is used to add an image, <text>Tags are used to create text, <circle>Labels are used to show circular structures. <path>The tag is used to create a connection.

[0076] Figure 3 A diagram of a workflow node group for one embodiment. As shown, the workflow node group includes two workflow nodes and a workflow connection for connecting the two workflow nodes, each of the workflow nodes includes Figure 3 <g> 、 <rect> 、 <text> 、 <circle>With five kinds of labels, wherein, <g>The tags are used to manage the distribution of <rect> 、 <text> 、 <circle>With The node display attribute obtained by constructing the same label, <text>Labels are used to define the text content that can be displayed in a workflow node, such as Figure 3 "Work Node 1" and "Work Node 2" as shown, it is understood that the text content displayed in a workflow node is determined by the corresponding node data. Workflow links include <g>With <path>two kinds of tags, <g>The tags are used to manage the distribution of <path>The tag constructs a display attribute of the link.

[0077] In one embodiment, the method comprises <path>The label is combined with a second-order Bezier curve to create a connection display attribute. The second-order Bezier curve formula is as follows:

[0078] B(t) = (1 - t) 2 P0+2t(1-t)P1+t 2 P2,t∈[0,1]

[0079] wherein P0 represents a starting node, P1 represents an intermediate node, P2 represents an ending node, and t is a constant value in the range of 0 to 1. The intermediate node is dynamically determined based on the starting node and the ending node corresponding to the connection data. In this way, based on the positions of the starting node, the intermediate node, and the ending node corresponding to the connection data on the workflow canvas, the connection path of the corresponding workflow connection on the workflow canvas can be determined according to the above second-order Bezier curve formula, and then the workflow connection for connecting the corresponding workflow nodes can be constructed on the workflow canvas according to the connection style specified by the connection display attribute and the connection path.

[0080] In one embodiment, a plurality of connection display attributes are included in the workflow component configuration file. The terminal can select the corresponding connection display attribute according to the association relationship between the workflow nodes corresponding to the connection data. The association relationship between the workflow nodes can be directly specified by the connection data, or can be dynamically determined by the terminal.

[0081] In one embodiment, during the workflow component configuration process, the configured connection display attribute is encapsulated into a corresponding connection template instance, so that during the workflow construction process, the terminal can run the connection template instance according to the workflow nodes corresponding to the node data, and the corresponding workflow connection can be constructed on the workflow canvas.

[0082] Figure 4 A schematic diagram of the principle of constructing a workflow based on node display attributes and connection display attributes in one embodiment is shown. As shown in Figure 4 The node data source includes three node data, task1, task2, and task3. Two node data, for example, are {id: 'task1', title: 'task1 title', x: 200, y: 200, data: {}}, {id: 'task3', title: 'task3 title', x: 290, y: 200, data: {}}, wherein id is the node identifier corresponding to the node data, title is the node title, x and y are the horizontal and vertical coordinates of the node coordinates, respectively, and data is the node data content. Figure 4 The node data content shown is empty, and the connection data source includes two connection data, which are {source: 'task1', target: 'task2'} and {source: 'task1', target: 'task3'}, where source represents the starting node and target represents the ending node. Thus, based on the node data source and the connection data source Figure 4 The node data source and the connection data source shown can be used to build the workflow shown Figure 4 The node data source is used to build workflow nodes in the workflow canvas, and the connection data source is used to build workflow connections that connect the corresponding workflow nodes in the workflow canvas.

[0083] The workflow construction method described above automatically initializes the workflow canvas according to the pre-configured workflow component configuration file, determines the node style according to the node display attribute in the workflow component configuration file for the obtained node data source and connection data source, and automatically constructs the corresponding workflow node on the initialized workflow canvas according to each node data in the node data source according to the corresponding node style. Further, according to the connection display attribute in the workflow component configuration file and each connection data in the connection data source, the corresponding workflow connection is automatically constructed on the workflow canvas to connect the corresponding workflow nodes through the workflow connection to obtain the constructed workflow. In this way, the workflow canvas is automatically initialized based on the workflow component configuration file, and the workflow is automatically constructed on the workflow canvas based on the node display attribute and the connection display attribute according to the node data source and the connection data source, which can reduce the operation complexity and the operation link, thereby improving the workflow construction efficiency.

[0084] In one embodiment, the workflow construction method described above further includes event binding of the workflow, detecting a workflow management event triggered for the workflow, and calling an event response function corresponding to the workflow management event to manage the workflow.

[0085] The workflow management event is an event for triggering a workflow management operation. The event response function is a function for managing a workflow by responding to a corresponding workflow management event. Different workflow management events can be obtained according to different event division manners. For example, the workflow management event includes, but is not limited to, workflow dragging, workflow size change, workflow data global update, workflow single node update, workflow single node dragging, workflow overall dragging, workflow node deletion, workflow node connection, workflow connection deletion, workflow node menu key, workflow connection menu key, and the like. For another example, the workflow management event includes, but is not limited to, node dragging, connection node dragging, node clicking, connection clicking, zooming, automatic layout, layout size, mouse sliding, node deletion, connection deletion, connection and focus node, and the like.

[0086] Specifically, after the terminal constructs the workflow according to the workflow component configuration file, the node data source and the connection data source in the above manner, the terminal performs event binding on the workflow to obtain corresponding workflow management events. The terminal dynamically detects a workflow management event triggered by a user for the workflow. When the workflow management event is detected, the terminal invokes an event response function corresponding to the workflow management event to perform a corresponding event management operation on the workflow, so as to implement management of the workflow.

[0087] In one embodiment, the workflow component configuration file includes preconfigured events and event response functions corresponding to each event. The terminal performs event binding on the events in the workflow component configuration file and the constructed workflow to obtain workflow management events bound to the workflow, so as to invoke corresponding event response functions from the workflow component configuration file according to the detected workflow management events to perform workflow management.

[0088] In one embodiment, the workflow management event includes a local event and a global event. The global event is an event bound to a workflow canvas, and the local event is an event bound to a workflow node or a workflow connection. For example, workflow single node dragging is a local event bound to a workflow node, and workflow overall dragging is a global event bound to a workflow canvas. The preconfigured events in the workflow component configuration file are basic events. When the basic events are bound to the workflow canvas, the workflow node or the workflow connection, the basic events constitute local events or global events corresponding to the workflow. For example, the basic event of dragging obtains the local event of workflow single node dragging when bound to the workflow node, and obtains the global event of workflow overall dragging when bound to the workflow canvas. The workflow single node dragging and the workflow overall dragging correspond to the same event response function, but the arguments required for invoking the event response function to perform workflow management are different.

[0089] Figure 5 FIG. 1 is a schematic diagram showing the principle of managing workflow based on events in one embodiment. Figure 5 As shown, the workflow includes three workflow nodes, task1, task2, and task3. The workflow node task2 is connected to the workflow nodes task1 and task3 through workflow lines. When the terminal detects a click event triggered for the workflow node task1, the corresponding event response function is called to highlight the color of the workflow node task1, such as adjusting the display background of the workflow node task1 to black. When the terminal detects a drag event for the workflow node task2, the event response function is called to adjust the position of the workflow node task2 in the workflow canvas and dynamically adjust the connection path of the workflow line connected to the workflow node task2. When the terminal detects the event of creating a new node triggered for the workflow, a new workflow node task4 is created in the workflow canvas. When further detecting a connection event triggered for the workflow nodes task3 and task4, a workflow line is constructed between the workflow nodes task3 and task4. It can be seen that by managing events in the workflow, the canvas can be rearranged and rendered based on the user's triggering operations.

[0090] In the above embodiment, the workflow is event bound to perform event management on the workflow based on the bound events. In this way, when a user triggers a workflow management event for the workflow, the event response function corresponding to the workflow management event is called to obtain data or operate data, thereby providing accurate and timely feedback for the user's workflow management operations.

[0091] In one embodiment, an event response function corresponding to a workflow management event is called to manage the workflow, including: when the workflow management event belongs to a first type of local event, intercepting event bubbling in the workflow management event; determining a target node and a target connection based on workflow data corresponding to the workflow; and calling an event response function corresponding to the workflow management event to manage the target node and the target connection.

[0092] Among them, the events in the workflow component configuration file can be divided into first-class events, second-class events and third-class events according to the performance optimization method. The first-class events are events that require local update optimization, such as dragging. The second-class events are events that require function throttling optimization, such as zooming, layout size, mouse over, focus node and dragging, and other continuous events that may have a duration. The third-class events are events that do not require performance optimization, such as clicks, automatic layouts, deletions and other non-continuous events. Binding the first-class events to the workflow canvas obtains the first-class global events, binding the first-class events to the workflow nodes or workflow lines obtains the first-class local events, and so on. The workflow management events bound to the workflow include the first-class global events, the first-class local events, the second-class global events, the second-class local events, the third-class global events and the third-class local events. The target node and the target line are the workflow nodes and workflow lines in the workflow to be managed by the event response function corresponding to the workflow management event.

[0093] Specifically, after detecting a workflow management event triggered for a workflow, the terminal matches the workflow management event with the various events bound to the workflow. When it is determined that the workflow management event belongs to the first type of local event, the terminal intercepts the event bubbling operation of the workflow management event to prevent the workflow management event from being propagated to the corresponding workflow management event in the first type of global event, thereby avoiding unnecessary global updates to the workflow. Furthermore, the terminal determines the target node and target connection to be managed from the workflow based on the workflow data corresponding to the workflow, and calls the event response function corresponding to the currently detected workflow management event to manage the target node and target connection.

[0094] In one embodiment, the workflow data corresponding to the workflow includes a node data source and a connection data source corresponding to the workflow. When a workflow management event belongs to the first type of local event, the terminal determines the workflow node bound to the workflow management event, and determines, from the node data source and connection data source corresponding to the workflow, workflow nodes and / or workflow connections that have a connection association relationship with the workflow node, and determines the workflow node determined from the node data source and the workflow node bound to the workflow management event as target nodes, and determines the workflow connection determined from the connection data source as the target connection.

[0095] For example, Figure 4 As an example of the workflow shown in the figure, assume that the user triggers the first type of local event of workflow single node drag for the workflow node task1 in the workflow. According to the above method, the workflow node task1 can be determined as the target node, and Figure 4 The two work flow links shown and associated with the target node are determined as target links. Further, the terminal invokes the event response function corresponding to the first type of local event of the work flow single node dragging to update the data corresponding to the target node and the target link. It can be understood that through event bubble interception, the event response function corresponding to the first type of global event of the work flow canvas binding is avoided to be invoked, and the entire work flow including the work flow nodes task2 and task3 is dynamically updated. In this way, at each node dragging, the target node and the node related link data are calculated to obtain the target node and the target link to be updated, and then the work flow canvas is locally updated. It can be understood that during local updating, the terminal can not calculate the node and link data through the react life cycle, but only perform local updating, and after updating is completed, the data is synchronized to the react state, so that the component life cycle is retained while the local updating of the work flow is ensured.

[0096] In the above embodiment, when the work flow management event is the first type of local event, the local updating of the work flow is realized through intercepting event bubbling, unnecessary global updating is avoided, and the performance of the work flow is improved.

[0097] In one embodiment, the event response function corresponding to the work flow management event is called to manage the work flow, and further includes: when the work flow management event belongs to the second type of event, the interval time length of the work flow management event is counted; and when the interval time length is greater than or equal to a preset time length, the event response function corresponding to the work flow management event is called to manage the work flow.

[0098] The events bound by the work flow include the first type of event, the second type of event and the third type of event, wherein the first type of event includes the first type of global event and the first type of local event, the second type of event includes the second type of global event and the second type of local event, and the third type of event includes the third type of global event and the third type of local event. The interval time length of the work flow management event refers to the time interval between adjacent two times of detecting the work flow management event. Taking the event of dragging a node as an example, the interval time length refers to the length of time when the user pauses during continuous node dragging. If the interval time length is greater than or equal to the preset time length, the state is synchronized to the react state management, and if the interval time length is less than the preset time length, the state is not synchronized to the react state management, preventing multiple synchronizations within a period of time and improving synchronization efficiency. Synchronizing the state to the react state management can be realized by calling the event response function corresponding to the work flow management event. The preset time length is the minimum time length of the trigger function throttling, which can be defined, for example, 200 milliseconds.

[0099] Specifically, after detecting a workflow management event triggered for a workflow, the terminal matches the workflow management event with the various events bound to the workflow. When it is determined that the workflow management event belongs to the second type of event, that is, when it is determined that the workflow management event belongs to the second type of global event or the second type of local event, the terminal counts the interval length of the workflow management event and compares the counted interval length with the preset duration. When it is determined that the interval length is greater than or equal to the preset duration, the terminal calls the event response function corresponding to the workflow management event to perform corresponding workflow management operations on the workflow.

[0100] In one embodiment, when a detected workflow management event is determined to be both a second-category event and a first-category local event, the terminal intercepts the workflow management event through event bubbling, calculates the interval duration of the workflow management event, and determines the target node and target connection to be managed in the aforementioned manner. Furthermore, when the calculated interval duration is greater than or equal to a preset duration, the terminal invokes the event response function corresponding to the workflow management event and manages the target node and target connection to be managed.

[0101] Figure 6 FIG. 1 is a schematic diagram showing the principle of updating and optimizing the workflow based on local updates and function throttling in one embodiment. Figure 6 As shown, when triggering an update operation on a workflow, such as dragging a node or connecting a line, global updates are blocked by intercepting event bubbling and triggering a local update. During the local update, throttling is triggered based on the interval between workflow management events and the preset duration. Based on the throttling, the corresponding event response function is called to complete the update. In this way, updating the workflow through function throttling can reduce the update frequency of the workflow, thereby improving workflow performance.

[0102] Figure 7 FIG. 1 is a schematic diagram showing the effect of optimizing the workflow based on local updates in one embodiment. Figure 7 As shown, the workflow includes five workflow nodes, i.e., task node 1, test node 2, target test node, task node 4, and test node 5. Task node 1 and task node 4 are respectively connected to the target test node through workflow connections. Task node 4 is connected to test node 5 through a workflow connection. Task node 1 is connected to test node 2 through a workflow connection. When the user drags the target test node in the workflow canvas by using a mouse, the workflow binding workflow single node drag triggers the first type of local event, and the terminal determines the target test node as the target node and determines the two workflow connections connected to the target node as the target connection according to the above method. The event response function corresponding to the first type of local event is called to update the target node and the target connection, so as to realize local update of the workflow and improve the performance of the browser. For example, Figure 7 As shown, the target node and the target connection are located in the redraw rendering area in the workflow canvas. The browser performance test is performed on the redraw rendering area. According to the test result, since only the dragged node and the workflow connection connected to the node are updated in the workflow, the rendering frame rate of the workflow canvas is stable at 60 fps (frames per second), and the GPU memory required for local update of the workflow is low. Therefore, it can be seen that the browser performance and the workflow performance are improved through local update optimization.

[0103] In the above embodiment, the calling time of the corresponding event response function is determined based on the interval length of the workflow management event and the preset length, so as to realize function throttling, reduce the update frequency of the workflow, and improve the performance of the workflow.

[0104] In one embodiment, the above workflow construction method further includes detecting a workflow uninstall event triggered for the workflow; and calling an event response function corresponding to the workflow uninstall event to perform event unbinding and data cleaning on the workflow.

[0105] The workflow uninstall event is an event used to trigger a workflow uninstall operation. When the user requests to close the browser or the webpage corresponding to the workflow component, the corresponding workflow uninstall event can be triggered.

[0106] Specifically, after the terminal constructs the workflow, the terminal further binds the workflow to the workflow uninstall event. Further, the terminal detects the workflow uninstall event triggered for the workflow in real time. When the workflow uninstall event is detected, the event response function corresponding to the workflow uninstall event is called to unbind the events bound to the workflow, and the workflow data stored in the browser and the terminal locally is cleaned.

[0107] In one embodiment, before the terminal unbinds the event of the workflow from the workflow and cleans up the data by calling the event response function corresponding to the workflow unloading event, the terminal stores the workflow data corresponding to the currently displayed workflow on the workflow canvas to the server, so that when the user wants to build the workflow again, the terminal can directly obtain the workflow data from the server and restore the corresponding workflow based on the workflow data.

[0108] In the above embodiment, the workflow unloading event is bound to the workflow, so that when the workflow needs to be unloaded, the event response function corresponding to the workflow unloading event is called to unbind the event of the workflow and clean up the data.

[0109] In one embodiment, the event response function corresponding to the workflow management event is called to manage the workflow, including: obtaining object data corresponding to the workflow management event; taking the object data as an input parameter of the event response function corresponding to the workflow management event, and calling the event response function through an interface corresponding to the workflow management event; and managing the workflow according to the object data through the event response function.

[0110] The object data refers to data corresponding to a workflow object that needs to be updated at present, and the workflow object includes the workflow itself, workflow nodes in the workflow, and workflow connections, etc. The object data can be dynamically determined according to the workflow management event and the workflow object corresponding to the workflow management event.

[0111] Specifically, after detecting the workflow management event triggered for the workflow, the terminal determines the workflow object corresponding to the workflow management event, and obtains object data corresponding to each workflow object as object data corresponding to the workflow management event. Further, the terminal calls the corresponding event response function through the interface preconfigured for the workflow management event, takes the obtained object data as an input parameter of the event response function, and responds to the workflow management event according to the object data through the event response function to achieve management of the workflow.

[0112] In one embodiment, during the workflow component configuration process, an interface is preconfigured for each event in the workflow component configuration file. In this way, if multiple workflow objects in the workflow are bound to the same event in the workflow component configuration file, the workflow management events obtained by respectively binding the event for the multiple workflow objects during the workflow building process all pass through the same interface corresponding to the same event response function. In this way, it is not necessary to preconfigure the corresponding event response function and interface for each workflow management event, which can improve the efficiency of workflow code development collaboration while providing more operation modes for the workflow.

[0113] In one embodiment, during the workflow updating process, the terminal can call the corresponding event response function through the interface corresponding to the workflow management event to realize the updating of the workflow. The terminal transmits the object data corresponding to the workflow management event into the corresponding event response function through the interface in the form of array data.

[0114] In one embodiment, the terminal manages the event of the mouse click node and click line through the click event. Taking the click event of the click node as an example, the terminal detects the click event of the svg single node and the click event of the click line. <g>and <rect>The terminal detects a tag click event, and obtains node data such as a node identifier and node data content of an event target based on the click event. The terminal performs event management on a workflow link through a link event and a link deletion event. Taking the link event as an example, the terminal obtains a node identifier, a link identifier, and link direction information corresponding to the link event, and performs link association on a workflow node corresponding to the node identifier according to the link direction information through the workflow link corresponding to the link identifier. The terminal performs event management on the workflow through a mouse-over event and a mouse-away event. Taking the mouse-over event as an example, the terminal detects a mouse-over node event, and obtains mouse coordinates, a node identifier, and node data content based on the detected event, so as to display the obtained data to a user.

[0115] The terminal performs management operations such as workflow scaling and single-node dragging on the workflow through detection of a mouse scroll event and a mouse drag event. Taking the workflow scaling as an example, the terminal obtains mouse coordinates and all workflow information when detecting the mouse scroll event. Taking a single-node drag event as an example, the terminal obtains a node identifier of the node when detecting the drag event on the workflow node. The terminal redraws the entire workflow by detecting a size change of the workflow canvas. When detecting a mouse scroll or a browser size change, the terminal determines that the size of the workflow canvas changes, re-reads the size of a dom outside the changed workflow canvas, redraws the workflow canvas based on the re-read size of the dom, and dynamically adjusts the workflow based on the redrawn workflow canvas.

[0116] In the above embodiment, the respective interfaces are pre-configured for the workflow management events bound to the workflow, so that the event response functions are called through the interfaces to perform event response. In this way, the respective event response functions do not need to be configured for each workflow management event, which can reduce development cost and save development time.

[0117] In one embodiment, the above workflow construction method further includes: detecting a node style update operation triggered for the workflow; obtaining a target node display attribute according to the node style update operation; and updating node styles of the workflow nodes in the workflow according to the target node display attribute.

[0118] Among them, the node style update operation is an operation for triggering the node style update process, which can specifically be a trigger operation for a preset trigger control on the workflow canvas. Specifically, the terminal dynamically detects the node style update operation triggered by the user for the currently displayed workflow. When a node style update operation is detected, the corresponding target node display attribute is obtained according to the detected node style update operation, and the target node style is determined according to the target node display attribute, and the node style currently corresponding to each workflow node in the currently displayed workflow is dynamically updated according to the target node style, that is, the node style of each workflow node in the workflow is updated to the target node style, so as to realize the update of the node style of the workflow.

[0119] In the above embodiment, the target node display attribute is obtained based on the node style update operation, and the node style of each workflow node in the workflow is automatically updated based on the target node display attribute, so as to quickly realize the dynamic update of the node style.

[0120] like Figure 8 As shown, in one embodiment, a workflow construction method is provided, which specifically includes the following steps:

[0121] Step 802: Obtain workflow component configuration file.

[0122] Step 804: Initialize and obtain a workflow canvas according to the workflow component configuration file.

[0123] Step 806: Obtain the node data source and the link data source.

[0124] Step 808: Determine the node style corresponding to each node data in the node data source according to the node display properties in the workflow component configuration file, and construct the corresponding workflow node on the workflow canvas according to each node data and the corresponding node style.

[0125] Step 810 : According to the connection display properties in the workflow component configuration file, each connection data in the connection data source, and the workflow node corresponding to each connection data, a corresponding workflow connection is constructed on the workflow canvas to obtain a corresponding workflow.

[0126] Step 812: Bind events to the workflow.

[0127] Step 814: Detect workflow management events triggered by the workflow.

[0128] Step 816: When the workflow management event belongs to the first type of local event, intercept event bubbling in the workflow management event.

[0129] Step 818: Determine the target node and target link according to the workflow data corresponding to the workflow.

[0130] Step 820, calling the event response function corresponding to the workflow management event to manage the target node and the target connection line.

[0131] Step 822, when the workflow management event belongs to the second type of event, the interval duration of the workflow management event is counted.

[0132] Step 824, when the interval duration is greater than or equal to the preset duration, the event response function corresponding to the workflow management event is called to manage the workflow.

[0133] Step 826, detecting a workflow unloading event triggered for the workflow.

[0134] Step 828, calling the event response function corresponding to the workflow unloading event to event unbind and data clean the workflow.

[0135] In the above embodiment, based on the workflow component configuration file, the node data source and the connection line data source, the workflow is automatically constructed, which can improve the workflow construction efficiency. By event binding of the workflow, the whole life cycle management of the workflow based on the bound event is realized, and in the process of workflow management based on the event, the life cycle event is updated and optimized by function throttling, which can realize the effects of high performance, multi-function and multi-scene adaptation of the workflow.

[0136] It can be understood that, compared with the existing command-based workflow construction method, the workflow construction method based on the template provided in one or more embodiments of the present application has the advantages of simple construction, convenient management, no need for selector operation to realize workflow update, and data management using react component state, which can reduce the cost of workflow construction and management, and reduce the difficulty of workflow update.

[0137] Figure 9 The principle diagram for the whole life cycle management of the workflow in one embodiment is shown. As shown in Figure 9 , the workflow life cycle includes workflow construction, event binding, component update and workflow unloading. Among them, the component update can be the whole or partial update of the workflow based on the events bound by the workflow. It can be understood that, similar to Figure 9 , the life cycle of the component includes component construction, event binding, component update optimization and component unloading.

[0138] In one embodiment, the workflow component is built based on svg and react, capable of providing the writing mode of react's jsx and supporting the lifecycle management of react. It can be understood that the workflow component based on the react framework and the svg high-performance image format can be applied to many systems and quickly build a multi-node workflow with complex association relationships.

[0139] In one embodiment, in the process of building a workflow based on a workflow component configuration file, the terminal builds a workflow canvas based on the workflow component configuration file, and then further builds the corresponding workflow on the workflow canvas based on the further triggered workflow building operation of the user, or the terminal builds the workflow that has not been associated with the node data source on the workflow canvas according to the node display attribute, the connection display attribute and the connection data source in the workflow component configuration file, which is not limited here. It can be understood that the form of the workflow initially built by the terminal according to the workflow component configuration file can be determined according to the current application scenario.

[0140] In one embodiment, the operation performed by the terminal in one or more of the above embodiments can be performed by the terminal through the workflow component corresponding to the workflow component configuration file. The workflow component is a visual tool that can be used to control a certain working state and process the association of the node. The workflow component can be used to describe the complex dependency relationship of multiple tasks, that is, to display and layout the related association of multiple tasks in the task view, and can also be used to display the association of nodes in the inheritance relationship and blood relationship, and can also be used for web front-end display and operation related to the process and inter-process relationship, such as node deletion, addition, canvas size scaling, etc.

[0141] Figure 10 The interface diagram of the workflow component in one embodiment is shown in FIG. 1. Figure 10 As shown in FIG. 1, the workflow component includes two area components of an operation area and a display area, wherein the operation area includes a node control area, an arrangement control area, a zoom function area, a data acquisition area, and a node switching area, the node control area includes a node operation control for randomly generating a workflow node, a custom operation control for adding a workflow node after a specific workflow node, and a refresh operation control, the arrangement control area includes an automatic arrangement operation control for automatically arranging a workflow, an automatic arrangement operation control for undoing the automatic arrangement operation of the workflow, and a positioning operation control for automatic positioning, and the zoom function area includes an enlargement operation control for enlarging the size of the workflow canvas, a reduction operation control for reducing the size of the workflow canvas, and a restore operation control for restoring the size of the workflow canvas.

[0142] Further, the display area is used to display the workflow constructed on the workflow canvas by the workflow component. Figure 10 As shown, the workflow includes workflow nodes and workflow links, and the workflow links are used to represent the relationship between the workflow nodes. It can be understood that, Figure 10 The workflow shown is a workflow directly initialized based on the workflow component configuration file and not yet associated with the node data source in the actual application scenario. It is worth noting that, Figure 10 The number of workflow nodes and the connection relationship between the workflow nodes shown are only examples and are not used to specifically limit.

[0143] The above workflow component can realize the following functions: display nodes and links, overall drag, link drag and single node drag, area scaling, overall scaling, restore scaling, link, node coordinates controlled, node name, description, state, etc. not controlled, automatic node layout, layout step undo, provide component creation method, template creation method and partial rendering method, etc.

[0144] Figure 11 An effect diagram of expanding the workflow according to the workflow nodes in one embodiment. Figure 11 The subgraph corresponding to reference numeral 1102 is a partial interface diagram of the workflow component initially obtained, and the subgraph corresponding to reference numeral 1104 is an interface diagram obtained after the workflow is expanded according to the workflow nodes. Among them, after detecting that the user triggers a click event for the workflow node with the node identifier "specific task name", if it is further detected that the user triggers an operation for the custom operation control in the operation area, the next workflow node is automatically expanded on the basis of the workflow node, and a new workflow link is constructed between the workflow node and the newly added next workflow node.

[0145] Figure 12 An effect diagram of automatically arranging the workflow in one embodiment. Figure 12 The subgraph corresponding to reference numeral 1202 is a partial interface diagram of the workflow component initially obtained, and the workflow link in the workflow currently displayed in the workflow component is relatively complex, that is, the layout of the workflow is relatively complex. The terminal automatically arranges the workflow shown in the subgraph corresponding to reference numeral 1202 according to the trigger operation of the user for the automatic arrangement operation control, which can automatically simplify the complex layout of the workflow, and obtain the workflow with clear connection relationship between the workflow nodes shown in reference numeral 1204. In one embodiment, when the terminal automatically arranges the workflow according to the trigger operation of the user for the automatic arrangement operation control, a third-party library needs to be called to realize the automatic arrangement of the workflow.

[0146] Figure 13 Fig. 1 is a schematic diagram of the effect of quick operation on a workflow in an embodiment. As shown in Fig. 1, the terminal can realize zooming and dragging of a target node according to a trigger operation of a user on the target node, and the terminal can also realize quick search of node data according to a workflow node. Figure 13

[0147] Figure 14 Fig. 4 is a schematic diagram of the effect of updating a node style in an embodiment. When the terminal detects a trigger operation of a user on a switching node operation control of an operation area, the terminal dynamically adjusts the node style and layout style of the currently displayed workflow according to a node display attribute preconfigured for a workflow component. Figure 10 Fig. 5 is a workflow before the node style is adjusted, and Fig. 6 is a workflow after the node style is adjusted. Figure 14

[0148] Figure 15 Fig. 7 is a display interface diagram of a workflow component when a large number of workflow nodes exist in an embodiment. As shown in Fig. 7, the workflow component can support display and operation of hundreds of workflow nodes, thereby embodying that the workflow component has high performance. Figure 15

[0149] In an embodiment, the workflow component involved in one or more embodiments described above can be applied to the following scenarios: as a workflow management component applied to application scenarios such as workflow view and data display, used for data view management in application scenarios such as data dependency and blood relationship, used for task description in application scenarios such as task history data display, or other application scenarios of constructing and displaying a workflow for a data form that can be displayed by a workflow. In an embodiment, the workflow component described above can be applied to a big data kit system.

[0150] It should be understood that, although Figure 2 the various steps in the flowcharts of Figure 8 are shown in sequential order, such processes can be conducted in other orders. Unless explicitly stated, as it is apparent that the order of execution of the steps has no strict sequence limitation, the steps can be executed in other orders. Moreover, Figure 2 at least part of the steps in Figure 8 may include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be executed in rotation or alternation with other steps or steps or stages in other steps.

[0151] In an embodiment, as shown in Fig. 8, the workflow component can be applied to a big data kit system. Figure 16 ​​​As shown, a workflow construction apparatus 1600 is provided, which can be a part of a computer device in the form of a software module or a hardware module, or a combination of both, and specifically includes a first obtaining module 1601, a canvas construction module 1602, a second obtaining module 1603, a node construction module 1604, and a workflow construction module 1605, wherein:

[0152] The first obtaining module 1601 is configured to obtain a workflow component configuration file.

[0153] The canvas construction module 1602 is configured to initialize a workflow canvas according to the workflow component configuration file.

[0154] The second obtaining module 1603 is configured to obtain node data sources and connection data sources.

[0155] The node construction module 1604 is configured to determine a node style corresponding to each node data in the node data sources according to a node display attribute in the workflow component configuration file, and construct a corresponding workflow node on the workflow canvas according to each node data in the node data sources and the corresponding node style.

[0156] The workflow construction module 1605 is configured to construct a corresponding workflow connection on the workflow canvas according to a connection display attribute in the workflow component configuration file, each connection data in the connection data sources, and a workflow node corresponding to each connection data, to obtain a corresponding workflow.

[0157] In an embodiment, the above-mentioned workflow construction apparatus 1600 further includes a workflow management module.

[0158] The workflow management module is configured to bind events to the workflow, detect a workflow management event triggered for the workflow, and call an event response function corresponding to the workflow management event to manage the workflow.

[0159] In an embodiment, the workflow management module is further configured to, when the workflow management event belongs to a first type of local event, intercept event bubbling in the workflow management event, determine a target node and a target connection according to workflow data corresponding to the workflow, and call the event response function corresponding to the workflow management event to manage the target node and the target connection.

[0160] In an embodiment, the workflow management module is further configured to, when the workflow management event belongs to a second type of event, count an interval duration of the workflow management event, and call the event response function corresponding to the workflow management event to manage the workflow when the interval duration is greater than or equal to a preset duration.

[0161] In an embodiment, the workflow management module is further configured to detect a workflow unloading event triggered for the workflow; and invoke an event response function corresponding to the workflow unloading event to perform event unbinding and data cleaning on the workflow.

[0162] In an embodiment, the workflow management module is further configured to obtain object data corresponding to the workflow management event; use the object data as an input parameter of an event response function corresponding to the workflow management event, and invoke the event response function through an interface corresponding to the workflow management event; and manage the workflow according to the object data through the event response function.

[0163] In an embodiment, the workflow management module is further configured to detect a node style updating operation triggered for the workflow; obtain target node display attributes according to the node style updating operation; and update node styles of each workflow node in the workflow according to the target node display attributes.

[0164] The specific limitations of the workflow construction apparatus can be referred to the limitations of the workflow construction method described above, and will not be repeated here. Each module in the above workflow construction apparatus can be realized by software, hardware and combinations thereof, in whole or in part. Each module described above can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each module.

[0165] In an embodiment, a computer device is provided, which can be a terminal, and the internal structure diagram thereof can be as shown in Figure 17 The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The communication interface of the computer device is configured to perform wired or wireless communication with an external terminal. The wireless communication can be achieved through WIFI, operator network, NFC (near field communication) or other technologies. The computer program is executed by the processor to implement a workflow construction method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device. In addition, an external keyboard, touchpad or mouse can also be used.

[0166] Those skilled in the art can understand that Figure 17 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0167] In an embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above-mentioned method embodiments when executing the computer program.

[0168] In an embodiment, a computer readable storage medium is provided, storing a computer program, which, when executed by a processor, implements the steps in the above-mentioned method embodiments.

[0169] In an embodiment, a computer program product or computer program is provided, including computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the steps in the above-mentioned method embodiments.

[0170] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer readable storage medium and, when executed, can include the processes of the above-mentioned embodiments. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not as a limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0171] Each technical feature of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described, however, as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.

[0172] The above-described embodiments are merely illustrative of several embodiments of the present application, which are described in more detail and in a specific and detailed manner, but should not be construed as limiting the scope of the patent. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the concept of the present application, and these are all within the scope of the present application. Therefore, the scope of protection of the patent of the present application should be subject to the appended claims.< / rect> < / g> < / path> < / path> < / g> < / path> < / g> < / text> < / circle> < / text> < / rect> < / g> < / circle> < / text> < / rect> < / g> ​< / path> < / circle> < / text> < / rect> < / g> < / g> < / path> < / g> < / circle> < / text> < / rect> < / g>

Claims

1. A workflow construction method, characterized in that: The method comprises: Obtaining a workflow component configuration file, and initializing a workflow canvas according to the workflow component configuration file; Get the node data source and the connection data source; Determine, according to the node display attributes in the workflow component configuration file, a node style corresponding to each node data in the node data source, and construct a corresponding workflow node on the workflow canvas according to each node data and the corresponding node style; According to the connection display attributes in the workflow component configuration file, each connection data in the connection data source, and the workflow node corresponding to each connection data, a corresponding workflow connection is constructed on the workflow canvas to obtain a corresponding workflow; Event binding is performed on the workflow, workflow management events triggered for the workflow are detected, and event response functions corresponding to the workflow management events are called to manage the workflow; the workflow management events include: global events obtained by binding events pre-configured in the workflow component configuration file to the workflow canvas, and local events obtained by binding the pre-configured events to the workflow nodes or workflow connections; the events pre-configured in the workflow component configuration file include: first-category events requiring local update optimization, and second-category events requiring function throttling optimization; The calling of the event response function corresponding to the workflow management event to manage the workflow includes: when the workflow management event belongs to a first type of local event, intercepting event bubbling in the workflow management event to prevent the workflow management event belonging to the first type of local event from being propagated to the workflow management event in the first type of global event; the first type of local event includes dragging a single node of the workflow, and the first type of global event includes dragging the entire workflow; determining a target node and a target connection based on workflow data corresponding to the workflow; calling the event response function corresponding to the workflow management event to manage the target node and the target connection, locally updating the workflow canvas, and synchronizing the locally updated data to the front-end framework status information after the update is completed; The calling of the event response function corresponding to the workflow management event to manage the workflow also includes: when the workflow management event belongs to the second type of event, counting the interval duration of the workflow management event; the interval duration of the workflow management event refers to the time interval between two adjacent detections of workflow management events; the second type of event includes a second global event bound to the workflow canvas, and a second local event bound to the workflow node or the workflow connection; when the interval duration is greater than or equal to the preset duration, calling the event response function corresponding to the workflow management event to manage the workflow, and synchronizing the status of the workflow canvas, the workflow node, or the workflow connection to the front-end framework status management.

2. The method according to claim 1, characterized in that The method further comprises: Detecting a workflow uninstallation event triggered for the workflow; The event response function corresponding to the workflow uninstallation event is called to perform event unbinding and data cleanup on the workflow.

3. The method according to claim 1, characterized in that The calling of the event response function corresponding to the workflow management event to manage the workflow includes: Obtaining object data corresponding to the workflow management event; Using the object data as an input parameter of an event response function corresponding to the workflow management event, and calling the event response function through an interface corresponding to the workflow management event; The workflow is managed according to the object data through the event response function.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: Detecting a node style update operation triggered for the workflow; Obtain target node display attributes according to the node style update operation; The node style of each workflow node in the workflow is updated according to the target node display attribute.

5. The method according to any one of claims 1 to 3, characterized in that The workflow data corresponding to the workflow includes a node data source and a connection data source corresponding to the workflow; and determining a target node and a target connection according to the workflow data corresponding to the workflow includes: Determine the workflow node bound to the workflow management event, and determine, from the node data source and the connection data source corresponding to the workflow, the workflow node and / or workflow connection that has a connection association relationship with the workflow node; The workflow node determined from the node data source and the workflow node bound to the workflow management event are determined as the target node, and the workflow link determined from the link data source is determined as the target link.

6. The method according to any one of claims 1 to 3, characterized in that The node data source includes one or more node data, each of which corresponds to a workflow node; the connection data source includes one or more connection data, each of which corresponds to a workflow connection; Among them, each of the node data includes a node identifier, a node title, node data content, and node coordinates; each of the connection data includes a starting node identifier and an ending node identifier, which are used to construct a workflow connection that connects the workflow nodes corresponding to the starting node identifier and the ending node identifier.

7. The method according to any one of claims 1 to 3, characterized in that The node display attributes are used to characterize the attribute features or attribute data of the display style of the workflow node. The node display attributes include a workflow node template, which is used to determine the node style of the workflow node when it is visually displayed on the workflow canvas. The node style represents the display style or form of the workflow node.

8. The method according to any one of claims 1 to 3, characterized in that The events pre-configured in the workflow component configuration file also include: a third type of event that does not require performance optimization; wherein, by respectively binding the first type of event, the second type of event, and the third type of event to the workflow canvas, corresponding first type of global events, second type of global events, and third type of global events are obtained; by respectively binding the first type of event, the second type of event, and the third type of event to the workflow node or the workflow line, corresponding first type of local events, second type of local events, and third type of local events are obtained.

9. A workflow construction device, characterized in that: The device comprises: A first acquisition module is used to acquire a workflow component configuration file; A canvas construction module, configured to initialize and obtain a workflow canvas according to the workflow component configuration file; The second acquisition module is used to obtain the node data source and the connection data source; A node construction module is used to determine the node style corresponding to each node data in the node data source according to the node display attributes in the workflow component configuration file, and construct a corresponding workflow node on the workflow canvas according to each node data and the corresponding node style; A workflow construction module is configured to construct corresponding workflow connections on the workflow canvas based on connection display properties in the workflow component configuration file, each connection data in the connection data source, and the workflow node corresponding to each connection data, thereby obtaining a corresponding workflow; A workflow management module is configured to perform event binding on the workflow, detect workflow management events triggered for the workflow, and call event response functions corresponding to the workflow management events to manage the workflow; the workflow management events include: global events obtained by binding events pre-configured in the workflow component configuration file to the workflow canvas, and local events obtained by binding the pre-configured events to the workflow nodes or workflow connections; the events pre-configured in the workflow component configuration file include: first-category events requiring local update optimization, and second-category events requiring function throttling optimization; The workflow management module is further configured to: when the workflow management event belongs to a first type of local event, intercept event bubbling in the workflow management event to prevent the workflow management event belonging to the first type of local event from propagating to a workflow management event in a first type of global event; the first type of local event includes dragging a single node of a workflow, and the first type of global event includes dragging an entire workflow; determine a target node and a target connection based on workflow data corresponding to the workflow; call an event response function corresponding to the workflow management event to manage the target node and the target connection, locally update the workflow canvas, and synchronize the locally updated data with the front-end framework status information after the update is completed; The workflow management module is further configured to: When the workflow management event belongs to the second type of event, the interval duration of the workflow management event is counted; the interval duration of the workflow management event refers to the time interval between two adjacent detections of workflow management events; when the interval duration is greater than or equal to the preset duration, the event response function corresponding to the workflow management event is called to manage the workflow, and the status of the workflow canvas, the workflow node, or the workflow connection is synchronized to the front-end framework status management.

10. The device according to claim 9, characterized in that The workflow management module is further configured to: Detecting a workflow uninstallation event triggered for the workflow; calling an event response function corresponding to the workflow uninstallation event to perform event unbinding and data cleanup on the workflow.

11. The device according to claim 10, characterized in that The workflow management module is further configured to: Obtaining object data corresponding to the workflow management event; using the object data as an input parameter of an event response function corresponding to the workflow management event, and calling the event response function through an interface corresponding to the workflow management event; The workflow is managed according to the object data through the event response function.

12. The device according to any one of claims 9 to 11, characterized in that The workflow management module is further configured to: Detecting a node style update operation triggered for the workflow; obtaining a target node display attribute according to the node style update operation; and updating a node style of each workflow node in the workflow according to the target node display attribute.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

14. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Method, system and terminal device for establishing working process

    CN102831497A

  • Method, device, terminal and storage medium for controlling widget

    CN109284046A

  • Plug-in node configuration method and device, equipment and storage medium

    CN110708202A