Workflow instance starting method and device, equipment and service system

By using a message queue in the workflow to send approval service requests to the workflow server, the efficiency problem when multiple business scenarios need to follow the same approval process is solved, and efficient approval process startup and business processing is achieved.

CN119415180AActive Publication Date: 2025-02-11INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202411553998.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-02-11
Estimated Expiration
2044-11-01

AI Technical Summary

Technical Problem

In workflow, when multiple business scenarios need to follow the same approval process, new approval services are added one by one and service code for the approval interface are rewritten, resulting in long-term business time, connection timeout and performance problems.

Method used

By starting and sending approval service requests to the message queue on the business server, the approval service requests are sent to the workflow server using the message queue, so that the workflow server can quickly start the approval process. At the same time, clarify the topic, business ID, and workflow instance types that need to be monitored to ensure that the approval process is initiated more accurately and efficiently.

Benefits of technology

Reduces the possible delays in traditional methods, improves the timeliness of business processing, and decouples the workflow approval process and the associated actual business processing through workflow drivers, avoids the impact of code changes on the other party's code, and improves the Workflow instance startup and approval efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415180A_ABST
    Figure CN119415180A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of servers, and discloses a workflow instance starting method, device and equipment and a service system. The method comprises the following steps: starting and sending an approval service request to a message queue, wherein the approval process is at least the same as the approval process of a second service; monitoring a response message fed back by the workflow service in real time in the message queue according to a preset association relationship, the preset association relationship including a corresponding relationship between each type of service and a theme; and when a target response message corresponding to the approval service request is monitored, analyzing the target response message, determining that the workflow instance corresponding to the approval service request is successfully started according to the content in the target response message, and executing the approval operation of each node in the workflow instance according to the workflow instance. According to the method, the starting of the approval process is more accurate and efficient. Moreover, the code change of one party does not affect the code of the other party, so that the code processing time is shortened, and the workflow instance starting and approval efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a workflow instance startup, device, equipment and service system. Background Art

[0002] With the development of computer technology, more and more business approval processes are transferred to the company management system. In order to facilitate the business process management in enterprise applications and ensure its flexibility, scalability and automation, the concept of workflow management system was proposed and applied to various fields.

[0003] With the emergence of microservice technology, considering that multiple businesses need to design related workflow management processes, workflows are usually deployed as independent service units. When other businesses need process management such as approval, they will call the workflow service through remote calls in the services related to this business and execute specific workflow nodes in the defined order.

[0004] There are multiple services involved in the workflow. For example, service A is a deployed workflow service developed using the Activiti process engine in Java. Service B, service C, and service D are other services that need to call service A. Since these services are developed by different teams, they are developed and implemented using different programming languages. However, there are one or more business scenarios in each of these services that need to follow the same approval process. In this case, each approval process must be designed, which consumes resources and increases costs. Moreover, after each node of the workflow is executed, the services associated with the specific business of service B / C / D need to process additional logic related to this business. In addition, when a new approval business needs to be added, the service code of the unified approval interface must be rewritten, and code decoupling cannot be achieved. Summary of the invention

[0005] The present invention provides a workflow instance startup, device, equipment and service system to solve the problem that when multiple business scenarios in the workflow need to follow the same approval process, new approval businesses are added one by one, and the service code of the approval interface is rewritten, resulting in long actual business time consumption, connection timeout and performance problems.

[0006] In a first aspect, the present invention provides a method for starting a workflow instance, which is applied to a first business service end, and the method includes:

[0007] Initiate and send an approval service request to the message queue, wherein the approval service request is used to initiate an approval process and inform the service of at least one of the subject to be monitored, the associated service ID, and the type of workflow instance to be initiated, and the approval process is at least the same as the approval process of the second business service;

[0008] According to the preset association relationship, in the message queue, real-time monitoring of the response message fed back by the workflow service, wherein the preset association relationship includes the corresponding relationship between each type of business and a topic;

[0009] When a target response message corresponding to the approval business request is monitored, the target response message is parsed, where the target response message is generated at least according to the subject, the business ID and the workflow instance type;

[0010] According to the content in the target response message, it is determined that the workflow instance corresponding to the approval business request is successfully started, and the approval operation of each node therein is performed according to the workflow instance.

[0011] In combination with the first aspect, in a possible implementation manner, before starting and sending the approval service request to the message queue, it also includes: establishing the preset association relationship; establishing the preset association relationship includes:

[0012] Establishing an association between the workflow service and the shared topic in the message queue, and,

[0013] Establish at least one association relationship of at least one business service, each of the association relationships being: a one-to-one correspondence between a business service and a listening topic in a message queue, the at least one business service including the first business service;

[0014] The parsing of the target response message includes:

[0015] Parse the target response message to obtain at least one of a business ID to be associated with the workflow instance of the approval process, an instance keyword associated with the business, a unique identifier of the workflow instance, and an indication field of successful start;

[0016] Determining, based on the content in the target response message, that the workflow instance corresponding to the approval business request is successfully started includes: if after parsing the target response message, the content obtained includes the start success indication field, then determining that the corresponding workflow instance is successfully started.

[0017] In combination with the first aspect, in another possible implementation, each node in the workflow instance includes an application node, and the method further includes:

[0018] When the target response message is parsed to obtain content indicating that the application node in the workflow instance has been executed, searching a data table associated with the current instance according to the instance keyword associated with the business;

[0019] The unique identifier of the workflow instance is updated to the entry in the data table whose ID value is the first value.

[0020] In combination with the first aspect, in another possible implementation manner, executing the approval operation of each node in the workflow instance according to the workflow instance includes:

[0021] Receiving in the message queue a notification message after the workflow service executes the approval of the current node, the notification message including: an indication field indicating whether the approval is passed, an identifier of the current node, and a unique identifier of the workflow instance;

[0022] According to the notification message, when the indication field indicates that the approval is passed, the workflow operation of the current node is executed based on the identifier of the current node.

[0023] In a second aspect, the present invention provides a method for starting a workflow instance, which is applied to a workflow server, wherein the workflow server has the functions of executing the workflow and providing a public approval interface for at least one business server, and the method comprises:

[0024] Monitoring an approval service request sent by the first business service through a message queue, wherein the approval service request includes: at least one of a subject to be monitored by the first business service, an associated business ID, and a type of workflow instance to be started, and the approval process is at least the same as the approval process of the second business service;

[0025] Parsing the approval business request, creating a workflow instance according to the content in the approval business request, and generating a target response message indicating that the workflow instance is successfully started;

[0026] The target response message is sent to a message queue according to a preset association relationship, so that the first business service listens to and obtains the target response message in the message queue. The preset association relationship includes: a correspondence between the first business service and a subject to be listened to by the first business service.

[0027] In conjunction with the second aspect, in a possible implementation manner, creating a workflow instance according to the content in the approval service request and generating a target response message indicating that the workflow instance is successfully started includes:

[0028] Prepare to start a workflow instance according to the content in the approval business request;

[0029] When the workflow instance is successfully started, a unique identifier of the workflow instance and an indication field of successful start are generated;

[0030] The target response message is generated according to at least one of the service ID to be associated with the workflow instance, the instance keyword associated with the service, the unique identifier, and the indication field of successful start.

[0031] In conjunction with the second aspect, in another possible implementation manner, after the workflow instance is successfully started, the method further includes:

[0032] Calling the general approval entry defined in the workflow service, approving each node in the workflow instance, and generating a notification message corresponding to the approval of the current node, wherein the notification message includes: an indication field indicating whether the approval is passed, an identifier of the current node, and a unique identifier of the workflow instance;

[0033] The notification message is added to the message queue, so that the corresponding business service monitors and obtains the notification message in the message queue.

[0034] In combination with the second aspect, in yet another possible implementation, the method further includes:

[0035] Use Activiti as the process execution framework, create and start a corresponding workflow instance based on at least one approval business request from at least one business server, and monitor, parse, and record the data in the message queue, and send a response message and / or notification message to the message queue.

[0036] In a third aspect, the present invention further provides a device for starting a workflow instance, which is applied to any business service end, and the device includes:

[0037] A first sending module is used to send an approval business request to a message queue, wherein the approval business request is used to start an approval process and inform the service of at least one of a subject to be monitored, an associated business ID, and a type of workflow instance to be started, and the approval process is at least the same as the approval process of the second business service;

[0038] A first monitoring module is used to monitor the response message fed back by the workflow service in the message queue in real time according to a preset association relationship, wherein the preset association relationship includes a correspondence between each type of business and a topic;

[0039] A parsing module, configured to parse a target response message corresponding to the approval service request when monitoring the target response message, wherein the target response message is generated at least according to the subject, the service ID and the workflow instance type;

[0040] The determination module is used to determine, based on the content in the target response message, whether the workflow instance corresponding to the approval business request is successfully started, and to execute the approval operation of each node therein according to the workflow instance.

[0041] In a fourth aspect, the present invention further provides a device for starting a workflow instance, which is applied to a workflow server, and the device comprises:

[0042] A second monitoring module is used to monitor the approval business request sent by the first business service through the message queue, wherein the approval business request includes: at least one of a subject to be monitored by the first business service, an associated business ID, and a type of workflow instance to be started, and the approval process is at least the same as the approval process of the second business service;

[0043] A processing module, used to parse the approval business request, create a workflow instance according to the content in the approval business request, and generate a target response message indicating that the workflow instance is successfully started;

[0044] The second sending module is used to send the target response message to the message queue according to a preset association relationship, so that the first business service listens to and obtains the target response message in the message queue. The preset association relationship includes: the corresponding relationship between the first business service and the subject it wants to listen to.

[0045] In a fifth aspect, the present invention provides an electronic device comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the method for starting a workflow instance described in any implementation corresponding to the first aspect or the second aspect by executing the computer instructions.

[0046] In a sixth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method for starting a workflow instance as described in any one of the implementations corresponding to the first aspect or the second aspect.

[0047] In addition, the present invention provides a computer program product, including computer instructions, which are used to enable a computer to execute the method for starting a workflow instance described in any implementation corresponding to the first aspect or the second aspect.

[0048] In a seventh aspect, the present invention provides a service system, the system comprising: at least one business service end, a workflow service end and a message queue, wherein the workflow service end provides a public approval interface function for at least one business service end;

[0049] A message queue, used to send and receive requests, data or notification messages between each business server and the workflow server;

[0050] A business service end, used to execute the method for starting a workflow instance according to the first aspect or any corresponding implementation manner thereof;

[0051] The workflow server is used to execute the method for starting a workflow instance as described in the second aspect or any corresponding implementation manner thereof.

[0052] The present invention provides a method, device, equipment and service system for starting a workflow instance, which starts at the business service end and sends an approval business request to a message queue, and uses a message queue to send the approval business request to the workflow service end, so that the workflow service end can quickly start the approval process, reducing the delay that may exist in the traditional method and improving the timeliness of business processing. At the same time, the method clarifies the information such as the subject, business ID and workflow instance type that need to be monitored, so that the start of the approval process is more accurate and efficient. In addition, the workflow approval process and the associated actual business processing are decoupled through the workflow driver, so that changes in the code of one party will not affect the code of the other party, reducing the code processing time and improving the efficiency of workflow instance startup and approval.

[0053] In addition, when multiple business services have the same approval process, this method uses a workflow service as the unified interface of the approval process to provide the business services with the same approval process with the function of a public approval interface, thereby avoiding adding new approval businesses to each service of the same approval process. This method reduces the interface development process and improves development efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0055] Figure 1 is a flowchart of a method for starting a workflow instance according to an embodiment of the present invention;

[0056] Figure 2 is a schematic diagram of a general approval process according to an embodiment of the present invention;

[0057] Figure 3 is a flowchart of another method for starting a workflow instance according to an embodiment of the present invention;

[0058] Figure 4is a flowchart of another method for starting a workflow instance according to an embodiment of the present invention;

[0059] Figure 5 is a signaling diagram of data flow between a workflow service and an actual business service according to an embodiment of the present invention;

[0060] Figure 6 is a schematic diagram of data flow between a workflow service and an actual business service according to an embodiment of the present invention;

[0061] Figure 7 is a structural block diagram of a starting device according to an embodiment of the present invention;

[0062] Figure 8 is a structural block diagram of another starting device according to an embodiment of the present invention;

[0063] Fig. 9 It is a schematic diagram of the hardware structure of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0065] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0066] Furthermore, the terms “first” and “second” are used for descriptive purposes only and should not be understood as indicating or implying relative importance.

[0067] The technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0068] First, the application scenarios and related technical terms involved in the technical solution of the present invention are introduced.

[0069] (1) Microservices

[0070] Microservices refer to a single application that contains many loosely coupled and independently deployable small components or services. These services usually have their own technology stack, including databases and data management models; communicate with each other through a REST API, event streams, and message brokers, and are organized according to business capabilities.

[0071] Among them, REST API (Representational State Transfer, Application Programming Interface) is a design style and development method for network applications, which allows different software applications to communicate and exchange data over the network. REST API is based on the HTTP protocol and uses standard HTTP methods (such as GET, POST, PUT, DELETE, etc.) to perform operations on resources.

[0072] (2) Workflow and workflow instance

[0073] Workflow is the process of automatically managing business processes through computers, allowing multiple participants to automatically transfer documents, information or tasks according to certain predefined rules.

[0074] Workflow Instance is a term in computer science and technology, specifically referring to an actual operation in a workflow mode. A workflow instance is the specific performance after the process definition is run. A process definition can generate multiple process instances. These instances represent the specific application and execution of the workflow in an actual business environment.

[0075] Specifically, a workflow instance can be composed of multiple links (or activities, nodes, tasks), which are arranged in a certain order and executed in sequence. Each link has specific functions and responsibilities, and they work together to achieve the overall goal of the workflow. In addition, workflow instances are widely used in many fields, including but not limited to:

[0076] Business process management: such as approval process, order processing process, reimbursement process, etc. By defining process models, rules and conditions, the process can be automatically executed and monitored.

[0077] Work order processing: such as service requests, fault handling, and customer complaints. Through the workflow engine, you can dispatch work orders, track the progress of work order processing, and prioritize and assign work orders.

[0078] Resource scheduling and task allocation: such as allocating server resources, scheduling task execution order and priority, etc. By defining workflow models and task dependencies, tasks can be automatically scheduled and allocated.

[0079] Event-driven processes: such as real-time data processing, message queue processing, and event-triggered business processes. By monitoring and responding to events, real-time process control and data processing can be achieved.

[0080] E-commerce processes: such as order processing, inventory management, and payment processes. By defining process models and business rules, e-commerce processes can be automated and optimized.

[0081] (3)Activiti

[0082] Activiti is a workflow parsing engine that can extract complex business processes from business systems and define them using a specialized modeling language. The business system executes according to pre-defined processes, reducing the workload of system upgrades and modifications due to process changes, thereby improving the robustness of the system and reducing system development and maintenance costs.

[0083] (4) Kafka

[0084] Kafka is an open source distributed event streaming platform (Event Streaming Platform), which can also be regarded as a distributed message queue (Message Queue) based on the publish / subscribe mode, which is used to process all real-time messages from consumers and producers.

[0085] The basic functions of Kafka include: message queue, data stream processing, data storage and distributed system integration. Among them, the message queue function means that Kafka can transmit messages between different applications to achieve decoupled asynchronous communication. Producers send messages to the Kafka cluster, and consumers read messages from it.

[0086] Data stream processing means that Kafka supports real-time data processing and analysis. Through tools such as Kafka Streams and KSQL, messages can be streamed and converted. In addition, Kafka also supports persistent messages, data backup and data recovery. Data can be written to Kafka and backed up regularly to other storage systems.

[0087] Optionally, Kafka in the embodiment of the present invention may be Apache Kafka, which is an open source distributed stream processing platform.

[0088] (5)RPC

[0089] Remote Procedure Call (RPC) is a protocol that allows a program on one computer to call a program or service on another computer, just like calling a local service, without the programmer having to perform complex programming for this interaction process.

[0090] Working principle: RPC adopts the client / server model. The calling program (client) sends a call message with process parameters to the service program (server), and then waits for a response message. After receiving the call message, the server calculates the result and sends a reply message back to the client. After receiving the reply message, the client continues to execute.

[0091] The following describes the application scenarios and technical problems of the embodiments of the present invention.

[0092] Commonly used methods for service calls between microservices include HTTP (HyperText Transfer Protocol) / HTTPS (HyperText Transfer Protocol Secure) calls or remote procedure calls (RPC).

[0093] Among them, HTTP / HTTPS is a simple and universal way to call microservices. However, the current review method for all businesses does not use a unified front-end interface. After the front-end submits the approval plan, it notifies the actual business associated with it to execute the business work. This needs to be done synchronously. When the actual business takes a long time, it is easy to cause connection timeouts; when there are many approval businesses, performance problems will also occur.

[0094] Although RPC can realize cross-programming language communication between microservices, it requires different implementations to be written for different programming languages, which is cumbersome. In addition, when a new approval business needs to be added, the service code of the unified approval interface must be rewritten, which also fails to achieve code decoupling. For example, when service B needs to call service A, the Http call method requires that the execution time of service A should not be too long, otherwise it may cause service B to time out while waiting for service A to finish executing, and service B will also fail to execute.

[0095] The technical solution provided by the embodiments of the present invention is intended to solve the following problems or achieve the following beneficial effects:

[0096] 1. Decouple workflow approval from the actual business code associated with it. The workflow call code will not be involved in the business code, and the actual business code will not be called when the public interface of the workflow-related node is called. The actual business-related services and the workflow-related services only communicate through the message queue.

[0097] 2. Implement the Activiti workflow service written in Java to be called by other languages ​​without additional code modification. The services communicate through message queues so that services are no longer called directly, and cross-programming language calls are implemented.

[0098] For example, business services A / B / C / D are all developed using Spring Cloud. When service B calls service A, it can directly use OpenFeign, which is a simplification of the Http call method. If service B is developed with a Go program and service C is developed with a Rust program, when calling service A developed in Java, the Http method call is used. The implementation of the Http call method in each language / program is different, so that services cannot be called directly, but need to write interface service codes separately.

[0099] 3. Share the same approval workflow code in multiple businesses. When the same approval process needs to be embedded in multiple business processes, it is hoped that only one set of code will be written for the approval process. In the actual business call (the workflow approval process of this node and the business code execution process of related nodes need to be executed at the same time), only the actual business code needs to be processed separately, and no longer the approval process-related code needs to be processed.

[0100] 4. Use the same front-end entry for approval operations of workflows with the same workflow approval model. When the same workflow model is used in services B / C / D, the execution of workflow nodes can be realized through the unified entry of workflow approval, and after completing the workflow service, a node completion notification is sent to the specific service (B, C or D service) where the associated business is located to inform the actual business to carry out other follow-up work.

[0101] The technical solution disclosed in this disclosure uses microservices as the architecture foundation and uses message queues for inter-service communication and calls, providing a loosely coupled and scalable way for inter-service calls. The use of asynchronous communication ensures the reliability and stability of inter-service calls when there are many workflow instances and the business process execution takes a long time.

[0102] In addition, inter-service communication is carried out through message queues, so that the execution of workflow services can drive the flow of specific business service processes associated with them, while ensuring the decoupling of the workflow approval process and the business process processing process.

[0103] An embodiment of the present invention provides an embodiment of a method for starting a workflow instance. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0104] In this embodiment, a method for starting a workflow instance is provided, which can be used for any business service end, such as the first business service end. The first business end is a service end, such as business service B, service C or service D. The end requesting approval is called a "workflow service end", referred to as a workflow service, such as service A.

[0105] Figure 1 is a flowchart of a startup method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0106] Step S101: Start and send an approval service request to a message queue.

[0107] Among them, the approval business request is used to start the approval process and inform this service of at least one of the subject to be monitored, the associated business ID, and the type of workflow instance to be started, and the approval process is at least the same as the approval process of the second business service (such as service C or service D).

[0108] Specifically, the business service sends a request to start the approval business to the message queue, and informs the topic (Topic) to be monitored for the later response. Each type of business monitors a specific Topic, and all responses associated with this business from the later workflow service are sent to this Topic. Among them, specifying the monitoring topic means that the business process informs the message queue, and all responses associated with this business from the later workflow service will be sent to the specified Topic.

[0109] Message queue processing: After receiving the request to start the approval business, the message queue stores it in the message queue. Workflow service monitoring: The workflow service (such as service A) monitors the specified topic to obtain request messages related to this business.

[0110] Approval process refers to the general approval process of a project, such as Figure 2 As shown in the figure, it is a schematic diagram of a general approval process, which includes four nodes: application, project manager approval, department manager approval and general manager approval. The execution order of these four nodes is as follows: Figure 2 As shown in the figure, after each node is approved by the "Manager" (a general concept for the three managers), the next step of approval can be executed until the last node is approved by the general manager, and the approval process ends. If the approval of any node is rejected, it will return to the initial node, such as Figure 2 As shown in , the initial node is "applyNode".

[0111] It should be understood that the approval process in this embodiment includes but is not limited to Figure 2The process shown may also be a process consisting of more or fewer nodes, which is not limited in this embodiment. In addition, the approval process is an application scenario of a workflow instance, which includes but is not limited to personnel approval process, project approval, operation process approval, etc. The specific content and fields involved in the approval process in this embodiment are not limited.

[0112] Optionally, the message queue may be Kafka or Apache Kafka, or a software module having Kafka functionality. Further, the Kafka functionality is specifically described in the foregoing embodiment and will not be described in detail herein.

[0113] In addition, the process of initiating the approval business request in this step can be initiated by the current business node itself, or by the user when the front-end workflow is started. Correspondingly, there can be multiple initiating users, and the corresponding service businesses can also be multiple. For example, service B, service C, and service D are initiated by different users simultaneously or successively, and request to create a workflow instance to their common approval process end.

[0114] Step S102: monitoring the response message fed back by the workflow service in the message queue in real time according to the preset association relationship.

[0115] The preset association relationship includes the corresponding relationship between each type of business and a topic (Topic).

[0116] Specifically, Figure 3 As shown, before starting and sending the approval business request to the message queue, it also includes:

[0117] Step S100: Establishing a preset association relationship. Further, step S100 specifically includes:

[0118] Step S100 - 1 : establishing an association relationship between a workflow service and a shared topic in a message queue.

[0119] Among them, the workflow service is an end module with workflow execution and workflow parsing engine functions, such as workflow service A, referred to as "service A", and the association relationship is the corresponding relationship between service A and a topic, such as topic-a. It is understood that the messages and data monitored by topic-a in the message queue are uniformly transmitted to service A.

[0120] Step S100 - 2 : Establish at least one association relationship of at least one business service.

[0121] Each association relationship is: a one-to-one correspondence between a business service and a monitoring topic in a message queue, and at least one business service includes a first business service.

[0122] For example, service B, service C, and service D are all business service ends. Services B, C, and D all contain a business that needs approval. For example, the business to be approved in service B is BB, the business to be approved in service C is CB, and the business to be approved in service D is DB. The approval processes of these three businesses BB, CB, and DB share the same Activiti approval model. For example, they use the attached Figure 2 approval process.

[0123] At the same time, after each approval node is completed, each business BB, CB, and DB needs to handle some other operations separately. For example, when executing the project manager approval node, after the workflow of service A completes the execution of this node, this node still needs to continue to execute the BB-specific business of the PB business. When both businesses are completed, it means that the node is completed.

[0124] Message queues, such as Kafka, are responsible for receiving and sending messages, requests, data, and notifications from services A to D. And establish associations between different topics and services. In this embodiment, assume that associations between services B, C, and D and topics topic-b, topic-c, and topic-d are established in Kafka, indicating that services B, C, and D listen to Topic messages named topic-b, topic-c, and topic-d in Kafka, respectively. The Topic messages include but are not limited to approval business requests. These Topic messages have been correctly created and stored before the approval process is initiated.

[0125] Similarly, in step S100 - 1 : Service A will listen to the Topic message named topic-a in Kafka, which is used to start the workflow instance.

[0126] Step S103: when a target response message corresponding to the approval service request is monitored, the target response message is parsed.

[0127] The target response message is generated by a workflow service, such as service A, based at least on the subject, service ID and workflow instance type in the request. In this embodiment, the response fed back based on the approval service request is called a target response message.

[0128] Specifically, service A calls the Kafka connection-related code and sends the relevant information when creating the approval instance to topic-a of the Kafka service. The relevant information includes the following:

[0129] ① The type of workflow instance to be created by this business (processType);

[0130] ② The topic (listen topic) to be listened to when receiving feedback information later. For example, assuming the requested business service is service B, establish topic-b and a business BB in service B;

[0131] ③Business ID to be associated with the approval process instance;

[0132] ④ The instance keyword (businessKey) associated with the current business, which is used to find the business ID in which table after receiving feedback information later. For example, the example keyword associated with business BB.

[0133] ⑤ The name or identification of the project manager (project User) to be approved, the department manager (department User) to be approved, or the general manager (general User) to be approved.

[0134] The above related information can be configured and generated by the business server.

[0135] like Figure 3 As shown, a possible implementation of this step is, step S103-1: parse the target response message to obtain at least one of the business ID (businessId) to be associated with the workflow instance of the approval process, the instance keyword (businessKey) associated with the business, the unique identifier (instanceId) of the workflow instance, and the indication field of successful startup.

[0136] In addition, parsing the target response message can also obtain other information besides the aforementioned ① to ⑤.

[0137] Step S104: according to the content in the target response message, determine that the workflow instance corresponding to the approval business request is started successfully, and execute the approval operation of each node in the workflow instance.

[0138] Specifically, one implementation includes:

[0139] Step S104-1: If the content obtained after parsing the target response message contains a start-success indication field, it is determined that the corresponding workflow instance is started successfully.

[0140] Step S104-2: Execute the approval operation of each node in the workflow instance.

[0141] Specifically, the approval operation of each node is executed according to the workflow instance, including: receiving a notification message in a message queue after the workflow service (A) executes the approval of the current node, the notification message including: an indication field indicating whether the approval is passed, as well as the identifier of the current node and the unique identifier of the workflow instance (instanceId); according to the notification message, when the indication field indicates that the approval is passed, executing the workflow operation of the current node based on the identifier of the current node.

[0142] In this embodiment, in the above step S104, after parsing the target response message to obtain the content, the method further includes:

[0143] When the application node in the workflow instance is indicated to have been executed, the data table associated with the current instance is searched according to the instance keyword associated with the business; the unique identifier of the workflow instance is updated to the entry with the first value of the ID value in the data table.

[0144] The workflow service has been listening to a specific topic. When a start request is sent to the topic, the workflow service will receive the request.

[0145] The workflow parsing engine performs parsing and records relevant data: After receiving the start request, the workflow parsing engine will parse the request, extract relevant data from it, and record the data. This data may include business process information, startup parameters, etc.

[0146] The specific implementation process of the workflow parsing engine starting a workflow instance includes: according to the content obtained by parsing (the aforementioned step S103-1), the workflow parsing engine will start a workflow instance. The workflow instance is the specific execution process of the workflow, which contains a series of tasks and steps. After the instance is successfully started, the workflow instance ID and other related information will be fed back to the specific business service: Once the workflow instance is successfully started, the workflow parsing engine will send the workflow instance ID and other related information to the specific business service. This information will be sent to the Topic monitored by the business service.

[0147] In this way, the workflow service and the specific business service are able to interact with each other. The workflow service is responsible for starting and managing the workflow instance and feeding back the relevant information to the business service, which can then perform subsequent processing and operations based on the information. This communication method based on message queues helps to achieve the decoupling flexibility of the system, allowing different services to be developed and deployed independently while effectively collaborating and exchanging data through message queues.

[0148] See also Figure 4, is another method for starting a workflow instance provided in this embodiment. The method can be applied to a workflow server. The workflow server has the functions of executing workflows and providing a public approval interface for at least one business server.

[0149] like Figure 4 As shown, the method includes:

[0150] Step S201: monitoring the approval service request sent by the first service through the message queue.

[0151] This step S201 corresponds to step S101 of the above embodiment. The approval service request includes: at least one of the subject to be monitored by the first service service, the associated service ID, and the type of workflow instance to be started, and the approval process is at least the same as the approval process of the second service service. For example, the first service service is service B, the second service service is service C, and services B and C include the same approval process. Figure 2 Approval process shown.

[0152] Workflow service A has been listening to a specific topic. When an approval business request is sent to the topic in the message queue, workflow service A will receive the request.

[0153] Step S202: parsing the approval business request, creating a workflow instance according to the content in the approval business request, and generating a target response message indicating that the workflow instance is successfully started.

[0154] After receiving the approval business request, the workflow parsing engine will parse the request, extract the relevant data, and record the data. The data may include business process information, startup parameters, etc.

[0155] Workflow service A monitors the approval business request from service B in real time through the preset association relationship in the message queue, that is, the corresponding relationship between service A and topic-a in step S100-1, and the message queue forwards the approval business request of service B to service A.

[0156] Workflow service A parses the approval business request and obtains the relevant information in ① to ⑤ above. Based on the relevant information, i.e., the content in the approval business request, it prepares to start the workflow instance. When the workflow instance is successfully started, a unique identifier (instanceId) of the workflow instance and an indication field of successful start are generated. The indication field (instanceId) is a newly added field used to uniquely identify the current workflow instance.

[0157] The workflow service A uses the relevant information obtained through parsing to start a workflow instance. The workflow instance is the specific execution process of the workflow, which includes a series of tasks and steps, such as Figure 2 shown.

[0158] A target response message is generated according to at least one of a business ID (businessId) to be associated with the workflow instance, an instance keyword (businessKey) associated with the business, a unique identifier (instanceId), and an indication field of successful startup.

[0159] After the instance is successfully started, the workflow instance ID and other related information will be fed back to the specific business service. Specifically, once the workflow instance is successfully started, the workflow parsing engine will send the workflow instance ID and other related information to the specific business service, and this information will be sent to the Topic monitored by the business service. In this way, the workflow service and the specific business service are interactive. The workflow service is responsible for starting and managing the workflow instance and feeding back the related information to the business service, which can then perform subsequent processing and operations based on this information.

[0160] In this embodiment, the communication method based on the message queue helps to achieve the decoupling flexibility of the system, so that different services can be developed and deployed independently, while effective collaboration and data exchange are carried out through the message queue.

[0161] like Figure 4 As shown, after the above workflow instance is successfully started, the method further includes:

[0162] Step S204: Call the general approval entry defined in the workflow service, approve each node in the workflow instance, and generate a notification message corresponding to the approval of the current node. The notification message includes: an indication field of whether the approval is passed, the identifier of the current node, and the unique identifier of the workflow instance.

[0163] Step S205: Add the notification message to the message queue, so that the corresponding business service monitors and obtains the notification message in the message queue.

[0164] In this embodiment, the functions or methods on the workflow service side, such as service A, also include: using Activiti as a process execution framework, creating and starting a corresponding workflow instance based on at least one approval business request from at least one business service side, and monitoring, parsing, and recording the data in the message queue, and sending response messages and / or notification messages to the message queue.

[0165] Furthermore, if Figure 6As shown, the workflow service node (service A is registered as a workflow execution service node) can include a workflow execution unit and a workflow parsing engine. The workflow execution unit is used to use Activiti as a process execution framework and is responsible for creating and starting workflow instances. The workflow parsing engine is used to monitor, parse, and record Kafka data, and send data to Kafka, while also providing the ability to process the front-end approval public access interface.

[0166] The method for starting a workflow instance provided in this embodiment starts at the business service end and sends an approval business request to a message queue, and uses a message queue to send the approval business request to the workflow service end, so that the workflow service end can quickly start the approval process, reducing the delay that may exist in the traditional method and improving the timeliness of business processing. At the same time, the method clarifies the information such as the subject, business ID and workflow instance type that need to be monitored, so that the start of the approval process is more accurate and efficient. In addition, the workflow approval process and the associated actual business processing are decoupled through the workflow driver, so that changes in the code of one party will not affect the code of the other party, reducing the code processing time and improving the efficiency of workflow instance startup and approval.

[0167] In addition, when multiple business services have the same approval process, this method uses a workflow service as the unified interface of the approval process to provide the business services with the same approval process with the function of a public approval interface, thereby avoiding adding new approval businesses to each service of the same approval process. This method reduces the interface development process and improves development efficiency.

[0168] Combine the following Figure 5 and Figure 6 The method for starting a workflow instance provided by the present invention is described. Figure 5 , is a signaling diagram of data flow between a workflow service and an actual business service provided by an embodiment of the present invention; Figure 6 is with Figure 5 Schematic diagram of the corresponding data flow.

[0169] like Figure 6 As shown in the figure, the type name of the approval process is CommonAuditProcess, which includes nodes such as "application", "project manager approval", "department manager approval", and "general manager approval", each of which is a single instance (that is, the approver or executor is one person). Figure 2 Among the nodes in , the "application" node is initiated by business BB, CB, and DB respectively and submitted to service A to start the Activiti instance. The "project manager approval", "department manager approval", and "general manager approval" nodes are initiated by the general approval interface provided by service A respectively.

[0170] This case uses SpringCloud as the microservice architecture and Kafka as the message queue. In this case, service A is a registered workflow service. The workflow execution unit uses Activiti as the process execution framework, which is responsible for creating and starting workflow instances. The workflow parsing engine is used to listen to, parse, and record Kafka data and send data to Kafka. In addition, it also provides the ability to process the front-end approval public access interface. Services B, C, and D contain businesses that need to start the approval process. These businesses share the same Activiti approval model (that is, they all use the attached Figure 2 approval process), and each business needs to handle some other operations separately after each approval node is completed.

[0171] The following description uses the business BB using services A and B. The basic process is as follows:

[0172] Step S1: Start related business and add workflow approval process. Front-end workflow starts application interface.

