Disclosure of Invention
The invention aims to provide a workflow management tracing method and a workflow management tracing system based on a block chain technology, which can store and trace all project execution data during the workflow management of a project.
The embodiment of the invention is realized by the following steps:
in a first aspect, an embodiment of the present application provides a workflow management tracing method based on a blockchain technique, which includes the following steps:
acquiring and constructing a network according to the type of a target project, wherein all network resources in the network are latched on a block chain, the block chain is used for network supervision of all network resources, and the block chain comprises a alliance chain, a private chain and a public chain;
acquiring a plurality of historical project execution data according to the type of the target project;
performing big data analysis by using a plurality of historical project execution data to obtain privacy degrees of different data types;
monitoring the execution process of the target project in real time and acquiring execution data;
based on the privacy degree of each data type, storing the execution data into a corresponding block chain according to the data type of any execution data;
when responding to a data tracing request, acquiring and determining a storage block chain of data to be traced according to the data to be traced;
if the storage block chain is a federation chain, broadcasting the execution data record of the federation chain to a public chain and a private chain through a node where the data to be traced is located so as to trace the data source and obtain a first tracing result;
if the storage block chain is a public chain, generating corresponding metadata according to the data to be traced, and sequentially querying the alliance chain and the private chain based on the metadata to obtain a second tracing result;
and if the storage block chain is a private chain, determining the request node according to the data tracing request, acquiring all associated nodes of the request node, and sequentially acquiring data in the alliance chain and the public chain based on all associated nodes to obtain a third tracing result.
In some embodiments of the present invention, the step of obtaining and according to the data to be traced when responding to the data tracing request includes:
acquiring user identity information;
and logging in a network according to the user identity information so as to trace the source of the data.
In some embodiments of the present invention, before the step of obtaining the user identity information, the method further includes:
acquiring identity registration information of a user through a network node, verifying the identity registration information, registering by using the identity registration information to generate an identification registration request, and uploading the identification registration request to an upper domain;
and the upper domain receives the identifier registration request, authenticates and registers the identity registration information.
In some embodiments of the present invention, the step of storing the execution data into the corresponding block chain according to a data type of any execution data based on the privacy degree of each data type includes:
generating a public key for encryption and a private key for decryption by utilizing an OpenSSL open source library according to the block chain corresponding to the execution data;
and calling an encryption function of the jsencrypt open source library, transmitting the public key and the execution data to obtain an encryption execution parameter, and storing the encryption execution parameter to the blockchain.
In some embodiments of the present invention, the step of obtaining and according to the data to be traced when responding to the data tracing request includes:
when responding to a data tracing request, determining a corresponding storage block chain;
based on the memory block chain, a decryption function of the jsecrypt open source library is called, and a private key and encryption execution parameters are transmitted to obtain data to be traced.
In some embodiments of the present invention, before the step of storing the execution data in the corresponding block chain according to a data type of any execution data based on the privacy level of each data type, the method further includes:
and installing the block chain on the virtual machine.
In some embodiments of the invention, storing the execution data to the corresponding blockchain is performed by the virtual machine.
In a second aspect, an embodiment of the present application provides a workflow management traceability system based on a blockchain technique, including:
the network construction module is used for acquiring and constructing a network according to the type of a target project, wherein all network resources in the network are latched on a block chain, the block chain is used for network supervision of all network resources, and the block chain comprises an alliance chain, a private chain and a public chain;
the historical project execution data acquisition module is used for acquiring a plurality of historical project execution data according to the type of the target project;
the big data analysis module is used for carrying out big data analysis by utilizing a plurality of historical project execution data to obtain privacy degrees of different data types;
the monitoring module is used for monitoring the execution process of the target project in real time and acquiring execution data;
the execution data storage module is used for storing the execution data into a corresponding block chain according to the data type of any execution data based on the privacy degree of each data type;
the storage block chain determining module is used for acquiring and determining a storage block chain of the data to be traced according to the data to be traced when responding to the data tracing request;
the first tracing module is used for broadcasting the execution data record of the alliance chain to a public chain and a private chain through a node where the data to be traced is located if the storage block chain is the alliance chain so as to trace the data source and obtain a first tracing result;
the second traceability module is used for generating corresponding metadata according to the data to be traced if the storage block chain is a public chain, and sequentially inquiring the alliance chain and the private chain based on the metadata to obtain a second traceability result;
and the third tracing module is used for determining the request node according to the data tracing request and acquiring all the associated nodes of the request node if the storage block chain is a private chain, and acquiring the data in the alliance chain and the public chain in sequence based on all the associated nodes to obtain a third tracing result.
In a third aspect, an embodiment of the present application provides an electronic device, which includes a memory for storing one or more programs; a processor. The program or programs, when executed by a processor, implement the method of any of the first aspects as described above.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium, on which a computer program is stored, which, when executed by a processor, implements the method of any one of the above first aspects.
Compared with the prior art, the embodiment of the invention has at least the following advantages or beneficial effects:
the invention provides a work flow management tracing method and a work flow management tracing system based on a block chain technology, which comprise the following steps: and acquiring and constructing a network according to the type of the target project, wherein all network resources in the network are latched on a block chain, the block chain is used for network supervision of all network resources, and the block chain comprises a alliance chain, a private chain and a public chain. A plurality of historical item execution data is acquired according to the target item type. And performing big data analysis by using a plurality of historical items to obtain the privacy degrees of different data types, thereby ensuring the accuracy of the privacy degrees of different data types. And monitoring the execution process of the target project in real time and acquiring execution data. And storing the execution data into the corresponding block chain according to the data type of any execution data based on the privacy degree of each data type. Thereby ensuring privacy security of the execution data. When responding to the data tracing request, acquiring and determining a storage block chain of the data to be traced according to the data to be traced. And if the storage block chain is a federation chain, broadcasting the execution data record of the federation chain to a public chain and a private chain through a node where the data to be traced is located so as to trace the data source and obtain a first tracing result. And if the storage block chain is a public chain, generating corresponding metadata according to the data to be traced, and sequentially querying the alliance chain and the private chain based on the metadata to obtain a second tracing result. And if the storage block chain is a private chain, determining the request node according to the data tracing request, acquiring all associated nodes of the request node, and sequentially acquiring data in the alliance chain and the public chain based on all associated nodes to obtain a third tracing result. The method and the system achieve the purpose of storing and tracing the execution data by using the block chain, also achieve the work supervision of the target project by using the block chain, and avoid the condition of malicious counterfeiting of project data.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, as generally described and illustrated in the figures herein, could be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, as presented in the figures, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not construed as indicating or implying relative importance.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Furthermore, if the terms "comprise," "include," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of an element identified by the phrases "comprising a component of' 8230; \8230;" does not exclude the presence of additional like elements in any process, method, article, or apparatus that comprises the element.
In the description of the present application, it should be noted that if the terms "upper", "lower", "inner", "outer", etc. are used to indicate an orientation or positional relationship based on that shown in the drawings or that the application product is usually placed in use, the description is merely for convenience and simplicity, and it is not intended to indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and therefore should not be construed as limiting the present application.
In the description of the present application, it should also be noted that, unless otherwise explicitly stated or limited, the terms "disposed" and "connected" should be interpreted broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the individual features of the embodiments can be combined with one another without conflict.
Examples
Referring to fig. 1, fig. 1 is a flowchart illustrating a workflow management tracing method based on a blockchain technique according to an embodiment of the present invention. The embodiment of the application provides a workflow management tracing method based on a block chain technology, which comprises the following steps:
s110: acquiring and constructing a network according to the type of a target project, wherein all network resources in the network are latched on a block chain, the block chain is used for network supervision of all network resources, and the block chain comprises a alliance chain, a private chain and a public chain;
the public chain is a block chain which can be used and maintained by anyone, the information of the public chain is completely disclosed and completely decentralized, anyone can read and send transactions, the transactions can be effectively confirmed on the block chain, and anyone can participate in the consensus process. Each node of the public chain can freely join and leave the network, and the topological relation among the nodes is flat. A private chain is a blockchain system that is open to an individual person or organization, i.e., the system has write and read rights controlled by one organization. A federation chain is a system form between public and private chains, often controlled by multiple centers. Several organizations cooperate to maintain a blockchain whose usage must be restricted access with authority, and related information is protected, such as a supply chain organization or bank federation. The greatest benefit of the federation chain is to encrypt the audit and public identity information. No one can tamper with the data, and the source of the error can be tracked even if the error occurs.
S120: acquiring a plurality of historical project execution data according to the target project type;
specifically, the workflow and data for each project are stored in a database. The historical item execution data consistent with the target item type may be retrieved from the database according to the target item type.
S130: performing big data analysis by using a plurality of historical project execution data to obtain privacy degrees of different data types;
specifically, based on big data analysis, a plurality of historical project execution data are analyzed, and the accuracy of the privacy degrees of different obtained data types can be ensured.
S140: monitoring the execution process of the target project in real time and acquiring execution data;
s150: based on the privacy degree of each data type, storing the execution data into a corresponding block chain according to the data type of any execution data;
specifically, in the execution process of the target item, the execution data input by the user is obtained, and the privacy degree of the execution data is determined according to the data type of the execution data, so that a federation chain, a private chain or a public chain is selected for storage, and the privacy security of the execution data is ensured.
S160: when responding to a data tracing request, acquiring and determining a storage block chain of data to be traced according to the data to be traced;
s170: if the storage block chain is a federation chain, broadcasting the execution data record of the federation chain to a public chain and a private chain through a node where the data to be traced is located so as to trace the data source and obtain a first tracing result;
s180: if the storage block chain is a public chain, generating corresponding metadata according to the data to be traced, and sequentially querying the alliance chain and the private chain based on the metadata to obtain a second tracing result;
s190: and if the storage block chain is a private chain, determining the request node according to the data tracing request, acquiring all associated nodes of the request node, and sequentially acquiring data in the alliance chain and the public chain based on all associated nodes to obtain a third tracing result.
Specifically, when a user conducts data tracing, data tracing is conducted according to a corresponding data tracing mode according to the type of a storage block chain corresponding to data to be traced. Because the alliance chain has the characteristic that each node has a corresponding entity mechanism and can be added into or withdrawn from the system only after being approved by an alliance, when the storage block chain is the alliance chain, the node where the data to be traced is located can be directly utilized to broadcast the execution data record of the alliance chain to the public chain and the private chain, and then the data related to the data to be traced in the public chain and the private chain is inquired. Because the public chain has the characteristic that anyone can participate in reading, transaction and writing, when the storage block chain is the public chain, the metadata of the data to be traced can be utilized to quickly inquire the associated data of the alliance chain and the private chain. Because the privacy degree of the private chain is highest, for the data to be traced existing on the private chain, all the associated nodes of the request node can be obtained, so that the data in the alliance chain and the public chain can be called by using all the associated nodes, and the data tracing is realized. The method realizes the purpose of storing and tracing the execution data by using the block chain, also realizes the work supervision of the target project by using the block chain, and avoids the condition of malicious and fake project data.
In some embodiments of this embodiment, when responding to the data tracing request, the step of obtaining and according to the data to be traced includes:
acquiring user identity information;
and logging in a network according to the user identity information so as to trace the source of the data. Therefore, the authenticity of the identity of the user logging in the network is ensured, and the safety of the execution data is further ensured.
In some embodiments of this embodiment, before the step of obtaining the user identity information, the method further includes:
acquiring identity registration information of a user through a network node, verifying the identity registration information, registering by using the identity registration information, generating an identifier registration request, and uploading the identifier registration request to an upper domain;
and the upper domain receives the identifier registration request, authenticates and registers the identity registration information. Therefore, the aim of registering the user identity information is fulfilled.
Referring to fig. 2, fig. 2 is a flowchart illustrating an embodiment of storing execution data according to the present invention. In some embodiments of this embodiment, the step of storing the execution data into the corresponding block chain according to the data type of any execution data based on the privacy degree of each data type includes:
generating a public key for encryption and a private key for decryption by utilizing an OpenSSL open source library according to the block chain corresponding to the execution data;
and calling an encryption function of the jsencrypt open source library, transmitting the public key and the execution data to obtain an encryption execution parameter, and storing the encryption execution parameter to the blockchain.
The encryption algorithm may be an RSA asymmetric encryption algorithm. Specifically, firstly, according to the block chain corresponding to the execution data, the OpenSSL open source library is used for generating a public key for encryption and a private key for decryption, then an encryption function of the jsencrypt open source library is called, the public key and the execution data are transmitted, and a character string after RSA encryption, namely an encryption execution parameter, is obtained.
Referring to fig. 3, fig. 3 is a flowchart illustrating obtaining data to be traced according to an embodiment of the present invention. In some embodiments of this embodiment, when responding to the data tracing request, the step of obtaining and according to the data to be traced includes:
when responding to a data source tracing request, determining a corresponding storage block chain;
based on the memory block chain, a decryption function of the jsecrypt open source library is called, and a private key and encryption execution parameters are transmitted to obtain data to be traced.
Specifically, when a user conducts data tracing, a corresponding storage block chain is determined according to a data tracing request, and then the encrypted execution parameters are decrypted through a decryption function of a jsecrypt source opening library to obtain data to be traced.
In some embodiments of this embodiment, before the step of storing the execution data in the corresponding block chain according to a data type of any execution data based on the privacy degree of each data type, the method further includes:
and installing the block chain on the virtual machine.
In particular, the blockchain may be installed into and executed by a virtual machine of a certified host. Therefore, distributed deployment of the block chains can be rapidly realized by means of the virtual machine, and the block chains are increased and decreased at any time.
In some implementations of this embodiment, storing the execution data to the corresponding blockchain is performed by the virtual machine.
Referring to fig. 4, fig. 4 is a block diagram illustrating a workflow management tracing system based on a blockchain technique according to an embodiment of the present invention. The embodiment of the application provides a workflow management traceability system based on a block chain technology, which comprises:
a network construction module 110, configured to acquire and construct a network according to a target project type, where all network resources in the network are latched on a blockchain, the blockchain is used to perform network supervision on all network resources, and the blockchain includes an alliance chain, a private chain, and a public chain;
a historical item execution data acquisition module 120 configured to acquire a plurality of historical item execution data according to the target item type;
the big data analysis module 130 is configured to perform big data analysis by using multiple historical project execution data to obtain privacy degrees of different data types;
the monitoring module 140 is configured to monitor an execution process of the target project in real time and acquire execution data;
the execution data storage module 150 is configured to store, based on the privacy degree of each data type, the execution data into a corresponding block chain according to a data type of any execution data;
a storage block chain determining module 160, configured to, when responding to a data source tracing request, obtain and determine a storage block chain of data to be traced according to the data to be traced;
the first tracing module 170 is configured to broadcast, if the storage block chain is an alliance chain, the execution data record of the alliance chain to a public chain and a private chain through a node where the data to be traced is located, so as to perform data tracing, and obtain a first tracing result;
the second tracing module 180 is configured to, if the storage block chain is a public chain, generate corresponding metadata according to the data to be traced, and sequentially query the federation chain and the private chain based on the metadata to obtain a second tracing result;
and the third tracing module 190 is configured to determine the request node according to the data tracing request if the storage block chain is a private chain, acquire all associated nodes of the request node, and sequentially acquire data in the federation chain and the public chain based on all associated nodes to obtain a third tracing result.
In the implementation process, the system achieves the purpose of storing and tracing the execution data by using the block chain, also achieves the purpose of monitoring the work of the target project by using the block chain, and avoids the condition of malicious counterfeiting of project data.
Referring to fig. 5, fig. 5 is a schematic structural block diagram of an electronic device according to an embodiment of the present disclosure. The electronic device comprises a memory 101, a processor 102 and a communication interface 103, wherein the memory 101, the processor 102 and the communication interface 103 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The memory 101 may be used for storing software programs and modules, such as program instructions/modules corresponding to the workflow management traceability system based on the blockchain technology provided in the embodiment of the present application, and the processor 102 executes the software programs and modules stored in the memory 101, thereby executing various functional applications and data processing. The communication interface 103 may be used for communicating signaling or data with other node devices.
The Memory 101 may be, but not limited to, a Random Access Memory (RAM), a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Read Only Memory (EPROM), an electrically Erasable Read Only Memory (EEPROM), and the like.
The processor 102 may be an integrated circuit chip having signal processing capabilities. The Processor 102 may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
It will be appreciated that the configuration shown in fig. 5 is merely illustrative and that the electronic device may include more or fewer components than shown in fig. 5 or have a different configuration than shown in fig. 5. The components shown in fig. 5 may be implemented in hardware, software, or a combination thereof.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist alone, or two or more modules may be integrated to form an independent part.
The functions may be stored in a computer-readable storage medium if they are implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present application and is not intended to limit the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
It will be evident to those skilled in the art that the application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential attributes thereof. The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned.