CN114489772A - Workflow execution method and device, storage medium and equipment - Google Patents

Workflow execution method and device, storage medium and equipment Download PDF

Info

Publication number
CN114489772A
CN114489772A CN202210119006.5A CN202210119006A CN114489772A CN 114489772 A CN114489772 A CN 114489772A CN 202210119006 A CN202210119006 A CN 202210119006A CN 114489772 A CN114489772 A CN 114489772A
Authority
CN
China
Prior art keywords
workflow
executed
version
name
workflow execution
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210119006.5A
Other languages
Chinese (zh)
Inventor
胡珅健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN202210119006.5A priority Critical patent/CN114489772A/en
Publication of CN114489772A publication Critical patent/CN114489772A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files

Abstract

The present disclosure relates to the field of computer technologies, and provides a workflow execution method, a workflow execution apparatus, a computer storage medium, and an electronic device, which are applied to a workflow server, where a network environment where the workflow server is located is pre-configured in the workflow server, and the workflow execution method includes: receiving a workflow execution request, wherein the workflow execution request comprises the name of a workflow to be executed; determining a to-be-executed version of the to-be-executed workflow according to the name of the to-be-executed workflow and the identifier of the network environment; and acquiring configuration information corresponding to the version to be executed, and executing the version to be executed according to the configuration information. The method and the device can realize version isolation of the flow chart, and improve data query performance.

Description

Workflow execution method and device, storage medium and equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a workflow execution method, a workflow execution apparatus, a computer storage medium, and an electronic device.
Background
Workflow (Workflow), which refers to the "automation of a part or the whole of a business process in a computer application environment," is an abstract and generalized description of the business rules between the Workflow and its various operational steps. After the workflow is on-line, if the service changes, the function of the workflow needs to be updated, for example: an approver to add a procedure or modify a procedure, etc.
Currently, each time a workflow is initiated, the system defaults to the latest version. However, this approach may result in the latest version of the flow chart being mixed into the on-line traffic during the verification phase, with a greater risk.
In view of the above, there is a need in the art to develop a new workflow execution method and apparatus.
It is to be noted that the information disclosed in the background section above is only used to enhance understanding of the background of the present disclosure.
Disclosure of Invention
The present disclosure is directed to a workflow execution method, a workflow execution apparatus, a computer storage medium, and an electronic device, so as to overcome, at least to some extent, a problem of a high risk caused by a default process initiated in the latest version in the related art.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
According to a first aspect of the present disclosure, a workflow execution method is provided, which is applied to a workflow server, where a network environment where the workflow server is located is configured in advance, and the method includes: receiving a workflow execution request, wherein the workflow execution request comprises the name of a workflow to be executed; determining a to-be-executed version of the to-be-executed workflow according to the name of the to-be-executed workflow and the identifier of the network environment; and acquiring configuration information corresponding to the version to be executed, and executing the version to be executed according to the configuration information.
In an exemplary embodiment of the present disclosure, determining a to-be-executed version of the to-be-executed workflow according to the name of the to-be-executed workflow and the identifier of the network environment includes: splicing the name of the workflow to be executed and the identifier of the network environment to obtain a process keyword; and determining the to-be-executed version of the to-be-executed workflow according to the flow keywords and the mapping relation between the prestored flow keywords and the to-be-executed version thereof.
In an exemplary embodiment of the present disclosure, the to-be-executed version includes a plurality of task nodes, and the method further includes: receiving a locking request of a client aiming at a target task node; responding to that the target task node is not locked, generating locking information according to the locking request and storing the locking information in a cache so as to enable the client to execute the business operation protected by the distributed lock; in response to the target task node being locked, returning a locking failure message to the client.
In an exemplary embodiment of the present disclosure, the to-be-executed version includes a plurality of task nodes, and the executing the to-be-executed version includes: and storing the newly added data of each task node as a data record in the search server cluster.
In an exemplary embodiment of the present disclosure, the number of the search server clusters is at least two; after the newly added data of each task node is stored as a data record in the search server cluster, the method further comprises the following steps: receiving a data query request of a client, wherein the data query request comprises a user identifier; authenticating the user identification; and if the authentication is passed, selecting a target cluster for responding to the data query request from the at least two search server clusters, and responding to the data query request through the target cluster.
In an exemplary embodiment of the present disclosure, the user identity is authenticated by: sending the user identification to an authority configuration terminal so that the authority configuration terminal generates an authentication code according to the user identification; comparing the authentication code returned by the authority configuration terminal with a prestored authentication code; and if the comparison is consistent, determining that the user identification passes the authentication.
In an exemplary embodiment of the present disclosure, the target cluster is selected by: randomly generating a weight attribute value corresponding to each search server; calculating the service probability of each search server cluster according to the weight attribute value; and determining the search server cluster with the service probability meeting the probability threshold value as the target cluster.
According to a second aspect of the present disclosure, there is provided a workflow execution apparatus, including a request receiving module, configured to receive a workflow execution request, where the workflow execution request includes a name of a workflow to be executed; the version determining module is used for determining the to-be-executed version of the to-be-executed workflow according to the name of the to-be-executed workflow and the identifier of the network environment; and the workflow execution module is used for acquiring the configuration information corresponding to the version to be executed and executing the version to be executed according to the configuration information.
According to a third aspect of the present disclosure, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the workflow execution method of the first aspect described above.
According to a fourth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the workflow execution method of the first aspect described above via execution of the executable instructions.
According to the technical solution, the workflow execution method, the workflow execution device, the computer storage medium and the electronic device in the exemplary embodiment of the disclosure have at least the following advantages and positive effects:
in the technical solutions provided in some embodiments of the present disclosure, by receiving a workflow execution request (where the workflow execution request includes a name of a to-be-executed workflow), determining a to-be-executed version of the to-be-executed workflow according to the name of the to-be-executed workflow and an identifier of a network environment, further obtaining configuration information corresponding to the to-be-executed version, and executing the to-be-executed version according to the configuration information, a problem of a high risk caused by a default process initiated by a latest version in the related art can be solved, execution of different versions of flowcharts in different network environments is realized, so that version isolation is performed on the flowcharts, and a deployment risk of the latest version of the flowcharts is reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty.
FIG. 1 shows a flow diagram of a method of workflow execution in an embodiment of the disclosure;
fig. 2 is a schematic flow chart illustrating the determination of a workflow to be executed and a version to be executed thereof according to a name of the workflow to be executed and an identifier of a network environment in the embodiment of the present disclosure;
FIG. 3 shows a flow diagram of how a data query request is responded to in an embodiment of the disclosure;
FIG. 4 is a schematic flow chart illustrating the selection of a target cluster from at least two search server clusters for responding to a data query request in an embodiment of the present disclosure;
FIG. 5 illustrates a flow diagram for deploying a workflow in an embodiment of the disclosure;
FIG. 6 illustrates a flow diagram for executing a workflow in an embodiment of the disclosure;
FIG. 7 shows a flow diagram of how a workflow is initiated in an embodiment of the disclosure;
FIG. 8 is a flow diagram illustrating a process for synchronizing and querying data in an embodiment of the present disclosure;
fig. 9 shows a schematic configuration diagram of a workflow execution apparatus in an exemplary embodiment of the present disclosure;
fig. 10 shows a schematic structural diagram of an electronic device in an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
The terms "a," "an," "the," and "said" are used in this specification to denote the presence of one or more elements/components/parts/etc.; the terms "comprising" and "having" are intended to be inclusive and mean that there may be additional elements/components/etc. other than the listed elements/components/etc.; the terms "first" and "second", etc. are used merely as labels, and are not limiting on the number of their objects.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities.
The workflow is the abstraction, summarization and description of the workflow and the business rules among the operation steps. And (3) workflow modeling, namely representing the logic and rules of how the work in the workflow is organized back and forth in a computer by using a proper model, carrying out calculation on the logic and rules, and realizing the circulation of a specified planning path according to the nodes drawn by a flow chart. The most popular workflow engine is Activiti, which is an open source BPM (Business Process Management) platform based on Apache license, and covers an open source, flexible and easily extensible executable Process language framework in the fields of Business Process Management, workflow, service collaboration and the like.
However, the current workflow engine has the following problems:
firstly, activti cannot isolate a User Acceptance Test (User Acceptance Test, i.e., a User Acceptance Test) environment and an online environment, so that a new version of a flow chart is mixed with online traffic in a verification stage, and the risk is high;
secondly, in the process of initiating the process in the Activiti, a plurality of tables need to be read and written, and the process initiating performance is poor;
thirdly, the data stored in activti is generally stored in MySQL in a vertical table form, and one variable corresponds to one record, so that the data volume increases exponentially under the condition that the flow is complex (for example, one flow contains dozens of variables). Moreover, when a user queries data, one query result needs to extract field data from two or more tables, which seriously affects the data query speed and reduces the user experience.
In the embodiment of the disclosure, firstly, a workflow execution method is provided, which at least partially overcomes the problem of the related art that the risk caused by the default of launching the flow with the latest version is large.
Fig. 1 is a flowchart illustrating a workflow execution method according to an embodiment of the present disclosure, where an execution subject of the workflow execution method may be a server that executes a workflow.
Referring to fig. 1, a workflow execution method according to one embodiment of the present disclosure includes the steps of:
step S110, receiving a workflow execution request, wherein the workflow execution request comprises the name of the workflow to be executed;
step S120, determining the version to be executed of the workflow to be executed according to the name of the workflow to be executed and the identifier of the network environment;
step S130, obtaining configuration information corresponding to the version to be executed, and executing the version to be executed according to the configuration information.
In the technical solution provided in the embodiment shown in fig. 1, by receiving a workflow execution request (the workflow execution request includes a name of a to-be-executed workflow), determining a to-be-executed version of the to-be-executed workflow according to the name of the to-be-executed workflow and an identifier of a network environment, further acquiring configuration information corresponding to the to-be-executed version, and executing the to-be-executed version according to the configuration information, a problem of a high risk caused by initiating a flow with a latest version by default in the related art can be solved, execution of flowcharts of different versions in different network environments is realized, version isolation is performed on the flowcharts, and a deployment risk of the latest version of the flowcharts is reduced.
The following describes the specific implementation of each step in fig. 1 in detail:
the name of the workflow (processDefinitionKey) can be used to distinguish between different workflows, the names of the workflows differing from one another. All versions of the same workflow can be queried by name, that is, a process under a name can include multiple different versions, and each version corresponds to a version identification (processdefinitionsid).
The network environment (env) may include a Test environment (whose corresponding identity may be UAT or Test) and an online environment (whose corresponding identity may be online). The test environment refers to an environment which is simulated by a tester by using some tools and data and is close to the use environment of a real user, and the purpose of the test environment is to enable the test result to be more real and effective. The online environment, i.e. the publishing environment, the environment visited by the real user, requires that no BUG is available and cannot be published frequently, which may affect the user experience.
In the deployment stage of the flowchart, for each workflow, the corresponding version identifier under different network environments may be pre-stored, for example, the name of the workflow and the identifier of the network environment may be spliced to obtain a character string, and then the character string is used as a key, the corresponding version identifier is used as a value, and is correspondingly stored in the cache, referring to table 1:
TABLE 1
key value
env+processDefinitionKey processDefinitionID
It should be noted that, when the key-value correspondence is configured, when the network environment env is a test environment (i.e., UAT or test), the processdefinitionsid may be set to be a version identifier corresponding to a latest version under the processdefinitionskey, and when the network environment env is an Online environment (Online), the processdefinitionsid may be set to be a version identifier corresponding to a version which is most stable in operation under the processdefinitionskey, and the version identifier may be set by itself according to an actual situation, which is not particularly limited by the present disclosure.
The cache is a storage capable of exchanging high-speed data, and exchanges data with a Central Processing Unit (CPU) before the memory, so that the speed is fast. The working principle of the cache is that when the CPU needs to read a piece of data, the CPU cache is firstly searched, the found data is immediately read and sent to the CPU for processing, if the found data is not found, the data is read from the memory with relatively low speed and sent to the CPU for processing, and meanwhile, the data block where the data is located is called into the cache, so that the whole data can be read from the cache in the future without calling the memory.
After the above corresponding relationship is configured, the network environment identifier (e.g., UAT, test, online) where the machine is located may be written in the memory or cache of each machine (i.e., workflow server) providing the workflow service in advance, so as to configure the network environment where the machine is located in advance.
Furthermore, each workflow server may report the workflow service and its information (including but not limited to an interface name, an interface alias, and ip (Internet Protocol) of the reporting device) provided by itself to the service registry for service registration, and the service registry may record each workflow service and its corresponding service provider information.
Furthermore, the related service user can read the workflow service through the service registration center, and when a certain workflow service needs to be called, the related service user can send a workflow execution request to the service registration center, wherein the workflow execution request includes the name of the workflow to be called, and further, the service registration center can position and process the workflow server side of the workflow execution request according to the name of the workflow, and forward the workflow execution request to the workflow server side.
Further, the workflow server may perform the following steps S110 to S130.
In step S110, a workflow execution request is received.
In this step, the workflow server may receive a workflow execution request, where the workflow execution request may include a name of a workflow to be executed.
In step S120, a to-be-executed version of the to-be-executed workflow is determined according to the name of the to-be-executed workflow and the identifier of the network environment.
In this step, referring to fig. 2, fig. 2 shows a flowchart for determining a to-be-executed version of a to-be-executed workflow according to a name of the to-be-executed workflow and an identifier of a network environment in the embodiment of the present disclosure, and includes steps S201 to S202:
in step S201, the name of the workflow to be executed is spliced with the identifier of the network environment to obtain a process keyword.
In this step, the workflow server may read a preconfigured network environment from the memory or the cache, and concatenate the identifier of the network environment and the name of the workflow to be executed as a process keyword. Taking the identifier of the network environment as the UAT as an example, and the name of the to-be-executed workflow as the Procedure as an example, the obtained process keyword may be the UAT-Procedure.
In step S202, a to-be-executed version of the to-be-executed workflow is determined according to a mapping relationship between the process keyword and a pre-stored process keyword and the to-be-executed version thereof.
In this step, the process keyword may be compared with a mapping relationship (i.e., table 1) between the process keyword pre-stored in the cache and the to-be-executed version thereof, so as to determine the to-be-executed version of the to-be-executed workflow.
Based on the above embodiment, the method and the device can solve the problem that in the related art, when the flow chart is initiated each time, the flow is initiated by the latest version by default, and when the latest version is the version which is not tested, the online flow and the test flow are both accessed to the latest version, so that the online flow and the test flow cannot be distinguished, and the accurate verification cannot be performed on the online flow and the test flow.
After the version to be executed is determined, in step S130, configuration information corresponding to the version to be executed is obtained, and the version to be executed is executed according to the configuration information.
In this step, the configuration information corresponding to the version to be executed may be obtained from MySQL, and the version to be executed may be executed according to the configuration information.
The version to be executed may include a plurality of task nodes, and the configuration information may include an execution sequence of the plurality of task nodes and user right control data corresponding to each task node.
For example, taking the leave approval workflow as an example for explanation, the plurality of task nodes may include: the executive sequence is that the executive sequence can jump to the task node approved by the manager only after the supervisor approves the task node, and can jump to the task node approved by the general manager only after the manager approves the task node. The user authority control data is that when entering a supervisor approval node, only a supervisor type user can operate the task node, and other users do not have operation authority.
It should be noted that, in the process of executing the to-be-executed version, the newly added data of each task node may be stored as a data record in the search server cluster. Specifically, the task identifier of each task node may be used as a key, all the newly added data of each task node may be used as a value, and the value is stored in an ES cluster (ES) in the form of a horizontal table. Therefore, the method and the device can solve the problem of poor data query performance caused by storing the data in a vertical table form in the related technology, and remarkably improve the data query speed under the scene of high query flow concurrency.
Illustratively, the present disclosure may configure at least two search server clusters (e.g., dual ES clusters) to accommodate scenarios where there are a large number of concurrent query tasks at the same time.
The elastic search (es) is a full-text search engine based on an open-source, distributed and RESTful interface constructed by Lucene. The Elasticsearch is also a distributed document database in which each field can be indexed and the data of each field can be searched, and a large amount of data can be stored, searched and analyzed in an extremely short time. The ES generally works in a cluster mode, so that the searching capability of the ES can be improved, the capability of searching big data can be processed, the fault tolerance capability and high availability of the system are increased, and the ES can realize the searching of PB-level data.
Therefore, compared with a scheme of storing all data (tasks to be handled and historical tasks, wherein the task variables are tables independent of each other) into the MySQL (if the scheme needs to be retrieved according to the task variables, the MySQL needs to be subjected to multi-table association, and once the data volume is up, the query performance is very poor), the data query performance can be improved, and the data query speed is increased.
It should be noted that, after the newly added data is saved in the ES search database cluster, a binlog listener can be used to perform real-time monitoring on the MySQL (MySQL is a relational database management system) database, and the data in MySQL is compared with the data stored in the ES to determine whether the data is changed. And when the data change is monitored, updating the changed data into the ES database in real time, so that the newly added data in MySQL can be synchronized into the ES cluster in real time.
In an optional implementation manner, after the data is stored in the ES, the present disclosure further provides a scheme for performing fast query on the data, specifically, referring to fig. 3, fig. 3 shows a flow chart of how to respond to a data query request in an embodiment of the present disclosure, which includes steps S301 to S303:
in step S301, a data query request of a client is received, where the data query request includes a user identifier.
In this step, a data query request of a client may be received, and for example, the data query request may include a user identifier, for example: the user PIN (also known as PIN code, which is a serial number of digits used to authenticate the user and authorize him to enter the system).
In step S302, the user identity is authenticated.
In this step, the user PIN may be authenticated, and specifically, the user PIN may be sent to the authority configuration terminal, so that the authority configuration terminal generates an authentication code according to the user PIN (a specific generation manner of the authentication code may be defined by the authority configuration terminal, which is not specially limited by the present disclosure).
The authority configuration terminal can be an external business party using the workflow, so that each external business party can flexibly configure the calculation mode of the authority code according to the requirement of the external business party to meet the requirement of each external business party.
In step S303, if the authentication is passed, a target cluster for responding to the data query request is selected from the at least two search server clusters, so as to perform response processing on the data query request through the target cluster.
In this step, after the authentication is passed, refer to fig. 4, where fig. 4 shows a schematic flow chart of selecting a target cluster for responding to a data query request from at least two search server clusters in the embodiment of the present disclosure, and includes steps S401 to S403:
in step S401, a weight attribute value corresponding to each search server is randomly generated.
In this step, a random algorithm may be used to generate the weight attribute values corresponding to each search server. For example, taking the example that two search servers are deployed as an example, the weight attribute value corresponding to the search server cluster 1 may be 60, and the weight attribute value corresponding to the search server cluster 2 may be 40.
In step S402, the service probability of each search server cluster is calculated based on the weight attribute value.
In this step, the service probability of each search server cluster may be calculated according to the weight attribute value. For example, for the above search server cluster 1, the service probability may be
Figure BDA0003497718920000101
For the above search server cluster 2, the service probability may be
Figure BDA0003497718920000102
In step S403, the search server cluster whose service probability satisfies the probability threshold is determined as the target cluster.
In this step, after calculating the service probabilities corresponding to the respective search server clusters, the service probabilities may be compared, and the search server cluster with the higher service probability is determined as a target cluster, and the target cluster is used to respond to the data query request, that is, the query result corresponding to the data query request is returned.
Exemplarily, referring to fig. 5, fig. 5 shows an overall flowchart of the deployment workflow in the embodiment of the present disclosure, which includes steps S501 to S505:
in step S501, start;
in step S502, a workflow is deployed;
in step S503, a network environment identifier is set, and a flow version included in each flow is read from MySQL;
in step S504, configuration information is input through a process configuration operation, a correspondence between a process keyword (network environment identifier + name of workflow) and a version to be executed is set, and the correspondence is stored in a cache;
in step S505, the process ends.
After the workflow is deployed, reference may be made to fig. 6, where fig. 6 shows an overall flowchart of executing the workflow in the embodiment of the present disclosure, including step S601-step S607:
in step S601, a workflow is initiated;
in step S602, a network environment is determined;
in step S603, a to-be-executed version is acquired according to a process keyword composed of an identifier of a network environment and a process name;
in step S604, configuration information corresponding to the version to be executed is acquired;
in step S605, executing the version to be executed according to the configuration information;
in step S606, an instance id is generated;
in step S607, the process ends.
It should be noted that, in the related art, when initiating a workflow, the method generally includes the following steps, and specifically, the insertion process instance stage includes: inserting a starting user, setting a flow variable, inserting node information and inserting a history example table; the task to be handled inserting stage comprises the following steps: inquiring the task to be handled, setting a task variable, inserting an identity table, inserting a task to be handled table and inserting a historical task table.
While the present disclosure converges the above steps, referring to fig. 7, fig. 7 shows a schematic flow diagram of how to initiate a workflow in the embodiment of the present disclosure, including S701-step S710:
in step S701, start;
in step S702, the distributed lock is anti-replay;
in step S703, the latest version flowchart is acquired;
the insertion flow instance stage includes steps S704 to S705:
in step S704, the insertion start user;
in step S705, a flow variable is set;
the stage of inserting the task to be handled comprises steps S706-S709:
in step S706, a task to be handled is queried;
in step S707, a task variable is set;
in step S708, an identity table is inserted;
in step S709, a task table to be handled is inserted;
in step S710, the process ends.
And further writing node information and a history instance table after the flow instance is ended, writing a history task table after the task is ended, and inserting a task variable history table in batches.
Compared with the scheme in the related technology, the method and the device can converge unnecessary steps which do not influence the flow when the process is initiated, reduce the number of data tables which need to be read and written in the process of initiating the workflow, and improve the initiating speed of the workflow.
Exemplarily, referring to fig. 8, fig. 8 shows a flowchart of a synchronization and query process of data in an embodiment of the present disclosure, referring to fig. 8:
each external service party can initiate a flow through an Activiti engine and synchronize tasks to be processed into an ES cluster through a task listener;
the MySQL database (including the master MySQL and the slave MySQL) is listened by a task listener to obtain incremental data in real time, and the incremental data is written into binlog (used for recording data update or potential update of MySQL) through a binlake service so as to be synchronized into an ES cluster (including ES1 and ES 2).
When receiving a task query instruction, the data query module randomly allocates weight attribute values to various search server clusters (including ES1 and ES2), calculates service probability according to the weight attribute values, and selects a target cluster for responding to a query request.
Based on above technical scheme, this disclosure can realize following technological effect:
firstly, different process versions can be provided for a test environment and an online environment based on a network environment and a process name, so that isolation of different versions is realized, and deployment risk is reduced;
secondly, internal logic of the Activiti initiated process is converged, historical tasks and variables are stored and aggregated into a single command, and the process initiation performance is optimized;
thirdly, based on the API performance optimization initiated by Activiti, the newly added data of each task to be processed is stored as a data record, and each task to be processed corresponds to a task identifier, so that the newly added data of each task to be processed can be quickly inquired according to the task identifier, and the complexity of condition inquiry is reduced;
fourthly, the self-defined authority code of the external service party is supported.
The present disclosure also provides a workflow execution apparatus, and fig. 9 shows a schematic structural diagram of the workflow execution apparatus in an exemplary embodiment of the present disclosure; as shown in fig. 9, the workflow execution apparatus 900 may include a request receiving module 910, a version determining module 920, and a workflow execution module 930. Wherein:
a request receiving module 910, configured to receive a workflow execution request, where the workflow execution request includes a name of a workflow to be executed;
a version determining module 920, configured to determine a to-be-executed version of the to-be-executed workflow according to the name of the to-be-executed workflow and the identifier of the network environment;
the workflow executing module 930 is configured to obtain configuration information corresponding to the to-be-executed version, and execute the to-be-executed version according to the configuration information.
In an exemplary embodiment of the present disclosure, the version determination module 920 is configured to:
splicing the name of the workflow to be executed and the identifier of the network environment to obtain a flow keyword; and determining the to-be-executed version of the to-be-executed workflow according to the flow keywords and the mapping relation between the prestored flow keywords and the to-be-executed version thereof.
In an exemplary embodiment of the present disclosure, the to-be-executed version includes a plurality of task nodes, and the workflow execution module 930 is configured to:
receiving a locking request of a client aiming at a target task node; responding to that the target task node is not locked, generating locking information according to the locking request and storing the locking information in a cache so as to enable the client to execute the business operation protected by the distributed lock; and responding to the target task node being locked, and returning a locking failure message to the client.
In an exemplary embodiment of the present disclosure, the to-be-executed version includes a plurality of task nodes, and the workflow execution module 930 is configured to:
and storing the newly added data of each task node as a data record into the search server cluster.
In an exemplary embodiment of the present disclosure, the number of the search server clusters is at least two; after storing the new data for each task node as a data record in the search server cluster, the workflow execution module 930 is configured to:
receiving a data query request of a client, wherein the data query request comprises a user identifier; authenticating the user identification; and if the authentication is passed, selecting a target cluster for responding to the data query request from the at least two search server clusters, and responding to the data query request through the target cluster.
In an exemplary embodiment of the present disclosure, the workflow execution module 930 is configured to:
authenticating the user identity by: sending the user identification to an authority configuration terminal so that the authority configuration terminal generates an authentication code according to the user identification; comparing the authentication code returned by the authority configuration terminal with a prestored authentication code; and if the comparison is consistent, determining that the user identification passes the authentication.
In an exemplary embodiment of the present disclosure, the workflow execution module 930 is configured to:
selecting a target cluster by the following method: randomly generating a weight attribute value corresponding to each search server; calculating the service probability of each search server cluster according to the weight attribute value; and determining the search server cluster with the service probability meeting the probability threshold value as the target cluster.
The specific details of each module in the workflow execution apparatus have been described in detail in the corresponding workflow execution method, and therefore are not described herein again.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
The present application also provides a computer-readable storage medium, which may be contained in the electronic device described in the above embodiments; or may exist separately without being assembled into the electronic device.
A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable storage medium may transmit, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable storage medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The computer readable storage medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method as described in the above embodiments.
In addition, the embodiment of the disclosure also provides an electronic device capable of implementing the method.
As will be appreciated by one skilled in the art, aspects of the present disclosure may be embodied as a system, method or program product. Accordingly, various aspects of the present disclosure may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 1000 according to this embodiment of the disclosure is described below with reference to fig. 10. The electronic device 1000 shown in fig. 10 is only an example and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 10, the electronic device 1000 is embodied in the form of a general purpose computing device. The components of the electronic device 1000 may include, but are not limited to: the at least one processing unit 1010, the at least one memory unit 1020, a bus 1030 connecting different system components (including the memory unit 1020 and the processing unit 1010), and a display unit 1040.
Wherein the storage unit stores program code that is executable by the processing unit 1010 to cause the processing unit 1010 to perform steps according to various exemplary embodiments of the present disclosure described in the above section "exemplary methods" of the present specification. For example, the processing unit 1010 may perform the following as shown in fig. 1: step S110, receiving a workflow execution request, wherein the workflow execution request comprises the name of a workflow to be executed; step S120, determining the version to be executed of the workflow to be executed according to the name of the workflow to be executed and the identifier of the network environment; step S130, obtaining configuration information corresponding to the version to be executed, and executing the version to be executed according to the configuration information. The storage unit 1020 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)10201 and/or a cache memory unit 10202, and may further include a read-only memory unit (ROM) 10203.
The memory unit 1020 may also include a program/utility 10204 having a set (at least one) of program modules 10205, such program modules 10205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may comprise an implementation of a network environment.
Bus 1030 may be any one or more of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, and a local bus using any of a variety of bus architectures.
The electronic device 1000 may also communicate with one or more external devices 1100 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 1000, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 1000 to communicate with one or more other computing devices. Such communication may occur through input/output (I/O) interfaces 1050. Also, the electronic device 1000 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 1060. As shown, the network adapter 1060 communicates with the other modules of the electronic device 1000 over the bus 1030. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 1000, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (10)

