[go: up one dir, main page]

CN116307661A - Workflow state reverse recovery method, device, computer equipment and storage medium - Google Patents

Workflow state reverse recovery method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN116307661A
CN116307661A CN202310120676.3A CN202310120676A CN116307661A CN 116307661 A CN116307661 A CN 116307661A CN 202310120676 A CN202310120676 A CN 202310120676A CN 116307661 A CN116307661 A CN 116307661A
Authority
CN
China
Prior art keywords
data
workflow
state
tables
change
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.)
Granted
Application number
CN202310120676.3A
Other languages
Chinese (zh)
Other versions
CN116307661B (en
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.)
Chengdu Pan Micro Network Technology Co ltd
Original Assignee
Chengdu Pan Micro Network 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 Chengdu Pan Micro Network Technology Co ltd filed Critical Chengdu Pan Micro Network Technology Co ltd
Priority to CN202310120676.3A priority Critical patent/CN116307661B/en
Publication of CN116307661A publication Critical patent/CN116307661A/en
Application granted granted Critical
Publication of CN116307661B publication Critical patent/CN116307661B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0633Workflow analysis
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/103Workflow collaboration or project management

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Human Resources & Organizations (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Data Mining & Analysis (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Computational Linguistics (AREA)
  • Development Economics (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a workflow state reverse order recovery method, a workflow state reverse order recovery device, computer equipment and a storage medium, and relates to the technical field of workflow management. The method is characterized in that all tables before and after the change of the workflow state are respectively inquired and stored, corresponding newly added, updated and/or deleted data are compared and determined for each table after the change, then the newly added, updated and/or deleted data of each table after the change are packaged and are bound together with an execution time stamp to be stored as one piece of flow operation record information, a stack pressing-like process is realized, finally when a workflow state recovery request is received, all current tables are inquired and obtained, and the flow operation record information sequences obtained based on the reverse arrangement of the execution time stamp are combined, so that the workflow is gradually recovered to the workflow target state, a stack-off-like process is realized, and the maintainability, the reliability and the performance of a workflow management system can be greatly improved.

Description

工作流状态逆序恢复方法、装置、计算机设备及存储介质Workflow state reverse recovery method, device, computer equipment and storage medium

技术领域technical field

本发明属于工作流程管理技术领域,具体涉及一种工作流状态逆序恢复方法、装置、计算机设备及存储介质。The invention belongs to the technical field of workflow management, and in particular relates to a workflow state reverse recovery method, device, computer equipment and storage medium.

背景技术Background technique

工作流程管理是指系统化地实现公司日常办公的工作流程审批和管理,包括行政、财务、人事和采购等审批流程,通过工作流程的信息化管理可提高企业的工作效率。Workflow management refers to the systematic realization of the approval and management of the company's daily office work flow, including administrative, financial, personnel and procurement approval processes. Through the information management of the work flow, the work efficiency of the enterprise can be improved.

现有将工作流程状态(也简称工作流状态)逐步恢复到上一历史状态的方法,是在恢复时,根据工作流状态数据进行逻辑计算,判断是否可以恢复,如果可以恢复,则首先计算上一次操作的动作,然后根据操作动作的变更逻辑,推算影响的数据,最后基于这部分影响的数据进行状态还原。但是由于每次收回(即指恢复到上一历史状态的过程)都需要进行大量的运算,且依赖于现有数据和上一次操作动作的逻辑,如果操作动作的逻辑在某个版本发生了变更,则在收回逻辑中需要进行相应的判断和兼容,否则会导致收回失败,引发数据错乱,给用户造成极大的不变和困扰,因此会导致工作流程管理系统存在如下几点问题:(1)性能较差,即由于每次恢复到上一状态都需要进行大量的数据运算,且随着版本的更新越来越复杂,导致恢复所需时长越长;(2)可靠性较差,即由于操作动作的逻辑发生变更会影响收回的计算逻辑,新增的动作也需要进行兼容,所以会导致每次在其它地方发生变更时,需同步调整该处的逻辑,否则会导致数据错乱;(3)可维护性较差,即由于涉及大量运算,如果某个动作的数据和逻辑有一点点偏差,也会导致收回失败,引发数据错乱。The existing method for gradually restoring the workflow state (also referred to as the workflow state) to the previous historical state is to perform logical calculations based on the workflow state data to determine whether recovery is possible. If recovery is possible, first calculate the previous state. An operation action, and then calculate the affected data according to the change logic of the operation action, and finally restore the state based on this part of the affected data. However, since each retraction (that is, the process of restoring to the previous historical state) requires a lot of calculations and depends on the existing data and the logic of the last operation action, if the logic of the operation action changes in a certain version , you need to make corresponding judgments and compatibility in the retraction logic, otherwise it will lead to the failure of the retraction, cause data confusion, and cause great invariance and confusion to the user, which will lead to the following problems in the workflow management system: (1 ) has poor performance, that is, a large number of data operations are required to restore to the previous state each time, and as the version is updated more and more complex, the longer the recovery time is; (2) the reliability is poor, that is, Since the change of the logic of the operation action will affect the calculation logic of the retraction, the newly added action also needs to be compatible, so every time there is a change in other places, the logic there needs to be adjusted synchronously, otherwise it will lead to data confusion; ( 3) Poor maintainability, that is, due to the large number of calculations involved, if there is a slight deviation between the data and logic of an action, it will also lead to recovery failure and data confusion.

发明内容Contents of the invention

本发明的目的是提供一种工作流状态逆序恢复方法、装置、计算机设备及计算机可读存储介质,用以解决现有工作流程管理系统在状态收回过程中存在可维护性、可靠性和性能都比较差的问题。The object of the present invention is to provide a method, device, computer equipment, and computer-readable storage medium for reversing workflow state recovery, so as to solve the problem of maintainability, reliability, and performance in the state recovery process of existing workflow management systems. Relatively poor question.

为了实现上述目的,本发明采用以下技术方案:In order to achieve the above object, the present invention adopts the following technical solutions:

第一方面,提供了一种工作流状态逆序恢复方法,包括:In the first aspect, a method for reversing workflow state recovery is provided, including:

在收到工作流状态变更请求时,查询并存储涉及流程状态数据的所有变更前表;When a workflow status change request is received, query and store all pre-change tables involving process status data;

响应所述工作流状态变更请求执行操作动作逻辑,使工作流状态发生变更;Executing the operation action logic in response to the workflow state change request to change the workflow state;

在工作流状态发生变更后,查询并存储涉及流程状态数据的所有变更后表,其中,所述所有变更后表与所述所有变更前表一一对应;After the workflow status is changed, query and store all post-change tables related to process state data, wherein all the post-change tables correspond to all the pre-change tables one by one;

针对在所述所有变更后表中的各个变更后表,根据与对应的变更前表的数据对比结果,确定对应的新增数据、更新数据和/或删除数据;For each post-change table among all the post-change tables, determine the corresponding new data, update data and/or delete data according to the data comparison result with the corresponding pre-change table;

将所述各个变更后表的新增数据、更新数据和/或删除数据合并成一个数据包,并将所述数据包和所述操作动作逻辑的执行时间戳绑定作为一条流程操作记录信息存储在流程操作记录表中;Combining the newly added data, updated data and/or deleted data of each changed table into a data package, and binding the data package with the execution time stamp of the operation action logic as a process operation record information storage In the process operation record table;

在收到工作流状态恢复请求时,查询获取涉及流程状态数据的所有当前表,并基于执行时间戳倒叙排列在所述流程操作记录表中的至少一条流程操作记录信息,得到流程操作记录信息序列;When receiving a workflow state recovery request, query to obtain all current tables related to process state data, and reversely arrange at least one piece of process operation record information in the process operation record table based on the execution time stamp, to obtain the sequence of process operation record information ;

根据所述所有当前表和所述流程操作记录信息序列,使工作流程逐步回滚地恢复到在所述工作流状态恢复请求中所请求恢复的工作流目标状态。According to all the current tables and the information sequence of the process operation record, the workflow is gradually rolled back to restore to the workflow target state requested in the workflow state restoration request.

基于上述发明内容,提供了一种类似于压栈出栈方式的工作流状态收回新方案,即在每次工作流状态发生变更前后分别查询并存储涉及流程状态数据的所有变更前表和所有变更后表,然后针对在所述所有变更后表中的各个变更后表,根据与对应的变更前表的数据对比结果,确定对应的新增数据、更新数据和/或删除数据,再然后将所述各个变更后表的新增数据、更新数据和/或删除数据打包,并与操作动作逻辑的执行时间戳一起绑定作为一条流程操作记录信息存储在流程操作记录表中,实现类似压栈的过程,最后在收到工作流状态恢复请求时,查询获取涉及流程状态数据的所有当前表,并结合基于执行时间戳倒叙排列所得的流程操作记录信息序列,使工作流程逐步回滚地恢复到在所述工作流状态恢复请求中所请求恢复的工作流目标状态,实现类似出栈的过程,如此在收回过程中可以不涉及大量运算和动作逻辑,进而可大幅度提高工作流程管理系统的可维护性、可靠性和性能,便于实际应用和推广。Based on the content of the above invention, a new workflow state recovery scheme similar to the method of pushing and popping is provided, that is, before and after each workflow state change, all pre-change tables and all changes involving process state data are queried and stored After the table, and then for each post-change table among all the post-change tables, according to the data comparison result with the corresponding pre-change table, determine the corresponding new data, update data and/or delete data, and then add all The newly added data, updated data, and/or deleted data of each table after each change are packaged, and bound together with the execution time stamp of the operation action logic as a process operation record information stored in the process operation record table, to achieve a stack-like Finally, when receiving the workflow state recovery request, query to obtain all the current tables related to the process state data, and combine the process operation record information sequence based on the reverse order of the execution time stamp, so that the workflow can be gradually rolled back and restored to the state in The workflow target state requested in the workflow state recovery request realizes a process similar to popping, so that a large amount of calculation and action logic may not be involved in the recovery process, and the maintainability of the workflow management system can be greatly improved The reliability, reliability and performance are convenient for practical application and promotion.

在一个可能的设计中,查询并存储涉及流程状态数据的所有变更前表,包括:In one possible design, all pre-change tables involving process state data are queried and stored, including:

依次查询获取涉及流程状态数据的所有变更前表;Query in sequence to obtain all pre-change tables involving process state data;

基于包含有键名KEY和键值VALUE的MAP数据结构,按照如下方式得到在所述所有变更前表中的各个变更前表的表数据:先采用键名KEY为列名且键值VALUE为列值的方式,模拟在所述各个变更前表中的每一行的列数据,得到该每一行的且呈MAP数据结构的行数据,然后采用键名KEY为行数据主键标识ID且键值VALUE为行数据的方式,模拟在所述各个变更前表中的每一行,得到所述各个变更前表的表数据;Based on the MAP data structure containing the key name KEY and the key value VALUE, the table data of each pre-change table in the above-mentioned all pre-change tables is obtained as follows: first use the key name KEY as the column name and the key value VALUE as the column value, simulating the column data of each row in the table before each change, and obtaining the row data of each row in a MAP data structure, then using the key name KEY as the row data primary key ID and the key value VALUE as The mode of row data, simulates each row in the table before described each change, obtains the table data of the table before described each change;

按照查询先后顺序将所述各个变更前表的表数据依次放入到一个链表LIST数据结构中,得到用于存储所述所有变更前表的第一链表LIST。Put the table data of each pre-alteration table into a linked list LIST data structure sequentially according to the query sequence, and obtain the first linked list LIST for storing all the pre-alteration tables.

在一个可能的设计中,查询并存储涉及流程状态数据的所有变更后表,包括:In one possible design, all post-change tables that involve process state data are queried and stored, including:

按照所述查询先后顺序依次查询获取涉及流程状态数据的所有变更后表,其中,所述所有变更后表与所述所有变更前表一一对应;Query and obtain all the changed tables related to the process state data in sequence according to the query sequence, wherein, all the changed tables correspond to all the pre-changed tables one by one;

基于链表LIST数据结构和包含有键名KEY和键值VALUE的MAP数据结构,按照如下方式得到在所述所有变更后表中的各个变更后表的表数据:先采用键名KEY为列名且键值VALUE为列值的方式,模拟在所述各个变更后表中的每一行的列数据,得到该每一行的且呈MAP数据结构的行数据,然后采用链表LIST数据结构依次存储在所述各个变更后表中的每一行的行数据,得到所述各个变更后表的表数据;Based on the linked list LIST data structure and the MAP data structure that includes the key name KEY and the key value VALUE, the table data of each changed table in the described all changed tables is obtained as follows: first adopt the key name KEY as the column name and The key value VALUE is the mode of the column value, simulates the column data of each row in the table after each change, obtains the row data of each row and is in the MAP data structure, and then adopts the linked list LIST data structure to store in the described The row data of each row in each changed table is obtained to obtain the table data of each changed table;

按照所述查询先后顺序将所述各个变更后表的表数据依次放入到另一个链表LIST数据结构中,得到用于存储所述所有变更后表的第二链表LIST。The table data of each changed table is sequentially put into another linked list LIST data structure according to the query sequence, and a second linked list LIST for storing all changed tables is obtained.

在一个可能的设计中,针对在所述所有变更后表中的各个变更后表,根据与对应的变更前表的数据对比结果,确定对应的新增数据、更新数据和/或删除数据,包括:In a possible design, for each post-change table among all the post-change tables, according to the data comparison result with the corresponding pre-change table, determine the corresponding new data, update data and/or delete data, including :

按照所述查询先后顺序同步地依次遍历在所述第二链表LIST中的表数据和在所述第一链表LIST中的表数据;Traversing the table data in the second linked list LIST and the table data in the first linked list LIST synchronously and sequentially according to the query sequence;

针对当前遍历到的且在所述第二链表LIST中的第二表数据和在所述第一链表LIST中的第一表数据,按照如下方式(A)~(C)中任意一种或它们的任意组合确定对应的新增数据、更新数据和/或删除数据:For the currently traversed second table data in the second linked list LIST and the first table data in the first linked list LIST, follow any one of the following methods (A) to (C) or their Any combination of determines the corresponding new data, updated data and/or deleted data:

(A)针对在所述第二表数据中的且呈MAP数据结构的各个第二行数据,根据对应的行数据主键标识ID在所述第一表数据中查找是否存在为该行数据主键标识ID的键名KEY,若不存在,则将对应的第二行数据作为一条与所述第二表数据和所述第一表数据对应的新增数据;(A) For each second row data in the second table data and in the MAP data structure, search whether there is a primary key identifier for the row data in the first table data according to the corresponding row data primary key ID If the key name KEY of the ID does not exist, the corresponding second row of data is used as a piece of newly added data corresponding to the second table data and the first table data;

(B)针对在所述第二表数据中的且呈MAP数据结构的各个第二行数据,根据对应的行数据主键标识ID在所述第一表数据中查找是否存在为该行数据主键标识ID的键名KEY,若存在,则从所述第一表数据中获取与为该行数据主键标识ID的键名KEY对应的第一键值VALUE;(B) For each second row data in the second table data and in the MAP data structure, according to the corresponding row data primary key ID, search whether there is a primary key ID for the row data in the first table data If the key name KEY of the ID exists, then obtain the first key value VALUE corresponding to the key name KEY that identifies the ID for the row data primary key from the first table data;

针对所述各个第二行数据,按照如下方式确定对应的相异数据:针对在第一键值VALUE中的各个列,对比该列的键值VALUE与在第二行数据中的且与该列的键名KEY对应的键值VALUE,若两键值VALUE的对比结果为相异,则将该列的键名KEY和键值VALUE作为一条该第二行数据的相异数据;For each of the second rows of data, determine the corresponding different data in the following manner: For each column in the first key value VALUE, compare the key value VALUE of the column with that in the second row of data and with the column The key value VALUE corresponding to the key name KEY, if the comparison result of the two key values VALUE is different, then the key name KEY and key value VALUE of the column will be used as a different data of the second row of data;

将所述各个第二行数据的相异数据作为一条与所述第二表数据和所述第一表数据对应的更新数据;Using the different data of each second row of data as a piece of update data corresponding to the second table data and the first table data;

(C)针对在所述第一表数据中的且呈MAP数据结构的各个第一行数据,根据对应的行数据主键标识ID在所述第二表数据中查找是否存在为该行数据主键标识ID的键名KEY,若不存在,则将对应的第一行数据作为一条与所述第二表数据和所述第一表数据对应的删除数据。(C) For each first row data in the first table data and in the MAP data structure, according to the corresponding row data primary key ID, search whether there is a primary key ID for the row data in the second table data If the key name KEY of the ID does not exist, the corresponding first row of data is used as a piece of deleted data corresponding to the second table data and the first table data.

在一个可能的设计中,将所述各个变更后表的新增数据、更新数据和/或删除数据合并成一个数据包,包括:In a possible design, the newly added data, updated data and/or deleted data of each changed table are combined into one data package, including:

将所述各个变更后表的新增数据、更新数据和/或删除数据合并放到一个JSON数据格式中,得到一个数据包。Merge the newly added data, updated data and/or deleted data of each changed table into a JSON data format to obtain a data package.

在一个可能的设计中,根据所述所有当前表和所述流程操作记录信息序列,使工作流程逐步回滚地恢复到在所述工作流状态恢复请求中所请求恢复的工作流目标状态,包括有如下步骤S70~S76:In a possible design, according to all the current tables and the information sequence of the process operation record, the workflow is gradually rolled back to recover to the workflow target state requested in the workflow state recovery request, including There are the following steps S70-S76:

S70.将排序号K初始化为1,然后执行步骤S71,其中,K表示正整数且小于等于所述至少一条流程操作记录信息的信息总数;S70. Initialize the sorting number K to 1, and then execute step S71, wherein K represents a positive integer and is less than or equal to the total number of information of the at least one process operation record information;

S71.将所述所有当前表作为在最近第K个历史工作流状态更新后所得的且涉及流程状态数据的所有变更后表,然后执行步骤S72;S71. Use all the current tables as all changed tables obtained after the latest Kth historical workflow state update and involving process state data, and then perform step S72;

S72.获取在所述流程操作记录信息序列中的第K条流程操作记录信息,并解析在所述第K条流程操作记录信息中的数据包,获取在所述最近第K个历史工作流状态更新后所得的且各个变更后表的新增数据、更新数据和/或删除数据,然后执行步骤S73;S72. Obtain the K-th process operation record information in the process operation record information sequence, and analyze the data packet in the K-th process operation record information, and obtain the latest K-th historical workflow status The newly added data, updated data and/or deleted data obtained after the update and each changed table, and then step S73 is executed;

S73.根据在所述最近第K个历史工作流状态更新后所得的且涉及流程状态数据的所有变更后表和各个变更后表的新增数据、更新数据和/或删除数据,恢复得到在所述最近第K个历史工作流状态更新前的且涉及流程状态数据的所有变更前表,然后执行步骤S74;S73. According to the newly added data, updated data and/or deleted data of all the changed tables and each changed table obtained after the latest Kth historical workflow state update and involving the process state data, restore the obtained Describe all tables before the change of the latest Kth historical workflow state before updating and involving process state data, and then execute step S74;

S74.判断所述最近第K个历史工作流状态是否为在所述工作流状态恢复请求中所请求恢复的工作流目标状态,若是,则执行步骤S76,否则执行步骤S75;S74. Judging whether the latest K-th historical workflow state is the workflow target state requested in the workflow state recovery request, if so, execute step S76, otherwise execute step S75;

S75.将在所述最近第K个历史工作流状态更新前的且涉及流程状态数据的所有变更前表作为在最近第K+1个历史工作流状态更新后所得的且涉及流程状态数据的所有变更后表,并使排序号K自加1,然后返回执行步骤S72;S75. Use all pre-change tables that are related to process state data before the latest Kth historical workflow state update as all tables that are obtained after the latest K+1th historical workflow state update and involve process state data Change the back table, and make the sorting number K self-increment by 1, and then return to execute step S72;

S76.根据在所述最近第K个历史工作流状态更新前的且涉及流程状态数据的所有变更前表,使工作流程恢复到所述工作流目标状态。S76. Restoring the workflow to the workflow target state according to all pre-change tables involving process state data before the latest Kth historical workflow state update.

在一个可能的设计中,在恢复得到在所述最近第K个历史工作流状态更新前的且涉及流程状态数据的所有变更前表之后且执行步骤S74之前,所述方法还包括有:In a possible design, after recovering and obtaining all pre-change tables involving process state data before the latest Kth historical workflow state update and before performing step S74, the method further includes:

判断在所述最近第K个历史工作流状态更新前的且涉及流程状态数据的所有变更前表是否存在异常,若是,则终止工作流状态逆序恢复,否则执行步骤S74。Judging whether there is any abnormality in all pre-change tables involving process state data before the latest Kth historical workflow state update, if yes, terminate the workflow state and restore in reverse order, otherwise execute step S74.

第二方面,提供了一种工作流状态逆序恢复装置,包括有数据查询存储模块、状态变更响应模块、前后数据对比模块、数据打包记录模块、状态恢复响应模块和状态回滚恢复模块;In the second aspect, a workflow state reverse sequence restoration device is provided, including a data query storage module, a state change response module, a data comparison module before and after, a data packaging and recording module, a state restoration response module, and a state rollback restoration module;

所述数据查询存储模块,用于在收到工作流状态变更请求时,查询并存储涉及流程状态数据的所有变更前表;The data query storage module is used to query and store all pre-change tables related to process state data when a workflow state change request is received;

所述状态变更响应模块,通信连接所述数据查询存储模块,用于响应所述工作流状态变更请求执行操作动作逻辑,使工作流状态发生变更;The state change response module is communicatively connected to the data query storage module, and is used to execute operation logic in response to the workflow state change request to change the workflow state;

所述数据查询存储模块,还用于在工作流状态发生变更后,查询并存储涉及流程状态数据的所有变更后表,其中,所述所有变更后表与所述所有变更前表一一对应;The data query storage module is also used to query and store all the changed tables related to the process state data after the workflow state is changed, wherein, all the changed tables are in one-to-one correspondence with all the pre-changed tables;

所述前后数据对比模块,通信连接所述数据查询存储模块,用于针对在所述所有变更后表中的各个变更后表,根据与对应的变更前表的数据对比结果,确定对应的新增数据、更新数据和/或删除数据;The before and after data comparison module is communicatively connected to the data query storage module, and is used to determine the corresponding newly added data, update data and/or delete data;

所述数据打包记录模块,通信连接所述前后数据对比模块,用于将所述各个变更后表的新增数据、更新数据和/或删除数据合并成一个数据包,并将所述数据包和所述操作动作逻辑的执行时间戳绑定作为一条流程操作记录信息存储在流程操作记录表中;The data packaging and recording module is connected to the front and rear data comparison module by communication, and is used to combine the new data, update data and/or delete data of each table after the change into a data package, and combine the data package and The execution timestamp binding of the operation action logic is stored in the process operation record table as a process operation record information;

所述状态恢复响应模块,通信连接所述数据打包记录模块,用于在收到工作流状态恢复请求时,查询获取涉及流程状态数据的所有当前表,并基于执行时间戳倒叙排列在所述流程操作记录表中的至少一条流程操作记录信息,得到流程操作记录信息序列;The state recovery response module is connected to the data packaging and recording module by communication, and is used to query and obtain all current tables related to process state data when receiving a workflow state recovery request, and arrange them in reverse order based on the execution time stamp in the process Operating at least one piece of process operation record information in the record table to obtain a sequence of process operation record information;

所述状态回滚恢复模块,通信连接所述状态恢复响应模块,用于根据所述所有当前表和所述流程操作记录信息序列,使工作流程逐步回滚地恢复到在所述工作流状态恢复请求中所请求恢复的工作流目标状态。The state rollback restoration module is communicatively connected to the state restoration response module, and is used for recording information sequences according to all the current tables and the process operation, so that the work flow can be gradually rolled back to restore to the state in the state of the work flow The workflow target state requested to be restored in the request.

第三方面,本发明提供了一种计算机设备,包括有依次通信连接的存储器、处理器和收发器,其中,所述存储器用于存储计算机程序,所述收发器用于收发数据,所述处理器用于读取所述计算机程序,执行如第一方面或第一方面中任意可能设计所述的工作流状态逆序恢复方法。In a third aspect, the present invention provides a computer device, including a memory, a processor, and a transceiver connected in sequence, wherein the memory is used to store computer programs, the transceiver is used to send and receive data, and the processor uses After reading the computer program, execute the workflow state reverse order recovery method as described in the first aspect or any possible design in the first aspect.

第四方面,本发明提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有指令,当所述指令在计算机上运行时,执行如第一方面或第一方面中任意可能设计所述的工作流状态逆序恢复方法。In a fourth aspect, the present invention provides a computer-readable storage medium, where instructions are stored on the computer-readable storage medium, and when the instructions are run on a computer, any possible Design the reverse order recovery method of the workflow state described above.

第五方面,本发明提供了一种包含指令的计算机程序产品,当所述指令在计算机上运行时,使所述计算机执行如第一方面或第一方面中任意可能设计所述的工作流状态逆序恢复方法。In the fifth aspect, the present invention provides a computer program product containing instructions. When the instructions are run on a computer, the computer is made to execute the workflow state described in the first aspect or any possible design in the first aspect. Reverse order recovery method.

上述方案的有益效果:The beneficial effect of above-mentioned scheme:

(1)本发明创造性提供了一种类似于压栈出栈方式的工作流状态收回新方案,即在每次工作流状态发生变更前后分别查询并存储涉及流程状态数据的所有变更前表和所有变更后表,然后针对在所述所有变更后表中的各个变更后表,根据与对应的变更前表的数据对比结果,确定对应的新增数据、更新数据和/或删除数据,再然后将所述各个变更后表的新增数据、更新数据和/或删除数据打包,并与操作动作逻辑的执行时间戳一起绑定作为一条流程操作记录信息存储在流程操作记录表中,实现类似压栈的过程,最后在收到工作流状态恢复请求时,查询获取涉及流程状态数据的所有当前表,并结合基于执行时间戳倒叙排列所得的流程操作记录信息序列,使工作流程逐步回滚地恢复到在所述工作流状态恢复请求中所请求恢复的工作流目标状态,实现类似出栈的过程,如此在收回过程中可以不涉及大量运算和动作逻辑,进而可大幅度提高工作流程管理系统的可维护性、可靠性和性能,便于实际应用和推广;(1) The present invention creatively provides a new workflow state recovery scheme similar to the way of pushing and popping the stack, that is, before and after each change of the workflow state, query and store all the pre-change tables and all table after change, and then for each table after change among all the tables after change, according to the data comparison result with the corresponding table before change, determine the corresponding new data, update data and/or delete data, and then The newly added data, updated data, and/or deleted data of each changed table are packaged and bound together with the execution time stamp of the operation action logic as a process operation record information stored in the process operation record table to achieve a similar push Finally, when receiving the workflow state recovery request, query to obtain all the current tables related to the process state data, and combine the process operation record information sequence based on the reverse order of the execution time stamp, so that the workflow can be gradually rolled back and restored to The workflow target state requested in the workflow state restoration request realizes a process similar to popping, so that a large number of calculations and action logic may not be involved in the recovery process, and the reliability of the workflow management system can be greatly improved. Maintainability, reliability and performance, easy for practical application and promotion;

(2)由于该方案采用类似压栈及出栈的方式,仅对栈顶的操作做验证,可不涉及大量运算,因此性能较高;(2) Since the scheme adopts a method similar to pushing and popping the stack, it only verifies the operation on the top of the stack and does not involve a lot of calculations, so the performance is high;

(3)由于该方案采用了通用化数据变更,类似压栈及出栈处理,即使动作逻辑变更,也不会影响恢复逻辑,因此可维护性较高;(3) Since this solution adopts generalized data changes, similar to push and pop processing, even if the action logic is changed, it will not affect the recovery logic, so the maintainability is high;

(4)由于该方案的每次恢复,都是从类似栈顶中取出上一次操作的数据变更集合,然后恢复更新,不涉及运算,可确保每次都能恢复成功,因此可靠性也较高。(4) Since each recovery of this scheme takes out the data change set of the last operation from the top of the similar stack, and then restores the update without involving calculations, it can ensure that the recovery can be successful every time, so the reliability is also high .

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.

图1为本申请实施例提供的工作流状态逆序恢复方法的流程示意图。FIG. 1 is a schematic flowchart of a method for restoring a workflow state in reverse order provided by an embodiment of the present application.

图2为本申请实施例提供的工作流状态逆序恢复装置的结构示意图。FIG. 2 is a schematic structural diagram of an apparatus for restoring a reverse order of a workflow state provided by an embodiment of the present application.

图3为本申请实施例提供的计算机设备的结构示意图。FIG. 3 is a schematic structural diagram of a computer device provided by an embodiment of the present application.

具体实施方式Detailed ways

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将结合附图和实施例或现有技术的描述对本发明作简单地介绍,显而易见地,下面关于附图结构的描述仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。在此需要说明的是,对于这些实施例方式的说明用于帮助理解本发明,但并不构成对本发明的限定。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in conjunction with the accompanying drawings and the description of the embodiments or the prior art. Obviously, the following description about the structure of the accompanying drawings is only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work. It should be noted here that the descriptions of these embodiments are used to help understand the present invention, but are not intended to limit the present invention.

应当理解,尽管本文可能使用术语第一和第二等等来描述各种对象,但是这些对象不应当受到这些术语的限制。这些术语仅用于区分一个对象和另一个对象。例如可以将第一对象称作第二对象,并且类似地可以将第二对象称作第一对象,同时不脱离本发明的示例实施例的范围。It will be understood that, although the terms first and second etc. may be used herein to describe various objects, these objects should not be limited by these terms. These terms are only used to distinguish one object from another. For example, a first object could be termed a second object, and, similarly, a second object could be termed a first object, without departing from the scope of example embodiments of the present invention.

应当理解,对于本文中可能出现的术语“和/或”,其仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A、单独存在B或者同时存在A和B等三种情况;又例如,A、B和/或C,可以表示存在A、B和C中的任意一种或他们的任意组合;对于本文中可能出现的术语“/和”,其是描述另一种关联对象关系,表示可以存在两种关系,例如,A/和B,可以表示:单独存在A或者同时存在A和B等两种情况;另外,对于本文中可能出现的字符“/”,一般表示前后关联对象是一种“或”关系。It should be understood that for the term "and/or" that may appear in this article, it is only an association relationship describing associated objects, which means that there may be three relationships, for example, A and/or B may mean: there is A alone, There are three situations such as B alone or A and B at the same time; another example, A, B and/or C, can mean that there is any one of A, B and C or any combination of them; for possible occurrences in this article The term "/and" describes another relationship between associated objects, which means that there may be two relationships, for example, A/ and B, which can mean: there are two situations such as A alone or A and B at the same time; in addition, for The character "/" that may appear in this article generally indicates that the contextual objects are an "or" relationship.

实施例:Example:

如图1所示,本实施例第一方面提供的所述工作流状态逆序恢复方法,可以但不限于由具有一定计算资源的计算机设备执行,例如由平台服务器、个人计算机(PersonalComputer,PC,指一种大小、价格和性能适用于个人使用的多用途计算机;台式机、笔记本电脑到小型笔记本电脑和平板电脑以及超级本等都属于个人计算机)、智能手机、个人数字助理(Personal Digital Assistant,PDA)或可穿戴设备等电子设备执行。如图1所示,所述工作流状态逆序恢复方法,可以但不限于包括有如下步骤S1~S7。As shown in Figure 1, the workflow state reverse order recovery method provided by the first aspect of this embodiment can be executed by, but not limited to, a computer device with certain computing resources, such as a platform server, a personal computer (PersonalComputer, PC, refers to A multipurpose computer of a size, price, and performance suitable for personal use; desktops, laptops to small notebooks and tablets, and ultrabooks are all personal computers), smartphones, Personal Digital Assistants (PDAs) ) or electronic devices such as wearable devices. As shown in FIG. 1 , the method for restoring the reverse order of the workflow state may include, but is not limited to, steps S1 to S7 as follows.

S1.在收到工作流状态变更请求时,查询并存储涉及流程状态数据的所有变更前表。S1. When a workflow state change request is received, query and store all pre-change tables involving process state data.

在所述步骤S1中,所述工作流状态变更请求由用户在工作流程上操作且触发状态变更动作时常规生成并发送至本地。所述所有变更前表用于记录变更前的工作流状态,具体的,查询并存储涉及流程状态数据的所有变更前表,包括但不限于有如下步骤S11~S13。In the step S1, the workflow state change request is routinely generated and sent to the local when the user operates on the workflow and triggers a state change action. All the pre-change tables are used to record the workflow state before the change. Specifically, all the pre-change tables related to the process state data are queried and stored, including but not limited to the following steps S11-S13.

S11.依次查询获取涉及流程状态数据的所有变更前表。S11. Query in sequence to obtain all tables before the change involving process state data.

在所述步骤S11中,所述所有变更前表的具体查询获取方式为现有常规方式。In the step S11, the specific query acquisition method of all the tables before the change is an existing conventional method.

S12.基于包含有键名KEY和键值VALUE的MAP数据结构,按照如下方式得到在所述所有变更前表中的各个变更前表的表数据:先采用键名KEY为列名且键值VALUE为列值的方式,模拟在所述各个变更前表中的每一行的列数据,得到该每一行的且呈MAP数据结构的行数据,然后采用键名KEY为行数据主键标识ID且键值VALUE为行数据的方式,模拟在所述各个变更前表中的每一行,得到所述各个变更前表的表数据。S12. Based on the MAP data structure comprising the key name KEY and the key value VALUE, obtain the table data of each table before the change in all the tables before the change as follows: first adopt the key name KEY as the column name and the key value VALUE In the way of column values, simulate the column data of each row in the table before each change, obtain the row data of each row and in the MAP data structure, and then use the key name KEY as the row data primary key identification ID and key value VALUE is in the form of row data, simulating each row in each table before change to obtain table data of each table before change.

在所述步骤S12中,所述MAP数据结构是一种类似于键值对集合的现有数据结构,即键名KEY和键值VALUE构成键值对,其中,键值VALUE可以存任何数据类型;举例的,某行的且呈MAP数据结构的行数据为[列名1:列值1;列名2:列值2;列名3:列值3;...]。通过前述步骤S12,可以得到方便后续进行变更前后表数据对比的变更前表数据,例如可以直接根据行数据主键标识ID判断是新增、还是可能有更新或删除的记录。In the step S12, the MAP data structure is an existing data structure similar to a set of key-value pairs, that is, the key name KEY and the key value VALUE form a key-value pair, wherein the key value VALUE can store any data type ; For example, the row data of a certain row in the MAP data structure is [column name 1: column value 1; column name 2: column value 2; column name 3: column value 3; ...]. Through the aforementioned step S12, the pre-change table data can be obtained, which is convenient for subsequent comparison of the table data before and after the change. For example, it can be directly judged according to the primary key ID of the row data whether there is a new record, or there may be an updated or deleted record.

S13.按照查询先后顺序将所述各个变更前表的表数据依次放入到一个链表LIST数据结构中,得到用于存储所述所有变更前表的第一链表LIST。S13. Put the table data of each pre-change table into a linked list LIST data structure sequentially according to the query sequence, and obtain the first linked list LIST for storing all the pre-change tables.

在所述步骤S13中,所述链表LIST数据结构也是一种常见的基础数据结构,其是一种线性表,但是并不会按线性的顺序存储数据,而是在每一个节点里存到下一个节点的指针(Pointer)。通过前述步骤S13,可以方便后续进行遍历。In the step S13, the linked list LIST data structure is also a common basic data structure, which is a linear table, but does not store data in a linear order, but stores it in each node until the next A node pointer (Pointer). Through the aforementioned step S13, subsequent traversal can be facilitated.

S2.响应所述工作流状态变更请求执行操作动作逻辑,使工作流状态发生变更。S2. Execute operation action logic in response to the workflow state change request to change the workflow state.

在所述步骤S2中,具体响应执行过程现有技术手段,于此不再赘述。In the step S2, there are existing technical means in the specific response execution process, which will not be repeated here.

S3.在工作流状态发生变更后,查询并存储涉及流程状态数据的所有变更后表,其中,所述所有变更后表与所述所有变更前表一一对应。S3. After the workflow status is changed, query and store all post-change tables related to process state data, wherein all the post-change tables are in one-to-one correspondence with all the pre-change tables.

在所述步骤S3中,所述所有变更后表用于记录变更后的工作流状态,具体的,查询并存储涉及流程状态数据的所有变更后表,包括但不限于有如下步骤S31~S33:S31.按照所述查询先后顺序依次查询获取涉及流程状态数据的所有变更后表,其中,所述所有变更后表与所述所有变更前表一一对应;S32.基于链表LIST数据结构和包含有键名KEY和键值VALUE的MAP数据结构,按照如下方式得到在所述所有变更后表中的各个变更后表的表数据:先采用键名KEY为列名且键值VALUE为列值的方式,模拟在所述各个变更后表中的每一行的列数据,得到该每一行的且呈MAP数据结构的行数据,然后采用链表LIST数据结构依次存储在所述各个变更后表中的每一行的行数据,得到所述各个变更后表的表数据;S33.按照所述查询先后顺序将所述各个变更后表的表数据依次放入到另一个链表LIST数据结构中,得到用于存储所述所有变更后表的第二链表LIST。In the step S3, all the changed tables are used to record the changed workflow status. Specifically, all the changed tables related to the process status data are queried and stored, including but not limited to the following steps S31-S33: S31. Query and obtain all the changed tables related to the process state data in sequence according to the query sequence, wherein, all the changed tables are in one-to-one correspondence with all the pre-changed tables; S32. Based on the linked list LIST data structure and containing The MAP data structure of the key name KEY and the key value VALUE is obtained as follows in the table data of each changed table in all the changed tables: first, the key name KEY is used as the column name and the key value VALUE is the column value , simulating the column data of each row in the table after each change, obtaining the row data of each row and in the MAP data structure, and then using the linked list LIST data structure to sequentially store each row in the table after the change row data of each changed table to obtain the table data of each changed table; S33. put the table data of each changed table into another linked list LIST data structure in turn according to the query order, and obtain the data structure for storing all Describe the second linked list LIST of all changed tables.

S4.针对在所述所有变更后表中的各个变更后表,根据与对应的变更前表的数据对比结果,确定对应的新增数据、更新数据和/或删除数据。S4. For each post-change table among all the post-change tables, determine the corresponding new data, update data and/or delete data according to the data comparison result with the corresponding pre-change table.

在所述步骤S4中,所述新增数据可具体是指在变更后表中相对于变更前表的新增内容,所述更新数据可具体是指在变更前表中相对于变更后表的被更新内容,所述删除数据可具体是指在变更前表中相对于变更后表的被删除内容。同时具体的,针对在所述所有变更后表中的各个变更后表,根据与对应的变更前表的数据对比结果,确定对应的新增数据、更新数据和/或删除数据,包括但不限于有如下步骤S41~S42。In the step S4, the newly added data may specifically refer to the newly added content in the table after the change relative to the table before the change, and the updated data may specifically refer to the content in the table before the change relative to the table after the change For the updated content, the deleted data may specifically refer to the deleted content in the table before the change relative to the table after the change. At the same time, specifically, for each post-change table in all the post-change tables, according to the data comparison results with the corresponding pre-change tables, determine the corresponding new data, update data and/or delete data, including but not limited to There are the following steps S41 to S42.

S41.按照所述查询先后顺序同步地依次遍历在所述第二链表LIST中的表数据和在所述第一链表LIST中的表数据。S41. Traversing the table data in the second linked list LIST and the table data in the first linked list LIST synchronously and sequentially according to the query sequence.

S42.针对当前遍历到的且在所述第二链表LIST中的第二表数据和在所述第一链表LIST中的第一表数据,按照如下方式(A)~(C)中任意一种或它们的任意组合确定对应的新增数据、更新数据和/或删除数据。S42. For the currently traversed second table data in the second linked list LIST and the first table data in the first linked list LIST, follow any of the following methods (A) to (C) Or any combination thereof to determine corresponding added data, updated data and/or deleted data.

(A)针对在所述第二表数据中的且呈MAP数据结构的各个第二行数据,根据对应的行数据主键标识ID在所述第一表数据中查找是否存在为该行数据主键标识ID的键名KEY,若不存在,则将对应的第二行数据作为一条与所述第二表数据和所述第一表数据对应的新增数据。此外,如果都存在,则将无与所述第二表数据和所述第一表数据对应的新增数据。(A) For each second row data in the second table data and in the MAP data structure, search whether there is a primary key identifier for the row data in the first table data according to the corresponding row data primary key ID If the key name KEY of the ID does not exist, the corresponding second row of data is used as a new piece of data corresponding to the second table data and the first table data. In addition, if both exist, there will be no new data corresponding to the second table data and the first table data.

(B)针对在所述第二表数据中的且呈MAP数据结构的各个第二行数据,根据对应的行数据主键标识ID在所述第一表数据中查找是否存在为该行数据主键标识ID的键名KEY,若存在,则从所述第一表数据中获取与为该行数据主键标识ID的键名KEY对应的第一键值VALUE;针对所述各个第二行数据,按照如下方式确定对应的相异数据:针对在第一键值VALUE中的各个列,对比该列的键值VALUE与在第二行数据中的且与该列的键名KEY对应的键值VALUE,若两键值VALUE的对比结果为相异,则将该列的键名KEY和键值VALUE作为一条该第二行数据的相异数据;将所述各个第二行数据的相异数据作为一条与所述第二表数据和所述第一表数据对应的更新数据。前述第一键值VALUE即为一个呈MAP数据结构的行数据,因此会有所述各个列的键名KEY和键值VALUE。前述若两键值VALUE的对比结果为相异,则表明对应列在变更时发生了变化,而反之则不然,因此可将该列的键名KEY和键值VALUE作为在变更前表中相对于变更后表的被更新内容。此外,如果所述各个第二行数据均无相异数据,则将无与所述第二表数据和所述第一表数据对应的更新数据。(B) For each second row data in the second table data and in the MAP data structure, according to the corresponding row data primary key ID, search whether there is a primary key ID for the row data in the first table data The key name KEY of ID, if exist, then obtain from described first table data and be the first key value VALUE corresponding to the key name KEY of identification ID of this row data primary key; For described each second row data, according to as follows Determine the corresponding different data: For each column in the first key value VALUE, compare the key value VALUE of the column with the key value VALUE in the second row of data and corresponding to the key name KEY of the column, if If the comparison result of the two key values VALUE is different, then the key name KEY and key value VALUE of the column are used as a different data of the second row of data; Update data corresponding to the second table data and the first table data. The aforementioned first key value VALUE is a row data in a MAP data structure, so there will be key names KEY and key values VALUE of each column. If the comparison results of the two key values VALUE are different, it indicates that the corresponding column has changed when it is changed, and vice versa. The updated content of the table after the change. In addition, if there is no different data in each second row of data, there will be no update data corresponding to the second table data and the first table data.

(C)针对在所述第一表数据中的且呈MAP数据结构的各个第一行数据,根据对应的行数据主键标识ID在所述第二表数据中查找是否存在为该行数据主键标识ID的键名KEY,若不存在,则将对应的第一行数据作为一条与所述第二表数据和所述第一表数据对应的删除数据。此外,如果都存在,则将无与所述第二表数据和所述第一表数据对应的删除数据。(C) For each first row data in the first table data and in the MAP data structure, according to the corresponding row data primary key ID, search whether there is a primary key ID for the row data in the second table data If the key name KEY of the ID does not exist, the corresponding first row of data is used as a piece of deleted data corresponding to the second table data and the first table data. In addition, if both exist, there will be no delete data corresponding to the second table data and the first table data.

S5.将所述各个变更后表的新增数据、更新数据和/或删除数据合并成一个数据包,并将所述数据包和所述操作动作逻辑的执行时间戳绑定作为一条流程操作记录信息存储在流程操作记录表中。S5. Combine the newly added data, updated data and/or deleted data of each changed table into a data package, and bind the data package with the execution time stamp of the operation action logic as a process operation record The information is stored in the process operation log table.

在所述步骤S5中,为了实现记录轻量化目的,优选的,将所述各个变更后表的新增数据、更新数据和/或删除数据合并成一个数据包,包括但不限于:将所述各个变更后表的新增数据、更新数据和/或删除数据合并放到一个JSON数据格式中,得到一个数据包。前述JSON数据格式是一种轻量级的现有数据交换格式。此外,所述流程操作记录信息还可以但不限于包含有流程ID、操作人和操作的动作等具体内容。In the step S5, in order to achieve the purpose of lightweight records, preferably, the newly added data, updated data and/or deleted data of each changed table are combined into one data package, including but not limited to: The newly added data, updated data and/or deleted data of each changed table are combined into a JSON data format to obtain a data package. The aforementioned JSON data format is a lightweight existing data interchange format. In addition, the process operation record information may also include, but is not limited to, specific content such as process ID, operator, and operation action.

S6.在收到工作流状态恢复请求时,查询获取涉及流程状态数据的所有当前表,并基于执行时间戳倒叙排列在所述流程操作记录表中的至少一条流程操作记录信息,得到流程操作记录信息序列。S6. When receiving the workflow state recovery request, query and obtain all current tables related to the process state data, and at least one piece of process operation record information arranged in the process operation record table in reverse order based on the execution time stamp, to obtain the process operation record information sequence.

在所述步骤S6中,所述工作流状态恢复请求同样由用户在工作流程上操作且触发状态收回动作时常规生成并发送至本地,其需要具体但不限于包含有所请求恢复的工作流目标状态。所述所有当前表用于记录当前的工作流状态,也即为在最近第一个历史工作流状态更新后所得的且涉及流程状态数据的所有变更后表。此外,在收到所述工作流状态恢复请求时,还可以基于常规的权限校验方式,通过各种权限校验判断是否允许收回,若是,则执行后续步骤S7,否则终止工作流状态逆序恢复。In the step S6, the workflow state recovery request is also routinely generated and sent to the local when the user operates on the workflow and triggers a state retraction action, which needs to be specific but not limited to include the requested workflow target state. The all current tables are used to record the current workflow state, that is, all changed tables obtained after the latest first historical workflow state update and involving process state data. In addition, when receiving the workflow state recovery request, it is also possible to judge whether the recovery is allowed through various authority checks based on the conventional authority check method, and if so, perform the subsequent step S7, otherwise terminate the reverse order recovery of the workflow state .

S7.根据所述所有当前表和所述流程操作记录信息序列,使工作流程逐步回滚地恢复到在所述工作流状态恢复请求中所请求恢复的工作流目标状态。S7. According to all the current tables and the information sequence of the process operation record, the workflow is gradually rolled back to restore to the workflow target state requested in the workflow state restoration request.

在所述步骤S7中,具体的,包括但不限于有如下步骤S70~S76。In the step S7, specifically, it includes but not limited to the following steps S70-S76.

S70.将排序号K初始化为1,然后执行步骤S71,其中,K表示正整数且小于等于所述至少一条流程操作记录信息的信息总数。S70. Initialize the sort number K to 1, and then perform step S71, wherein K represents a positive integer and is less than or equal to the total number of information of the at least one piece of process operation record information.

S71.将所述所有当前表作为在最近第K个历史工作流状态更新后所得的且涉及流程状态数据的所有变更后表,然后执行步骤S72。S71. All the current tables are used as all changed tables obtained after the latest Kth historical workflow state update and involving process state data, and then step S72 is executed.

S72.获取在所述流程操作记录信息序列中的第K条流程操作记录信息,并解析在所述第K条流程操作记录信息中的数据包,获取在所述最近第K个历史工作流状态更新后所得的且各个变更后表的新增数据、更新数据和/或删除数据,然后执行步骤S73。S72. Obtain the K-th process operation record information in the process operation record information sequence, and analyze the data packet in the K-th process operation record information, and obtain the latest K-th historical workflow status Step S73 is performed after updating the newly added data, updated data and/or deleted data of each changed table.

S73.根据在所述最近第K个历史工作流状态更新后所得的且涉及流程状态数据的所有变更后表和各个变更后表的新增数据、更新数据和/或删除数据,恢复得到在所述最近第K个历史工作流状态更新前的且涉及流程状态数据的所有变更前表,然后执行步骤S74。S73. According to the newly added data, updated data and/or deleted data of all the changed tables and each changed table obtained after the latest Kth historical workflow state update and involving the process state data, restore the obtained All tables before the change of the latest Kth historical workflow state before updating and involving process state data, and then execute step S74.

在所述步骤S73中,具体恢复过程与前述步骤S42相反,即:针对新增数据,生成删除语句并在变更后表中执行对应的数据删除动作;针对更新数据,生成更新语句并在变更后表中执行对应的数据更新动作;针对删除数据,生成插入语句并在变更后表中执行对应的数据插入动作;由此通过前述数据删除动作、数据更新动作和数据插入动作,可以恢复得到更新前表。此外,为了及时发现并处理存在的恢复异常问题,优选的,在恢复得到在所述最近第K个历史工作流状态更新前的且涉及流程状态数据的所有变更前表之后且执行步骤S74之前,所述方法还包括有:判断在所述最近第K个历史工作流状态更新前的且涉及流程状态数据的所有变更前表是否存在异常(具体异常判断方式为现有常规方式,例如某个列值本应为整数,却恢复得到了一个小数,则可判定为异常情况),若是,则终止工作流状态逆序恢复,否则执行步骤S74。In the step S73, the specific restoration process is opposite to the aforementioned step S42, that is, for the newly added data, a delete statement is generated and the corresponding data deletion action is executed in the changed table; for the updated data, an update statement is generated and Execute the corresponding data update action in the table; for deleting data, generate an insert statement and execute the corresponding data insertion action in the table after the change; thus, through the aforementioned data deletion action, data update action and data insertion action, you can restore the data before the update surface. In addition, in order to discover and deal with the existing recovery abnormality in time, preferably, after recovering and obtaining all pre-change tables related to process state data before the latest Kth historical workflow state update and before performing step S74, The method also includes: judging whether there is any abnormality in all tables before the change of the latest Kth historical workflow state and involving process state data (the specific abnormality judgment method is an existing conventional method, such as a certain column The value should be an integer, but a decimal is recovered, which can be judged as an abnormal situation), if so, terminate the workflow state and restore in reverse order, otherwise execute step S74.

S74.判断所述最近第K个历史工作流状态是否为在所述工作流状态恢复请求中所请求恢复的工作流目标状态,若是,则执行步骤S76,否则执行步骤S75。S74. Judging whether the latest Kth historical workflow state is the workflow target state requested in the workflow state recovery request, if yes, execute step S76, otherwise execute step S75.

S75.将在所述最近第K个历史工作流状态更新前的且涉及流程状态数据的所有变更前表作为在最近第K+1个历史工作流状态更新后所得的且涉及流程状态数据的所有变更后表,并使排序号K自加1,然后返回执行步骤S72;S75. Use all pre-change tables that are related to process state data before the latest Kth historical workflow state update as all tables that are obtained after the latest K+1th historical workflow state update and involve process state data Change the back table, and make the sorting number K self-increment by 1, and then return to execute step S72;

S76.根据在所述最近第K个历史工作流状态更新前的且涉及流程状态数据的所有变更前表,使工作流程恢复到所述工作流目标状态。S76. Restoring the workflow to the workflow target state according to all pre-change tables involving process state data before the latest Kth historical workflow state update.

前述步骤S70~S76可以具体通过开启一个事务(此时需关闭本次操作对应表的主键自增长)并在使工作流程恢复到所述工作流目标状态时通过提交该事务来完成工作流程恢复,最后将恢复结果反馈到用户界面进行告知。The aforementioned steps S70-S76 can specifically start a transaction (the primary key auto-growth of the table corresponding to this operation needs to be turned off at this time) and submit the transaction to complete the workflow recovery when the workflow is restored to the workflow target state, Finally, the recovery result is fed back to the user interface for notification.

由此基于前述步骤S1~S7所描述的工作流状态逆序恢复方法,提供了一种类似于压栈出栈方式的工作流状态收回新方案,即在每次工作流状态发生变更前后分别查询并存储涉及流程状态数据的所有变更前表和所有变更后表,然后针对在所述所有变更后表中的各个变更后表,根据与对应的变更前表的数据对比结果,确定对应的新增数据、更新数据和/或删除数据,再然后将所述各个变更后表的新增数据、更新数据和/或删除数据打包,并与操作动作逻辑的执行时间戳一起绑定作为一条流程操作记录信息存储在流程操作记录表中,实现类似压栈的过程,最后在收到工作流状态恢复请求时,查询获取涉及流程状态数据的所有当前表,并结合基于执行时间戳倒叙排列所得的流程操作记录信息序列,使工作流程逐步回滚地恢复到在所述工作流状态恢复请求中所请求恢复的工作流目标状态,实现类似出栈的过程,如此在收回过程中可以不涉及大量运算和动作逻辑,进而可大幅度提高工作流程管理系统的可维护性、可靠性和性能,便于实际应用和推广。Therefore, based on the reverse order recovery method of the workflow state described in the aforementioned steps S1-S7, a new workflow state recovery scheme similar to the method of pushing and unstacking is provided, that is, query and query before and after each workflow state change. Store all pre-change tables and all post-change tables related to process state data, and then, for each post-change table in all the post-change tables, determine the corresponding new data according to the data comparison result with the corresponding pre-change table , update data and/or delete data, and then package the new data, update data and/or delete data of each changed table, and bind them together with the execution time stamp of the operation action logic as a piece of process operation record information Stored in the process operation record table to implement a process similar to pushing the stack. Finally, when receiving a workflow state recovery request, query to obtain all current tables involving process state data, and combine the process operation records based on the reverse order of the execution timestamp Information sequence, so that the workflow can be gradually rolled back to restore the workflow target state requested in the workflow state restoration request, and realize a process similar to popping, so that a large number of calculations and action logic may not be involved in the retraction process , which can greatly improve the maintainability, reliability and performance of the workflow management system, which is convenient for practical application and promotion.

如图2所示,本实施例第二方面提供了一种实现第一方面所述的工作流状态逆序恢复方法的虚拟装置,包括有数据查询存储模块、状态变更响应模块、前后数据对比模块、数据打包记录模块、状态恢复响应模块和状态回滚恢复模块;As shown in Fig. 2, the second aspect of this embodiment provides a virtual device for realizing the reverse order recovery method of the workflow state described in the first aspect, including a data query storage module, a status change response module, a data comparison module before and after, Data packaging and recording module, status recovery response module and status rollback recovery module;

所述数据查询存储模块,用于在收到工作流状态变更请求时,查询并存储涉及流程状态数据的所有变更前表;The data query storage module is used to query and store all pre-change tables related to process state data when a workflow state change request is received;

所述状态变更响应模块,通信连接所述数据查询存储模块,用于响应所述工作流状态变更请求执行操作动作逻辑,使工作流状态发生变更;The state change response module is communicatively connected to the data query storage module, and is used to execute operation logic in response to the workflow state change request to change the workflow state;

所述数据查询存储模块,还用于在工作流状态发生变更后,查询并存储涉及流程状态数据的所有变更后表,其中,所述所有变更后表与所述所有变更前表一一对应;The data query storage module is also used to query and store all the changed tables related to the process state data after the workflow state is changed, wherein, all the changed tables are in one-to-one correspondence with all the pre-changed tables;

所述前后数据对比模块,通信连接所述数据查询存储模块,用于针对在所述所有变更后表中的各个变更后表,根据与对应的变更前表的数据对比结果,确定对应的新增数据、更新数据和/或删除数据;The before and after data comparison module is communicatively connected to the data query storage module, and is used to determine the corresponding newly added data, update data and/or delete data;

所述数据打包记录模块,通信连接所述前后数据对比模块,用于将所述各个变更后表的新增数据、更新数据和/或删除数据合并成一个数据包,并将所述数据包和所述操作动作逻辑的执行时间戳绑定作为一条流程操作记录信息存储在流程操作记录表中;The data packaging and recording module is connected to the front and rear data comparison module by communication, and is used to combine the new data, update data and/or delete data of each table after the change into a data package, and combine the data package and The execution timestamp binding of the operation action logic is stored in the process operation record table as a process operation record information;

所述状态恢复响应模块,通信连接所述数据打包记录模块,用于在收到工作流状态恢复请求时,查询获取涉及流程状态数据的所有当前表,并基于执行时间戳倒叙排列在所述流程操作记录表中的至少一条流程操作记录信息,得到流程操作记录信息序列;The state recovery response module is connected to the data packaging and recording module by communication, and is used to query and obtain all current tables related to process state data when receiving a workflow state recovery request, and arrange them in reverse order based on the execution time stamp in the process Operating at least one piece of process operation record information in the record table to obtain a sequence of process operation record information;

所述状态回滚恢复模块,通信连接所述状态恢复响应模块,用于根据所述所有当前表和所述流程操作记录信息序列,使工作流程逐步回滚地恢复到在所述工作流状态恢复请求中所请求恢复的工作流目标状态。The state rollback restoration module is communicatively connected to the state restoration response module, and is used for recording information sequences according to all the current tables and the process operation, so that the work flow can be gradually rolled back to restore to the state in the state of the work flow The workflow target state requested to be restored in the request.

本实施例第二方面提供的前述装置的工作过程、工作细节和技术效果,可以参见第一方面所述的工作流状态逆序恢复方法,于此不再赘述。For the working process, working details, and technical effects of the foregoing devices provided in the second aspect of this embodiment, reference may be made to the method for restoring the reverse order of the workflow state described in the first aspect, and details are not repeated here.

如图3所示,本实施例第三方面提供了一种实现如第一方面所述的工作流状态逆序恢复方法的计算机设备,包括有依次通信连接的存储器、处理器和收发器,其中,所述存储器用于存储计算机程序,所述收发器用于收发数据,所述处理器用于读取所述计算机程序,执行如第一方面所述的工作流状态逆序恢复方法。具体举例的,所述存储器可以但不限于包括随机存取存储器(Random-Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、闪存(Flash Memory)、先进先出存储器(First Input First Output,FIFO)和/或先进后出存储器(First Input Last Output,FILO)等等。As shown in FIG. 3 , the third aspect of this embodiment provides a computer device for realizing the reverse order recovery method of the workflow state as described in the first aspect, including a memory, a processor, and a transceiver that are sequentially connected by communication, wherein, The memory is used to store a computer program, the transceiver is used to send and receive data, and the processor is used to read the computer program and execute the workflow state reverse order recovery method as described in the first aspect. For example, the memory may include, but is not limited to, random access memory (Random-Access Memory, RAM), read-only memory (Read-Only Memory, ROM), flash memory (Flash Memory), first-in-first-out memory (First Input First Output, FIFO) and/or first-in-last-out memory (First Input Last Output, FILO) and the like.

本实施例第三方面提供的前述计算机设备的工作过程、工作细节和技术效果,可以参见第一方面所述的工作流状态逆序恢复方法,于此不再赘述。For the working process, working details and technical effects of the foregoing computer equipment provided in the third aspect of this embodiment, please refer to the method for restoring the workflow state in reverse order described in the first aspect, and details are not repeated here.

本实施例第四方面提供了一种存储包含如第一方面所述的工作流状态逆序恢复方法的指令的计算机可读存储介质,即所述计算机可读存储介质上存储有指令,当所述指令在计算机上运行时,执行如第一方面所述的工作流状态逆序恢复方法。其中,所述计算机可读存储介质是指存储数据的载体,可以但不限于包括软盘、光盘、硬盘、闪存、优盘和/或记忆棒(Memory Stick)等计算机可读存储介质,所述计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。The fourth aspect of this embodiment provides a computer-readable storage medium that stores instructions including the workflow state reverse order recovery method as described in the first aspect, that is, the computer-readable storage medium stores instructions, when the When the instruction is run on the computer, the workflow state reverse order recovery method as described in the first aspect is executed. Wherein, the computer-readable storage medium refers to a carrier for storing data, which may, but is not limited to, include computer-readable storage media such as floppy disks, optical disks, hard disks, flash memory, USB flash drives and/or memory sticks (Memory Stick), and the computer may It is a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.

本实施例第四方面提供的前述计算机可读存储介质的工作过程、工作细节和技术效果,可以参见如第一方面所述的工作流状态逆序恢复方法,于此不再赘述。For the working process, working details and technical effects of the aforementioned computer-readable storage medium provided in the fourth aspect of this embodiment, please refer to the method for restoring the reverse order of the workflow state as described in the first aspect, and details are not repeated here.

本实施例第五方面提供了一种包含指令的计算机程序产品,当所述指令在计算机上运行时,使所述计算机执行如第一方面所述的工作流状态逆序恢复方法。其中,所述计算机可以是通用计算机、专用计算机、计算机网络或者其他可编程装置。The fifth aspect of this embodiment provides a computer program product containing instructions, and when the instructions are run on a computer, the computer is made to execute the method for restoring the reverse order of the workflow state as described in the first aspect. Wherein, the computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices.

最后应说明的是:以上所述仅为本发明的优选实施例而已,并不用于限制本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。Finally, it should be noted that: the above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (10)

1. A method for reverse order restoration of workflow status, comprising:
when a workflow status change request is received, querying and storing all pre-change tables related to the flow status data;
executing operation action logic in response to the workflow status change request to change the workflow status;
After the workflow state is changed, inquiring and storing all changed tables related to the flow state data, wherein all the changed tables are in one-to-one correspondence with all the tables before changing;
determining corresponding newly added data, updated data and/or deleted data according to the data comparison result of the tables before the change aiming at each table after the change in all tables after the change;
combining the new data, the updated data and/or the deleted data of each changed table into a data packet, and binding the data packet and the execution time stamp of the operation action logic as a piece of flow operation record information to be stored in a flow operation record table;
when a workflow state recovery request is received, inquiring and acquiring all current tables related to flow state data, and according to at least one piece of flow operation record information arranged in the flow operation record table in a description mode based on an execution time stamp, obtaining a flow operation record information sequence;
and gradually rollback the workflow to the workflow target state requested to be restored in the workflow state restoration request according to the current tables and the flow operation record information sequence.
2. The workflow status reverse recovery method of claim 1 wherein querying and storing all pre-change tables relating to flow status data comprises:
sequentially inquiring and acquiring all pre-change tables related to flow state data;
based on the MAP data structure containing KEY name KEY and KEY VALUE, table data of each of the pre-change tables is obtained as follows: firstly, simulating column data of each row in each pre-change table by adopting a mode that a KEY name KEY is a column name and a KEY VALUE is a column VALUE to obtain row data of each row and in a MAP data structure, and then simulating each row in each pre-change table by adopting a mode that the KEY name KEY is a row main KEY identification ID and the KEY VALUE is row data to obtain table data of each pre-change table;
and sequentially placing the table data of each pre-change table into a linked LIST data structure according to the query sequence to obtain a first linked LIST for storing all the pre-change tables.
3. The workflow status reverse recovery method of claim 2 wherein querying and storing all post-change tables relating to flow status data comprises:
Sequentially inquiring and acquiring all changed tables related to flow state data according to the inquiring sequence, wherein all the changed tables are in one-to-one correspondence with all the changed tables;
based on the linked LIST data structure and the MAP data structure containing KEY name KEY and KEY VALUE, table data of each changed table in the all changed tables is obtained as follows: simulating column data of each row in each changed table by adopting a mode that a KEY name KEY is a column name and a KEY VALUE is a column VALUE to obtain row data of each row and in a MAP data structure, and then sequentially storing the row data of each row in each changed table by adopting a linked LIST LIST data structure to obtain table data of each changed table;
and sequentially placing the table data of each changed table into another linked LIST data structure according to the query sequence to obtain a second linked LIST for storing all the changed tables.
4. A workflow status reverse recovery method according to claim 3, wherein determining corresponding newly added data, updated data and/or deleted data for each of the post-change tables based on a data comparison with the corresponding pre-change table comprises:
Synchronously traversing the table data in the second linked LIST and the table data in the first linked LIST in sequence according to the query sequence;
for the second table data currently traversed and in the second linked LIST and the first table data in the first linked LIST, determining corresponding newly added data, updated data and/or deleted data according to any one of the following modes (a) - (C) or any combination thereof:
(A) For each second row of data in the second table data and in the MAP data structure, searching whether a KEY name KEY which is the data main KEY identification ID exists in the first table data according to the corresponding data main KEY identification ID, and if not, taking the corresponding second row of data as a piece of newly-added data corresponding to the second table data and the first table data;
(B) For each second row of data in the second table data and in the MAP data structure, searching whether a KEY name KEY which is the row of data main KEY identification ID exists in the first table data according to the corresponding row of data main KEY identification ID, and if so, acquiring a first KEY VALUE corresponding to the KEY name KEY which is the row of data main KEY identification ID from the first table data;
For each second row of data, corresponding distinct data is determined as follows: for each column in the first KEY VALUE, comparing the KEY VALUE of the column with the KEY VALUE corresponding to the KEY name KEY in the second row data, and if the comparison result of the two KEY VALUEs is different, taking the KEY name KEY and the KEY VALUE of the column as different data of one piece of second row data;
taking the different data of each second row data as update data corresponding to the second table data and the first table data;
(C) For each first row of data in the first table data and in the MAP data structure, searching whether a KEY name KEY which is the data main KEY identification ID exists in the second table data according to the corresponding data main KEY identification ID, and if not, taking the corresponding first row of data as a piece of deletion data which corresponds to the second table data and the first table data.
5. The method according to claim 1, wherein merging the new data, the updated data and/or the deleted data of each changed table into one data packet comprises:
And merging the newly added data, the updated data and/or the deleted data of each changed table into a JSON data format to obtain a data packet.
6. The method for reverse order restoration of workflow status according to claim 1, wherein the step of gradually reverting the workflow back to the workflow target status requested to be restored in the workflow status restoration request according to the all current table and the sequence of flow operation record information comprises the steps of S70 to S76:
s70, initializing a sequence number K to be 1, and then executing a step S71, wherein K represents a positive integer and is smaller than or equal to the total number of the at least one piece of flow operation record information;
s71, taking all the current tables as all changed tables which are obtained after the latest K-th historical workflow state is updated and relate to flow state data, and then executing step S72;
s72, obtaining the K-th flow operation record information in the flow operation record information sequence, analyzing a data packet in the K-th flow operation record information, obtaining new data, updated data and/or deleted data of each changed table obtained after the latest K-th historical workflow state is updated, and executing step S73;
S73, recovering all the tables before the latest K historical workflow state is updated and related to the flow state data according to all the tables after the latest K historical workflow state is updated and the new data, the updated data and/or the deleted data of all the tables after the latest K historical workflow state is updated and related to the flow state data, and executing step S74;
s74, judging whether the latest K historical workflow state is a workflow target state requested to be restored in the workflow state restoration request, if so, executing a step S76, otherwise, executing a step S75;
s75, taking all the tables before the latest K-th historical workflow state update and related to the flow state data as all the tables after the latest K+1st historical workflow state update and related to the flow state data, adding the ranking number K by 1, and then returning to execute the step S72;
s76, restoring the workflow to the workflow target state according to all the tables before the latest Kth historical workflow state update and related to the flow state data.
7. The method of claim 6, wherein after recovering all pre-change tables that were prior to the last kth historical workflow state update and that relate to flow state data and before executing step S74, the method further comprises:
And judging whether all the tables before the latest Kth historical workflow state update and related to the flow state data are abnormal, if so, stopping the reverse order restoration of the workflow state, otherwise, executing step S74.
8. The workflow state reverse sequence recovery device is characterized by comprising a data query storage module, a state change response module, a front-back data comparison module, a data packaging and recording module, a state recovery response module and a state rollback recovery module;
the data query storage module is used for querying and storing all pre-change tables related to the flow state data when receiving a workflow state change request;
the state change response module is in communication connection with the data query storage module and is used for responding to the workflow state change request to execute operation action logic so as to change the workflow state;
the data query storage module is further used for querying and storing all tables related to the flow state data after the workflow state is changed, wherein all tables correspond to all tables one by one;
the front-back data comparison module is in communication connection with the data query storage module and is used for determining corresponding newly-added data, updated data and/or deleted data according to the data comparison result of the corresponding front-change table aiming at each of the all the changed tables;
The data packaging and recording module is in communication connection with the front-back data comparison module and is used for combining the newly added data, the updated data and/or the deleted data of each changed table into a data packet, and binding the data packet and the execution time stamp of the operation action logic as a piece of flow operation record information to be stored in a flow operation record table;
the state recovery response module is in communication connection with the data packaging and recording module and is used for inquiring and acquiring all current tables related to flow state data when a workflow state recovery request is received, and at least one piece of flow operation record information arranged in the flow operation record table is described based on an execution time stamp to obtain a flow operation record information sequence;
and the state rollback recovery module is in communication connection with the state recovery response module and is used for gradually rollback recovering the workflow to the workflow target state requested to be recovered in the workflow state recovery request according to the current tables and the flow operation record information sequence.
9. A computer device comprising a memory, a processor and a transceiver in communication connection in sequence, wherein the memory is configured to store a computer program, the transceiver is configured to transmit and receive data, and the processor is configured to read the computer program and perform the workflow status reverse recovery method according to any one of claims 1 to 7.
10. A computer readable storage medium having instructions stored thereon which, when executed on a computer, perform the workflow status reverse order restoration method of any of claims 1-7.
CN202310120676.3A 2023-02-14 2023-02-14 Workflow state reverse order recovery method, device, computer equipment and storage medium Active CN116307661B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310120676.3A CN116307661B (en) 2023-02-14 2023-02-14 Workflow state reverse order recovery method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310120676.3A CN116307661B (en) 2023-02-14 2023-02-14 Workflow state reverse order recovery method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116307661A true CN116307661A (en) 2023-06-23
CN116307661B CN116307661B (en) 2025-09-09

Family

ID=86800464

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310120676.3A Active CN116307661B (en) 2023-02-14 2023-02-14 Workflow state reverse order recovery method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116307661B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8818961B1 (en) * 2009-10-30 2014-08-26 Symantec Corporation User restoration of workflow objects and elements from an archived database
CN107678889A (en) * 2017-09-30 2018-02-09 上海数据交易中心有限公司 The restoration methods and device of workflow task state, storage medium, computing device
US10698767B1 (en) * 2014-12-22 2020-06-30 Amazon Technologies, Inc. Decentralized management of multi-service workflows
KR20210000891A (en) * 2019-06-26 2021-01-06 주식회사 코비젼 process rollback method utilzing snapshot for workflow based business automation engin
US20220229700A1 (en) * 2019-10-08 2022-07-21 Camelot ITLab GmbH Method for securely executing a workflow in a computer system
CN115658380A (en) * 2022-09-15 2023-01-31 远效科技成果转化服务有限公司 Distributed flow reverse rollback method and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8818961B1 (en) * 2009-10-30 2014-08-26 Symantec Corporation User restoration of workflow objects and elements from an archived database
US10698767B1 (en) * 2014-12-22 2020-06-30 Amazon Technologies, Inc. Decentralized management of multi-service workflows
CN107678889A (en) * 2017-09-30 2018-02-09 上海数据交易中心有限公司 The restoration methods and device of workflow task state, storage medium, computing device
KR20210000891A (en) * 2019-06-26 2021-01-06 주식회사 코비젼 process rollback method utilzing snapshot for workflow based business automation engin
US20220229700A1 (en) * 2019-10-08 2022-07-21 Camelot ITLab GmbH Method for securely executing a workflow in a computer system
CN115658380A (en) * 2022-09-15 2023-01-31 远效科技成果转化服务有限公司 Distributed flow reverse rollback method and system

Also Published As

Publication number Publication date
CN116307661B (en) 2025-09-09

Similar Documents

Publication Publication Date Title
CN113342750B (en) File data comparison method, device, equipment and storage medium
CN114925084B (en) Distributed transaction processing method, system, equipment and readable storage medium
CN102436408B (en) Data storage cloudification and cloud backup method based on Map/Dedup
CN102750317B (en) Method and device for data persistence processing and data base system
US9646033B2 (en) Building a metadata index from source metadata records when creating a target volume for subsequent metadata access from the target volume
US8700679B2 (en) Classic to in-memory cube conversion
CN111625617A (en) Data indexing method and device and computer readable storage medium
US11163799B2 (en) Automatic rollback to target for synchronous replication
CN115469810A (en) Data acquisition method, device, equipment and storage medium
CN116301597A (en) Data storage method, device, device and storage medium
CN105426119A (en) Storage apparatus and data processing method
CN116307661A (en) Workflow state reverse recovery method, device, computer equipment and storage medium
CN111930720A (en) Data tilt processing method, system, electronic device and medium
CN117112522A (en) Concurrent process log management method, device, equipment and storage medium
CN112506651B (en) Method and equipment for data operation in large-data-volume environment
CN115114297A (en) Data lightweight storage and search method, device, electronic device and storage medium
CN113434359B (en) Data traceability system construction method and device, electronic device and readable storage medium
CN115309704A (en) Blockchain data processing method, server and medium
CN114428739A (en) File merging method, device, equipment, storage medium and product
CN114385368A (en) Method and device for flashing pre-written log
CN114138182A (en) Cross-storage online cloning method, system and device for distributed cloud hard disk
JP2018109898A (en) Data migration system
CN113282551B (en) Data processing method, system and equipment
CN116257267B (en) A file generation method, device, equipment and storage medium
CN117592315B (en) Battery design management method, device, system, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant