技术领域technical field
本申请涉及到计算机领域,特别是涉及到一种基于区块链的数据保存方法、装置、计算机设备和存储介质。The present application relates to the computer field, in particular to a block chain-based data storage method, device, computer equipment and storage medium.
背景技术Background technique
当前的生产生活中,经常需要调用数据,可调用的数据是否真实,不可而知,调用的数据格式是否适用于当前环境,不可而知,从而出现数据可信度低、可用程度差(需要进行进一步转换格式等)等问题。尤其在对数据真实性要求程度高的应用场景,例如贷款核批等场景中,现有技术一般是从数据库中调用相应数据,调用的数据仅以单一的形式呈现给调用方,不能适应不同的调用需求,同时数据库中的相应数据若被偷偷篡改,将导致调用方做出错误的结论。因此现有技术无法解决上述数据安全性差、同时数据直接使用程度差等问题。In the current production and life, it is often necessary to call data. Whether the callable data is real or not is unknown, and whether the callable data format is suitable for the current environment is unknown, resulting in low data reliability and poor usability (need to Further conversion format, etc.) and other issues. Especially in application scenarios that require a high degree of data authenticity, such as loan approval and other scenarios, the existing technology generally calls the corresponding data from the database, and the called data is only presented to the caller in a single form, which cannot adapt to different applications. Call requirements, and if the corresponding data in the database is secretly tampered with, it will lead the caller to make a wrong conclusion. Therefore, the prior art cannot solve the aforementioned problems of poor data security and poor direct use of data.
发明内容Contents of the invention
本申请的主要目的为提供一种基于区块链的数据保存方法、装置、计算机设备和存储介质,旨在解决了数据安全性差、同时数据直接使用程度差的问题。The main purpose of this application is to provide a blockchain-based data storage method, device, computer equipment, and storage medium, which aims to solve the problems of poor data security and poor direct use of data.
为了实现上述发明目的,本申请提出一种基于区块链的数据保存方法,应用于数据保存终端,包括:In order to achieve the purpose of the above invention, this application proposes a data storage method based on blockchain, which is applied to the data storage terminal, including:
接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点;receiving a data storage instruction for specified data, wherein the data storage instruction records the type of specified data, and the data storage terminal is a blockchain node in a pre-built blockchain network;
从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板;calling an initial data template corresponding to the type of the specified data from a plurality of preset data templates;
将预先准备好的数据填入所述初始数据模板中,得到初始数据;Filling the pre-prepared data into the initial data template to obtain the initial data;
将所述初始数据发送给具有审核权限的区块链节点;Send the initial data to the blockchain node with audit authority;
接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件;receiving feedback information from the blockchain node with audit authority, and judging whether the feedback information satisfies the preset data storage conditions;
若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。If the feedback information satisfies the preset data storage condition, then record the initial data into the blockchain network.
进一步地,所述初始数据模板由数据框架模板和至少一个数据子模板构成,所述从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板的步骤,包括:Further, the initial data template is composed of a data frame template and at least one data sub-template, and the step of calling an initial data template corresponding to the type of the specified data from a plurality of preset data templates includes:
根据所述指定数据的类型,依据预设的数据类型与模板的对应关系,获取预设的多个数据框架模板与多个数据子模板;Acquiring multiple preset data frame templates and multiple data sub-templates according to the type of the specified data and according to the preset corresponding relationship between the data type and the template;
获取所述数据保存终端选择的数据框架模板与数据子模板,并将所述数据保存终端选择的数据框架模板与数据子模板组合成为所述初始数据模板;Obtaining the data frame template and data sub-template selected by the data storage terminal, and combining the data frame template and data sub-template selected by the data storage terminal into the initial data template;
调取所述初始数据模板。Call the initial data template.
进一步地,所述区块链网络包括指定区块链节点,所述将预先准备好的数据填入所述初始数据模板中,得到初始数据的步骤,包括:Further, the block chain network includes a designated block chain node, and the step of filling the pre-prepared data into the initial data template and obtaining the initial data includes:
接收从指定区块链节点发送的特定数据,其中所述特定数据包括特定对象的身份信息、教育经历或者是否属于黑名单的信息;Receive specific data sent from a designated blockchain node, where the specific data includes the identity information, educational experience, or blacklist information of a specific object;
将所述特定数据填入所述初始数据模板中,得到初始数据。Filling the specific data into the initial data template to obtain initial data.
进一步地,所述区块链网络采用指定共识机制,所述接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件的步骤,包括:Further, the block chain network adopts a designated consensus mechanism, and the step of receiving the feedback information from the block chain node with audit authority, and judging whether the feedback information satisfies the preset data storage conditions includes:
接收基于所述指定共识机制而投选出的多个受托区块链节点的反馈信息,其中所述受托区块链节点具有审核权限,所述反馈信息包括审核通过或者审核未通过;Receiving feedback information from a plurality of entrusted blockchain nodes voted based on the specified consensus mechanism, wherein the entrusted blockchain nodes have audit authority, and the feedback information includes whether the audit is passed or the audit is not passed;
统计审核通过的反馈信息的数量,并判断所述审核通过的反馈信息的数量是否大于预设的数量阈值;Counting the number of feedback information that has passed the review, and judging whether the number of feedback information that has passed the review is greater than a preset quantity threshold;
若所述审核通过的反馈信息的数量大于预设的数量阈值,则判定反馈信息满足预设的数据保存条件。If the quantity of the feedback information that has passed the review is greater than the preset quantity threshold, it is determined that the feedback information satisfies the preset data storage condition.
进一步地,所述接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点的步骤之前,包括:Further, before the step of receiving a data storage instruction for specified data, wherein the data storage instruction records the type of specified data, and the data storage terminal is a blockchain node in a pre-built blockchain network ,include:
采用指定语言在所述数据保存终端中创建区块链类,将所述区块链类实例化从而建立创世区块,其中所述创世区块中将前一区块的哈希值记为0;Create a block chain class in the data storage terminal using a specified language, instantiate the block chain class to establish a genesis block, wherein the hash value of the previous block is recorded in the genesis block is 0;
基于所述创世区块,生成其他区块,其中所述其他区块包括前一区块的哈希值;generating other blocks based on the genesis block, wherein the other blocks include the hash value of the previous block;
将预设终端作为区块链节点,从而建立所述区块链网络。The preset terminal is used as a blockchain node to establish the blockchain network.
进一步地,所述若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络的步骤之后,包括:Further, after the step of recording the initial data into the blockchain network if the feedback information satisfies the preset data storage conditions, it includes:
接收对所述指定数据的修改指令,其中所述修改指令附带有替换用子数据;receiving a modification instruction for the specified data, wherein the modification instruction is accompanied by sub-data for replacement;
根据所述修改指令,将所述指定数据中的待修改子数据替换为所述替换用子数据,从而得到修改后数据;According to the modifying instruction, replacing the sub-data to be modified in the specified data with the sub-data for replacement, thereby obtaining the modified data;
将所述修改后数据发送给所述具有审核权限的区块链节点;Send the modified data to the blockchain node with audit authority;
接收所述具有审核权限的区块链节点的对所述修改后数据的审核信息,并判断所述审核信息是否满足预设的数据保存条件;receiving the audit information of the modified data from the blockchain node with audit authority, and judging whether the audit information satisfies the preset data storage conditions;
若所述审核信息满足预设的数据保存条件,则将所述修改后数据加入所述区块链网络。If the audit information satisfies the preset data storage condition, the modified data is added to the blockchain network.
进一步地,所述若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络的步骤之后,包括:Further, after the step of recording the initial data into the blockchain network if the feedback information satisfies the preset data storage conditions, it includes:
接收基于所述特定数据的特定操作审批指令;receiving a specific operation approval instruction based on said specific data;
从所述区块链中调取所述特定数据,并判断所述特定数据是否符合预设的特定操作审批标准;Retrieving the specific data from the blockchain, and judging whether the specific data meets the preset specific operation approval standards;
若所述特定数据符合预设的特定操作审批标准,则执行特定操作。If the specific data meets the preset specific operation approval standard, a specific operation is performed.
本申请提供一种基于区块链的数据保存装置,应用于数据保存终端,包括:This application provides a data storage device based on blockchain, which is applied to data storage terminals, including:
数据保存指令接收单元,用于接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点;A data storage instruction receiving unit, configured to receive a data storage instruction for specified data, wherein the data storage instruction records the type of specified data, and the data storage terminal is a blockchain node in a pre-built blockchain network ;
初始数据模板调取单元,用于从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板;An initial data template calling unit, configured to call an initial data template corresponding to the type of the specified data from a plurality of preset data templates;
初始数据获取单元,用于将预先准备好的数据填入所述初始数据模板中,得到初始数据;an initial data acquisition unit, configured to fill in pre-prepared data into the initial data template to obtain initial data;
初始数据发送单元,用于将所述初始数据发送给具有审核权限的区块链节点;an initial data sending unit, configured to send the initial data to blockchain nodes with audit authority;
数据保存条件判断单元,用于接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件;A data storage condition judging unit, configured to receive feedback information from the blockchain node with audit authority, and judge whether the feedback information satisfies a preset data storage condition;
数据保存单元,用于若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。A data storage unit, configured to record the initial data into the blockchain network if the feedback information satisfies a preset data storage condition.
本申请提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现上述任一项所述方法的步骤。The present application provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the steps of any one of the methods described above when executing the computer program.
本申请提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的方法的步骤。The present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the methods described above are implemented.
本申请的基于区块链的数据保存方法、装置、计算机设备和存储介质,接收对指定数据的数据保存指令;将预先准备好的数据填入初始数据模板中,得到初始数据;将所述初始数据发送给具有审核权限的区块链节点;接收所述具有审核权限的区块链节点的反馈信息;若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。从而解决了数据安全性差、同时数据直接使用程度差的问题。The blockchain-based data storage method, device, computer equipment, and storage medium of the present application receive a data storage instruction for specified data; fill in the pre-prepared data into the initial data template to obtain initial data; The data is sent to the blockchain node with audit authority; the feedback information of the blockchain node with audit authority is received; if the feedback information meets the preset data storage conditions, the initial data is recorded in the blockchain network. Therefore, the problems of poor data security and poor direct use of data are solved.
附图说明Description of drawings
图1为本申请一实施例的基于区块链的数据保存方法的流程示意图;Fig. 1 is a schematic flow diagram of a data storage method based on blockchain according to an embodiment of the present application;
图2为本申请一实施例的基于区块链的数据保存装置的结构示意框图;FIG. 2 is a schematic block diagram of a block chain-based data storage device according to an embodiment of the present application;
图3为本申请一实施例的计算机设备的结构示意框图。FIG. 3 is a schematic block diagram of a computer device according to an embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional features and advantages of the present application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.
参照图1,本申请实施例提供一种基于区块链的数据保存方法,应用于数据保存终端,包括:Referring to Figure 1, the embodiment of the present application provides a blockchain-based data storage method, which is applied to a data storage terminal, including:
S1、接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点;S1. Receive a data storage instruction for specified data, wherein the data storage instruction records the type of specified data, and the data storage terminal is a blockchain node in a pre-built blockchain network;
S2、从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板;S2. Call an initial data template corresponding to the type of the specified data from a plurality of preset data templates;
S3、将预先准备好的数据填入所述初始数据模板中,得到初始数据;S3. Filling the pre-prepared data into the initial data template to obtain initial data;
S4、将所述初始数据发送给具有审核权限的区块链节点;S4. Send the initial data to the blockchain node with audit authority;
S5、接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件;S5. Receive feedback information from the blockchain node with audit authority, and judge whether the feedback information satisfies a preset data storage condition;
S6、若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。S6. If the feedback information satisfies the preset data storage condition, record the initial data into the blockchain network.
如上述步骤S1所述,接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点。本中指定数据可为任意数据,例如虚拟币交易、生产数据、贸易数据、金融数据、贷款审批数据、风控数据等数据。所述数据保存指令是指指示将所述指定数据记录在所述区块链中的指令。预先搭建的区块链网络可以是公有链、联盟链或者私有链,优选联盟链。区块链节点可包括任意终端,例如各银行中的计算机终端。所述区块链网络的共识机制可为任意共识机制,例如工作量证明机制、权益证明机制、指定共识机制(DPOS)等,优选采用股份授权证明的共识机制。其中,所述指定数据的类型可为任意方式分类的类型,例如为风控数据、生产数据、贸易数据等,当然,还可以包括任意不同分类方式分成的数据类型。不同类型的指定数据采用的数据格式不同。As described in the above step S1, a data storage instruction for the specified data is received, wherein the data storage instruction records the type of the specified data, and the data storage terminal is a blockchain node in the pre-built blockchain network. The data specified in this document can be any data, such as virtual currency transactions, production data, trade data, financial data, loan approval data, risk control data and other data. The data saving instruction refers to an instruction indicating to record the specified data in the block chain. The pre-built blockchain network can be a public chain, alliance chain or private chain, preferably alliance chain. Blockchain nodes can include arbitrary terminals, such as computer terminals in banks. The consensus mechanism of the blockchain network can be any consensus mechanism, such as workload proof mechanism, equity proof mechanism, designated consensus mechanism (DPOS), etc., preferably adopting the consensus mechanism of share authorization certificate. Wherein, the type of the specified data can be classified in any way, such as risk control data, production data, trade data, etc. Of course, it can also include any data types classified by different classification methods. Different types of specified data adopt different data formats.
如上述步骤S2所述,从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板。由于不同类型的指定数据采用的数据格式不同,因此通过从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板,可以及早获取准确的数据格式,提高形成数据的速度,免去了从零开始形成数据的步骤。进一步地,所述初始数据模板由数据框架模板和至少一个数据子模板构成,从而更进一步地利用可编辑可组的分离式数据的特性,达到更高效率生成更有准确的数据。As described in step S2 above, an initial data template corresponding to the type of the specified data is called from a plurality of preset data templates. Since different types of specified data adopt different data formats, by calling the initial data template corresponding to the type of the specified data from the preset multiple data templates, the accurate data format can be obtained early, and the efficiency of forming data can be improved. Speed, eliminating the step of forming data from scratch. Further, the initial data template is composed of a data frame template and at least one data sub-template, so as to further utilize the characteristics of editable and groupable separated data to achieve higher efficiency and generate more accurate data.
如上述步骤S3所述,将预先准备好的数据填入所述初始数据模板中,得到初始数据。由前述可知,初始数据模板是针对性生成的,因此预先准备好的数据是与初始数据模板相匹配的,将预先准备好的数据相应填入所述初始数据模板中,即可得到初始数据。As described in step S3 above, the pre-prepared data is filled into the initial data template to obtain initial data. As can be seen from the foregoing, the initial data template is generated in a targeted manner, so the pre-prepared data matches the initial data template, and the pre-prepared data is correspondingly filled into the initial data template to obtain the initial data.
如上述步骤S4所述,将所述初始数据发送给具有审核权限的区块链节点。根据预先约定的不同,具有审核权限的区块链节点也不同。例如当采用股份授权证明的共识机制时,所述具有审核权限的区块链节点即为由所有区块链节点投选出的受托区块链节点。这些具有审核权限的区块链节点审核所述初始数据,进而决定所述初始数据能否加入所述区块链网络。As described in step S4 above, the initial data is sent to the blockchain node with audit authority. According to the pre-agreement, the blockchain nodes with audit authority are also different. For example, when the consensus mechanism of share authorization certificate is adopted, the blockchain node with audit authority is the entrusted blockchain node voted by all blockchain nodes. These blockchain nodes with audit authority audit the initial data, and then decide whether the initial data can be added to the blockchain network.
如上述步骤S5所述,接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件。所述反馈信息可以是任意形式的能够反应初始数据是否审核通过的信息。例如,所述反馈信息包括审核通过或者审核未通过。判断所述反馈信息是否满足预设的数据保存条件的过程包括:判断所述审核通过的反馈信息的数量是否大于预设的数量阈值;若所述审核通过的反馈信息的数量大于预设的数量阈值,则判定反馈信息满足预设的数据保存条件。其中预设的数量阈值例如为所述具有审核权限的区块链节点数量的一半加一。As described in step S5 above, the feedback information from the blockchain node with audit authority is received, and it is judged whether the feedback information satisfies the preset data storage condition. The feedback information may be any form of information that can reflect whether the initial data is approved or not. For example, the feedback information includes whether the review is passed or the review is not passed. The process of judging whether the feedback information satisfies the preset data storage conditions includes: judging whether the number of the feedback information passed the review is greater than a preset quantity threshold; if the number of the feedback information passed the review is greater than the preset number threshold, it is determined that the feedback information meets the preset data storage conditions. The preset quantity threshold is, for example, half of the number of blockchain nodes with audit authority plus one.
如上述步骤S6所述,若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。若所述反馈信息满足预设的数据保存条件,表明所述初始数据是正确的,是允许加入区块链的。据此,将所述初始数据记录入所述区块链网络。As described in step S6 above, if the feedback information satisfies the preset data storage condition, then record the initial data into the blockchain network. If the feedback information satisfies the preset data storage conditions, it indicates that the initial data is correct and is allowed to be added to the blockchain. Accordingly, the initial data is recorded into the blockchain network.
在一个实施方式中,所述初始数据模板由数据框架模板和至少一个数据子模板构成,所述从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板的步骤S2,包括:In one embodiment, the initial data template is composed of a data frame template and at least one data sub-template, and the step of calling an initial data template corresponding to the specified data type from a plurality of preset data templates S2, including:
S201、根据所述指定数据的类型,依据预设的数据类型与模板的对应关系,获取预设的多个数据框架模板与多个数据子模板;S201. Acquire multiple preset data frame templates and multiple data sub-templates according to the type of the specified data and according to the preset correspondence between data types and templates;
S202、获取数据保存终端选择的数据框架模板与数据子模板,并将所述数据保存终端选择的数据框架模板与数据子模板组合成为所述初始数据模板;S202. Obtain the data frame template and data sub-template selected by the data storage terminal, and combine the data frame template and data sub-template selected by the data storage terminal into the initial data template;
S203、调取所述初始数据模板。S203. Call the initial data template.
如上所述,实现了从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板。本实施方式采用的所述初始数据模板由数据框架模板和至少一个数据子模板构成,从而使得数据可利用组合预设的模板的方式形成,使数据的生成更为快捷,并能针对性地生成适宜的数据。由于不同数据需要的具体要求不同,因此数据的格式、布局(框架)等各方面都不尽相同。通过将数据分解为框架和细节部分,再针对性地预先设计有框架模板与子模板(细节部分模板),当需要指定数据的模板时,只需从已有的框架模板与子模板中选择,再组合起来,即可形成所述初始数据模板。其中当指定数据为特定操作审批数据时,数据子模板例如为抵押物子模板(包括抵押物相关的字段,包括抵押物名称字段、估值字段、抵押历史字段等)。As described above, it is realized that an initial data template corresponding to the type of the specified data is called from a plurality of preset data templates. The initial data template used in this embodiment is composed of a data frame template and at least one data sub-template, so that data can be formed by combining preset templates, making data generation faster and targeted appropriate data. Due to the different specific requirements of different data, the format, layout (frame) and other aspects of the data are different. By decomposing the data into frame and detail parts, and then pre-designing frame templates and sub-templates (detail part templates), when you need to specify a template for data, you only need to choose from the existing frame templates and sub-templates, Combined again, the initial data template can be formed. Wherein when the specified data is specific operation approval data, the data sub-template is, for example, a mortgage sub-template (including fields related to mortgages, including mortgage name fields, valuation fields, mortgage history fields, etc.).
在一个实施方式中,所述区块链网络包括指定区块链节点,所述将预先准备好的数据填入所述初始数据模板中,得到初始数据的步骤S3,包括:In one embodiment, the block chain network includes a designated block chain node, and the step S3 of filling the pre-prepared data into the initial data template and obtaining the initial data includes:
S301、接收从指定区块链节点发送的特定数据,其中所述特定数据包括特定对象的身份信息、教育经历或者是否属于黑名单的信息;S301. Receive specific data sent from a designated blockchain node, wherein the specific data includes the identity information, educational experience, or information of whether a specific object belongs to a blacklist;
S302、将所述特定数据填入所述初始数据模板中,得到初始数据。S302. Fill the specific data into the initial data template to obtain initial data.
如上所述,实现了将预先准备好的数据填入所述初始数据模板中,得到初始数据。本实施方式采用从指定区块链节点发送的特定数据作为数据,并将在后续流程中加入区块链中,从而利用区块链的数据难以篡改的特性,保证特定数据真实有效,以使特定相关的程序有真实的数据可依靠。其中所述特定数据包括特定对象的身份信息、教育经历或者是否属于黑名单的信息,可供特定操作审批等流程进行调用。将所述特定数据填入所述初始数据模板中,得到初始数据的方式包括:分别提取从指定区块链节点发送的特定数据,以得到不同字段对应的数据内容;将所述数据内容填入所述初始数据模板的相应字段中,得到初始数据。其中所述指定区块链节点可以为任意区块链节点,例如为银行区块链节点。其中所述特定数据例如为风控数据等。As mentioned above, it is realized that the pre-prepared data is filled into the initial data template to obtain the initial data. This embodiment adopts the specific data sent from the specified blockchain node as data, and will add it to the blockchain in the subsequent process, so as to make use of the characteristics of blockchain data that are difficult to tamper with, to ensure that the specific data is true and effective, so that the specific The relevant programs have real data to rely on. The specific data includes the identity information, educational experience, or blacklist information of the specific object, which can be used for procedures such as approval of specific operations. Filling the specific data into the initial data template, and obtaining the initial data includes: respectively extracting the specific data sent from the specified blockchain node to obtain the data content corresponding to different fields; filling the data content into The initial data is obtained in the corresponding field of the initial data template. Wherein the specified blockchain node can be any blockchain node, such as a bank blockchain node. Wherein the specific data is, for example, risk control data and the like.
在一个实施方式中,所述区块链网络采用指定共识机制,所述接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件的步骤S5,包括:In one embodiment, the block chain network adopts a designated consensus mechanism, the step of receiving the feedback information from the block chain node with audit authority, and judging whether the feedback information satisfies the preset data storage conditions S5, including:
S501、接收基于所述指定共识机制而投选出的多个受托区块链节点的反馈信息,其中所述受托区块链节点具有审核权限,所述反馈信息包括审核通过或者审核未通过;S501. Receive feedback information from a plurality of entrusted blockchain nodes voted based on the specified consensus mechanism, wherein the entrusted blockchain nodes have audit authority, and the feedback information includes whether the audit is passed or the audit is not passed;
S502、统计审核通过的反馈信息的数量,并判断所述审核通过的反馈信息的数量是否大于预设的数量阈值;S502. Count the number of feedback information that has passed the review, and determine whether the number of feedback information that has passed the review is greater than a preset quantity threshold;
S503、若所述审核通过的反馈信息的数量大于预设的数量阈值,则判定反馈信息满足预设的数据保存条件。S503. If the quantity of the feedback information that has passed the review is greater than a preset quantity threshold, determine that the feedback information satisfies a preset data storage condition.
如上所述,实现了接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件。本实施方式中的区块链网络采用指定共识机制(例如股份授权证明机制)的共识机制,从而减少审核需要的时间。其中,股份授权证明机制类似于董事会投票,就是区块链节点会进行投票,从而投选出一部分数量的节点(受托区块链节点),所述受托区块链节点代理所有区块链节点进行验证审核工作,从而不需要每个区块链节点都进行验证审核。所述反馈信息包括审核通过或者审核未通过。通过统计审核通过的反馈信息的数量,并判断所述审核通过的反馈信息的数量是否大于预设的数量阈值,若所述审核通过的反馈信息的数量大于预设的数量阈值,则判定反馈信息满足预设的数据保存条件;若不大于预设的数量阈值,则判定反馈信息不满足预设的数据保存条件。具体的数量阈值例如可设为所述具有审核权限的区块链节点数量的一半加一。As mentioned above, it is realized to receive the feedback information from the blockchain node with audit authority, and judge whether the feedback information satisfies the preset data storage condition. The blockchain network in this embodiment adopts a consensus mechanism of a specified consensus mechanism (such as a share authorization certificate mechanism), thereby reducing the time required for review. Among them, the share authorization certificate mechanism is similar to the voting of the board of directors, that is, the blockchain nodes will vote to select a part of the number of nodes (entrusted blockchain nodes), and the entrusted blockchain nodes will act on behalf of all blockchain nodes. Verification and audit work, so that each blockchain node does not need to conduct verification audits. The feedback information includes whether the review is passed or the review is not passed. By counting the number of feedback information passed through review, and judging whether the number of feedback information passed through review is greater than a preset number threshold, if the number of feedback information passed through review is greater than a preset number threshold, then determine the feedback information The preset data storage condition is satisfied; if it is not greater than the preset quantity threshold, it is determined that the feedback information does not meet the preset data storage condition. The specific quantity threshold can be set as half of the number of blockchain nodes with audit authority plus one, for example.
在一个实施方式中,所述接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点的步骤S1之前,包括:In one embodiment, the receiving a data storage instruction for specified data, wherein the data storage instruction records the type of specified data, and the data storage terminal is a blockchain node in a pre-built blockchain network Before step S1, including:
S01、采用指定语言在所述数据保存终端中创建区块链类,将所述区块链类实例化从而建立创世区块,其中所述创世区块中将前一区块的哈希值记为0;S01. Using a specified language to create a blockchain class in the data storage terminal, instantiate the blockchain class to create a genesis block, wherein the genesis block uses the hash of the previous block The value is recorded as 0;
S02、基于所述创世区块,生成其他区块,其中所述其他区块包括前一区块的哈希值;S02. Generate other blocks based on the genesis block, wherein the other blocks include the hash value of the previous block;
S03、将预设终端作为区块链节点,从而建立所述区块链网络。S03. The preset terminal is used as a blockchain node, thereby establishing the blockchain network.
如上所述,实现了构建区块链网络。其中指定语言包括JAVA、C++、Python等任意可行语言。类(Class)是面向对象程序设计实现信息封装的基础。类是一种用户定义类型,也称类型。每个类包含数据说明和一组操作数据或传递消息的函数。所述区块链类即是描述区块链的类。将区块链类实例化,即是声明一个区块链类型的对象,从而获得了创世区块(没有区块前的第一个区块),其中创世区块中的前一区块的哈希值可设置为0。再基于所述创世区块,生成其他区块,其中所述其他区块包括前一区块的哈希值,从而构成了一条具有多区块的区块链。再将同意所述区块链的预设共识机制的终端(预设终端)作为区块链节点,从而建立所述区块链网络。其中,所述共识机制例如工作量证明机制、权益证明机制、指定共识机制等。据此,建立所述区块链网络。As mentioned above, building a blockchain network is realized. The specified language includes any feasible language such as JAVA, C++, and Python. Class is the basis of object-oriented programming to realize information encapsulation. A class is a user-defined type, also called a type. Each class contains a description of the data and a set of functions for manipulating the data or passing messages. The blockchain class is a class describing a blockchain. Instantiating the blockchain class means declaring an object of the blockchain type, thus obtaining the genesis block (the first block before the block), where the previous block in the genesis block The hash value of can be set to 0. Based on the genesis block, other blocks are generated, wherein the other blocks include the hash value of the previous block, thereby forming a block chain with multiple blocks. Then, the terminal (preset terminal) that agrees with the preset consensus mechanism of the blockchain is used as a blockchain node, thereby establishing the blockchain network. Wherein, the consensus mechanism is, for example, a proof-of-work mechanism, a proof-of-interest mechanism, a designated consensus mechanism, and the like. Accordingly, the blockchain network is established.
在一个实施方式中,所述若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络的步骤S6之后,包括:In one embodiment, after the step S6 of recording the initial data into the blockchain network if the feedback information satisfies the preset data storage condition, it includes:
S61、接收对所述指定数据的修改指令,其中所述修改指令附带有替换用子数据;S61. Receive a modification instruction for the designated data, wherein the modification instruction is accompanied by sub-data for replacement;
S62、根据所述修改指令,将所述指定数据中的待修改子数据替换为所述替换用子数据,并在所述指定数据中保留修改记录,从而得到修改后数据;S62. According to the modification instruction, replace the sub-data to be modified in the specified data with the sub-data for replacement, and keep a modification record in the specified data, so as to obtain the modified data;
S63、将所述修改后数据发送给所述具有审核权限的区块链节点;S63. Send the modified data to the blockchain node with audit authority;
S64、接收所述具有审核权限的区块链节点的对所述修改后数据的审核信息,并判断所述审核信息是否满足预设的数据保存条件;S64. Receive the audit information of the modified data from the blockchain node with audit authority, and judge whether the audit information satisfies a preset data storage condition;
S65、若所述审核信息满足预设的数据保存条件,则将所述修改后数据加入所述区块链网络。S65. If the audit information satisfies the preset data storage condition, add the modified data to the blockchain network.
如上所述,实现了修改数据。已加入区块链的指定数据的数据难以篡改,但是当指定数据的数据在录入时存在错误,因此具有修改的需要。此时若要进行修改指定数据的数据,则应当经过具有审核权限的区块链节点进行审核,当所述具有审核权限的区块链节点的对所述修改后数据的审核信息满足预设的数据保存条件,则将所述修改后数据加入所述区块链网络。预设的数据保存条件例如为审核通过的区块链节点的数量大于预设的阈值。其中,对所述指令数据进行修改成功后,将对被修改的数据进行失效标记,以作提示。As mentioned above, modifying data is implemented. The data of the specified data that has been added to the blockchain is difficult to tamper with, but when the data of the specified data is entered incorrectly, it is necessary to modify it. At this time, if the data of the specified data is to be modified, it should be audited by the blockchain node with audit authority. When the audit information of the modified data of the blockchain node with audit authority meets the preset If the data preservation condition is satisfied, the modified data is added to the block chain network. The preset data storage condition is, for example, that the number of approved blockchain nodes is greater than a preset threshold. Wherein, after the instruction data is modified successfully, the modified data will be marked as invalid as a reminder.
在一个实施方式中,所述若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络的步骤S6之后,包括:In one embodiment, after the step S6 of recording the initial data into the blockchain network if the feedback information satisfies the preset data storage condition, it includes:
S7、接收基于所述特定数据的特定操作审批指令;S7. Receive a specific operation approval instruction based on the specific data;
S8、从所述区块链中调取所述特定数据,并判断所述特定数据是否符合预设的特定操作审批标准;S8. Retrieving the specific data from the blockchain, and judging whether the specific data meets the preset specific operation approval standard;
S9、若所述特定数据符合预设的特定操作审批标准,则执行特定操作。S9. If the specific data meets the preset specific operation approval standard, perform a specific operation.
如上所述,实现了执行特定操作。从所述区块链中调取的所述特定数据相较于现有技术的其他技术手段获取的特定数据要真实可靠,因此基于所述特定数据的特定操作审批可避免数据篡改而造成的欺诈风险。其中所述特定数据包括特定对象的身份信息、教育经历或者是否属于黑名单的信息,判断所述特定数据是否符合预设的特定操作审批标准的方式包括:判断特定对象的身份信息是否与预设的身份信息相同,判断预设的教育经历是否与特定对象的教育经历相同,和/或判断特定对象是否属于黑名单。从而利用了区块链网络中存储的特定数据,判断是否执行特定操作。其中所述特定操作审批指令例如为贷款审批指令等。As mentioned above, it is implemented to perform a specific operation. The specific data retrieved from the blockchain is more authentic and reliable than the specific data obtained by other technical means in the prior art, so specific operation approval based on the specific data can avoid fraud caused by data tampering risk. Wherein the specific data includes the identity information of the specific object, education experience, or information on whether it belongs to the blacklist, and the method of judging whether the specific data meets the preset approval standards for specific operations includes: judging whether the identity information of the specific object is consistent with the preset The same identity information, determine whether the preset educational experience is the same as that of the specific object, and/or determine whether the specific object belongs to the blacklist. Thus, specific data stored in the blockchain network is used to determine whether to perform a specific operation. The specific operation approval instruction is, for example, a loan approval instruction.
本申请的基于区块链的数据保存方法,接收对指定数据的数据保存指令;将预先准备好的数据填入初始数据模板中,得到初始数据;将所述初始数据发送给具有审核权限的区块链节点;接收所述具有审核权限的区块链节点的反馈信息;若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。从而解决了数据安全性差、同时数据直接使用程度差的问题。The blockchain-based data storage method of this application receives a data storage instruction for specified data; fills the pre-prepared data into the initial data template to obtain the initial data; sends the initial data to the district with audit authority A block chain node; receiving feedback information from the block chain node with audit authority; if the feedback information satisfies a preset data storage condition, recording the initial data into the block chain network. Therefore, the problems of poor data security and poor direct use of data are solved.
参照图2,本申请实施例提供一种基于区块链的数据保存装置,应用于数据保存终端,包括:Referring to Figure 2, the embodiment of the present application provides a blockchain-based data storage device, which is applied to a data storage terminal, including:
数据保存指令接收单元10,用于接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点;A data storage instruction receiving unit 10, configured to receive a data storage instruction for specified data, wherein the data storage instruction records the type of specified data, and the data storage terminal is a blockchain in a pre-built blockchain network node;
初始数据模板调取单元20,用于从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板;An initial data template calling unit 20, configured to call an initial data template corresponding to the type of the specified data from a plurality of preset data templates;
初始数据获取单元30,用于将预先准备好的数据填入所述初始数据模板中,得到初始数据;An initial data acquisition unit 30, configured to fill in pre-prepared data into the initial data template to obtain initial data;
初始数据发送单元40,用于将所述初始数据发送给具有审核权限的区块链节点;An initial data sending unit 40, configured to send the initial data to blockchain nodes with audit authority;
数据保存条件判断单元50,用于接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件;A data storage condition judging unit 50, configured to receive feedback information from the blockchain node with audit authority, and judge whether the feedback information satisfies a preset data storage condition;
数据保存单元60,用于若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。The data storage unit 60 is configured to record the initial data into the blockchain network if the feedback information satisfies a preset data storage condition.
如上述单元10所述,接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点。本中指定数据可为任意数据,例如虚拟币交易、生产数据、贸易数据、金融数据、特定操作审批数据、特定数据等数据。所述数据保存指令是指指示将所述指定数据记录在所述区块链中的指令。预先搭建的区块链网络可以是公有链、联盟链或者私有链,优选联盟链。区块链节点可包括任意终端,例如各银行中的计算机终端。所述区块链网络的共识机制可为任意共识机制,例如工作量证明机制、权益证明机制、指定共识机制(DPOS)等,优选采用股份授权证明的共识机制。其中,所述指定数据的类型可为任意方式分类的类型,例如为特定数据、生产数据、贸易数据等,当然,还可以包括任意不同分类方式分成的数据类型。不同类型的指定数据采用的数据格式不同。As described in the above unit 10, a data storage instruction for the specified data is received, wherein the data storage instruction records the type of the specified data, and the data storage terminal is a blockchain node in the pre-built blockchain network. The data specified in this document can be any data, such as virtual currency transactions, production data, trade data, financial data, specific operation approval data, specific data and other data. The data saving instruction refers to an instruction indicating to record the specified data in the block chain. The pre-built blockchain network can be a public chain, alliance chain or private chain, preferably alliance chain. Blockchain nodes can include arbitrary terminals, such as computer terminals in banks. The consensus mechanism of the blockchain network can be any consensus mechanism, such as workload proof mechanism, equity proof mechanism, designated consensus mechanism (DPOS), etc., preferably adopting the consensus mechanism of share authorization certificate. Wherein, the type of the specified data may be classified in any manner, such as specific data, production data, trade data, etc., and of course, may also include any data types classified in different classification manners. Different types of specified data adopt different data formats.
如上述单元20所述,从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板。由于不同类型的指定数据采用的数据格式不同,因此通过从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板,可以及早获取准确的数据格式,提高形成数据的速度,免去了从零开始形成数据的步骤。进一步地,所述初始数据模板由数据框架模板和至少一个数据子模板构成,从而更进一步地利用可编辑可组的分离式数据的特性,达到更高效率生成更有准确的数据。As described in the above unit 20, an initial data template corresponding to the type of the specified data is called from a plurality of preset data templates. Since different types of specified data adopt different data formats, by calling the initial data template corresponding to the type of the specified data from the preset multiple data templates, the accurate data format can be obtained early, and the efficiency of forming data can be improved. Speed, eliminating the step of forming data from scratch. Further, the initial data template is composed of a data frame template and at least one data sub-template, so as to further utilize the characteristics of editable and groupable separated data to achieve higher efficiency and generate more accurate data.
如上述单元30所述,将预先准备好的数据填入所述初始数据模板中,得到初始数据。由前述可知,初始数据模板是针对性生成的,因此预先准备好的数据是与初始数据模板相匹配的,将预先准备好的数据相应填入所述初始数据模板中,即可得到初始数据。As described in the above unit 30, the pre-prepared data is filled into the initial data template to obtain the initial data. As can be seen from the foregoing, the initial data template is generated in a targeted manner, so the pre-prepared data matches the initial data template, and the pre-prepared data is correspondingly filled into the initial data template to obtain the initial data.
如上述单元40所述,将所述初始数据发送给具有审核权限的区块链节点。根据预先约定的不同,具有审核权限的区块链节点也不同。例如当采用股份授权证明的共识机制时,所述具有审核权限的区块链节点即为由所有区块链节点投选出的受托区块链节点。这些具有审核权限的区块链节点审核所述初始数据,进而决定所述初始数据能否加入所述区块链网络。As described in unit 40 above, the initial data is sent to the blockchain node with audit authority. According to the pre-agreement, the blockchain nodes with audit authority are also different. For example, when the consensus mechanism of share authorization certificate is adopted, the blockchain node with audit authority is the entrusted blockchain node voted by all blockchain nodes. These blockchain nodes with audit authority audit the initial data, and then decide whether the initial data can be added to the blockchain network.
如上述单元50所述,接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件。所述反馈信息可以是任意形式的能够反应初始数据是否审核通过的信息。例如,所述反馈信息包括审核通过或者审核未通过。判断所述反馈信息是否满足预设的数据保存条件的过程包括:判断所述审核通过的反馈信息的数量是否大于预设的数量阈值;若所述审核通过的反馈信息的数量大于预设的数量阈值,则判定反馈信息满足预设的数据保存条件。其中预设的数量阈值例如为所述具有审核权限的区块链节点数量的一半加一。As described in the above unit 50, the feedback information from the blockchain node with audit authority is received, and it is judged whether the feedback information satisfies the preset data storage condition. The feedback information may be any form of information that can reflect whether the initial data is approved or not. For example, the feedback information includes whether the review is passed or the review is not passed. The process of judging whether the feedback information satisfies the preset data storage conditions includes: judging whether the number of the feedback information passed the review is greater than a preset quantity threshold; if the number of the feedback information passed the review is greater than the preset number threshold, it is determined that the feedback information meets the preset data storage conditions. The preset quantity threshold is, for example, half of the number of blockchain nodes with audit authority plus one.
如上述单元60所述,若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。若所述反馈信息满足预设的数据保存条件,表明所述初始数据是正确的,是允许加入区块链的。据此,将所述初始数据记录入所述区块链网络。As described in the above unit 60, if the feedback information satisfies the preset data storage condition, then record the initial data into the blockchain network. If the feedback information satisfies the preset data storage conditions, it indicates that the initial data is correct and is allowed to be added to the blockchain. Accordingly, the initial data is recorded into the blockchain network.
在一个实施方式中,所述初始数据模板由数据框架模板和至少一个数据子模板构成,所述初始数据模板调取单元20,包括:In one embodiment, the initial data template is composed of a data frame template and at least one data sub-template, and the initial data template calling unit 20 includes:
数据模板获取子单元,用于根据所述指定数据的类型,依据预设的数据类型与模板的对应关系,获取预设的多个数据框架模板与多个数据子模板;The data template obtaining subunit is used to obtain a plurality of preset data frame templates and a plurality of data sub-templates according to the type of the specified data and according to the corresponding relationship between the preset data type and the template;
数据模板组合子单元,用于获取数据保存终端选择的数据框架模板与数据子模板,并将所述数据保存终端选择的数据框架模板与数据子模板组合成为所述初始数据模板;The data template combination subunit is used to obtain the data frame template and data sub-template selected by the data storage terminal, and combine the data frame template and data sub-template selected by the data storage terminal into the initial data template;
调取子单元,用于调取所述初始数据模板。The calling subunit is used to call the initial data template.
如上所述,实现了从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板。本实施方式采用的所述初始数据模板由数据框架模板和至少一个数据子模板构成,从而使得数据可利用组合预设的模板的方式形成,使数据的生成更为快捷,并能针对性地生成适宜的数据。由于不同数据需要的具体要求不同,因此数据的格式、布局(框架)等各方面都不尽相同。通过将数据分解为框架和细节部分,再针对性地预先设计有框架模板与子模板(细节部分模板),当需要指定数据的模板时,只需从已有的框架模板与子模板中选择,再组合起来,即可形成所述初始数据模板。其中当指定数据为特定操作审批数据时,数据子模板例如为抵押物子模板(包括抵押物相关的字段,包括抵押物名称字段、估值字段、抵押历史字段等)。As described above, it is realized that an initial data template corresponding to the type of the specified data is called from a plurality of preset data templates. The initial data template used in this embodiment is composed of a data frame template and at least one data sub-template, so that data can be formed by combining preset templates, making data generation faster and targeted appropriate data. Due to the different specific requirements of different data, the format, layout (frame) and other aspects of the data are different. By decomposing the data into frame and detail parts, and then pre-designing frame templates and sub-templates (detail part templates), when you need to specify a template for data, you only need to choose from the existing frame templates and sub-templates, Combined again, the initial data template can be formed. Wherein when the specified data is specific operation approval data, the data sub-template is, for example, a mortgage sub-template (including fields related to mortgages, including mortgage name fields, valuation fields, mortgage history fields, etc.).
在一个实施方式中,所述区块链网络包括指定区块链节点,所述初始数据获取单元30,包括:In one embodiment, the blockchain network includes designated blockchain nodes, and the initial data acquisition unit 30 includes:
特定数据接收子单元,用于接收从指定区块链节点发送的特定数据,其中所述特定数据包括特定对象的身份信息、教育经历或者是否属于黑名单的信息;The specific data receiving subunit is used to receive the specific data sent from the specified block chain node, wherein the specific data includes the identity information, educational experience or information of whether the specific object belongs to the blacklist;
初始数据获取子单元,用于将所述特定数据填入所述初始数据模板中,得到初始数据。The initial data acquisition subunit is configured to fill the specific data into the initial data template to obtain initial data.
如上所述,实现了将预先准备好的数据填入所述初始数据模板中,得到初始数据。本实施方式采用从指定区块链节点发送的特定数据作为数据,并将在后续流程中加入区块链中,从而利用区块链的数据难以篡改的特性,保证特定数据真实有效,以使特定相关的程序有真实的数据可依靠。其中所述特定数据包括特定对象的身份信息、教育经历或者是否属于黑名单的信息,可供特定操作审批等流程进行调用。将所述特定数据填入所述初始数据模板中,得到初始数据的方式包括:分别提取从指定区块链节点发送的特定数据,以得到不同字段对应的数据内容;将所述数据内容填入所述初始数据模板的相应字段中,得到初始数据。其中所述指定区块链节点可以为任意区块链节点,例如为银行区块链节点。As mentioned above, it is realized that the pre-prepared data is filled into the initial data template to obtain the initial data. This embodiment adopts the specific data sent from the specified blockchain node as data, and will add it to the blockchain in the subsequent process, so as to make use of the characteristics of blockchain data that are difficult to tamper with, to ensure that the specific data is true and effective, so that the specific Related programs have real data to rely on. The specific data includes the identity information, educational experience, or blacklist information of the specific object, which can be used for procedures such as approval of specific operations. Filling the specific data into the initial data template, and obtaining the initial data includes: respectively extracting the specific data sent from the specified blockchain node to obtain the data content corresponding to different fields; filling the data content into The initial data is obtained in the corresponding field of the initial data template. Wherein the specified blockchain node can be any blockchain node, such as a bank blockchain node.
在一个实施方式中,所述区块链网络采用指定共识机制,所述数据保存条件判断单元50,包括:In one embodiment, the blockchain network adopts a specified consensus mechanism, and the data storage condition judging unit 50 includes:
反馈信息接收子单元,用于接收基于所述指定共识机制而投选出的多个受托区块链节点的反馈信息,其中所述受托区块链节点具有审核权限,所述反馈信息包括审核通过或者审核未通过;The feedback information receiving subunit is configured to receive feedback information from a plurality of entrusted blockchain nodes voted out based on the specified consensus mechanism, wherein the entrusted blockchain nodes have audit authority, and the feedback information includes audit pass or failed the review;
反馈信息统计子单元,用于统计审核通过的反馈信息的数量,并判断所述审核通过的反馈信息的数量是否大于预设的数量阈值;The feedback information statistics subunit is used to count the number of feedback information that has passed the review, and determine whether the number of feedback information that has passed the review is greater than a preset quantity threshold;
满足数据保存条件判定子单元,用于若所述审核通过的反馈信息的数量大于预设的数量阈值,则判定反馈信息满足预设的数据保存条件。The data storage condition determination subunit is configured to determine that the feedback information satisfies the preset data storage condition if the number of the feedback information that has passed the review is greater than a preset quantity threshold.
如上所述,实现了接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件。本实施方式中的区块链网络采用指定共识机制(例如股份授权证明机制)的共识机制,从而减少审核需要的时间。其中,股份授权证明机制类似于董事会投票,就是区块链节点会进行投票,从而投选出一部分数量的节点(受托区块链节点),所述受托区块链节点代理所有区块链节点进行验证审核工作,从而不需要每个区块链节点都进行验证审核。所述反馈信息包括审核通过或者审核未通过。通过统计审核通过的反馈信息的数量,并判断所述审核通过的反馈信息的数量是否大于预设的数量阈值,若所述审核通过的反馈信息的数量大于预设的数量阈值,则判定反馈信息满足预设的数据保存条件;若不大于预设的数量阈值,则判定反馈信息不满足预设的数据保存条件。具体的数量阈值例如可设为所述具有审核权限的区块链节点数量的一半加一。As mentioned above, it is realized to receive the feedback information from the blockchain node with audit authority, and judge whether the feedback information satisfies the preset data storage condition. The blockchain network in this embodiment adopts a consensus mechanism of a specified consensus mechanism (such as a share authorization certificate mechanism), thereby reducing the time required for review. Among them, the share authorization certificate mechanism is similar to the voting of the board of directors, that is, the blockchain nodes will vote to select a part of the number of nodes (entrusted blockchain nodes), and the entrusted blockchain nodes will act on behalf of all blockchain nodes. Verification and audit work, so that each blockchain node does not need to conduct verification audits. The feedback information includes whether the review is passed or the review is not passed. By counting the number of feedback information passed through review, and judging whether the number of feedback information passed through review is greater than a preset number threshold, if the number of feedback information passed through review is greater than a preset number threshold, then determine the feedback information The preset data storage condition is satisfied; if it is not greater than the preset quantity threshold, it is determined that the feedback information does not meet the preset data storage condition. The specific quantity threshold can be set as half of the number of blockchain nodes with audit authority plus one, for example.
在一个实施方式中,所述装置,包括:In one embodiment, the device includes:
建立创世区块单元,用于采用指定语言在所述数据保存终端中创建区块链类,将所述区块链类实例化从而建立创世区块,其中所述创世区块中将前一区块的哈希值记为0;Establish a genesis block unit, which is used to create a block chain class in the data storage terminal using a specified language, and instantiate the block chain class to establish a genesis block, wherein the genesis block will The hash value of the previous block is recorded as 0;
生成其他区块单元,用于基于所述创世区块,生成其他区块,其中所述其他区块包括前一区块的哈希值;generating other block units for generating other blocks based on the genesis block, wherein the other blocks include the hash value of the previous block;
建立区块链网络单元,用于将预设终端作为区块链节点,从而建立所述区块链网络。A block chain network unit is established, which is used to use the preset terminal as a block chain node, thereby establishing the block chain network.
如上所述,实现了构建区块链网络。其中指定语言包括JAVA、C++、Python等任意可行语言。类(Class)是面向对象程序设计实现信息封装的基础。类是一种用户定义类型,也称类型。每个类包含数据说明和一组操作数据或传递消息的函数。所述区块链类即是描述区块链的类。将区块链类实例化,即是声明一个区块链类型的对象,从而获得了创世区块(没有区块前的第一个区块),其中创世区块中的前一区块的哈希值可设置为0。再基于所述创世区块,生成其他区块,其中所述其他区块包括前一区块的哈希值,从而构成了一条具有多区块的区块链。再将同意所述区块链的预设共识机制的终端(预设终端)作为区块链节点,从而建立所述区块链网络。其中,所述共识机制例如工作量证明机制、权益证明机制、指定共识机制等。据此,建立所述区块链网络。As mentioned above, building a blockchain network is realized. The specified language includes any feasible language such as JAVA, C++, and Python. Class is the basis of object-oriented programming to realize information encapsulation. A class is a user-defined type, also called a type. Each class contains a description of the data and a set of functions for manipulating the data or passing messages. The blockchain class is a class describing a blockchain. Instantiating the blockchain class means declaring an object of the blockchain type, thus obtaining the genesis block (the first block before the block), where the previous block in the genesis block The hash value of can be set to 0. Based on the genesis block, other blocks are generated, wherein the other blocks include the hash value of the previous block, thereby forming a block chain with multiple blocks. Then, the terminal (preset terminal) that agrees with the preset consensus mechanism of the blockchain is used as a blockchain node, thereby establishing the blockchain network. Wherein, the consensus mechanism is, for example, a proof-of-work mechanism, a proof-of-interest mechanism, a designated consensus mechanism, and the like. Accordingly, the blockchain network is established.
在一个实施方式中,所述装置,包括:In one embodiment, the device includes:
修改指令接收单元,用于接收对所述指定数据的修改指令,其中所述修改指令附带有替换用子数据;a modification instruction receiving unit, configured to receive a modification instruction to the specified data, wherein the modification instruction is accompanied by sub-data for replacement;
替换单元,用于根据所述修改指令,将所述指定数据中的待修改子数据替换为所述替换用子数据,并在所述指定数据中保留修改记录,从而得到修改后数据;A replacement unit, configured to replace the sub-data to be modified in the specified data with the sub-data for replacement according to the modification instruction, and keep a modification record in the specified data, so as to obtain the modified data;
修改后数据发送单元,用于将所述修改后数据发送给所述具有审核权限的区块链节点;A modified data sending unit, configured to send the modified data to the blockchain node with audit authority;
审核信息接收单元,用于接收所述具有审核权限的区块链节点的对所述修改后数据的审核信息,并判断所述审核信息是否满足预设的数据保存条件;An audit information receiving unit, configured to receive audit information on the modified data from the blockchain node with audit authority, and determine whether the audit information satisfies a preset data storage condition;
修改后数据加入单元,用于若所述审核信息满足预设的数据保存条件,则将所述修改后数据加入所述区块链网络。The modified data adding unit is configured to add the modified data to the block chain network if the audit information satisfies the preset data storage condition.
如上所述,实现了修改数据。已加入区块链的指定数据的数据难以篡改,但是当指定数据的数据在录入时存在错误,因此具有修改的需要。此时若要进行修改指定数据的数据,则应当经过具有审核权限的区块链节点进行审核,当所述具有审核权限的区块链节点的对所述修改后数据的审核信息满足预设的数据保存条件,则将所述修改后数据加入所述区块链网络。预设的数据保存条件例如为审核通过的区块链节点的数量大于预设的阈值。其中,对所述指令数据进行修改成功后,将对被修改的数据进行失效标记,以作提示。As mentioned above, modifying data is implemented. The data of the specified data that has been added to the blockchain is difficult to tamper with, but when the data of the specified data is entered incorrectly, it is necessary to modify it. At this time, if the data of the specified data is to be modified, it should be audited by the blockchain node with audit authority. When the audit information of the modified data of the blockchain node with audit authority meets the preset If the data preservation condition is satisfied, the modified data is added to the block chain network. The preset data storage condition is, for example, that the number of approved blockchain nodes is greater than a preset threshold. Wherein, after the instruction data is modified successfully, the modified data will be marked as invalid as a reminder.
在一个实施方式中,所述装置,包括:In one embodiment, the device includes:
特定操作审批指令接收单元,用于接收基于所述特定数据的特定操作审批指令;A specific operation approval instruction receiving unit, configured to receive a specific operation approval instruction based on the specific data;
特定操作审批标准判断单元,用于从所述区块链中调取所述特定数据,并判断所述特定数据是否符合预设的特定操作审批标准;A specific operation approval standard judging unit, configured to retrieve the specific data from the block chain, and judge whether the specific data meets the preset specific operation approval standard;
执行特定操作单元,用于若所述特定数据符合预设的特定操作审批标准,则执行特定操作。Executing a specific operation unit, configured to execute a specific operation if the specific data meets a preset approval standard for a specific operation.
如上所述,实现了执行特定操作。从所述区块链中调取的所述特定数据相较于现有技术的其他技术手段获取的特定数据要真实可靠,因此基于所述特定数据的特定操作审批可避免数据篡改而造成的欺诈风险。其中所述特定数据包括特定对象的身份信息、教育经历或者是否属于黑名单的信息,判断所述特定数据是否符合预设的特定操作审批标准的方式包括:判断特定对象的身份信息是否与预设的身份信息相同,判断预设的教育经历是否与特定对象的教育经历相同,和/或判断特定对象是否属于黑名单。从而利用了区块链网络中存储的特定数据,判断是否执行特定操作。其中所述特定操作审批指令例如为贷款审批指令等。As mentioned above, it is implemented to perform a specific operation. The specific data retrieved from the blockchain is more authentic and reliable than the specific data obtained by other technical means in the prior art, so specific operation approval based on the specific data can avoid fraud caused by data tampering risk. Wherein the specific data includes the identity information of the specific object, education experience, or information on whether it belongs to the blacklist, and the method of judging whether the specific data meets the preset approval standards for specific operations includes: judging whether the identity information of the specific object is consistent with the preset The same identity information, determine whether the preset educational experience is the same as that of the specific object, and/or determine whether the specific object belongs to the blacklist. Thus, specific data stored in the blockchain network is used to determine whether to perform a specific operation. The specific operation approval instruction is, for example, a loan approval instruction.
本申请的基于区块链的数据保存装置,接收对指定数据的数据保存指令;将预先准备好的数据填入初始数据模板中,得到初始数据;将所述初始数据发送给具有审核权限的区块链节点;接收所述具有审核权限的区块链节点的反馈信息;若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。从而解决了数据安全性差、同时数据直接使用程度差的问题。The blockchain-based data storage device of this application receives a data storage instruction for specified data; fills the pre-prepared data into the initial data template to obtain the initial data; sends the initial data to the district with audit authority A block chain node; receiving feedback information from the block chain node with audit authority; if the feedback information satisfies a preset data storage condition, recording the initial data into the block chain network. Therefore, the problems of poor data security and poor direct use of data are solved.
参照图3,本发明实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储基于区块链的数据保存方法所用数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于区块链的数据保存方法。Referring to FIG. 3 , an embodiment of the present invention also provides a computer device, which may be a server, and its internal structure may be as shown in the figure. The computer device includes a processor, memory, network interface and database connected by a system bus. Among them, the processor designed by the computer is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs and databases. The memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store data used by the blockchain-based data storage method. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a blockchain-based data storage method is implemented.
上述处理器执行上述基于区块链的数据保存方法,应用于数据保存终端,包括:接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点;从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板;将预先准备好的数据填入所述初始数据模板中,得到初始数据;将所述初始数据发送给具有审核权限的区块链节点;接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件;若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。The above-mentioned processor executes the above-mentioned blockchain-based data storage method, which is applied to a data storage terminal, including: receiving a data storage instruction for specified data, wherein the data storage instruction records the type of specified data, and the data storage terminal is A block chain node in the pre-built block chain network; call the initial data template corresponding to the type of the specified data from the preset multiple data templates; fill the pre-prepared data into the initial In the data template, the initial data is obtained; the initial data is sent to the blockchain node with audit authority; the feedback information of the blockchain node with audit authority is received, and it is judged whether the feedback information satisfies the preset Data storage conditions; if the feedback information meets the preset data storage conditions, then record the initial data into the blockchain network.
在一个实施方式中,所述初始数据模板由数据框架模板和至少一个数据子模板构成,所述从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板的步骤,包括:根据所述指定数据的类型,依据预设的数据类型与模板的对应关系,获取预设的多个数据框架模板与多个数据子模板;获取所述数据保存终端选择的数据框架模板与数据子模板,并将所述数据保存终端选择的数据框架模板与数据子模板组合成为所述初始数据模板;调取所述初始数据模板。In one embodiment, the initial data template is composed of a data frame template and at least one data sub-template, and the step of calling an initial data template corresponding to the specified data type from a plurality of preset data templates , including: according to the type of the specified data, according to the preset corresponding relationship between the data type and the template, obtaining a plurality of preset data frame templates and a plurality of data sub-templates; obtaining the data frame template selected by the data storage terminal and a data sub-template, and combine the data frame template and data sub-template selected by the data storage terminal to form the initial data template; call the initial data template.
在一个实施方式中,所述区块链网络包括指定区块链节点,所述将预先准备好的数据填入所述初始数据模板中,得到初始数据的步骤,包括:接收从指定区块链节点发送的特定数据,其中所述特定数据包括特定对象的身份信息、教育经历或者是否属于黑名单的信息;将所述特定数据填入所述初始数据模板中,得到初始数据。In one embodiment, the block chain network includes a designated block chain node, and the step of filling the pre-prepared data into the initial data template and obtaining the initial data includes: receiving The specific data sent by the node, wherein the specific data includes the identity information of the specific object, education experience, or information about whether it belongs to the blacklist; the specific data is filled into the initial data template to obtain the initial data.
在一个实施方式中,所述区块链网络采用指定共识机制,所述接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件的步骤,包括:接收基于所述指定共识机制而投选出的多个受托区块链节点的反馈信息,其中所述受托区块链节点具有审核权限,所述反馈信息包括审核通过或者审核未通过;统计审核通过的反馈信息的数量,并判断所述审核通过的反馈信息的数量是否大于预设的数量阈值;若所述审核通过的反馈信息的数量大于预设的数量阈值,则判定反馈信息满足预设的数据保存条件。In one embodiment, the block chain network adopts a designated consensus mechanism, the step of receiving the feedback information from the block chain node with audit authority, and judging whether the feedback information satisfies the preset data storage conditions , including: receiving feedback information from a plurality of entrusted blockchain nodes voted based on the specified consensus mechanism, wherein the entrusted blockchain nodes have audit authority, and the feedback information includes whether the audit is passed or the audit is not passed; Counting the number of feedback information passed through review, and judging whether the number of feedback information passed through review is greater than a preset number threshold; if the number of feedback information passed through review is greater than a preset number threshold, it is determined that the feedback information meets Preset data storage conditions.
在一个实施方式中,所述接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点的步骤之前,包括:采用指定语言在所述数据保存终端中创建区块链类,将所述区块链类实例化从而建立创世区块,其中所述创世区块中将前一区块的哈希值记为0;基于所述创世区块,生成其他区块,其中所述其他区块包括前一区块的哈希值;将预设终端作为区块链节点,从而建立所述区块链网络。In one embodiment, the receiving a data storage instruction for specified data, wherein the data storage instruction records the type of specified data, and the data storage terminal is a blockchain node in a pre-built blockchain network Before the step, it includes: using a specified language to create a blockchain class in the data storage terminal, and instantiating the blockchain class to create a genesis block, wherein the previous block in the genesis block The hash value of the block is recorded as 0; based on the genesis block, other blocks are generated, wherein the other blocks include the hash value of the previous block; the preset terminal is used as a blockchain node to establish The blockchain network.
在一个实施方式中,所述若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络的步骤之后,包括:接收对所述指定数据的修改指令,其中所述修改指令附带有替换用子数据;根据所述修改指令,将所述指定数据中的待修改子数据替换为所述替换用子数据,从而得到修改后数据;将所述修改后数据发送给所述具有审核权限的区块链节点;接收所述具有审核权限的区块链节点的对所述修改后数据的审核信息,并判断所述审核信息是否满足预设的数据保存条件;若所述审核信息满足预设的数据保存条件,则将所述修改后数据加入所述区块链网络。In one embodiment, if the feedback information satisfies the preset data storage condition, after the step of recording the initial data into the blockchain network, it includes: receiving a modification instruction for the specified data , wherein the modification instruction is accompanied by sub-data for replacement; according to the modification instruction, the sub-data to be modified in the specified data is replaced with the sub-data for replacement, so as to obtain the modified data; the modified Send the data to the blockchain node with audit authority; receive the audit information of the modified data from the blockchain node with audit authority, and judge whether the audit information meets the preset data storage conditions ; If the audit information satisfies the preset data storage conditions, adding the modified data to the blockchain network.
在一个实施方式中,所述若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络的步骤之后,包括:接收基于所述特定数据的特定操作审批指令;从所述区块链中调取所述特定数据,并判断所述特定数据是否符合预设的特定操作审批标准;若所述特定数据符合预设的特定操作审批标准,则执行特定操作。In one embodiment, if the feedback information satisfies the preset data storage condition, after the step of recording the initial data into the blockchain network, it includes: receiving a specific operation based on the specific data Approval instruction; retrieve the specific data from the block chain, and judge whether the specific data meets the preset specific operation approval standard; if the specific data meets the preset specific operation approval standard, execute the specific operate.
本领域技术人员可以理解,图中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定。Those skilled in the art can understand that the structure shown in the figure is only a block diagram of a partial structure related to the solution of this application, and does not constitute a limitation on the computer equipment to which the solution of this application is applied.
本申请的计算机设备,接收对指定数据的数据保存指令;将预先准备好的数据填入初始数据模板中,得到初始数据;将所述初始数据发送给具有审核权限的区块链节点;接收所述具有审核权限的区块链节点的反馈信息;若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。从而解决了数据安全性差、同时数据直接使用程度差的问题。The computer equipment of this application receives the data storage instruction for the specified data; fills the pre-prepared data into the initial data template to obtain the initial data; sends the initial data to the block chain node with audit authority; receives the If the feedback information meets the preset data storage conditions, then record the initial data into the blockchain network. Therefore, the problems of poor data security and poor direct use of data are solved.
本申请一实施例还提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现基于区块链的数据保存方法,应用于数据保存终端,包括:接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点;从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板;将预先准备好的数据填入所述初始数据模板中,得到初始数据;将所述初始数据发送给具有审核权限的区块链节点;接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件;若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, a blockchain-based data storage method is implemented, which is applied to a data storage terminal, including: receiving a specified A data storage instruction for data, wherein the data storage instruction records the type of specified data, and the data storage terminal is a blockchain node in a pre-built blockchain network; Get the initial data template corresponding to the type of the specified data; fill in the pre-prepared data into the initial data template to obtain the initial data; send the initial data to the block chain node with audit authority; receive The feedback information of the block chain node with audit authority, and judge whether the feedback information meets the preset data storage conditions; if the feedback information meets the preset data storage conditions, record the initial data into The blockchain network.
在一个实施方式中,所述初始数据模板由数据框架模板和至少一个数据子模板构成,所述从预设的多个数据模板中调取与所述指定数据的类型对应的初始数据模板的步骤,包括:根据所述指定数据的类型,依据预设的数据类型与模板的对应关系,获取预设的多个数据框架模板与多个数据子模板;获取所述数据保存终端选择的数据框架模板与数据子模板,并将所述数据保存终端选择的数据框架模板与数据子模板组合成为所述初始数据模板;调取所述初始数据模板。In one embodiment, the initial data template is composed of a data frame template and at least one data sub-template, and the step of calling an initial data template corresponding to the specified data type from a plurality of preset data templates , including: according to the type of the specified data, according to the preset corresponding relationship between the data type and the template, obtaining a plurality of preset data frame templates and a plurality of data sub-templates; obtaining the data frame template selected by the data storage terminal and a data sub-template, and combine the data frame template and data sub-template selected by the data storage terminal to form the initial data template; call the initial data template.
在一个实施方式中,所述区块链网络包括指定区块链节点,所述将预先准备好的数据填入所述初始数据模板中,得到初始数据的步骤,包括:接收从指定区块链节点发送的特定数据,其中所述特定数据包括特定对象的身份信息、教育经历或者是否属于黑名单的信息;将所述特定数据填入所述初始数据模板中,得到初始数据。In one embodiment, the block chain network includes a designated block chain node, and the step of filling the pre-prepared data into the initial data template and obtaining the initial data includes: receiving The specific data sent by the node, wherein the specific data includes the identity information of the specific object, education experience, or information about whether it belongs to the blacklist; the specific data is filled into the initial data template to obtain the initial data.
在一个实施方式中,所述区块链网络采用指定共识机制,所述接收所述具有审核权限的区块链节点的反馈信息,并判断所述反馈信息是否满足预设的数据保存条件的步骤,包括:接收基于所述指定共识机制而投选出的多个受托区块链节点的反馈信息,其中所述受托区块链节点具有审核权限,所述反馈信息包括审核通过或者审核未通过;统计审核通过的反馈信息的数量,并判断所述审核通过的反馈信息的数量是否大于预设的数量阈值;若所述审核通过的反馈信息的数量大于预设的数量阈值,则判定反馈信息满足预设的数据保存条件。In one embodiment, the block chain network adopts a designated consensus mechanism, the step of receiving the feedback information from the block chain node with audit authority, and judging whether the feedback information satisfies the preset data storage conditions , including: receiving feedback information from a plurality of entrusted blockchain nodes voted based on the specified consensus mechanism, wherein the entrusted blockchain nodes have audit authority, and the feedback information includes whether the audit is passed or the audit is not passed; Counting the number of feedback information passed through review, and judging whether the number of feedback information passed through review is greater than a preset number threshold; if the number of feedback information passed through review is greater than a preset number threshold, it is determined that the feedback information meets Preset data storage conditions.
在一个实施方式中,所述接收对指定数据的数据保存指令,其中所述数据保存指令记载了指定数据的类型,所述数据保存终端是预先搭建的区块链网络中的一个区块链节点的步骤之前,包括:采用指定语言在所述数据保存终端中创建区块链类,将所述区块链类实例化从而建立创世区块,其中所述创世区块中将前一区块的哈希值记为0;基于所述创世区块,生成其他区块,其中所述其他区块包括前一区块的哈希值;将预设终端作为区块链节点,从而建立所述区块链网络。In one embodiment, the receiving a data storage instruction for specified data, wherein the data storage instruction records the type of specified data, and the data storage terminal is a blockchain node in a pre-built blockchain network Before the step, it includes: using a specified language to create a blockchain class in the data storage terminal, and instantiating the blockchain class to create a genesis block, wherein the previous block in the genesis block The hash value of the block is recorded as 0; based on the genesis block, other blocks are generated, wherein the other blocks include the hash value of the previous block; the preset terminal is used as a blockchain node to establish The blockchain network.
在一个实施方式中,所述若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络的步骤之后,包括:接收对所述指定数据的修改指令,其中所述修改指令附带有替换用子数据;根据所述修改指令,将所述指定数据中的待修改子数据替换为所述替换用子数据,从而得到修改后数据;将所述修改后数据发送给所述具有审核权限的区块链节点;接收所述具有审核权限的区块链节点的对所述修改后数据的审核信息,并判断所述审核信息是否满足预设的数据保存条件;若所述审核信息满足预设的数据保存条件,则将所述修改后数据加入所述区块链网络。In one embodiment, if the feedback information satisfies the preset data storage condition, after the step of recording the initial data into the blockchain network, it includes: receiving a modification instruction for the specified data , wherein the modification instruction is accompanied by sub-data for replacement; according to the modification instruction, the sub-data to be modified in the specified data is replaced with the sub-data for replacement, so as to obtain the modified data; the modified Send the data to the blockchain node with audit authority; receive the audit information of the modified data from the blockchain node with audit authority, and judge whether the audit information meets the preset data storage conditions ; If the audit information satisfies the preset data storage conditions, adding the modified data to the blockchain network.
在一个实施方式中,所述若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络的步骤之后,包括:接收基于所述特定数据的特定操作审批指令;从所述区块链中调取所述特定数据,并判断所述特定数据是否符合预设的特定操作审批标准;若所述特定数据符合预设的特定操作审批标准,则执行特定操作。In one embodiment, if the feedback information satisfies the preset data storage condition, after the step of recording the initial data into the blockchain network, it includes: receiving a specific operation based on the specific data Approval instruction; retrieve the specific data from the block chain, and judge whether the specific data meets the preset specific operation approval standard; if the specific data meets the preset specific operation approval standard, execute the specific operate.
本申请的计算机可读存储介质,接收对指定数据的数据保存指令;将预先准备好的数据填入初始数据模板中,得到初始数据;将所述初始数据发送给具有审核权限的区块链节点;接收所述具有审核权限的区块链节点的反馈信息;若所述反馈信息满足预设的数据保存条件,则将所述初始数据记录入所述区块链网络。从而解决了数据安全性差、同时数据直接使用程度差的问题。The computer-readable storage medium of the present application receives a data storage instruction for the specified data; fills the pre-prepared data into the initial data template to obtain the initial data; sends the initial data to the blockchain node with audit authority ; Receive feedback information from the blockchain node with audit authority; if the feedback information meets the preset data storage conditions, record the initial data into the blockchain network. Therefore, the problems of poor data security and poor direct use of data are solved.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的和实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可以包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双速据率SDRAM(SSRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the computer programs can be stored in a non-volatile computer-readable memory In the medium, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media provided in the present application and used in the embodiments may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (SSRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that, in this document, the term "comprising", "comprising" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, apparatus, article or method comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, apparatus, article, or method. Without further limitations, an element defined by the phrase "comprising a ..." does not preclude the presence of additional same elements in the process, apparatus, article or method comprising the element.
以上所述仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only preferred embodiments of the application, and are not intended to limit the patent scope of the application. Any equivalent structure or equivalent process conversion made by using the specification and drawings of the application, or directly or indirectly used in other related All technical fields are equally included in the patent protection scope of the present application.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910463894.0ACN110334536A (en) | 2019-05-30 | 2019-05-30 | Block chain-based data storage method, device and computer equipment |
| PCT/CN2020/088011WO2020238554A1 (en) | 2019-05-30 | 2020-04-30 | Data storage method and apparatus employing blockchain and computer device |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910463894.0ACN110334536A (en) | 2019-05-30 | 2019-05-30 | Block chain-based data storage method, device and computer equipment |
| Publication Number | Publication Date |
|---|---|
| CN110334536Atrue CN110334536A (en) | 2019-10-15 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910463894.0APendingCN110334536A (en) | 2019-05-30 | 2019-05-30 | Block chain-based data storage method, device and computer equipment |
| Country | Link |
|---|---|
| CN (1) | CN110334536A (en) |
| WO (1) | WO2020238554A1 (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110852800A (en)* | 2019-11-07 | 2020-02-28 | 深圳前海点金保理有限公司 | Method for integrating trade information, terminal device and storage medium |
| CN111553920A (en)* | 2020-05-14 | 2020-08-18 | 无锡北斗星通信息科技有限公司 | Block chain server cultural relic restoration data storage platform |
| CN111913932A (en)* | 2020-05-29 | 2020-11-10 | 上海边界智能科技有限公司 | Data modeling method and device based on block chain |
| WO2020238554A1 (en)* | 2019-05-30 | 2020-12-03 | 深圳壹账通智能科技有限公司 | Data storage method and apparatus employing blockchain and computer device |
| CN112528334A (en)* | 2020-12-16 | 2021-03-19 | 平安普惠企业管理有限公司 | Data acquisition method and device based on block chain network and computer equipment |
| CN115408685A (en)* | 2022-06-27 | 2022-11-29 | 中国银行股份有限公司 | Data detection method, device and equipment for sql injection |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113300889A (en)* | 2020-12-31 | 2021-08-24 | 恬家(上海)信息科技有限公司 | Method for adjusting link width and block link network system |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006185212A (en)* | 2004-12-28 | 2006-07-13 | Ricoh Software Kk | Information management system, information management method and program |
| US20110161375A1 (en)* | 2009-12-24 | 2011-06-30 | Doug Tedder | Systems, methods and articles for template based generation of markup documents to access back office systems |
| CN102868712A (en)* | 2011-07-06 | 2013-01-09 | 阿里巴巴集团控股有限公司 | Method and system for data transmission |
| US20140019967A1 (en)* | 2012-07-16 | 2014-01-16 | International Business Machines Corporation | Preprovisioning using mutated templates |
| US20150088898A1 (en)* | 2013-09-24 | 2015-03-26 | Qliktech International Ab | Methods And Systems For Data Management And Analysis |
| US20150295759A1 (en)* | 2012-10-31 | 2015-10-15 | Telefonaktiebolaget L M Ericsson (Publ) | Method for configuring a communication device using a configuration file template |
| CN105808375A (en)* | 2014-12-31 | 2016-07-27 | 航天信息软件技术有限公司 | Data import method and device |
| CN107147950A (en)* | 2017-06-16 | 2017-09-08 | 环球智达科技(北京)有限公司 | A kind of intelligent television system for supporting self-defined template data to add |
| CN109165856A (en)* | 2018-08-31 | 2019-01-08 | 平安科技(深圳)有限公司 | Examine Dynamic Configuration, device and the storage medium of chain |
| CN109284108A (en)* | 2018-08-30 | 2019-01-29 | 百度在线网络技术(北京)有限公司 | Date storage method, device, electronic equipment and storage medium |
| CN109525671A (en)* | 2018-11-26 | 2019-03-26 | 远光软件股份有限公司 | Date storage method, electronic equipment and storage medium based on block chain |
| CN109615534A (en)* | 2018-10-29 | 2019-04-12 | 平安医疗健康管理股份有限公司 | Model generating method, device, equipment and readable storage medium storing program for executing are audited in air control |
| CN109816563A (en)* | 2019-01-03 | 2019-05-28 | 深圳壹账通智能科技有限公司 | Electronic contract template circulation method, apparatus, computer equipment and storage medium |
| CN109816327A (en)* | 2018-12-14 | 2019-05-28 | 平安国际融资租赁有限公司 | Contract dataset processing method, device, computer equipment and storage medium |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109509108B (en)* | 2018-12-19 | 2023-08-22 | 中国平安财产保险股份有限公司 | Insurance policy processing method and device based on block chain technology and computer equipment |
| CN109711816A (en)* | 2019-01-02 | 2019-05-03 | 深圳壹账通智能科技有限公司 | Cooperative institution's approaches to IM, device, computer equipment and storage medium |
| CN110334536A (en)* | 2019-05-30 | 2019-10-15 | 深圳壹账通智能科技有限公司 | Block chain-based data storage method, device and computer equipment |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006185212A (en)* | 2004-12-28 | 2006-07-13 | Ricoh Software Kk | Information management system, information management method and program |
| US20110161375A1 (en)* | 2009-12-24 | 2011-06-30 | Doug Tedder | Systems, methods and articles for template based generation of markup documents to access back office systems |
| CN102868712A (en)* | 2011-07-06 | 2013-01-09 | 阿里巴巴集团控股有限公司 | Method and system for data transmission |
| US20140019967A1 (en)* | 2012-07-16 | 2014-01-16 | International Business Machines Corporation | Preprovisioning using mutated templates |
| US20150295759A1 (en)* | 2012-10-31 | 2015-10-15 | Telefonaktiebolaget L M Ericsson (Publ) | Method for configuring a communication device using a configuration file template |
| US20150088898A1 (en)* | 2013-09-24 | 2015-03-26 | Qliktech International Ab | Methods And Systems For Data Management And Analysis |
| CN105808375A (en)* | 2014-12-31 | 2016-07-27 | 航天信息软件技术有限公司 | Data import method and device |
| CN107147950A (en)* | 2017-06-16 | 2017-09-08 | 环球智达科技(北京)有限公司 | A kind of intelligent television system for supporting self-defined template data to add |
| CN109284108A (en)* | 2018-08-30 | 2019-01-29 | 百度在线网络技术(北京)有限公司 | Date storage method, device, electronic equipment and storage medium |
| CN109165856A (en)* | 2018-08-31 | 2019-01-08 | 平安科技(深圳)有限公司 | Examine Dynamic Configuration, device and the storage medium of chain |
| CN109615534A (en)* | 2018-10-29 | 2019-04-12 | 平安医疗健康管理股份有限公司 | Model generating method, device, equipment and readable storage medium storing program for executing are audited in air control |
| CN109525671A (en)* | 2018-11-26 | 2019-03-26 | 远光软件股份有限公司 | Date storage method, electronic equipment and storage medium based on block chain |
| CN109816327A (en)* | 2018-12-14 | 2019-05-28 | 平安国际融资租赁有限公司 | Contract dataset processing method, device, computer equipment and storage medium |
| CN109816563A (en)* | 2019-01-03 | 2019-05-28 | 深圳壹账通智能科技有限公司 | Electronic contract template circulation method, apparatus, computer equipment and storage medium |
| Title |
|---|
| K. INBANILA 等: "Enhancement of substitution voices using F1 formant deviation analysis and DTW based template matching", 《2017 INTERNATIONAL CONFERENCE ON WIRELESS COMMUNICATIONS, SIGNAL PROCESSING AND NETWORKING (WISPNET)》, 24 March 2017 (2017-03-24), pages 352 - 356, XP033324052, DOI: 10.1109/WiSPNET.2017.8299777* |
| 李彬 等: "基于异构区块链的多能系统交易体系及关键技术", 《电力系统自动化》, vol. 42, no. 4, 25 February 2018 (2018-02-25), pages 183 - 193* |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2020238554A1 (en)* | 2019-05-30 | 2020-12-03 | 深圳壹账通智能科技有限公司 | Data storage method and apparatus employing blockchain and computer device |
| CN110852800A (en)* | 2019-11-07 | 2020-02-28 | 深圳前海点金保理有限公司 | Method for integrating trade information, terminal device and storage medium |
| CN111553920A (en)* | 2020-05-14 | 2020-08-18 | 无锡北斗星通信息科技有限公司 | Block chain server cultural relic restoration data storage platform |
| CN111553920B (en)* | 2020-05-14 | 2021-06-25 | 上海映城网络科技有限公司 | Block chain server cultural relic restoration data storage platform |
| CN111913932A (en)* | 2020-05-29 | 2020-11-10 | 上海边界智能科技有限公司 | Data modeling method and device based on block chain |
| CN112528334A (en)* | 2020-12-16 | 2021-03-19 | 平安普惠企业管理有限公司 | Data acquisition method and device based on block chain network and computer equipment |
| CN112528334B (en)* | 2020-12-16 | 2024-01-23 | 海南博盈电子竞技有限公司 | Data acquisition method and device based on blockchain network and computer equipment |
| CN115408685A (en)* | 2022-06-27 | 2022-11-29 | 中国银行股份有限公司 | Data detection method, device and equipment for sql injection |
| Publication number | Publication date |
|---|---|
| WO2020238554A1 (en) | 2020-12-03 |
| Publication | Publication Date | Title |
|---|---|---|
| CN110334536A (en) | Block chain-based data storage method, device and computer equipment | |
| US20220271960A1 (en) | Blockchain-based data processing method, apparatus, device, and readable storage medium | |
| CN110533429A (en) | Transaction endorsement method, apparatus and block chain network in block chain | |
| CN114363412B (en) | Message data processing method, device, computer equipment and storage medium | |
| CN110555319B (en) | Resource expected result auditing method and device based on block chain and computer equipment | |
| CN111178894B (en) | Asset type registration and transaction record verification method and system | |
| CN111090581B (en) | Intelligent contract testing method, intelligent contract testing device, computer equipment and storage medium | |
| CN111405505B (en) | Bill processing method, system and storage medium for roaming service | |
| CN108629567A (en) | Declaration information processing method, device, computer equipment and storage medium | |
| CN112801658A (en) | Cross-border resource transfer authenticity auditing method and device and electronic equipment | |
| CN109509108A (en) | Insurance policy processing method, device and computer equipment based on block chain technology | |
| CN111367923A (en) | Data processing method, data processing device, node equipment and storage medium | |
| CN110619511A (en) | Electronic bill processing method and device, readable storage medium and computer equipment | |
| CN110071897A (en) | A kind of block catenary system based on mobile terminal | |
| CN111245913A (en) | Message sending method and device based on gateway, computer equipment and storage medium | |
| CN111552822A (en) | User information report generation method based on block chain node communication | |
| CN110334071A (en) | Property configuration method, device and computer equipment of log4j log framework | |
| CN108062713B (en) | Annuity data file obtaining method and device, computer equipment and storage medium | |
| CN113379577B (en) | A transaction audit method, device and equipment | |
| CN110351091B (en) | Resource replacement method and device based on double signatures and computer equipment | |
| CN114487842A (en) | Data path end-to-end test method, device, computer equipment and storage medium | |
| CN111309571B (en) | Service data control method, device, computer equipment and storage medium | |
| CN113342835A (en) | Method, device, equipment and medium for modifying text to be checked based on block chain | |
| CN114186971B (en) | A business audit form distribution method, device, computer equipment and storage medium | |
| CN116703542A (en) | Financial account opening method, device, terminal and readable storage medium |
| 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 | ||
| WD01 | Invention patent application deemed withdrawn after publication | Application publication date:20191015 | |
| WD01 | Invention patent application deemed withdrawn after publication |