1. A workflow execution method is applied to a workflow server, wherein a network environment where the workflow server is located is configured in advance, and the method comprises the following steps:
receiving a workflow execution request, wherein the workflow execution request comprises the name of a workflow to be executed;
determining a to-be-executed version of the to-be-executed workflow according to the name of the to-be-executed workflow and the identifier of the network environment;
and acquiring configuration information corresponding to the version to be executed, and executing the version to be executed according to the configuration information.
2. The method of claim 1, wherein determining the to-be-executed version of the to-be-executed workflow according to the name of the to-be-executed workflow and the identifier of the network environment comprises:
splicing the name of the workflow to be executed and the identifier of the network environment to obtain a process keyword;
and determining the to-be-executed version of the to-be-executed workflow according to the flow keywords and the mapping relation between the prestored flow keywords and the to-be-executed version thereof.
3. The method of claim 1, wherein the to-be-executed version comprises a plurality of task nodes, the method further comprising:
receiving a locking request of a client aiming at a target task node;
responding to that the target task node is not locked, generating locking information according to the locking request and storing the locking information in a cache so as to enable the client to execute the business operation protected by the distributed lock;
in response to the target task node being locked, returning a locking failure message to the client.
4. The method of claim 1, wherein the to-be-executed version comprises a plurality of task nodes, and wherein executing the to-be-executed version comprises:
and storing the newly added data of each task node as a data record in the search server cluster.
5. The method of claim 4, wherein the number of search server clusters is at least two;
after the newly added data of each task node is stored as a data record in the search server cluster, the method further comprises the following steps:
receiving a data query request of a client, wherein the data query request comprises a user identifier;
authenticating the user identification;
and if the authentication is passed, selecting a target cluster for responding to the data query request from the at least two search server clusters, and responding to the data query request through the target cluster.
6. The method of claim 5, wherein the user identity is authenticated by:
sending the user identification to an authority configuration terminal so that the authority configuration terminal generates an authentication code according to the user identification;
comparing the authentication code returned by the authority configuration terminal with a prestored authentication code;
and if the comparison is consistent, determining that the user identification passes the authentication.
7. The method of claim 5, wherein the target cluster is selected by:
randomly generating a weight attribute value corresponding to each search server;
calculating the service probability of each search server cluster according to the weight attribute value;
and determining the search server cluster with the service probability meeting the probability threshold value as the target cluster.
8. A workflow execution apparatus, comprising:
the system comprises a request receiving module, a workflow execution module and a workflow execution module, wherein the request receiving module is used for receiving a workflow execution request which comprises the name of a workflow to be executed;
the version determining module is used for determining the to-be-executed version of the to-be-executed workflow according to the name of the to-be-executed workflow and the identifier of the network environment;
and the workflow execution module is used for acquiring the configuration information corresponding to the version to be executed and executing the version to be executed according to the configuration information.
9. A computer storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the workflow execution method of any one of claims 1 to 7.
10. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the workflow execution method of any one of claims 1 to 7 via execution of the executable instructions.
CN202210119006.5A 2022-02-08 2022-02-08 Workflow execution method and device, storage medium and equipment Pending CN114489772A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210119006.5A CN114489772A (en) 2022-02-08 2022-02-08 Workflow execution method and device, storage medium and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210119006.5A CN114489772A (en) 2022-02-08 2022-02-08 Workflow execution method and device, storage medium and equipment

Publications (1)

Publication Number Publication Date
CN114489772A true CN114489772A (en) 2022-05-13

Family

ID=81477657

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210119006.5A Pending CN114489772A (en) 2022-02-08 2022-02-08 Workflow execution method and device, storage medium and equipment

Country Status (1)

Country Link
CN (1) CN114489772A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116029539A (en) * 2023-03-30 2023-04-28 深圳市奥思网络科技有限公司 Project circulation method based on workflow and related components

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116029539A (en) * 2023-03-30 2023-04-28 深圳市奥思网络科技有限公司 Project circulation method based on workflow and related components
CN116029539B (en) * 2023-03-30 2023-06-09 深圳市奥思网络科技有限公司 Project circulation method based on workflow and related components

Similar Documents

Publication Publication Date Title
CN108280367B (en) Data operation authority management method and device, computing equipment and storage medium
US9690822B2 (en) System and method for metadata level validation of custom setup objects
US8255409B2 (en) Systems and methods for generating a change log for files in a managed network
KR20210133289A (en) Data extraction from blockchain networks
CN103067463A (en) Centralized management system and centralized management method for user root permission
JP6595625B2 (en) Automatic recharge system, method and server
CN108287894B (en) Data processing method, device, computing equipment and storage medium
KR102295593B1 (en) Automatically generating certification documents
US9582270B2 (en) Effective feature location in large legacy systems
CN111552934A (en) Database access method and device
CN109086382A (en) A kind of method of data synchronization, device, equipment and storage medium
US11704114B2 (en) Data structures for managing configuration versions of cloud-based applications
CN111930489A (en) Task scheduling method, device, equipment and storage medium
CN109858285B (en) Block chain data processing method, device, equipment and medium
CN114489772A (en) Workflow execution method and device, storage medium and equipment
US11080043B1 (en) Data structures for managing configuration versions of cloud-based applications
CN111274004B (en) Process instance management method and device and computer storage medium
US11194785B2 (en) Universal self-learning database recovery
CN110347718B (en) REDIS (REDIS) slicing method, REDIS slicing device, computer equipment and storage medium
CN112507298A (en) User authentication method, device, server and storage medium
US10003492B2 (en) Systems and methods for managing data related to network elements from multiple sources
CN112148728A (en) Method, apparatus and computer program product for information processing
CN110096543A (en) Data manipulation method, device, server and the medium of application program
US9852385B2 (en) Processing of business object identifiers in master data integration scenarios involving non-local identifiers
US11727022B2 (en) Generating a global delta in distributed databases

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination