Method and Application for Implementing Multithreaded Task Process Scheduling
Through the combination of task designer and process scheduling tools, visual design and efficient scheduling of multi-threaded task processes are realized, solving the complexity and maintenance difficulties of traditional multi-threaded scheduling, and improving development efficiency and system adaptability.
Patent Information
- Application Number
- CN202411890512.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-20
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2044-12-20
AI Technical Summary
In traditional software development, multi-threaded tasks are complex, error-prone and difficult to maintain, especially in the field of industrial control, which is difficult to meet complex and changeable needs.
Using task designer and process scheduling tools, multi-threaded task processes are created and defined through visual means, serial and parallel relationships are supported, task workflows are built based on functional modules, and efficient data flow between modules is realized through data binding, and the scheduling tools optimize task execution.
It significantly reduces the difficulty and technical threshold of multi-threaded development, improves development efficiency and system maintainability, and adapts to the needs of complex and changeable industrial control fields.
Smart Images

Figure CN120085973B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer software, and particularly relates to a method for implementing multi-threaded task process scheduling and its application. Background Art
[0002] In the current era of rapid development of information technology, software development is increasingly widely used in various industries. Especially in the industrial control (industrial automation) field, the complexity and reliability requirements of software systems are extremely high. Traditional software development mainly relies on manual coding, and software functions are implemented by writing codes in various programming languages. However, with the continuous growth and complexity of application requirements, the traditional coding method faces many challenges and limitations.
[0003] Implementing parallel or synchronous execution of multi-tasks is a key task in software development. In the traditional coding mode, developers need to manually write multi-threaded codes to ensure that multiple tasks can run efficiently simultaneously or execute in a specific order. This not only increases the complexity of development but also significantly raises the risk of errors. Multi-threaded programming involves the creation, synchronization, communication of threads, as well as the sharing and management of resources. Any problem in any link may lead to program instability and performance degradation. In addition, the multi-threaded debugging process is complex, and developers need to invest a lot of time and effort to locate and fix thread-related errors, which is particularly difficult in the case of tight project schedules.
[0004] Therefore, in view of the above technical problems, it is necessary to provide a new solution. Summary of the Invention
[0005] The object of the present invention is to provide a method for implementing multi-threaded task process scheduling and its application, which can transform the multi-threaded task process scheduling from traditional complex manual coding into a simple and efficient process design, and provides a more intuitive, flexible and easy-to-maintain solution.
[0006] To achieve the above object, the technical solution provided by the present invention is as follows:
[0007] In the first aspect, the present invention provides a method for implementing multi-threaded task process scheduling, which includes:
[0008] The task designer responds to the user's request operation for a multi-threaded process, creates multiple processes to be executed, and defines the serial or parallel execution relationship between the multiple processes to be executed. The processes to be executed include passive processes and active processes. Based on the function modules provided by the task designer, a task workflow is built for each process to be executed. The task workflow is composed of function modules in a predetermined logical order. Each function module in the task workflow is configured to bind reference data and configure output data that can be referenced by other function modules. Based on the process scheduling tool, the execution relationship between the processes to be executed is scheduled to achieve synchronous or asynchronous execution of the multi-threaded task process.
[0009] In one or more embodiments, the task designer is used to design and manage multiple task processes and is a graphical display window for configuring the attributes of each task process.
[0010] In one or more embodiments, the process scheduling tool includes a trigger. The trigger accesses the task designer through a delegate to obtain all passive processes in the task designer and selects one of the passive processes to be triggered for execution in response to the user's configuration operation.
[0011] In one or more embodiments, the method includes: in response to the user's trigger configuration request, presenting a trigger configuration interface. The trigger configuration interface includes a reference dependency control, a trigger process control, a wait-for-process-to-end control, a binding control, and a manual trigger control. In response to an operation on the reference dependency control, selecting the pre-dependency condition for executing the task process. In response to an operation on the trigger process control, selecting the passive process that needs to be triggered for execution. In response to an operation on the wait-for-process-to-end control, controlling the passive process selected by the trigger process control to be triggered synchronously or in the background. In response to an operation on the binding control, binding the selected pre-dependency condition and the passive process. In response to an operation on the manual trigger control, triggering the execution of the selected passive process.
[0012] In one or more embodiments, the process scheduling tool includes a run process tool. The run process tool accesses the task designer through a delegate to obtain all passive processes in the task designer and selects one of the passive processes to be executed in response to the user's execution operation.
[0013] In one or more embodiments, the process scheduling tool includes a merge process tool. The merge process tool accesses the task designer through a delegate to obtain all passive processes in the task designer and selects multiple passive processes to run in parallel in response to the user's merge operation.
[0014] In one or more embodiments, the method includes: in response to a user's request for a merging process, presenting a merging process configuration interface, the merging process tool configuration interface including an adding control, an enabling process control, an all-process control, and any-process control; in response to an operation on the adding control, automatically adding all passive processes to the merging process tool and presenting them in the merging process tool configuration interface; in response to an operation on the enabling process control, selecting or deselecting the passive processes presented in the merging process tool configuration interface; in response to an operation on the all-process control, waiting for all processes to be executed to finish running before returning the running result of the merging process tool; in response to an operation on the any-process control, after any selected passive process finishes running, the merging process tool ends running and returns the running result.
[0015] In a second aspect, the present invention provides a multi-threaded task process scheduling system, which includes: a task designer, a workflow module, a configuration module, and a process scheduling tool; the task designer is used to respond to a user's request operation for a multi-threaded process, create multiple processes to be executed, and define the serial or parallel execution relationship between the multiple processes to be executed, the processes to be executed including passive processes and active processes; the workflow module is used to build a task workflow for each process to be executed based on the functional modules provided by the task designer, the task workflow being composed of functional modules in a predetermined logical order; the configuration module is used to configure each functional module in the task workflow, bind reference data to each functional module, and configure output data that can be referenced by other functional modules; the process scheduling tool is used to schedule the execution relationship between the various processes to be executed to achieve synchronous or asynchronous execution of the multi-threaded task process.
[0016] In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the method for implementing multi-threaded task process scheduling as described above when executing the program.
[0017] In a fourth aspect, the present invention provides a computer-readable medium, which carries computer-executable instructions, and the computer-executable instructions are used to implement the method for implementing multi-threaded task process scheduling as described above when executed by a processor.
[0018] Compared with the prior art, the method for implementing multi-threaded task process scheduling and its application provided by the present invention combine a task designer and a process scheduling tool to provide a modular, visual, and efficient multi-threaded task management method; the task designer can intuitively create and define the process to be executed, support flexible setting of serial and parallel relationships, and significantly reduce the complexity of task logic design; build a task workflow based on functional modules and achieve efficient data flow between modules through data binding, making the task execution logic clear and easy to maintain; the process scheduling tool further optimizes the execution and scheduling of tasks, supports various execution modes of synchronous and asynchronous, meets the requirements of different scenarios, and improves the adaptability and efficiency of the system; users can quickly design, configure, and schedule task processes without in-depth programming, greatly reducing the development threshold. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present invention, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0020] Figure 1 It is a flowchart of the method for implementing multi-threaded task process scheduling in an embodiment of the present invention;
[0021] Figure 2 It is a schematic diagram of a task workflow in an embodiment of the present invention;
[0022] Figure 3 It is a schematic diagram of a trigger configuration interface in an embodiment of the present invention;
[0023] Figure 4 It is a schematic diagram of a running process tool configuration interface in an embodiment of the present invention;
[0024] Figure 5 It is a schematic diagram of a merge process tool configuration interface in an embodiment of the present invention;
[0025] Figure 6 It is a structural block diagram of a multi-threaded task process scheduling system in an embodiment of the present invention;
[0026] Figure 7 It is a structural block diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0027] To enable those skilled in the art to better understand the technical solutions in the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the scope of protection of the present invention.
[0028] With the rapid development of information technology, software is increasingly widely used in various industries. Especially in the field of industrial control (industrial automation), the complexity and reliability requirements of software systems are extremely high. However, the existing software development methods mainly rely on manual coding, and realize software functions by writing codes in various programming languages. This traditional coding method faces many challenges and limitations when implementing multi-task parallel or synchronous execution. Especially in the industrial control field, with a tight development cycle, heavy tasks, and complex processes, it leads to low development efficiency and difficult maintenance.
[0029] Through in-depth analysis of the existing technology, the inventors found that there are significant defects in the traditional coding method in multi-thread task scheduling. First of all, manually writing multi-threaded code not only increases the complexity of development, but also easily introduces errors, resulting in system instability. Secondly, the multi-thread debugging process is complex, and developers need to invest a lot of time and effort to locate and fix thread-related errors, further extending the development cycle of the project. In addition, the traditional coding method has relatively high requirements for the professional skills of maintenance personnel, and the modularity and visualization of the system are relatively low, making it difficult for later maintenance and upgrade, increasing the human and cost input of enterprises.
[0030] In view of the above problems, the present invention proposes a method for implementing multi-thread task process scheduling on a zero-code platform. The core idea of this method is to simplify the design, configuration, and management process of multi-thread tasks by providing a visual task design tool and a flexible process scheduling mechanism, thereby reducing the technical threshold of development, improving development efficiency, and enhancing the maintainability of the system.
[0031] Specifically, the method of the present invention responds to the user's multi-thread process operation request through a task designer, creates multiple processes to be executed, and defines the execution relationships between these processes. Based on the function modules provided by the task designer, a task workflow is built for each process to be executed, and each function module is configured to bind reference data and output data. Finally, a process scheduling tool is used to schedule the execution relationships between the processes to be executed, realizing synchronous or asynchronous execution of the multi-thread task process.
[0032] Through the foregoing method, the present invention transforms the complex multi-threaded task scheduling process into a user-friendly visual operation. Developers can implement the parallel or synchronous execution of multi-tasks without writing heavy codes. This not only significantly reduces the difficulty and technical threshold of multi-threaded development, but also greatly improves the development efficiency and system maintainability. At the same time, the modular design of the system and the flexible process scheduling mechanism enable it to adapt to the complex and ever-changing requirements in the industrial control field, and have good scalability and adaptability.
[0033] Please refer to Figure 1 as shown in the flowchart of the method for multi-threaded task process scheduling in an embodiment of the present invention. The method for implementing multi-threaded task process scheduling specifically includes the following steps:
[0034] S101: The task designer responds to the user's request operation for the multi-threaded process, creates multiple processes to be executed, and defines the serial or parallel execution relationship between the multiple processes to be executed. The processes to be executed include passive processes and active processes.
[0035] It should be noted that the task designer is a graphical interface based on a zero-code or low-code development platform (such as the GraniStudio platform), which allows users to intuitively create and manage task processes through operations such as dragging and configuration. In this process, users can decompose complex multi-task processes into multiple independent processes to be executed based on operation requirements. These processes can be further classified into passive processes and active processes. An active process can run independently, such as a predetermined automatic task; a passive process needs to be triggered and started by other processes, such as a response operation under a certain event drive.
[0036] In the present invention, the forms of the task designer include a canvas task designer, a tree task designer, and other node-based task designers.
[0037] The canvas task designer is a task design tool based on a graphical interface. Users can design task processes by dragging and connecting nodes. It is suitable for scenarios where task logic needs to be intuitively expressed. Especially when the task process is relatively complex or the parallel and dependency relationships between processes need to be shown, the canvas designer has significant advantages.
[0038] The tree task designer displays the task process in a hierarchical structure, organizes tasks into a tree structure, and each node represents a task unit, and the sub-nodes represent its sub-tasks or dependent tasks. The tree designer is more suitable for task logic scenarios with obvious hierarchical relationships, such as project management and process approval.
[0039] The node task designer is a more general logical design tool applicable to scenarios where any task logic is expressed through connections between nodes. Node designers typically support advanced functions such as logical conditional branching, looping, and parallel control, and can be used to design highly dynamic and complex task flows.
[0040] In terms of specific implementation methods, the task designer realizes the modular and visual management of multi-threaded tasks by providing flexible process design tools. Users can create multiple processes in the designer, and each process can be regarded as an independent task unit. Users can define the execution order (serial) or parallel relationship of these processes through configuration options. The serial relationship means that the processes are executed in sequence one after another, and the completion of one process is a prerequisite for the start of the next process; the parallel relationship allows multiple processes to run simultaneously and independently of each other. The designer also allows users to define the attributes of the processes, such as setting the trigger conditions of the processes, associated event sources, etc.
[0041] For example, in an industrial control application scenario, a user needs to design a task flow to complete multi-process operations on an assembly line. Suppose the first step of the assembly line is to detect the product size, the second step is to mark the products that meet the standards, and the third step is to package the marked products. The user can create three processes through the task designer: the size detection process, the product marking process, and the packaging process. The size detection process can be defined as an active process because it is the first step automatically triggered after the assembly line starts; the product marking process and the packaging process can be defined as passive processes, triggered by the completion events of the size detection process and the marking process respectively. At the same time, if the packaging process involves multiple equipment operations, it can be further refined into multiple parallel processes, such as sub-processes like sealing and labeling.
[0042] By clarifying the serial or parallel relationship between processes, the task designer helps users sort out the execution order and interdependent relationship of tasks at the logical level. This intuitive design method not only reduces the complexity of multi-threaded task planning but also significantly improves the readability and management efficiency of task flows. In addition, the modular design of processes facilitates subsequent adjustment and optimization. For example, when requirements change, users only need to modify the execution relationship or attributes of relevant processes without having to rewrite the underlying code.
[0043] In an exemplary embodiment, the task designer is used to design and manage multiple task flows and a graphical display window for configuring the attributes of each task flow. The task designer also provides a task flow manager for managing all process information in the canvas, including process ID, process name, and process attributes.
[0044] The functions of the task designer include designing multiple task processes, managing the execution relationships of the processes, configuring the attributes of the processes, and associating a graphical display window with each process. For example, for the canvas task designer, an interactive canvas area can be provided. Users can add task process modules to the canvas by dragging and define the relationships between the processes through connection lines. Each task process module can be configured with its own attributes, including process ID, process name, execution conditions, etc. At the same time, the task designer supports associating a graphical display window with the task process. This window can display the running status of the process, data flow, etc., enabling users to monitor the execution process of the process in real time.
[0045] For example, in an industrial production scenario, users need to design a control task process for an assembly line. Users can create multiple process modules in the task designer, such as "loading process", "detection process", and "packaging process". Each module can define its execution conditions through attribute configuration. For example, the "detection process" is automatically triggered after the "loading process" starts, and the "packaging process" is only triggered after the "detection process" completes specific data collection. At the same time, users can associate a display window with the "detection process" to monitor the detection data of the sensors in real time, thus ensuring the quality control of the production process.
[0046] Another core function of the task designer is to provide a task process manager. The task process manager is a centralized tool used to record and manage all process information in the canvas, including the ID, name, and attributes of each process. Through the task process manager, users can quickly search for, modify, or delete the configuration information of a specific process, thus simplifying the management and maintenance of the task process. For example, if a user needs to adjust the execution conditions of the "detection process", they can directly find the corresponding process in the task process manager and modify its configuration without having to redesign it on the canvas.
[0047] The role of the task designer is not limited to design and configuration, but also reflected in its organization and optimization of task processes. By splitting complex tasks into multiple modular processes and clearly presenting them on the canvas, the task designer helps users grasp the logical structure of the task as a whole. In addition, the associated graphical display window visualizes the running status of the process, helping users monitor and diagnose problems in real time, significantly improving the running reliability of the task process.
[0048] S102: Based on the function modules provided by the task designer, build a task workflow for each process to be executed. The task workflow is composed of function modules in a predetermined logical order.
[0049] A task workflow can be understood as a flowchart or task diagram composed of multiple functional modules combined in a predetermined logical order. It is the logical carrier for implementing specific tasks and the basis for multi-threaded task scheduling. In a task workflow, functional modules, as basic units, are interconnected according to established logical relationships to form a complete execution system. Through this process, the present invention not only clarifies the logic of complex tasks but also significantly reduces the difficulty and error rate of multi-threaded task development. Figure 2 It is a schematic diagram of the task workflow in an embodiment of the present invention.
[0050] In actual implementation, the task designer provides a series of functional modules, which cover functions such as data processing, condition judgment, task triggering, and result output. Users can build a task workflow by selecting, configuring these modules and connecting them in the execution order. For example, users can drag functional modules onto the canvas in the canvas task designer, set input conditions, output results, and execution logic for each functional module, and then connect the modules in series through wires to form a workflow with complete functions. The setting of the predetermined logical order can be based on the specific requirements of the task, such as arranging in chronological order, condition-triggering order, or data flow order.
[0051] For example, in a quality inspection scenario, assume that a certain production line needs to complete the following tasks in sequence: product image acquisition, size detection, defect identification, and result storage. Through the task designer, users can create an image acquisition module, a detection module, an identification module, and a storage module for these tasks respectively, and connect them in series according to the execution logic. The logical order of the workflow can be set as follows: when the image acquisition module is completed, the size detection module is automatically triggered; if the detection passes, the defect identification module is started; if the identification is confirmed to be correct, the results are stored in the database. Each module independently executes its specific function, and the workflow ensures their coordinated operation through logical relationships.
[0052] By decomposing complex tasks into multiple modular units and connecting these units in series through a workflow, developers can overall control the logical structure of the tasks and avoid problems such as logical confusion or incorrect dependency relationships. The modular and visual workflow design method makes the design process of complex tasks intuitive and clear, reducing the development threshold. Especially in a multi-threaded scenario, the task workflow makes the execution relationships, data dependencies, and triggering conditions of each thread obvious, thus greatly reducing the workload of development and debugging.
[0053] Since each functional module is an independent unit, users can adjust the configuration of the module or replace the module itself without reconstructing the entire process. For example, in the above quality inspection scenario, if a new task requirement is added to send an alarm for unqualified products, only an "alarm module" needs to be inserted into the workflow and its trigger condition is set to failure of defect identification. This modular and extensible design approach significantly improves the adaptability of the system.
[0054] In addition, the predefined logical order of the task workflow also supports various complex execution logics, including conditional branching, looping, and concurrency. For example, in an inspection pipeline, branch logic can be set for the "dimension inspection module": if the dimension is within the qualified range, the subsequent module is triggered; if not, it is directly stored as a non-conforming record and the process is terminated. This flexible logical design ability further enhances the application scope of the task workflow.
[0055] S103: Configure each functional module in the task workflow, bind reference data to each functional module, and configure output data that can be referenced by other functional modules.
[0056] By binding reference data to the module and configuring the output data, it ensures that the data flow and logical connection between modules can be smoothly realized. The data reference relationship between functional modules is similar to shared variables or message passing in multi-threaded tasks, which ensures the tight connection and logical consistency of each link in the task process.
[0057] The task designer provides an independent configuration interface for each functional module. Users can set the input and output of the functional module through the configuration interface. For example, users can bind the input data source required by a certain module, and these data may be the output from the previous module or other stored data in the system. In addition, users can also define the output data of the module to ensure that the subsequent module can correctly receive and use this data. The configuration process includes selecting the data source, defining the format and type of the output variable, and setting the conditions and rules for data flow.
[0058] In a specific implementation method, a "data binding wizard" tool can be provided to help users quickly complete data reference and binding. For example, in a task flow, if a certain module is responsible for collecting sensor data and the subsequent module needs to analyze these data, users can use the "data binding wizard" to bind the output data of the sensor collection module to the input end of the analysis module. At the same time, the analysis module can configure its output data type according to needs, such as generating an analysis report or outputting an alarm signal for further processing by the next module.
[0059] Taking an intelligent manufacturing scenario as an example, assume that the products on the assembly line need to go through three task modules: "dimension detection module", "defect identification module", and "qualified classification module". In the dimension detection module, the product dimensions collected by the sensor are set as the output data and bound as the input data for the subsequent defect identification module. The defect identification module then analyzes the product surface data and outputs a boolean value of "whether there is a defect", which is then bound to the qualified classification module to classify the product as "qualified" or "unqualified". Through the precise configuration of data references and outputs for each module, the entire workflow can be seamlessly connected to ensure the integrity of the logical chain.
[0060] S104: Based on the process scheduling tool, schedule the execution relationships between each to-be-executed process to achieve synchronous or asynchronous execution of the multi-threaded task process.
[0061] The core logic of the process scheduling tool scheduling includes two parts: the first is to clarify the dependency relationships between processes to ensure that each process starts or executes in parallel according to the predetermined logical order; the second is to determine the execution mode of the process, that is, synchronous execution or asynchronous execution. In the synchronous execution mode, the system needs to wait for the current process to complete before starting the subsequent process; while in the asynchronous execution mode, the start of the process has nothing to do with the completion of the current process, allowing multiple processes to run simultaneously.
[0062] In an exemplary embodiment, the process scheduling tool includes a trigger. The trigger accesses the task designer through delegation to obtain all passive processes in the task designer, and responds to the user's configuration operation to select and trigger the execution of one of the passive processes, and can be set to synchronous execution or background execution.
[0063] The trigger is one of the core components in the process scheduling tool. Its main function is to dynamically obtain all the passive processes therein through delegation to access the task designer, and selectively trigger the execution of one of the passive processes according to the user's configuration operation. The design purpose of the trigger is to solve the start logic problem between processes, enabling the task workflow to achieve flexible scheduling and execution in a way driven by set conditions or events.
[0064] The implementation method of the trigger depends on two core functions: process discovery and execution configuration. In the process discovery stage, the trigger accesses the task designer through the delegation mechanism, automatically obtains all the passive processes defined in the canvas, and displays these processes in an interactive configuration interface for the user to select. In the execution configuration stage, the user can set the trigger conditions and execution mode for the trigger according to the requirements, including synchronous execution or background execution.
[0065] Specifically, the configuration method of the trigger includes: in response to a trigger configuration request from the user, presenting a trigger configuration interface, where the trigger configuration interface includes a reference dependency control, a trigger process control, a wait-for-process-completion control, a binding control, and a manual trigger control; in response to an operation on the reference dependency control, selecting a precondition dependency for the execution task process; in response to an operation on the trigger process control, selecting a passive process that needs to be triggered for execution; in response to an operation on the wait-for-process-completion control, controlling the passive process selected by the trigger process control to be triggered synchronously or in the background; in response to an operation on the binding control, binding the selected precondition dependency and the passive process; and in response to an operation on the manual trigger control, triggering the execution of the selected passive process.
[0066] Figure 3 This is a schematic diagram of the trigger configuration interface in an embodiment of the present invention. The trigger configuration interface consists of multiple controls, each control undertakes different functions, and they cooperate to complete the trigger configuration task. Among them, the reference dependency control is used to select the precondition dependency of the trigger, that is, the execution operator for triggering the execution of the task process; the trigger process control is used to select the specific passive process that needs to be triggered for execution. The wait-for-process-completion control allows the user to specify the execution mode of the trigger, including synchronous trigger (waiting for the triggered process to complete) and background trigger (returning control immediately after triggering). The binding control realizes the logical binding of the selected precondition dependency and the passive process, and the manual trigger control provides the user with an option to manually start the process at runtime.
[0067] In a specific implementation, the configuration interface is usually presented in a graphical or form-based interface. The available execution operators (precondition dependencies) and passive processes are listed in the interface, and interactive options are provided. For example, the user can select an execution operator (such as "main process_receive text") from the drop-down menu of the reference dependency control, and then select a passive process (such as "process 1") in the trigger process control. If synchronous trigger is required, the user only needs to activate the wait-for-process-completion control; otherwise, the background trigger mode can be selected. The binding control is responsible for permanently recording the set dependency relationship in the process logic to ensure that the trigger works according to the set logic during actual operation.
[0068] In an exemplary embodiment, the process scheduling tool includes a running process tool. The running process tool accesses the task designer through delegation to obtain all passive processes in the task designer, and in response to the user's execution operation, selects one of the passive processes for execution, and can be set to execute synchronously or in the background. The running process tool can output the running time and the running status variable. The data type of the running time is GNumbericType, and the data type of the running status is bool, for use by other operators and the system. Figure 4Schematic diagram of the operation process tool configuration interface in an embodiment of the present invention.
[0069] The operation process tool first establishes a connection with the task designer through a delegation method. This delegation mechanism ensures that the operation process tool can access and obtain all passive processes defined on the canvas in real time, ensuring that users can always call the latest process configuration.
[0070] In the interface of the operation process tool, users can see a list of all available passive processes and, through a simple selection operation, specify a specific process to be executed. For example, in an intelligent manufacturing system, when an abnormality occurs in the production line, users may need to automatically start the "fault diagnosis process" to quickly locate and solve the problem. Through the operation process tool, users only need to select the "fault diagnosis process" from the passive process list and decide whether to execute it synchronously or in the background.
[0071] The operation process tool also has the function of outputting the running time and running status variables. The running time is represented by GNumbericType and records the execution time of the passive process, which is helpful for performance monitoring and optimization. For example, users can evaluate the efficiency of the "order confirmation process" by analyzing its running time and make process optimization or resource adjustment as needed. The running status variable is represented by a boolean type and indicates whether the passive process has been successfully completed. This function provides real-time execution feedback for other operators and systems, enabling the system to make dynamic adjustments or trigger subsequent operations based on the execution results of the process.
[0072] In an exemplary embodiment, the process scheduling tool includes a merging process tool. The merging process tool accesses the task designer through delegation to obtain all passive processes in the task designer, and in response to the user's merging operation, selects multiple passive processes to run in parallel and can be set to wait for all processes to end, wait for any process to end, or execute asynchronously.
[0073] In the specific implementation process, the merging process tool establishes a connection with the task designer through a delegation mechanism. This delegation access ensures that the merging process tool can obtain all defined passive processes on the canvas in real time, ensuring that users can call the latest process information when configuring the merging task. Passive processes usually refer to those task processes that need to be triggered by specific events or conditions, such as data backup, report generation, or exception handling. The merging process tool extracts the list of these passive processes from the task designer through interface calls and displays it to users in an intuitive way on the user interface.
[0074] In the interface of the merge process tool, the user can select multiple passive processes for parallel execution through simple selection operations. During the configuration process, the user can specify the execution modes of these parallel processes, specifically including waiting for all processes to end, waiting for any one process to end, or asynchronous execution. The mode of waiting for all processes to end means that the merge process tool will continue to perform subsequent operations only after all selected processes are completed; the mode of waiting for any one process to end is to immediately return control after any one process is completed, and the other uncompleted processes will continue to run in the background; the asynchronous execution mode allows all selected processes to start simultaneously and directly returns control without waiting for any one process to complete.
[0075] Specifically, the configuration method of the merge process tool includes: in response to the user's merge process request, presenting a merge process configuration interface, where the merge process tool configuration interface includes an add control, an enable process control, an all processes control, and any one process control; in response to an operation on the add control, automatically adding all passive processes to the merge process tool and presenting them in the merge process tool configuration interface; in response to an operation on the enable process control, selecting or deselecting the passive processes presented in the merge process tool configuration interface; in response to an operation on the all processes control, waiting for all processes to be executed to end before returning the operation result of the merge process tool; in response to an operation on the any one process control, after any one selected passive process ends, the merge process tool ends running and returns the operation result.
[0076] In a specific implementation, in response to the user's merge process request, the system presents a merge process configuration interface as the main operation interface for the user to configure process scheduling. The configuration interface includes the following core controls: the add control allows the user to load all available passive processes into the interface, and these processes are automatically obtained through interaction with the task designer; the enable process control provides the user with a free selection function to enable or disable certain processes among the added passive processes; the all processes control is used to set the execution logic of the merge process tool to "return after all processes are completed", which is applicable to scenarios with strict dependencies on process results; the any one process control allows the merge process tool to immediately return the operation result after any one passive process is completed, which is used for quick response or real-time processing requirements. Figure 5 This is a schematic diagram of the merge process tool configuration interface in an embodiment of the present invention.
[0077] The interaction method of the configuration interface can adopt a form-based or visual layout. For example, after the user clicks to add a control, the interface will display a list of all passive processes, including information such as the name, ID, and status of each process. The user can enable or disable specific processes through checkboxes and select the "All Processes" or "Any Process" mode at the bottom of the interface. After completing the configuration, the merge process tool will start the selected processes to run in parallel according to the user's settings and return the results when the set conditions are met.
[0078] The various process scheduling tools described above can be used alone, in combination with other tools, or cascaded in a logical order to achieve the development of complex task projects. By cascading multiple scheduling tools in a logical order, complex multi-task projects can be easily constructed to meet diverse business needs.
[0079] In specific implementations, the scenarios of using process scheduling tools alone mainly focus on the scheduling and management of independent tasks. For example, the run process tool can be used alone to trigger and manage the execution of a certain passive process; the merge process tool can independently manage the parallel running of multiple processes. In these scenarios, the user only needs to call a specific tool and configure its parameters to complete the task scheduling without relying on the assistance of other tools.
[0080] When the task logic is relatively complex, the process scheduling tools can be used in combination with other tools to achieve more powerful functions. For example, in a task chain, a trigger can be used to start processes under certain specific conditions, and at the same time, the run process tool and the merge process tool are combined to ensure the dynamic management and efficient execution of the task. In this mode, the trigger is responsible for starting the process, the run process tool manages the specific process execution, and the merge process tool ensures the synchronization or asynchronous coordination of multiple processes.
[0081] In summary, the method for implementing multi-threaded task process scheduling provided by the present invention combines a task designer and process scheduling tools to provide a modular, visual, and efficient multi-threaded task management method; the task designer can intuitively create and define the processes to be executed, support flexible setting of serial and parallel relationships, and significantly reduce the complexity of task logic design; build a task workflow based on functional modules and achieve efficient data flow between modules through data binding, making the task execution logic clear and easy to maintain; the process scheduling tools further optimize the execution and scheduling of tasks, support multiple execution modes of synchronization and asynchrony, meet different scenario requirements, and improve the adaptability and efficiency of the system; users can quickly design, configure, and schedule task processes without in-depth programming, greatly reducing the development threshold.
[0082] Please refer to Figure 6As shown, based on the same inventive concept as the aforementioned method for implementing multi-threaded task process scheduling, the present invention provides a multi-threaded task process scheduling system 600, which includes: a task designer 601, a workflow module 602, a configuration module 603, and a process scheduling tool 604.
[0083] The task designer 601 is configured to respond to a user's request operation for a multi-threaded process, create multiple processes to be executed, and define a serial or parallel execution relationship between the multiple processes to be executed. The processes to be executed include passive processes and active processes. The workflow module 602 is configured to build a task workflow for each process to be executed based on the functional modules provided by the task designer. The task workflow is composed of functional modules in a predetermined logical order. The configuration module 603 is configured to configure each functional module in the task workflow, bind reference data to each functional module, and configure output data that can be referenced by other functional modules. The process scheduling tool 604 is configured to schedule the execution relationship between the processes to be executed, and implement synchronous or asynchronous execution of the multi-threaded task process.
[0084] Please refer to Figure 7 As shown, an embodiment of the present invention further provides an electronic device 700. The electronic device 700 includes at least one processor 701, a memory 702 (such as a non-volatile memory), a memory 703, and a communication interface 704. And at least one processor 701, the memory 702, the memory 703, and the communication interface 704 are connected together via a bus 705. The at least one processor 701 is configured to call at least one program instruction stored or encoded in the memory 702, so that the at least one processor 701 performs various operations and functions of the method for implementing multi-threaded task process scheduling described in various embodiments of this specification.
[0085] In the embodiments of this specification, the electronic device 700 may include, but is not limited to: a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile electronic device, a smart phone, a tablet computer, a cellular phone, a personal digital assistant (PDA), a handheld device, a messaging device, a wearable electronic device, a consumer electronic device, and so on.
[0086] An embodiment of the present invention further provides a computer-readable medium, on which computer-executable instructions are carried. When the computer-executable instructions are executed by a processor, they can be used to implement various operations and functions of the method for implementing multi-threaded task process scheduling described in various embodiments of this specification.
[0087] The computer-readable medium in the present invention can be a computer-readable signal medium, a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, the computer-readable storage medium can be any tangible medium that contains or stores a program, which can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0088] In the present invention, a computer-readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.
[0089] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0090] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses, systems, and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate for implementation in the processFigure 1 One process or multiple processes and / or blocks Figure 1 A device for the functions specified in one block or multiple blocks.
[0091] For those skilled in the art, it is obvious that the present invention is not limited to the details of the above-described exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or basic characteristics of the present invention. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-limiting. The scope of the present invention is defined by the appended claims rather than the above description. Therefore, all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present invention. Any reference signs in the claims should not be construed as limiting the claims involved.
[0092] In addition, it should be understood that although this specification is described according to embodiments, not every embodiment only contains an independent technical solution. This narrative way of the specification is only for clarity. Those skilled in the art should regard the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A method for implementing multi-threaded task process scheduling, characterized in that Including: The task designer responds to the user's request operation for the multi-threaded process, creates multiple processes to be executed, and defines the serial or parallel execution relationship between the multiple processes to be executed. The processes to be executed include passive processes and active processes, and the passive processes are executed through user configuration or event triggering; Based on the function modules provided by the task designer, a task workflow is built for each process to be executed, and the task workflow is composed of function modules in a predetermined logical order; Configure each function module in the task workflow, bind reference data to each function module, and configure output data that can be referenced by other function modules; Based on the process scheduling tool, schedule the execution relationship between each process to be executed to achieve synchronous or asynchronous execution of the multi-threaded task process; the process scheduling tool includes a trigger, a running process tool, and a merging process tool; Among them, the trigger obtains all passive processes by delegating to access the task designer, displays the obtained passive processes in the configuration interface of the trigger, and responds to the user's configuration operation in the configuration interface of the trigger to select and trigger the execution of one of the passive processes; The configuration interface of the trigger includes a reference dependency control, a trigger process control, and a waiting process to end control. The dependency control is used to select the pre-dependency condition for executing the task process, the trigger process control is used to select the passive process that needs to be triggered for execution, and the waiting process to end control is used to control the synchronous trigger or background trigger of the passive process; The running process tool obtains all passive processes in the task designer by delegating to access the task designer, and responds to the user's execution operation to select and execute one of the passive processes; The merging process tool obtains all passive processes in the task designer by delegating to access the task designer, and responds to the user's merging operation to select multiple passive processes to run in parallel.
2. The method for implementing multi-threaded task process scheduling according to claim 1, wherein The task designer is used to design and manage multiple task processes and is a graphical display window for configuring the attributes of each task process.
3. The method for implementing multi-threaded task process scheduling according to claim 1, wherein The method includes: In response to the user's trigger configuration request, display the trigger configuration interface. The trigger configuration interface includes a reference dependency control, a trigger process control, a waiting process to end control, a binding control, and a manual trigger control; In response to the operation on the reference dependency control, select the pre-dependency condition for executing the task process; In response to the operation on the trigger process control, select the passive process that needs to be triggered for execution; In response to the operation on the waiting process to end control, control the synchronous trigger or background trigger of the passive process selected by the trigger process control; In response to the operation on the binding control, bind the selected pre-dependency condition and the passive process; In response to the operation on the manual trigger control, trigger the execution of the selected passive process.
4. The method for implementing multi-threaded task process scheduling according to claim 1, wherein The method includes: In response to the user's merging process request, display the merging process configuration interface. The configuration interface of the merging process tool includes an add control, an enable process control, an all process control, and an any process control; In response to an operation on the addition control, all passive processes are automatically added to the merging process tool and displayed in the merging process tool configuration interface; In response to an operation on the enable process control, select or deselect the passive processes displayed in the merging process tool configuration interface; In response to an operation on the all process control, wait for all processes to be executed to finish running and then return the running result of the merging process tool; In response to an operation on any one of the process controls, after any selected passive process finishes running, the merging process tool ends running and returns the running result.
5. A multi-threaded task process scheduling system, characterized in that, It includes: A task designer, which is used to respond to a user's request operation for a multi-threaded process, create multiple processes to be executed, and define the serial or parallel execution relationship between the multiple processes to be executed, where the processes to be executed include passive processes and active processes; A workflow module, which is used to build a task workflow for each process to be executed based on the function modules provided by the task designer, and the task workflow is composed of function modules in a predetermined logical order; A configuration module, which is used to configure each function module in the task workflow, bind reference data to each function module, and configure output data that can be referenced by other function modules; A process scheduling tool, which is used to schedule the execution relationship between each process to be executed to achieve synchronous or asynchronous execution of multi-threaded task processes; the process scheduling tool includes a trigger, a running process tool, and a merging process tool; Among them, the trigger obtains all passive processes by delegating to access the task designer, displays the obtained passive processes in the trigger configuration interface, and selects and triggers the execution of one of the passive processes in response to a user's configuration operation in the trigger configuration interface; The trigger configuration interface includes a reference dependency control, a trigger process control, and a wait for process to finish control. The dependency control is used to select the precondition dependencies for executing the task process, the trigger process control is used to select the passive process that needs to be triggered for execution, and the wait for process to finish control is used to control the synchronous trigger or background trigger of the passive process; The running process tool obtains all passive processes in the task designer by delegating to access the task designer, and selects and executes one of the passive processes in response to a user's execution operation; The merging process tool obtains all passive processes in the task designer by delegating to access the task designer, and selects multiple passive processes to run in parallel in response to a user's merging operation.
6. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the method for realizing multi-threaded task process scheduling as described in any one of claims 1 to 4 when executing the program.
7. A computer-readable medium, characterized in that, The computer-readable medium carries computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method for realizing multi-threaded task process scheduling as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Task flow arrangement method and device and electronic equipment
CN111861235A
Multi-process cooperative work implementation method, electronic equipment and storage medium
CN115994736A