Disclosure of Invention
The invention aims to provide a method and a system for regulating and controlling data storage and evidence sharing so as to solve one or more technical problems. The invention provides a regulation and control data evidence sharing method based on functional improvement of a block chain, is applicable to data evidence sharing involved in a power grid scene, and can meet the requirements on the reliability and the interactivity of the regulation and control data.
In order to achieve the purpose, the invention adopts the following technical scheme:
the invention relates to a regulation and control data storage and evidence sharing method, which comprises the following steps:
acquiring a data entry request by a data input end block chain node;
according to a data entry request, the data input end block chain node acquires source end data and analyzes the data type of the source end data;
writing the source end data of the structured data into a data input end block chain node for local storage according to the data type of the source end data;
converting the storage address of the source end data of the unstructured data into a structured character string according to the data type of the source end data, and writing the structured character string into a data input end block chain node for local storage;
and outputting the data type of the source end data and the source end data based on a preset consensus algorithm among the block chain nodes to perform distributed account book storage.
The further improvement of the present invention is that the step of writing the source end data of the structured data into the data input end block chain node for local storage specifically includes:
and writing the data ID and the structural character string of the source end data of the structural data into a data input end block chain node for local storage.
The further improvement of the present invention lies in that the step of converting the storage address of the source end data of the unstructured data into a structured character string, and writing the structured character string into the data input end block chain node for local storage specifically includes:
and generating an internal structural character string of a source end data pointer representing the unstructured data for the source end data of the unstructured data, and writing the data ID of the source end data of the unstructured data and the internal structural character string into a data input end block chain node for local storage.
The invention further improves the method, after completing the local storage, the method also comprises the following steps:
acquiring a data verification request by a data input end block chain node;
and according to the data verification request, the data input end block chain node acquires the data ID of the source end data and performs local verification to acquire a local verification result.
A further refinement of the invention is that the source data comprises structured data in the format (ID, structured string) and unstructured data in the format (ID, file).
The invention relates to a regulation and control data storage and evidence sharing method, which comprises the following steps:
the data type of the source end data is obtained by the data storage end block chain node, and the data type of the source end data is obtained by analyzing the source end data by the data input end block chain node;
writing source end data of the structured data into a block chain node of a data storage end to perform distributed account book storage;
and converting the storage address of the source end data of the unstructured data into a structured character string, and writing the structured character string into a block chain node of a data storage end to perform distributed account book storage.
The further improvement of the present invention is that the step of writing the source end data of the structured data into the data storage end block chain node for distributed account book storage specifically includes:
and writing the data ID and the structural character string of the source end data of the structural data into the block chain nodes of the data storage end based on a preset consensus algorithm among the block chain nodes for synchronous storage, so as to form distributed account book storage.
The further improvement of the present invention is that the step of converting the storage address of the source end data of the unstructured data into a structured character string, and writing the structured character string into the block chain node of the data storage end to perform distributed ledger storage specifically includes:
and generating an internal structural character string of a source end data pointer representing unstructured data for source end data of the unstructured data, and writing a data ID of the source end data of the unstructured data and the internal structural character string into a block chain node of a data storage end for synchronous storage based on a preset consensus algorithm between the block chain nodes to form distributed account book storage.
The invention is further improved in that after the distributed ledger storage is finished, the method further comprises the following steps:
the data storage end block chain node acquires a local verification result, and the local verification result is obtained by performing local verification on the data input end block chain node;
judging whether the local verification result passes or not; when the local verification result passes, acquiring a data verification request of the local verification, and performing synchronous verification in the block chain node of the data storage terminal based on a consensus algorithm to obtain a verification query result; and when the local verification result is failed, stopping inquiring and outputting the verification failure result.
The invention relates to a regulation and control data storage and evidence sharing method, which comprises the following steps:
acquiring a data entry request by a data input end block chain node; according to a data entry request, the data input end block chain node acquires source end data and analyzes the data type of the source end data; writing the source end data of the structured data into a data input end block chain node for local storage according to the data type of the source end data; converting the storage address of the source end data of the unstructured data into a structured character string according to the data type of the source end data, and writing the structured character string into a data input end block chain node for local storage;
outputting the data type of the source end data and the source end data to the block chain nodes of the data storage end based on a consensus algorithm preset among the block chain nodes; writing source end data of the structured data into a block chain node of a data storage end to perform distributed account book storage; and converting the storage address of the source end data of the unstructured data into a structured character string, and writing the structured character string into a block chain node of a data storage end to perform distributed account book storage.
The invention relates to a regulation and control data storage and certification sharing system, which comprises:
the request acquisition module is used for acquiring a data entry request by the data input end block chain node;
the data analysis module is used for acquiring source end data by the data input end block chain node according to the data entry request and analyzing the data type of the source end data;
the data distribution module is used for writing the source end data of the structured data into a data input end block link node for local storage according to the data type of the source end data; converting the storage address of the source end data of the unstructured data into a structured character string according to the data type of the source end data, and writing the structured character string into a data input end block chain node for local storage; and outputting the data type of the source end data and the source end data based on a preset consensus algorithm among the block chain nodes to perform distributed account book storage.
The invention relates to a regulation and control data storage and certification sharing system, which comprises:
the data type acquisition module is used for acquiring the data type of the source end data by the data storage end block chain node, wherein the data type of the source end data is acquired by analyzing the source end data by the data input end block chain node;
the distributed account book storage control module is used for writing source end data of the structured data into a data storage end block chain node to store the distributed account book; and converting the storage address of the source end data of the unstructured data into a structured character string, and writing the structured character string into a block chain node of a data storage end to perform distributed account book storage.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a data interaction method suitable for regulation and control data evidence storage and sharing based on a block chain distributed account book technology and considering regulation and control data interaction function requirements, and can realize general storage of structured and unstructured data in regulation and control business and realize on-chain evidence storage and sharing of regulation and control data. The invention solves the problems of storage efficiency and credible sharing under the condition of large-batch regulation and control data sharing, and can meet the requirements on the reliability and interactivity of the regulation and control data.
In the invention, in order to avoid resource waste caused by excessive data volume of the distributed account book, a lightweight node and a common node are further designed for supporting different services such as data writing, data verification and the like.
Detailed Description
In order to make the purpose, technical effect and technical solution of the embodiments of the present invention clearer, the following clearly and completely describes the technical solution of the embodiments of the present invention with reference to the drawings in the embodiments of the present invention; it is to be understood that the described embodiments are only some of the embodiments of the present invention. Other embodiments, which can be derived by one of ordinary skill in the art from the disclosed embodiments without inventive faculty, are intended to be within the scope of the invention.
The regulation and control data storage sharing method is based on a block chain architecture, and the block chain architecture comprises a plurality of block chain nodes and a consensus algorithm among the plurality of block chain nodes; the regulation and control data storage and sharing method comprises the following steps: one of the block chain nodes acquires and analyzes the request information to acquire an analysis result; when the analysis result is a data entry request, the block chain link point acquires and analyzes source end data to acquire a source end data analysis result; when the source end data analysis result is that the source end data is structured data, writing a data ID and a structured character string into a distributed account book storage based on the consensus algorithm; and when the source end data analysis result is that the source end data is unstructured data, generating an internal structured character string representing a file pointer for the source end data, and writing a data ID and the internal structured character string into a distributed account book storage based on the consensus algorithm.
The invention provides a data interaction method suitable for regulation and control data evidence storage and sharing based on a block chain distributed account book technology and considering regulation and control data interaction function requirements, and can realize general storage of structured and unstructured data in regulation and control business and realize on-chain evidence storage and sharing of regulation and control data. The invention solves the problems of storage efficiency and credible sharing under the condition of large-batch regulation and control data sharing, and can meet the requirements on the reliability and interactivity of the regulation and control data.
Referring to fig. 1, fig. 1 shows a general blockchain architecture derived from the field of digital currency. The blockchain technology is derived from digital currency 'bitcoin', the block chain technology solves the trust that the traditional currency depends on a third party, and the essential characteristic of the blockchain technology is that a decentralized storage structure (in the field of digital currency, the storage structure is called a distributed account book) is constructed, the storage structure is stored on each node in a network, and the 'tamper-proof and traceable' of the blockchain technology can be ensured.
As shown in fig. 1, in a general blockchain architecture, when an arbitrary data initiator needs to perform an operation on a global ledger, a request is initiated by a client. At this time, the block chain link point connected with the client submits the operation to the whole block chain network, and all nodes on the block chain network run a consensus algorithm to start writing the global account book data once. Once global consensus is completed, each node in the blockchain network is equivalent to witness the accounting process of the current account, and therefore the trust problem in a multi-subject accounting scene is fundamentally solved.
The power grid regulation and control system accumulates a large amount of model data, operation data, management data and other data in the long-term operation. With the strategic development of the energy internet of a company, a regulation cloud platform which is centrally constructed by national regulation becomes an important system for bearing various data such as the model, the operation, the management and the like, and with the further construction of the regulation cloud, the data interaction between the regulation cloud leading node and the regulation cloud cooperating node is tighter, so that the requirements on the safe interaction and the sharing of the internal and external data of the regulation cloud are provided. In view of this, the present invention provides an improved technical solution based on the existing general block chain technology, and can implement on-chain evidence sharing of regulation and control service data.
The embodiment of the invention provides a regulation and control data storage and certification sharing method, which comprises the following steps:
one of the block chain nodes acquires and analyzes the request information to acquire a request information analysis result;
when the request information analysis result is a data entry request, the block chain node acquires and analyzes source end data to acquire a source end data analysis result;
when the source end data analysis result shows that the source end data is structured data, writing the data ID and the structured character string of the source end data into one block chain node for local storage; writing a data ID and a structural character string of source end data into the rest blockchain nodes except the blockchain node in the plurality of blockchain nodes based on a preset consensus algorithm among the plurality of blockchain nodes for synchronous storage to form distributed account book storage;
when the source end data analysis result shows that the source end data is unstructured data, generating an internal structured character string representing a file pointer for the source end data, and writing the data ID of the source end data and the internal structured character string into one block chain node for local storage; and writing the data ID of the source data and the internal structural character string into the residual block chain nodes except the block chain node in the plurality of block chain nodes based on the consensus algorithm for synchronous storage, so as to form distributed account book storage.
Preferably, in the embodiment of the present invention, after obtaining the request information parsing result, the method further includes: and when the request information analysis result is a data verification request, the block link point acquires the data ID of the source data and performs local verification, and after the local verification is passed, synchronous verification is performed in the residual block link nodes except the block link node in the plurality of block link nodes based on the consensus algorithm, so that a verification query result is obtained.
Preferably, in the embodiment of the present invention, when the one block link point acquires source data: when the source data is structured data, the format is (ID, structured character string); when the source data is unstructured data, the format is (ID, file).
The embodiment of the invention provides a regulation and control data storage and certification sharing system, which comprises: a plurality of blockchain nodes; each block chain node is provided with a server;
the server side of one of the block chain nodes is used for acquiring and analyzing the request information to acquire a request information analysis result; when the request information analysis result is a data entry request, the server side of the block link node is also used for acquiring and analyzing source data to be stored and verified to obtain a source data analysis result;
when the source end data analysis result shows that the source end data is structured data, writing a data ID and a structured character string of the source end data into one block chain node for local storage; writing a data ID and a structural character string of source end data into the rest blockchain nodes except the blockchain node in the plurality of blockchain nodes based on a preset consensus algorithm among the plurality of blockchain nodes for synchronous storage to form distributed account book storage;
when the source end data analysis result shows that the source end data is unstructured data, generating an internal structured character string representing a file pointer for the source end data, and writing the data ID of the source end data and the internal structured character string into one block chain node for local storage; and writing the data ID of the source data and the internal structural character string into the residual block chain nodes except the block chain node in the plurality of block chain nodes based on the consensus algorithm for synchronous storage, so as to form distributed account book storage.
Preferably, in the embodiment of the present invention, the server side of the block chain node includes: the system comprises a data receiving module, a data analysis module, an account book storage module and a data evidence storage and verification module;
the data receiving module is used for acquiring request information and source end data to be stored;
the data analysis module is used for inputting the request information acquired by the data receiving module, analyzing the request information, acquiring a request information analysis result and outputting the request information analysis result; the system comprises a data storage module, a request information analysis module, a data verification module and a data verification module, wherein the request information analysis module is used for forwarding a request to the account book storage module when the request information analysis result is a data writing request, and is used for forwarding the request to the data verification module when the request information analysis result is a data verification request;
the account book storage module is used for receiving a data writing request from the data analysis module and locally storing source end data to be stored and verified according to the data writing request; the account book storage module is used for transferring the source end data to be stored and verified to global synchronization according to the consensus algorithm;
the data certificate storage and verification module is used for receiving a data verification request from the data analysis module and performing local verification at a server side according to the data verification request; and the data certificate storage and verification module is used for carrying out global verification according to the consensus algorithm.
Preferably, in the embodiment of the present invention, the server side of the remaining blockchain node excluding the one blockchain node from the plurality of blockchain nodes includes:
the account book storage module is used for transferring the source end data to be stored and verified to be locally stored according to the consensus algorithm;
and the data certificate storage and verification module is used for carrying out local verification according to the consensus algorithm.
The preferred embodiment of the present invention further includes: a first client; the first client is used for inputting source end data and a data ID to the server end; when the source data is structured data, the input format is (ID, structured character string); and when the source data is unstructured data, the input format is (ID, file).
The preferred embodiment of the present invention further includes: a second client; the second client is used for inputting a data ID to the server.
The method of the embodiment of the invention is based on the block chain distributed account book technology, considers the requirement of the regulation and control data interaction function, provides the data interaction method suitable for regulation and control data storage and sharing, can realize the general storage of structured and unstructured data in the regulation and control service, and realizes the on-chain storage and sharing of the regulation and control data. The invention solves the problems of storage efficiency and credible sharing under the condition of large-batch regulation and control data sharing, and can meet the requirements on the reliability and interactivity of the regulation and control data.
Referring to fig. 2, a regulation and control cloud data evidence sharing system based on a block chain according to an embodiment of the present invention includes:
referring to fig. 3, the client is used for submitting a data entry and data verification request to the server, and includes modules: the data input module and the data verification module.
(1) The data entry module is responsible for receiving source end data input. The input source can be various data acquisition or generation modules of a regulation and control business system; the data format receivable by the data entry module includes structured data and unstructured data. Structured data is submitted in the form of (ID, structured string) and unstructured data is submitted in the form of (ID, file), where ID must be unique, no ID is provided, and ID will be generated randomly by the client. The data entry module will interact directly with the server data receiving module.
(2) And the data verification module is responsible for inquiring and verifying the data. The client user provides ID as the input of the data verification module, the data verification module directly interacts with the server data deposit and certificate verification module, and the inquiry result of the data in the account book storage module is returned.
(3) The data entry module is an optional function, part of services in the scheduling services only need the data verification module to realize the storage of service data, the client only deployed with the data verification module is called a light client, and the light client only has the data verification function, so that the storage efficiency can be further improved.
Referring to fig. 4, the server is responsible for receiving the data entry and data verification request of the client and returning the result, and simultaneously interacts with the distributed accounting management module, and stores the data in the accounting book storage module after the distributed accounting management is returned. The server side of the embodiment of the invention comprises 4 modules: the system comprises a data receiving module, a data analyzing module, an account book storage module and a data evidence storage and verification module.
(1) The data receiving module is responsible for receiving the client data entry module request and returning to the client result. After receiving the request, the data receiving module firstly transmits the request to the data analysis module; secondly, after receiving the return of the data analysis module, interacting with an account book management module of the distributed accounting management according to the return result; and finally, after returning, writing the data into the account book storage module and returning a client data entry result. The last step is written into the account book storage module, and different functions of the account book storage module need to be called according to a return result (structured character string or file) of the data analysis module.
(2) The data analysis module is responsible for analyzing the data format and returning an analysis result. According to the data provided by the data receiving module, the data analyzing module distinguishes the structured character string from the file, according to the data and the data type parameters provided by the data receiving module, the data analyzing module generates an internal structured string representing a file pointer from the data additionally in a file format, and returns an analysis result to the data receiving module, and the data analyzing module is a key for supporting and controlling business structured and unstructured data storage.
(3) And the account book storage module is responsible for storing the data and returning a storage result. According to the data provided by the data receiving module, the account book storage module comprises two storage functions of a structured string and a file. If the file is a structured string, (ID, structured string) is written into the distributed ledger storage area, if the file is a file, (ID, internal structured string) is written into the distributed ledger storage area, and the file is written into a file pointer pointing to the place.
(4) And the data storage and verification module is responsible for carrying out existence verification on the data and returning a verification result. After receiving the data ID in the client request content, the data evidence storage and verification module inquires the local account book storage module, interacts with other data evidence storage and verification modules on the wide area network through the account book management module of the distributed accounting management, and receives the result of local inquiry of other data evidence storage and verification modules on the wide area network.
Referring to fig. 5, the distributed accounting management module is responsible for interacting with other servers in the wide area network to implement global storage of data, and includes 2 modules: account book management module and account book storage module.
(1) And the account book management module is responsible for receiving the requests of the server data receiving module and the data deposit and verification module and returning the results. After receiving the request, the account book management module firstly interacts with a data receiving module and a data evidence storing and checking module of other service terminals (non-request source service terminals) of the wide area network; secondly, after receiving the returns of all other servers, the account book management module calls the account book storage module and returns the data result to the source server.
(2) And the account book storage module is responsible for storing the data and returning a storage result. And the ledger storage submodule in the distributed accounting management module only receives the request format of the (ID, structured character string) and writes the (ID, structured character string) data into the distributed ledger storage area.
In the embodiment of the invention, the regulation cloud master node and the cooperative node can be used as the block link node in the embodiment of the invention. The bottom layer is based on hardware, storage, network and other resources provided by a regulation cloud base platform; the communication of the wide area network between the cloud nodes is regulated and controlled through regulating and controlling the local network inside the cloud nodes.
The client can be deployed in a personal computer, a mobile terminal or a web browser-based plug-in as exemplified in the embodiment of the present invention.
In the embodiment of the invention, exemplarily, the server is deployed on one or more servers, but only one server is used as a main server to communicate with all the clients at the same time, and data transmitted by the communication between the clients and the main server is synchronized to the servers where other servers are located by the main server in a real-time synchronization manner.
In an exemplary embodiment of the invention, the distributed accounting management module is deployed on a server and communicates with other distributed accounting management modules on the wide area network through the wide area network. The client communicates with the server through a local area network, and the server communicates with the distributed accounting management module through a wide area network.
In summary, the embodiment of the invention designs a regulation and control data evidence sharing method including a client, a server and distributed accounting management based on a block chain technology, and realizes the credible sharing of two types of data of a regulation and control business system structured and unstructured based on a block chain distributed account book; meanwhile, the problem of storage efficiency in a large-batch service data sharing scene is solved by utilizing a light client technology. The reliability and the safety of the data sharing of the regulation and control service system are improved.
Illustratively, the regulation cloud is an innovative application of information communication technologies such as 'cloud big thing moving intelligent chain' and the like in the regulation field. With the continuous promotion of the construction of the regulation cloud, the regulation cloud becomes one of important data collection centers of the regulation business, the data quantity collected on the regulation cloud is increased in an explosive mode, and the related data types are diversified. In the aspect of data use and maintenance, data maintenance processes are increasingly complex, cross-department and cross-scheduling data interaction is increasingly frequent, and higher requirements are put forward on the reliability and interactivity of cloud data regulation and control. The method is based on the block chain distributed account book technology, can be implemented on the basis of the existing regulation and control cloud infrastructure in architecture, and meets the requirements of regulation and control business data interaction safety and reliability in a business layer. Based on the two points, the method can be efficiently and quickly popularized to the existing national cloud and each provincial level regulation cloud system.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art can make modifications and equivalents to the embodiments of the present invention without departing from the spirit and scope of the present invention, which is set forth in the claims of the present application.