[0173] Step S2: Business service B sends an approval business request, notifying the workflow service of the subject to be monitored by the service, the associated business ID, the type of workflow instance to be started, etc.

[0174] Business service B initiates an approval process business request. After completing business-related work, it calls Kafka (message queue system) to connect and send relevant information, such as: the type of workflow instance to be created for this business, the monitored Topic, the associated business ID, the project manager, department manager, general manager, etc.

[0175] Step S3: The Kafka engine monitors the message queue, specifically monitoring whether any business service sends an approval business request.

[0176] The business BB backend sends the processed "approval business request" data to the Kafka software; then, the receiving module in the Kafka software (such as topic-a real-time monitoring) determines the object to be sent (service A) and sends the processed "approval business request" data to service A.

[0177] The Kafka software determines that the object to be sent is service A based on the pre-established relationship between topic-a and the unique business in service A. This unique relationship can be determined by step S100-1 of the aforementioned embodiment, which is understood as: it is pre-specified that all data / messages obtained from real-time monitoring of topic-a are sent to service A.

[0178] In this embodiment, the approval submission initiation interface of the business approval is defined in the service where the specific business is located (that is, the front-end approval initiation interface is defined in BB, CB, and DB respectively). After the BB business completes the processing of the internal relevant data of the "application" node, it will call the Kafka software connection related code and send the relevant information when creating the approval instance to the topic-a topic of the Kafka software service. The relevant information includes the contents of the above circles ① to ⑤.

[0179] Optionally, Kafka software processes the relevant data within the business (such as special field modification) to obtain relevant information circles ① to ⑤, the purpose of which is to indicate that the business approval application has been submitted. For example, a relevant information code example is as follows:

[0180] {

[0181] "processType": "CommonAuditProcess", (the workflow instance type to be created for this business);

[0182] "listenTopic": "topic-b", (the Topic to be listened to when receiving feedback information later in this service);

[0183] "businessId": "1", (the business ID to be associated with the approval process instance);

[0184] "businessKey": "BusinessB", (after receiving feedback information later, you need to look up the business ID in Table B);

[0185] "projectUser": "xxx", (the project manager to be approved is xxx);

[0186] “departmentUser”: “yyy” (the department manager to be approved is yyy);

[0187] “generalUser”: “zzz” (the general manager to be approved is zzz);

[0188] }

[0189] At the same time, service B starts the Kafka monitoring function, which is responsible for monitoring the return messages of topic-b.

[0190] Step S4: Workflow service A obtains engine parsed data and starts the workflow instance.

[0191] Step S5: After the workflow is successfully started, workflow service A notifies the specific workflow instance ID etc. through Kafka.

[0192] Specifically, the workflow parsing engine of workflow service A starts monitoring topic-a messages of Kafka. When the startup task of the approval instance is monitored, it starts parsing the approval business request to obtain relevant information, namely the above contents ① to ⑤. According to the parsing result, the workflow execution unit is called to prepare to start the workflow instance, and a unique ID (instanceId, assumed to be "10001") is automatically generated to identify the instance. This unique ID is a new ID in workflow service A, assumed to be marked as ⑥.

[0193] From the analysis results, it is found that the workflow needs to create an instance for the model ① "CommonAuditProcess", and when the instance is started, the project manager node of the instance is set to "xxx", the department manager node is set to "yyy", and the general manager node is set to "zzz". After the workflow instance is successfully started, a unique ID for the instance will be created (instanceId, assumed to be "10001"⑥).

[0194] The workflow parsing engine records the associated data in the database, such as instanceId(10001), listenTopic(topic-b), businessId(1), businessKey(BusinessB), etc. Then, the parsing engine of workflow service A feeds back the successful startup information to business service B. Through the above association, it is found that the feedback data needs to be sent to topic-b of Kafka. The feedback response message is as follows:

[0195] {

[0196] "businessId": "1", (the business ID to be associated with the approval process instance);

[0197] "businessKey": "BusinessB", (the instance key associated with the BB business);

[0198] “instanceId”: “10001”, (newly added, used to identify the unique ID of the workflow instance);

[0199] "instanceNode": "applyNode", (newly added, the system executes the "apply" node);

[0200] "code": 200 (new, indicating success message);

[0201] }

[0202] The Kafka software receives the topic-b message and directly sends the message to business service B that monitors the topic.

[0203] Step S6: Business service B monitors the message queue and parses information such as the workflow instance ID.

[0204] Business service B starts listening to topic-b in Kafka. After receiving the response message from workflow service A, it parses it as successful (code 200 indicates successful startup), and finds that its instanceNode is applyNode (indicating that the executed node is the "application" node). The system executes related operations of the "application" node. Specifically, business service B finds the data table associated with the BusinessB instance through the businessKey, and updates the workflow instance ID (10001) to the entry with ID value 1 in the table.

[0205] So far, the approval instance creation process of the workflow has been completed. At this point, the "application" node of business BB has been completed and the approval process has been successfully created, and the approval process is executed to the "project manager approval" node. In this embodiment, it is specified that since BB, CB, and DB share the same approval process, interfaces will not be defined for the "project manager approval", "department manager approval", and "general manager approval" nodes in services B, C, and D, respectively, but the approval interface for each node in B, C, and D is shared (that is, the same interface is used in services B, C, and D when the project manager approves), so the processing interfaces of "project manager approval", "department manager approval", and "general manager approval" are defined in service A, and there is no approval entry in services B, C, and D. This method is different from the general processing method in that a "project manager approval" interface is defined in services B, C, and D, and service A is remotely called after processing its own business, so as to avoid adding new approval business to each service of the same approval process, reduce the interface development process, and improve development efficiency.

[0206] like Figure 5 As shown, the above method also includes:

[0207] Step S7: Workflow service A calls the general approval entry defined in workflow service (A).

[0208] Step S8: Workflow service A executes the current node and sends a notification to the associated business service (including whether the approval is passed).

[0209] Step S9: Business service B performs relevant business processing according to the notification content.

[0210] Specifically, after the project manager associated with business BB receives the information that the business with ID "1" needs to be approved, he / she approves it by calling the approval entry in service A in the system. The approval transmission message is as follows (approval data structure).

[0211] The approval entry of service A is processed by the workflow parsing engine. After receiving the message and parsing it to the project manager's "approval" of the application, the parsing engine calls the workflow execution unit to continue the downward execution of the instance of workflow 10001 to the "department manager approval" node. After receiving the successful execution of the execution unit, the information associated with 10001 is searched in the aforementioned associated database, and the listenTopic (topic-b), businessId (1), businessKey (BusinessB) information is searched, and the approval result of the node is sent to Kafka's topic-b. The structure of the approval data contained in an approval result is as follows:

[0212] {

[0213] "instanceId":"10001",

[0214] "accept":true,

[0215] "msg": "Agree",

[0216] }

[0217] Service A encapsulates the above approval data into a notification message, and then sends the notification message to Kafka. The data structure of a notification message sent to Kafka is as follows:

[0218] {

[0219] "businessId": "1",

[0220] "businessKey":"BusinessB",

[0221] "instanceId":"10001",

[0222] "instanceNode":"projectUserNode",

[0223] "accept":true,

[0224] "msg": "Agree",

[0225] "code":200,

[0226] }

[0227] The operation of executing the next node is the same as step S7 above. According to steps S8 and S9, service B parses the notification message or information monitored in topic-b and determines that the next node to be executed is projectUserNode. Then the system executes the relevant operations of the "department manager approval" node.

[0228] Similarly, the operations of the "department manager approval" and "general manager approval" nodes are the same as the aforementioned steps S7 to S9, and will not be described in detail in this embodiment.

[0229] This embodiment provides a general interface processing method for the same approval process, and proposes a solution for sharing the same approval process under multiple businesses. This method decouples the workflow approval process and the associated actual business processing through workflow drive, so that code changes on one side will not affect the code on the other side, reducing code processing time. At the same time, since the approval interfaces of the same node are unified into one interface, interface development is also reduced, improving development efficiency.

[0230] It should be noted that the above-mentioned synchronization process in this embodiment includes a rollback method when an exception occurs between the workflow service and the associated service.

[0231] In this embodiment, a device for starting a workflow instance is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0232] This embodiment provides a workflow instance startup device, which is applied to any business server, or used to implement the functions of the aforementioned business server, such as Figure 7 As shown, the starting device includes: a first sending module 710, a first monitoring module 720, a parsing module 730 and a determining module 740. In addition, the device may also include other more or fewer modules, which is not limited in this embodiment.

[0233] The first sending module 710 is used to send an approval business request to the message queue, where the approval business request is used to start the approval process and inform the service of at least one of the subject to be monitored, the associated business ID, and the type of workflow instance to be started, and the approval process is at least the same as the approval process of the second business service.

[0234] The first monitoring module 720 is used to monitor the response message fed back by the workflow service in the message queue in real time according to the preset association relationship, wherein the preset association relationship includes the corresponding relationship between each type of business and a topic (Topic).

[0235] The parsing module 730 is used to parse the target response message corresponding to the approval business request when monitoring the target response message, wherein the target response message is generated at least according to the subject, the business ID and the workflow instance type;

[0236] The determination module 740 is used to determine, based on the content in the target response message, whether the workflow instance corresponding to the approval business request is successfully started, and to perform the approval operation of each node therein according to the workflow instance.

[0237] In addition, this embodiment also provides another workflow instance startup device, which is applied to the workflow server, or used to implement the functions of the aforementioned workflow server, such as Figure 8 As shown, the device includes: a second monitoring module 810, a processing module 820 and a second sending module 830. In addition, the device may also include other more or fewer modules, such as a storage module, a receiving module, etc., which is not limited in this embodiment.

[0238] The second monitoring module 810 is used to monitor the approval business request sent by the first business service through the message queue, and the approval business request includes: at least one of the subject to be monitored by the first business service, the associated business ID, and the type of workflow instance to be started, and the approval process is at least the same as the approval process of the second business service.

[0239] The processing module 820 is used to parse the approval service request, create a workflow instance according to the content in the approval service request, and generate a target response message indicating that the workflow instance is successfully started.

[0240] The second sending module 830 is used to send the target response message to the message queue according to a preset association relationship, so that the first business service listens and obtains the target response message in the message queue. The preset association relationship includes: the corresponding relationship between the first business service and the subject it wants to listen to.

[0241] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.

[0242] The starting device of the workflow instance in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0243] The embodiment of the present invention also provides an electronic device having the above Figure 7 or Figure 8 The initiator of the workflow instance shown.

[0244] See also Fig. 9 , is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface).

[0245] In some optional embodiments, if desired, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides part of the necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.

[0246] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0247] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method for starting the workflow instance shown in the above embodiment.

[0248] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0249] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0250] The computer device also includes an input device and an output device. The processor 10, the memory 20, the input device and the output device may be connected via a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.

[0251] Among them, the input device can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick, etc. The output device may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.

[0252] The electronic device further comprises at least one communication interface 30 for the electronic device to communicate with other devices or a communication network.

[0253] Optionally, the above-mentioned electronic device may be a server or a server cluster, or may also be other network devices.

[0254] The embodiment of the present invention also provides a service system, the structure of which can be as follows: Figure 6 As shown, it includes: at least one business server, a workflow server and a message queue, wherein the workflow server provides a public approval interface function for at least one business server.

[0255] The message queue is used to send and receive requests, data or notification messages between each business server and the workflow server. Further, the message queue is a Kafka software system.

[0256] Among them, any business server can be used to execute the above Figure 1 , Figure 3 and Figure 5 The workflow server can be used to execute the above Figure 4 and Figure 5 The start method of the workflow instance shown.

[0257] The service system provided in this embodiment starts at the business service end and sends an approval business request to the message queue, and uses the message queue to send the approval business request to the workflow service end, so that the workflow service end can quickly start the approval process, reducing the delay that may exist in the traditional method and improving the timeliness of business processing. At the same time, the method clarifies the information such as the subject, business ID and workflow instance type that need to be monitored, so that the start of the approval process is more accurate and efficient. In addition, the workflow approval process and the associated actual business processing are decoupled through the workflow driver, so that the code change of one party will not affect the code of the other party, reducing the code processing time and improving the efficiency of workflow instance startup and approval.

[0258] In addition, when multiple business services have the same approval process, this method uses a workflow service as the unified interface of the approval process to provide the business services with the same approval process with the function of a public approval interface, thereby avoiding adding new approval businesses to each service of the same approval process. This method reduces the interface development process and improves development efficiency.

[0259] An embodiment of the present invention also provides a computer-readable storage medium, and the above-mentioned method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented by downloading through a network and originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware.

[0260] The storage medium may be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid state drive, etc.; further, the storage medium may also include a combination of the above-mentioned types of memories. It is understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by the computer, processor or hardware, the method shown in the above embodiment is implemented.

[0261] Embodiments of the present application may also provide a computer program product, including computer program instructions, which, when executed by a processor, cause the processor to perform the steps in the above method. Wherein, the computer program product may be written in any combination of one or more programming languages ​​to perform program codes for performing the operations of the disclosed embodiments, wherein the programming languages ​​include object-oriented programming languages, such as Java, C++, etc., and also include conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on a user computing device, partially on a user device, as an independent software package, partially on a user computing device, partially on a remote computing device, or entirely on a remote computing device or server.

[0262] The above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the embodiments of the present invention are described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some of the technical features therein by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for starting a workflow instance, characterized in that: Applied to the first business service end, the method includes: Initiate and send an approval service request to the message queue, wherein the approval service request is used to initiate an approval process and inform the service of at least one of the subject to be monitored, the associated service ID, and the type of workflow instance to be initiated, and the approval process is at least the same as the approval process of the second business service; According to the preset association relationship, in the message queue, real-time monitoring of the response message fed back by the workflow service, wherein the preset association relationship includes the corresponding relationship between each type of business and a topic; When a target response message corresponding to the approval business request is monitored, the target response message is parsed, where the target response message is generated at least according to the subject, the business ID and the workflow instance type; According to the content in the target response message, it is determined that the workflow instance corresponding to the approval business request is successfully started, and the approval operation of each node therein is performed according to the workflow instance.

2. The method according to claim 1, characterized in that Before starting and sending the approval service request to the message queue, the method further includes: establishing the preset association relationship; Establishing the preset association relationship includes: Establishing an association between the workflow service and the shared topic in the message queue, and, Establish at least one association relationship of at least one business service, each of the association relationships being: a one-to-one correspondence between a business service and a listening topic in a message queue, the at least one business service including the first business service; The parsing of the target response message includes: Parse the target response message to obtain at least one of a business ID to be associated with the workflow instance of the approval process, an instance keyword associated with the business, a unique identifier of the workflow instance, and an indication field of successful start; Determining, based on the content in the target response message, that the workflow instance corresponding to the approval business request is successfully started includes: If, after parsing the target response message, the content obtained includes the start-success indication field, it is determined that the corresponding workflow instance is started successfully.

3. The method according to claim 2, characterized in that Each node in the workflow instance includes an application node, and the method further includes: When the target response message is parsed to obtain content indicating that the application node in the workflow instance has been executed, searching a data table associated with the current instance according to the instance keyword associated with the business; The unique identifier of the workflow instance is updated to the entry in the data table whose ID value is the first value.

4. The method according to any one of claims 1 to 3, characterized in that: The step of executing the approval operation of each node in the workflow instance includes: Receiving in the message queue a notification message after the workflow service executes the approval of the current node, the notification message including: an indication field indicating whether the approval is passed, an identifier of the current node, and a unique identifier of the workflow instance; According to the notification message, when the indication field indicates that the approval is passed, the workflow operation of the current node is executed based on the identifier of the current node.

5. A method for starting a workflow instance, characterized in that: Applied to a workflow server, the workflow server has the functions of workflow execution and providing a public approval interface for at least one business server, the method comprises: Monitoring the approval service request sent by the first business service through the message queue, wherein the approval service request includes: at least one of a subject to be monitored by the first business service, an associated business ID, and a type of workflow instance to be started, and the approval process is at least the same as the approval process of the second business service; Parsing the approval service request, creating a workflow instance according to the content in the approval service request, and generating a target response message indicating that the workflow instance is successfully started; The target response message is sent to a message queue according to a preset association relationship, so that the first business service monitors and obtains the target response message in the message queue. The preset association relationship includes: a corresponding relationship between the first business service and the subject to be monitored.

6. The method according to claim 5, characterized in that The step of creating a workflow instance according to the content in the approval service request and generating a target response message indicating that the workflow instance is successfully started includes: Prepare to start a workflow instance according to the content in the approval business request; When the workflow instance is successfully started, a unique identifier of the workflow instance and an indication field of successful start are generated; The target response message is generated according to at least one of the service ID to be associated with the workflow instance, the instance keyword associated with the service, the unique identifier, and the indication field of successful start.

7. The method according to claim 5, characterized in that After the workflow instance is successfully started, the following steps are also included: Calling the general approval entry defined in the workflow service, approving each node in the workflow instance, and generating a notification message corresponding to the approval of the current node, wherein the notification message includes: an indication field indicating whether the approval is passed, an identifier of the current node, and a unique identifier of the workflow instance; The notification message is added to the message queue, so that the corresponding business service monitors and obtains the notification message in the message queue.

8. The method according to any one of claims 5 to 7, characterized in that: The method further comprises: Use Activiti as the process execution framework to create and start a corresponding workflow instance based on at least one approval business request from at least one business server, and, The data in the message queue is monitored, parsed, and recorded, and a response message and / or a notification message is sent to the message queue.

9. A device for starting a workflow instance, characterized in that: Applied to any business service end, the device includes: A first sending module is used to send an approval business request to a message queue, wherein the approval business request is used to start an approval process and inform the service of at least one of a subject to be monitored, an associated business ID, and a type of workflow instance to be started, and the approval process is at least the same as the approval process of the second business service; A first monitoring module is used to monitor the response message fed back by the workflow service in the message queue in real time according to a preset association relationship, wherein the preset association relationship includes a correspondence between each type of business and a topic; A parsing module, configured to parse a target response message corresponding to the approval service request when monitoring the target response message, wherein the target response message is generated at least according to the subject, the service ID and the workflow instance type; The determination module is used to determine, based on the content in the target response message, whether the workflow instance corresponding to the approval business request is successfully started, and to execute the approval operation of each node therein according to the workflow instance.

10. A device for starting a workflow instance, characterized in that: Applied to a workflow server, the device comprises: A second monitoring module is used to monitor the approval business request sent by the first business service through the message queue, wherein the approval business request includes: at least one of a subject to be monitored by the first business service, an associated business ID, and a type of workflow instance to be started, and the approval process is at least the same as the approval process of the second business service; A processing module, used to parse the approval business request, create a workflow instance according to the content in the approval business request, and generate a target response message indicating that the workflow instance is successfully started; The second sending module is used to send the target response message to the message queue according to a preset association relationship, so that the first business service listens to and obtains the target response message in the message queue. The preset association relationship includes: the corresponding relationship between the first business service and the subject it wants to listen to.

11. An electronic device, characterized in that: comprising a memory and a processor, wherein the memory and the processor are connected; The memory stores computer instructions, and the processor executes the method for starting a workflow instance according to any one of claims 1 to 4 or any one of claims 5 to 8 by executing the computer instructions.

12. A service system, characterized in that: The system comprises: at least one business server, a workflow server and a message queue, wherein the workflow server provides a public approval interface function for the at least one business server; The message queue is used to send and receive requests, data or notification messages between each business server and the workflow server; The business service end is used to execute the method for starting a workflow instance according to any one of claims 1 to 4; The workflow server is used to execute the method for starting a workflow instance as claimed in any one of claims 5 to 8.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for starting a workflow instance according to any one of claims 1 to 4 or any one of claims 5 to 8.

Citation Information

Patent Citations

  • Cross-service system process monitoring device and method, corresponding equipment and storage medium

    CN112200505A

  • Message data updating method and device, computer equipment and storage medium

    CN112559211A

  • Method for decoupling process engine Activiti and business

    CN115016789A

  • Business system and workflow engine interaction method and system

    CN115204736A

  • Service approval processing method and device, computer equipment and storage medium

    CN115936619A

Cited By

  • Service calling mode based on data message

    CN120196445A

  • Datagram-based service invocation mode

    CN120196445B

  • Intelligent process task allocation method and system based on combination of Activiti and machine learning

    CN120806449A

  • Business linkage processing method and device of enterprise information system, computer program product and readable storage medium

    CN121764519A