[go: up one dir, main page]

HK1246893B - Method and device for writing business data in block chain system - Google Patents

Method and device for writing business data in block chain system Download PDF

Info

Publication number
HK1246893B
HK1246893B HK18106136.2A HK18106136A HK1246893B HK 1246893 B HK1246893 B HK 1246893B HK 18106136 A HK18106136 A HK 18106136A HK 1246893 B HK1246893 B HK 1246893B
Authority
HK
Hong Kong
Prior art keywords
blockchain
business
data
added
business data
Prior art date
Application number
HK18106136.2A
Other languages
Chinese (zh)
Other versions
HK1246893A1 (en
Inventor
叶国俊
Original Assignee
创新先进技术有限公司
Filing date
Publication date
Application filed by 创新先进技术有限公司 filed Critical 创新先进技术有限公司
Priority to HK18106136.2A priority Critical patent/HK1246893B/en
Publication of HK1246893A1 publication Critical patent/HK1246893A1/en
Publication of HK1246893B publication Critical patent/HK1246893B/en

Links

Description

一种向区块链系统中写入业务数据的方法和装置A method and device for writing business data into a blockchain system

技术领域Technical Field

本申请涉及计算机技术领域,尤其涉及一种向区块链系统中写入业务数据的方法和装置。The present application relates to the field of computer technology, and in particular to a method and apparatus for writing business data into a blockchain system.

背景技术Background Art

随着计算机技术的发展,区块链技术(又称分布式账本技术)以其去中心化、公开透明、不可篡改、可信任等优点,备受青睐,在智能合约、证券交易、电子商务、物联网、社交通讯、文件存储、存在性证明、身份验证、股权众筹等众多领域得到广泛应用。With the development of computer technology, blockchain technology (also known as distributed ledger technology) has become popular for its advantages such as decentralization, openness, transparency, immutability and trustworthiness. It has been widely used in many fields such as smart contracts, securities trading, e-commerce, Internet of Things, social communications, file storage, proof of existence, identity authentication, equity crowdfunding, etc.

在基于区块链技术实现业务系统时,业务系统(因采用区块链技术实现,又可称为区块链系统)需要将业务数据写入区块链。区块链系统接收到需写入区块链的业务数据(在区块链技术中也可称为交易)后,会按照时间顺序,采用先进先出的队列执行这些交易,完成交易验证、实施、数据入链等操作。When implementing a business system based on blockchain technology, the business system (also known as a blockchain system because it uses blockchain technology) needs to write business data to the blockchain. After receiving the business data to be written to the blockchain (also known as transactions in blockchain technology), the blockchain system executes these transactions in chronological order using a first-in-first-out queue, completing operations such as transaction verification, execution, and data entry.

在现有技术中,为了充分合理的利用区块链系统的计算资源,一个区块链系统可能接入多种不同类型的业务,并按照时间的先后顺序平等对待这些不同类型的业务数据。但是,在某些情况下,上述依据时间的先后顺序执行交易的方式无法满足应用需求。例如,对多种保密密级不同的信息进行处理时,区块链系统可能接收到针对不同密级的信息进行处理的交易,这时对不同密级的信息可能需要隔离,避免密级更高的信息的泄露,保障信息安全性。因此,当需要对某项业务进行特殊管控时,现有技术中写入区块链业务数据的方式将无法满足应用需求。In existing technologies, to fully and rationally utilize a blockchain system's computing resources, a blockchain system may integrate multiple different types of services and treat these different types of service data equally, chronologically. However, in some cases, this chronological approach to transaction execution fails to meet application requirements. For example, when processing information with varying levels of confidentiality, a blockchain system may receive transactions tailored to each level. In these cases, information with different levels of confidentiality may need to be isolated to prevent the leakage of higher-level information and ensure information security. Therefore, when specialized controls are required for a particular service, existing approaches to writing blockchain service data fail to meet application requirements.

因此,亟需一种在接入了多种业务类型的区块链系统中,能够满足不同类型业务数据的业务处理需求的业务数据写入方法。Therefore, there is an urgent need for a business data writing method that can meet the business processing requirements of different types of business data in a blockchain system that is connected to multiple business types.

发明内容Summary of the Invention

本申请实施例提供一种向区块链系统中写入业务数据的方法和装置,从而能够满足区块链系统中不同类型的业务数据的处理需求。The embodiments of the present application provide a method and apparatus for writing business data into a blockchain system, thereby meeting the processing requirements of different types of business data in the blockchain system.

本申请实施例采用下述技术方案:The embodiments of this application adopt the following technical solutions:

本申请实施例提供一种向区块链系统中写入业务数据的方法,所述区块链系统包括至少一条区块链,所述方法包括:This embodiment of the present application provides a method for writing business data into a blockchain system, wherein the blockchain system includes at least one blockchain, and the method includes:

接收区块链业务数据写入请求,所述区块链业务数据写入请求中包括待入链业务数据的业务特征信息;Receive a blockchain business data write request, wherein the blockchain business data write request includes business feature information of the business data to be added to the chain;

依据区块链数据记录表和所述待入链业务数据的业务特征信息,确定与所述待入链业务数据相匹配的区块链;其中,所述区块链数据记录表中记录有区块链的业务类型标识信息,用于反映区块链中已入链业务数据的业务特征信息;Determining a blockchain that matches the business data to be added to the chain based on the blockchain data record table and the business characteristic information of the business data to be added to the chain; wherein the blockchain data record table records the business type identification information of the blockchain, which is used to reflect the business characteristic information of the business data that has been added to the chain in the blockchain;

将所述待入链业务数据的执行结果写入与所述待入链业务数据相匹配的区块链。The execution result of the business data to be entered into the chain is written into the blockchain that matches the business data to be entered into the chain.

优选地,本申请实施例提供的方法中,依据区块链数据记录表和所述待入链业务数据的业务特征信息,确定与所述待入链业务数据相匹配的区块链,包括:Preferably, in the method provided in the embodiment of the present application, determining a blockchain that matches the business data to be added to the chain based on the blockchain data record table and the business feature information of the business data to be added to the chain includes:

当在所述区块链数据记录表中查找到满足第一预设条件的第一业务类型标识信息时,将所述第一业务类型标识信息所对应的区块链确定为与所述待入链业务数据相匹配的区块链;When first business type identification information that meets the first preset condition is found in the blockchain data record table, the blockchain corresponding to the first business type identification information is determined as the blockchain that matches the business data to be added to the chain;

其中,满足所述第一预设条件包括:第一业务类型标识信息与所述待入链业务数据的业务特征信息相匹配。Among them, satisfying the first preset condition includes: the first business type identification information matches the business feature information of the business data to be linked.

优选地,本申请实施例提供的方法中,所述业务特征信息取为2的N次幂,其中,所述N为0或正整数;Preferably, in the method provided in the embodiment of the present application, the service feature information is taken as 2 to the power of N, where N is 0 or a positive integer;

所述区块链的业务类型标识信息取为所述区块链中已入链业务数据的不同业务特征信息之和。The business type identification information of the blockchain is taken as the sum of different business feature information of the business data that has been entered into the blockchain.

优选地,本申请实施例提供的方法中,第一业务类型标识信息与所述待入链业务数据的业务特征信息相匹配,具体为:Preferably, in the method provided in the embodiment of the present application, the first service type identification information matches the service feature information of the service data to be in-linked, specifically:

若所述第一业务类型标识信息的值与所述待入链业务数据的业务特征信息的值的逻辑与操作等于所述待入链业务数据的业务特征信息的值,则所述第一业务类型标识信息与所述待入链业务数据的业务特征信息相匹配。If the logical AND operation of the value of the first business type identification information and the value of the business characteristic information of the to-be-linked business data is equal to the value of the business characteristic information of the to-be-linked business data, then the first business type identification information matches the business characteristic information of the to-be-linked business data.

优选地,本申请实施例提供的方法中,依据区块链数据记录表和所述待入链业务数据的业务特征信息,确定与所述待入链业务数据相匹配的区块链,还包括:Preferably, in the method provided in the embodiment of the present application, determining a blockchain that matches the business data to be added to the chain based on the blockchain data record table and the business feature information of the business data to be added to the chain, further includes:

当在所述区块链数据记录表中未查找到满足所述第一预设条件的第一业务类型标识信息时,将预设的第二业务类型标识信息所对应的区块链确定为与所述待入链业务数据相匹配的区块链。When the first business type identification information that meets the first preset condition is not found in the blockchain data record table, the blockchain corresponding to the preset second business type identification information is determined as the blockchain that matches the business data to be entered into the chain.

优选地,本申请实施例提供的方法中,所述区块链数据记录表中还记录有区块链的状态信息,则,所述第一业务类型标识信息满足所述第一预设条件还包括:Preferably, in the method provided in the embodiment of the present application, the blockchain data record table further records blockchain status information, and then, the first business type identification information satisfies the first preset condition and further includes:

所述第一业务类型标识信息所对应的区块链的状态信息为有效状态。The status information of the blockchain corresponding to the first business type identification information is a valid status.

优选地,本申请实施例提供的方法中,所述区块链数据记录表中还记录有区块链的最后区块哈希值和对应的时间戳,则将所述待入链业务数据的执行结果写入与所述待入链业务数据相匹配的区块链,包括:Preferably, in the method provided in the embodiment of the present application, the blockchain data record table further records the last block hash value and the corresponding timestamp of the blockchain, and then writing the execution result of the business data to be entered into the blockchain that matches the business data to be entered into the chain includes:

提取与所述待入链业务数据相匹配的区块链所对应的最后区块哈希值和对应的时间戳;Extract the last block hash value and corresponding timestamp corresponding to the blockchain that matches the business data to be added to the chain;

将所述待入链业务数据的执行结果、所述最后区块哈希值和对应的时间戳写入所述区块链中的新的区块中;Writing the execution result of the business data to be entered into the chain, the last block hash value and the corresponding timestamp into a new block in the blockchain;

将所述新的区块的哈希值和对应的时间戳作为新的最后区块哈希值和对应的时间戳更新到所述区块链数据记录表中。The hash value and corresponding timestamp of the new block are updated into the blockchain data record table as the new last block hash value and corresponding timestamp.

优选地,本申请实施例提供的方法中,所述区块链系统中包含一条作为主链的区块链,在接收区块链业务数据写入请求之后,所述方法还包括:Preferably, in the method provided in the embodiment of the present application, the blockchain system includes a blockchain as a main chain. After receiving the blockchain business data write request, the method further includes:

当满足第二预设条件时,在所述区块链系统中增加新的区块链作为侧链,并在所述区块链数据记录表中增加与所述新的区块链及其业务类型标识信息相对应的记录。When the second preset condition is met, a new blockchain is added to the blockchain system as a side chain, and a record corresponding to the new blockchain and its business type identification information is added to the blockchain data record table.

优选地,本申请实施例提供的方法中,满足所述第二预设条件包括:Preferably, in the method provided in the embodiment of the present application, satisfying the second preset condition includes:

所述区块链业务数据写入请求中包含的待入链业务数据的业务特征信息与预设业务特征信息相匹配;和/或The business characteristic information of the business data to be added to the blockchain contained in the blockchain business data write request matches the preset business characteristic information; and/or

接收到的所述区块链业务数据写入请求的并发数量达到预设阈值;和/或The concurrent number of received blockchain business data write requests reaches a preset threshold; and/or

预设的增加新的区块链作为侧链的时间到达。The scheduled time for adding a new blockchain as a sidechain has arrived.

优选地,本申请实施例提供的方法中,所述区块链系统中包含一条作为主链的区块链和至少一条作为侧链的区块链,则在接收区块链业务数据写入请求之后,所述方法还包括:Preferably, in the method provided in the embodiment of the present application, the blockchain system includes a blockchain as a main chain and at least one blockchain as a side chain. Then, after receiving the blockchain business data write request, the method further includes:

当满足第三预设条件时,在所述区块链系统中终止作为侧链的区块链,并在所述区块链数据记录表中更新与被终止的所述区块链相对应的记录。When the third preset condition is met, the blockchain serving as the side chain is terminated in the blockchain system, and a record corresponding to the terminated blockchain is updated in the blockchain data record table.

优选地,本申请实施例提供的方法中,满足所述第三预设条件包括:Preferably, in the method provided in the embodiment of the present application, satisfying the third preset condition includes:

接收到的所述区块链业务数据写入请求的并发数量小于预设阈值;和/或The concurrent number of received blockchain business data write requests is less than a preset threshold; and/or

侧链的有效时间到达。The side chain's validity period has arrived.

优选地,本申请实施例提供的方法中,在所述区块链数据记录表中更新与被终止的所述区块链相对应的记录,包括:Preferably, in the method provided in the embodiment of the present application, updating the record corresponding to the terminated blockchain in the blockchain data record table includes:

删除与被终止的所述区块链相对应的记录;或者,Deleting the records corresponding to the terminated blockchain; or

当所述区块链数据记录表中记录有被终止的所述区块链的状态信息时,将被终止的所述区块链的状态信息修改为无效状态。When the state information of the terminated blockchain is recorded in the blockchain data record table, the state information of the terminated blockchain is modified to an invalid state.

本申请实施例还提供一种向区块链系统中写入业务数据的装置,所述区块链系统包括至少一条区块链,所述装置包括:An embodiment of the present application further provides a device for writing business data into a blockchain system, wherein the blockchain system includes at least one blockchain, and the device includes:

请求接收模块,用于接收区块链业务数据写入请求,所述区块链业务数据写入请求中包括待入链业务数据的业务特征信息;A request receiving module, configured to receive a blockchain business data write request, wherein the blockchain business data write request includes business feature information of the business data to be added to the chain;

入链区块链确定模块,用于依据区块链数据记录表和所述待入链业务数据的业务特征信息,确定与所述待入链业务数据相匹配的区块链;其中,所述区块链数据记录表中记录有区块链的业务类型标识信息,所述业务类型标识信息用于反映区块链中已入链业务数据的业务特征信息;An entry blockchain determination module is configured to determine a blockchain that matches the business data to be entered into the chain based on the blockchain data record table and the business characteristic information of the business data to be entered into the chain; wherein the blockchain data record table records the business type identification information of the blockchain, and the business type identification information is used to reflect the business characteristic information of the business data that has been entered into the chain in the blockchain;

入链模块,用于将所述待入链业务数据的执行结果写入与所述待入链业务数据相匹配的区块链。The on-chain module is used to write the execution result of the business data to be on-chain into the blockchain that matches the business data to be on-chain.

本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:At least one of the above technical solutions adopted in the embodiments of the present application can achieve the following beneficial effects:

在本申请实施例中,区块链系统在接收到包括有待入链业务数据的业务特征信息的区块链业务数据写入请求后,由于区块链数据记录表中记录有区块链的业务类型标识信息,且这些标识信息能够反映区块链中已入链业务数据的业务特征信息,因此,依据区块链数据记录表和待入链业务数据的业务特征信息,可以确定出与待入链业务数据相匹配的区块链,从而可将待入链业务数据的执行结果写入相匹配的区块链。采用本申请实施例的技术方案,可以根据待入链业务数据的业务特征信息选择相匹配的区块链完成入链,并建立区块链数据记录表能够对与业务类型相对应的各区块链进行记录,因此使得对不同类型业务数据的不同处理成为可能,从而能够满足区块链系统中不同类型的业务数据的处理需求。In an embodiment of the present application, after the blockchain system receives a blockchain business data write request including business feature information of the business data to be added to the chain, since the blockchain data record table records the business type identification information of the blockchain, and this identification information can reflect the business feature information of the business data already added to the chain in the blockchain, therefore, based on the blockchain data record table and the business feature information of the business data to be added to the chain, the blockchain that matches the business data to be added to the chain can be determined, so that the execution result of the business data to be added to the chain can be written to the matching blockchain. Using the technical solution of the embodiment of the present application, a matching blockchain can be selected based on the business feature information of the business data to be added to the chain to complete the addition, and a blockchain data record table can be established to record each blockchain corresponding to the business type, thereby making it possible to process different types of business data differently, thereby meeting the processing requirements of different types of business data in the blockchain system.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

图1为本申请实施例提供的一种向区块链系统中写入业务数据的方法的流程示意图;FIG1 is a flow chart of a method for writing business data into a blockchain system according to an embodiment of the present application;

图2为本申请实施例提供的第二种向区块链系统中写入业务数据的方法的流程示意图;FIG2 is a flow chart of a second method for writing business data into a blockchain system according to an embodiment of the present application;

图3为本申请中的区块链系统分出区块链侧链的示意图;FIG3 is a schematic diagram of a blockchain system in this application that separates a blockchain side chain;

图4为本申请中的区块链系统分出区块链侧链的另一示意图;FIG4 is another schematic diagram of a blockchain side chain separated from the blockchain system in this application;

图5为本申请中的区块链系统终止区块链侧链的示意图;FIG5 is a schematic diagram of the blockchain system in this application terminating a blockchain side chain;

图6为本申请实施例提供的一种向区块链系统中写入业务数据的装置的结构示意图。FIG6 is a schematic diagram of the structure of an apparatus for writing business data into a blockchain system provided by an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。To make the purpose, technical solutions, and advantages of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

以下结合附图,详细说明本申请各实施例提供的技术方案。The following describes in detail the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.

本申请实施例提供了一种向区块链系统中写入业务数据的方法,上述区块链系统包括至少一条区块链。若区块链系统中仅包含一条区块链,该条区块链可理解为该区块链系统的主链,区块链系统所接入的各类业务数据的执行结果均默认地写入该条主链。在具体实施时,根据区块链系统的交易处理要求,按照接收到区块链业务数据写入请求的时间先后顺序执行待入链业务数据,并按照时间先后顺序写入上述主链中。The present application provides a method for writing business data into a blockchain system, wherein the blockchain system includes at least one blockchain. If the blockchain system includes only one blockchain, this blockchain can be considered the blockchain system's main chain, and the execution results of all business data accessed by the blockchain system are written to this main chain by default. In specific implementations, based on the transaction processing requirements of the blockchain system, the business data to be entered into the blockchain is executed in the order in which the blockchain business data write requests are received, and is written to the main chain in chronological order.

若区块链系统中包含多条区块链,则其中一条作为该区块链系统的主链,而其余各条区块链作为该区块链系统的侧链。在本申请实施例所称的区块链系统中,有一条主链,在没有特殊配置的情况下,区块链系统所接入的各类业务数据的执行结果均默认地写入该条主链。而在需要时,区块链系统可以分出一条或多条侧链,各条侧链对应处理一种或多种不同的业务类型的业务数据,进而可以依据业务数据的业务特征信息,将某类或某些类有特殊处理要求的业务数据分配到侧链中处理,而不会影响到写入主链和写入其他侧链(如果存在)的其他业务类型的业务数据的处理,因此能够满足不同类型业务数据的业务处理需求。以下将详细说明举例本申请实施例的实施过程。If a blockchain system contains multiple blockchains, one of them serves as the main chain of the blockchain system, and the remaining blockchains serve as side chains of the blockchain system. In the blockchain system referred to in the embodiment of the present application, there is a main chain. In the absence of special configuration, the execution results of all types of business data accessed by the blockchain system are written to the main chain by default. When necessary, the blockchain system can be divided into one or more side chains, each of which processes business data of one or more different business types. Then, based on the business feature information of the business data, a certain type or certain types of business data with special processing requirements can be allocated to the side chain for processing, without affecting the processing of business data of other business types written to the main chain and written to other side chains (if any), thereby meeting the business processing requirements of different types of business data. The following will describe in detail the implementation process of the embodiment of the present application.

参见图1所示,本申请实施例提供的向区块链系统中写入业务数据的方法,可具体包括:As shown in FIG1 , the method for writing business data into a blockchain system provided in an embodiment of the present application may specifically include:

S101:接收区块链业务数据写入请求,区块链业务数据写入请求中包括待入链业务数据的业务特征信息;S101: Receive a blockchain business data write request, where the blockchain business data write request includes business feature information of the business data to be added to the blockchain;

S102:依据区块链数据记录表和区块链业务数据请求中的业务特征信息,确定与待入链业务数据相匹配的区块链;其中,区块链数据记录表中记录有区块链的业务类型标识信息,业务类型标识信息用于反映区块链中已入链业务数据的业务特征信息;S102: Determine a blockchain that matches the business data to be added to the blockchain based on the blockchain data record table and the business feature information in the blockchain business data request; wherein the blockchain data record table records the business type identification information of the blockchain, and the business type identification information is used to reflect the business feature information of the business data that has been added to the blockchain;

S103:将待入链业务数据的执行结果写入与待入链业务数据相匹配的区块链。S103: Writing the execution result of the business data to be added to the blockchain that matches the business data to be added to the blockchain.

上述区块链系统执行步骤S101接收到的区块链业务数据写入请求(在区块链技术体系中,又可称为交易,英文名称为transaction,可简写为tx),用于请求执行待入链业务数据,以便将待入链业务数据的执行结果写入区块链系统中的区块链。上述请求中包含有待入链业务数据的相关信息,例如待入链业务数据的业务特征信息等。待入链业务数据的业务特征信息用于反映待入链业务数据属于哪种类型的业务数据,以便区分不同业务类型的业务数据。在本申请实施例中,业务数据的类型可以按照多种不同的维度进行划分。例如,可以按照业务数据所涉及到的处理方式进行划分,分为合约类业务、转账类业务等等;也可以按照业务数据所涉及到的信息的保密程度进行划分,分为绝密、机密、秘密等等。The blockchain system executes the blockchain business data write request (also called transaction in the blockchain technology system, abbreviated as tx) received in step S101, which is used to request the execution of the business data to be entered into the chain, so as to write the execution result of the business data to be entered into the chain into the blockchain in the blockchain system. The above request contains relevant information about the business data to be entered into the chain, such as the business feature information of the business data to be entered into the chain. The business feature information of the business data to be entered into the chain is used to reflect the type of business data to be entered into the chain, so as to distinguish business data of different business types. In an embodiment of the present application, the type of business data can be divided according to a variety of different dimensions. For example, it can be divided according to the processing method involved in the business data, such as contract-type business, transfer-type business, etc.; it can also be divided according to the confidentiality level of the information involved in the business data, such as top secret, confidential, secret, etc.

在本申请实施例中,可以采用A、B、C、D这种字符形式表示业务数据的业务特征信息,只要能够对不同类型的业务数据进行区分即可。假设区块链系统中包括三条侧链,分别用于处理类型A和类型D的业务(可表示为【A,D】)、类型B和类型D的业务(可表示为【B,C】)、以及类型D的业务(可表示为【D】),则在确定与待入链业务数据相匹配的区块链时,可以遍历区块链数据记录表,将待入链业务数据的业务特征信息(此处可体现为A、B、C、D这种字符形式)与区块链数据记录表中记录的区块链的业务类型标识信息(此处可体现为【A,D】、【B,C】、【D】的形式)进行字符串的匹配,从而确定出待入链业务数据应写入的区块链,进而实现后续的入链操作。In the embodiment of the present application, the business characteristic information of the business data can be represented by characters such as A, B, C, and D, as long as different types of business data can be distinguished. Assuming that the blockchain system includes three side chains, which are respectively used to process type A and type D businesses (which can be represented as [A, D]), type B and type D businesses (which can be represented as [B, C]), and type D businesses (which can be represented as [D]), when determining the blockchain that matches the business data to be added to the chain, the blockchain data record table can be traversed, and the business characteristic information of the business data to be added to the chain (which can be represented as characters such as A, B, C, and D here) can be matched with the business type identification information of the blockchain recorded in the blockchain data record table (which can be represented as [A, D], [B, C], and [D] here) to determine the blockchain to which the business data to be added should be written, thereby realizing the subsequent addition operation.

在本申请中的一个优选实施例在于,将业务特征信息表示为2的N次幂的形式,其中,参数N为0或正整数。采用这种形式表现业务数据的业务特征信息,好处在于:当一条侧链中同时接入多种不同业务类型的业务数据时,业务特征信息体现为2的N次幂形式,即2N(N≥0)的形式,能够更方便的进行该条侧链所对应的业务类型标识信息的计算以及后续的逻辑运算。后文中将进一步举例说明业务类型标识信息的计算过程和逻辑运算的过程。A preferred embodiment of this application is to represent service feature information as a power of 2, where the parameter N is 0 or a positive integer. This representation of service feature information offers the advantage that when a side chain simultaneously accesses service data of multiple different service types, the service feature information is represented as a power of 2, i.e., 2N (N ≥ 0), making it easier to calculate the service type identification information corresponding to the side chain and perform subsequent logical operations. The following text further illustrates the process of calculating the service type identification information and performing logical operations.

区块链业务数据写入请求中除包含待入链业务数据的业务特征信息外,还可以包含业务发起方(也可称为交易发起方)用私钥签名得到的信息,用于在区块链系统处理该请求对应的业务数据时结合公钥进行验证:若验证通过则表示该交易合法,允许接入当前的区块链系统,进行后续入链步骤,否则将拒绝执行该项交易。In addition to the business feature information of the business data to be added to the chain, the blockchain business data write request may also include information signed by the business initiator (also known as the transaction initiator) using the private key, which is used in conjunction with the public key for verification when the blockchain system processes the business data corresponding to the request: if the verification is successful, it means that the transaction is legal and is allowed to access the current blockchain system and proceed to the subsequent chain-in steps; otherwise, the transaction will be rejected.

区块链系统在接收到区块链业务数据写入请求后,可将该请求对应的待入链业务数据(也可称为交易)保存到本地缓存(可以理解为区块链系统的交易池),以便进行后续处理。在缓存时,可以采用表1所示的交易模型表的表结构,将与待入链业务数据相关的信息进行记录。After receiving a request to write blockchain business data, the blockchain system can save the business data (also known as the transaction) to be added to the chain to the local cache (which can be understood as the blockchain system's transaction pool) for subsequent processing. When caching, the transaction model table structure shown in Table 1 can be used to record information related to the business data to be added to the chain.

表1交易模型表结构示例Table 1 Example of transaction model table structure

在接收到区块链业务数据写入请求后,区块链系统执行步骤S102,依据区块链数据记录表和所述待入链业务数据的业务特征信息,确定与所述待入链业务数据相匹配的区块链。区块链数据记录表中记录的区块链的业务类型标识信息,对于区块链系统中的侧链而言,可以依据写入侧链的一种或多种业务数据的业务特征信息确定得到,因此,该侧链的业务类型标识信息可以反映该侧链中已入链业务数据的业务特征信息。对于区块链系统中的主链而言,其业务类型标识信息可以采用预设的标识符来表示,例如“*”等,只要能够与侧链的业务类型标识信息显著区分开,在后续与待入链业务数据的业务特征信息的值进行逻辑运算时不会混淆结论即可。After receiving a blockchain business data write request, the blockchain system executes step S102 to determine a blockchain that matches the business data to be added to the chain based on the blockchain data record table and the business characteristic information of the business data to be added to the chain. For side chains in the blockchain system, the business type identification information of the blockchain recorded in the blockchain data record table can be determined based on the business characteristic information of one or more business data written to the side chain. Therefore, the business type identification information of the side chain can reflect the business characteristic information of the business data already added to the chain in the side chain. For the main chain in the blockchain system, its business type identification information can be represented by a preset identifier, such as "*", as long as it can be clearly distinguished from the business type identification information of the side chain and does not confuse the conclusion when performing subsequent logical operations with the value of the business characteristic information of the business data to be added to the chain.

以以上业务特征信息体现为2的N次幂形式,即2N(N≥0)形式为例。若一区块链侧链A中包含有两种类型的业务数据,那么依据这两种业务数据的业务特征信息即可确定这一区块链侧链A的业务类型标识信息。具体地,假设第一种业务数据的业务特征信息的值为20(此时N的值取为0),具体对应到卖家业务;第二种业务数据的业务特征信息的值为21(此时N的值取为1),具体对应到手机认证业务。则本例中的区块链侧链A的业务类型标识信息可以取为写入该侧链A的两种业务数据的业务特征信息的值的和,即20+21,可表示为十进制数,记为3。For example, let's take the business characteristic information above, expressed as 2 raised to the power of N, or 2 N (N ≥ 0). If a blockchain sidechain A contains two types of business data, then the business type identification information for blockchain sidechain A can be determined based on the business characteristic information of these two types of business data. Specifically, assume that the business characteristic information value of the first type of business data is 2 0 (in this case, the value of N is 0), corresponding to the seller business; and the business characteristic information value of the second type of business data is 2 1 (in this case, the value of N is 1), corresponding to the mobile phone authentication business. In this example, the business type identification information for blockchain sidechain A can be taken as the sum of the business characteristic information values of the two types of business data written into sidechain A, namely 2 0 + 2 1 , which can be expressed as a decimal number and recorded as 3.

由于区块链数据记录表中呈现了区块链与写入该区块链的业务数据的业务类型(业务类型通过能够反映已入链业务数据的业务特征信息的业务类型标识信息体现)之间的对应关系,因此,执行步骤S102就能够依据待入链业务数据的业务特征信息(业务特征信息能够表征待入链业务数据的业务类型),在区块链数据记录表中查找确定出与待入链业务数据相匹配的区块链,进而能够执行步骤S103完成待入链业务数据的入链。Since the blockchain data record table presents the correspondence between the blockchain and the business type of the business data written into the blockchain (the business type is reflected by the business type identification information that can reflect the business characteristic information of the business data that has been entered into the chain), therefore, executing step S102 can search and determine the blockchain that matches the business data to be entered into the chain in the blockchain data record table based on the business characteristic information of the business data to be entered into the chain (the business characteristic information can represent the business type of the business data to be entered into the chain), and then execute step S103 to complete the entry of the business data to be entered into the chain.

具体地,在执行步骤S102时,可优选采用以下方法:Specifically, when executing step S102, the following method may be preferably adopted:

当在区块链数据记录表中查找到满足第一预设条件的第一业务类型标识信息时,将第一业务类型标识信息所对应的区块链确定为与待入链业务数据相匹配的区块链;When first business type identification information that meets the first preset condition is found in the blockchain data record table, the blockchain corresponding to the first business type identification information is determined as the blockchain that matches the business data to be added to the chain;

其中,第一业务类型标识信息满足第一预设条件包括:第一业务类型标识信息与待入链业务数据的业务特征信息相匹配。The first business type identification information satisfies the first preset condition, which includes: the first business type identification information matches the business feature information of the to-be-linked business data.

鉴于区块链数据记录表中已建立有区块链与业务类型标识信息的对应关系,能够反映区块链中接入了哪些类型的业务数据,因此,若待入链业务数据的业务特征信息与区块链数据记录表中记录的第一业务类型标识信息相匹配,则可据此为待入链业务数据确定出相匹配的区块链,即确定待入链业务数据这一类型的业务数据应写入哪一条区块链。Given that a correspondence between blockchains and business type identification information has been established in the blockchain data record table, it can reflect what types of business data are connected to the blockchain. Therefore, if the business feature information of the business data to be entered into the chain matches the first business type identification information recorded in the blockchain data record table, the matching blockchain can be determined for the business data to be entered into the chain, that is, it can be determined which blockchain the business data of this type should be written into.

进一步地,在判断上述第一预设条件是否达成,即判断第一业务类型标识信息与待入链业务数据的业务特征信息是否相匹配时,可以采用以下方式:若第一业务类型标识信息的值与待入链业务数据的业务特征信息的值的逻辑与操作等于待入链业务数据的业务特征信息的值,则第一业务类型标识信息与待入链业务数据的业务特征信息相匹配。具体操作时,可以将待入链业务数据的业务特征信息的值与区块链数据记录表中记录的各业务类型标识符逐个地进行逻辑与操作,直至找到使得逻辑与操作的值等于上述业务特征信息的值的第一业务类型标识信息。也可以计算逻辑表达式“业务特征信息的值&第一业务类型标识信息的值==业务特征信息的值”的结果是否为真,则使得该逻辑表达式的值为“真”的第一业务类型标识信息即可确定为与待入链业务数据的业务特征信息相匹配。Furthermore, when determining whether the aforementioned first preset condition is met, that is, determining whether the first business type identification information matches the business characteristic information of the business data to be added to the chain, the following method can be used: if the logical AND operation of the value of the first business type identification information and the value of the business characteristic information of the business data to be added to the chain equals the value of the business characteristic information of the business data to be added to the chain, then the first business type identification information matches the business characteristic information of the business data to be added to the chain. Specifically, a logical AND operation can be performed on the value of the business characteristic information of the business data to be added to the chain with each business type identifier recorded in the blockchain data record table one by one until the first business type identification information is found such that the value of the logical AND operation equals the value of the aforementioned business characteristic information. Alternatively, the logical expression "value of business characteristic information & value of first business type identification information == value of business characteristic information" can be calculated to determine whether the result is true. In this case, the first business type identification information for which the logical expression evaluates to "true" is determined to match the business characteristic information of the business data to be added to the chain.

延续以上示例,假设接收到的待入链业务数据是手机认证类业务,该待入链业务数据所对应的业务特征信息的值为21(此时N的值取为1)。将此时的业务特征信息的值21与区块链数据记录表中记录的业务类型标识信息的值进行逻辑与运算可知,当业务特征信息的值21与区块链侧链A的业务类型标识信息的值3(20+21)进行二进制与运算时的计算结果为2,等于业务特征信息的值21,则可将区块链侧链A的业务类型标识信息作为与待入链业务数据的业务特征信息相匹配的第一业务类型标识信息,从而可将区块链侧链A确定为与待入链业务数据相匹配的区块链,表示应将待入链业务数据写入区块链侧链A。Continuing with the above example, assume that the received business data to be added to the chain is a mobile phone authentication business, and the value of the business feature information corresponding to the business data to be added to the chain is 2 1 (the value of N is 1 in this case). Performing a logical AND operation on the current business feature information value 2 1 and the value of the business type identification information recorded in the blockchain data record table shows that when the business feature information value 2 1 is binary ANDed with the value 3 (2 0 + 2 1 ) of the business type identification information of blockchain side chain A, the result is 2, which is equal to the business feature information value 2 1. Therefore, the business type identification information of blockchain side chain A can be used as the first business type identification information that matches the business feature information of the business data to be added to the chain, thereby determining blockchain side chain A as the blockchain that matches the business data to be added to the chain, indicating that the business data to be added to the chain should be written to blockchain side chain A.

在进行二进制与运算时,先将十进制形式表示的业务类型标识信息转化为二进制字符串,然后依据二进制与运算的计算原理进行运算:0&0=0,0&1=0,1&0=0,1&1=1,从而得到运算结果。例如上例中的运算过程可细化为:When performing a binary AND operation, the service type identification information represented in decimal form is first converted into a binary string, and then the operation is performed according to the calculation principle of the binary AND operation: 0 & 0 = 0, 0 & 1 = 0, 1 & 0 = 0, 1 & 1 = 1, thereby obtaining the operation result. For example, the operation process in the above example can be refined as follows:

2&3→10&11=10→2=21 2&3→10&11=10→2=2 1

在计算机中具体实现上述查找相匹配的第一业务类型标识信息的过程时,可以有多种方式。例如,可以采用语句SQL的判断语句实现,从区块链数据记录表中选择使得“业务特征信息的值&业务类型标识信息的值==业务特征信息的值”的值为“真”的第一业务类型标识信息。也可以将区块链数据记录表的数据提取到内存中,通过程序的循环比较完成查找。在此基础上还能进一步对循环比较的过程进行优化,例如对区块链数据记录表中的业务类型标识信息进行划分,将满足“业务类型标识信息的值%2==0”这一条件,即业务类型标识信息的值是2的倍数的相关记录放入一个hash表(哈希表)中,将不是2的倍数的相关记录放到一个循环队列里面进行遍历,从而可以减少循环的次数,提高查找效率。There are various ways to implement the aforementioned process of searching for matching first business type identification information on a computer. For example, an SQL statement can be used to select the first business type identification information from the blockchain data record table that satisfies the condition "business feature information value & business type identification information value == business feature information value" and evaluates to "true." Alternatively, the data from the blockchain data record table can be extracted into memory and the search performed through a program's loop comparison. This loop comparison process can be further optimized, for example by partitioning the business type identification information in the blockchain data record table and placing records that meet the condition "business type identification information value % 2 == 0" (i.e., where the business type identification information value is a multiple of 2) into a hash table. Records that are not multiples of 2 can be placed in a loop queue for traversal, thereby reducing the number of loops and improving search efficiency.

在采用上述具体步骤实施步骤S102时,也可能出现在区块链数据记录表中无法查找到满足上述第一预设条件的第一业务类型标识信息的情况,此时可理解为,区块链系统中并未包含接入了待入链业务数据这类业务数据的侧链。此时,可以直接将预设的第二业务类型标识信息所对应的区块链确定为与待入链业务数据相匹配的区块链。在具体实现时,预设的第二业务类型标识信息可以取为主链所对应的标识符,例如表示为“*”,从而将与待入链业务数据相匹配的区块链确定为区块链系统中的主链,将未分配到侧链处理的待入链业务数据的执行结果写入上述主链。When implementing step S102 using the above specific steps, it is possible that the blockchain data record table cannot find the first business type identification information that meets the above first preset condition. In this case, it can be understood that the blockchain system does not include a side chain that accesses business data such as the business data to be added to the chain. In this case, the blockchain corresponding to the preset second business type identification information can be directly determined as the blockchain that matches the business data to be added to the chain. In specific implementations, the preset second business type identification information can be the identifier corresponding to the main chain, such as "*", so that the blockchain that matches the business data to be added to the chain is determined as the main chain in the blockchain system, and the execution results of the business data to be added to the chain that are not assigned to the side chain for processing are written to the above main chain.

在本申请的实施例中,区块链数据记录表中除记录区块链对应的业务类型标识信息外,还可记录有区块链的状态信息,区块链的状态信息用于反映区块链是否有效,即对应的区块链是否能够接收新增的区块。对于区块链系统中的主链而言,主链的状态信息通常始终保持有效状态,否则可能导致区块链系统无法正常运行。对于区块链系统中的侧链而言,当允许向该侧链中接入该侧链所对应的业务类型(即该侧链的业务类型标识符所反映出来的业务类型)时,侧链的状态信息为有效状态;当不允许向该侧链中接入该侧链所对应的业务类型时,侧链的状态信息为无效状态。In an embodiment of the present application, in addition to recording the business type identification information corresponding to the blockchain, the blockchain data record table may also record the status information of the blockchain. The status information of the blockchain is used to reflect whether the blockchain is valid, that is, whether the corresponding blockchain can receive newly added blocks. For the main chain in the blockchain system, the status information of the main chain usually remains valid at all times, otherwise the blockchain system may not operate normally. For the side chain in the blockchain system, when the business type corresponding to the side chain is allowed to be accessed to the side chain (that is, the business type reflected by the business type identifier of the side chain), the status information of the side chain is valid; when the business type corresponding to the side chain is not allowed to be accessed to the side chain, the status information of the side chain is invalid.

在依据区块链数据记录表确定与待入链业务数据相匹配的区块链的过程中,除考虑区块链的业务类型标识信息与待入链业务数据的业务特征信息的匹配性问题之外,还可考虑区块链自身的有效性问题。若区块链数据记录表中记录的区块链状态信息为无效状态,则不应将待入链业务数据写入到这样无效的区块链。因此,在确定上述第一业务类型标识信息时,还可要求第一业务类型标识信息所对应的区块链的状态信息为有效状态。When determining a blockchain that matches the business data to be added to the chain based on the blockchain data record table, in addition to considering the compatibility between the blockchain's business type identification information and the business characteristics of the business data to be added to the chain, the validity of the blockchain itself must also be considered. If the blockchain status information recorded in the blockchain data record table is invalid, the business data to be added to the chain should not be written to such an invalid blockchain. Therefore, when determining the first business type identification information, it is also required that the status information of the blockchain corresponding to the first business type identification information is valid.

在具体实施时,通常要求两个条件同时满足,即第一业务类型标识信息满足第一预设条件包括:第一业务类型标识信息与待入链业务数据的业务特征信息相匹配,并且,第一业务类型标识信息所对应的区块链的状态信息为有效状态。在判断流程的具体实现时,对两个条件进行判断的顺序可以互换,本申请实施例不做限定。也就是说,可以先判断区块数据记录表中记录的区块链的状态信息,进而只在状态信息为有效状态的区块链中寻找与待入链业务数据相匹配的区块链;也可以先在区块数据记录表中查找与待入链业务数据的业务特征信息相匹配的第一业务类型标识信息,再判断第一业务类型标识信息所对应的区块链的状态信息是否为有效状态,如有效则确定对应的区块链为与待入链业务数据相匹配的区块链。In specific implementation, it is usually required that two conditions are met at the same time, that is, the first business type identification information satisfies the first preset condition, including: the first business type identification information matches the business characteristic information of the business data to be included in the chain, and the status information of the blockchain corresponding to the first business type identification information is in a valid state. In the specific implementation of the judgment process, the order of judging the two conditions can be interchanged, and the embodiments of the present application do not limit it. In other words, you can first judge the status information of the blockchain recorded in the block data record table, and then only look for the blockchain that matches the business data to be included in the chain in the blockchain whose status information is in a valid state; you can also first look for the first business type identification information that matches the business characteristic information of the business data to be included in the chain in the block data record table, and then judge whether the status information of the blockchain corresponding to the first business type identification information is in a valid state. If valid, determine that the corresponding blockchain is a blockchain that matches the business data to be included in the chain.

在本申请的实施例中,上述区块链数据记录表中还可以记录区块链的最后区块哈希值和对应的时间戳,例如采用下表2所示的表结构进行记录。In an embodiment of the present application, the above-mentioned blockchain data record table can also record the last block hash value and the corresponding timestamp of the blockchain, for example, using the table structure shown in Table 2 below for recording.

表2区块链数据记录表表结构示例Table 2 Blockchain data record table structure example

基于表2形式给出的区块链数据记录表,区块链系统在执行步骤S103将待入链业务数据的执行结果写入与待入链业务数据相匹配的区块链时,可具体包括以下步骤,参见图2:Based on the blockchain data record table given in Table 2, when the blockchain system executes step S103 to write the execution result of the business data to be added to the blockchain that matches the business data to be added to the blockchain, the following steps may be specifically included, see Figure 2:

S1031:提取与待入链业务数据相匹配的区块链所对应的最后区块哈希值和对应的时间戳;S1031: Extract the last block hash value and corresponding timestamp corresponding to the blockchain that matches the business data to be added to the chain;

S1032:将待入链业务数据的执行结果、最后区块哈希值和对应的时间戳写入区块链中的新的区块中;S1032: Write the execution result of the business data to be entered into the chain, the final block hash value and the corresponding timestamp into a new block in the blockchain;

S1033:将新的区块的哈希值和对应的时间戳作为新的最后区块哈希值和对应的时间戳更新到区块链数据记录表中。S1033: Update the new block's hash value and corresponding timestamp as the new last block's hash value and corresponding timestamp into the blockchain data record table.

在上述实施过程中,若同一类型的业务数据同时接入多条侧链,则在区块链数据记录表中可能会查找到多个满足第一预设条件的业务类型标识信息,则待入链业务数据可能会需要接入多条相匹配的区块链,并更新区块链数据记录表中对应这些区块链的最后区块哈希值和对应的时间戳。In the above implementation process, if the same type of business data is connected to multiple side chains at the same time, multiple business type identification information that meets the first preset condition may be found in the blockchain data record table. In this case, the business data to be connected to the chain may need to be connected to multiple matching blockchains, and the last block hash value and corresponding timestamp of these blockchains in the blockchain data record table must be updated.

以下举例说明这种情况。假设区块链系统中接入了多种类型的业务数据,除以上示例中提及的业务特征信息的值为20的卖家业务、业务特征信息的值为21的手机认证业务外,还包括业务特征信息的值为22(此时N的值取为2)的手机注册业务等。需要说明的是,区块链系统所接入的所有业务类型的业务特征信息的值与其对应的实际业务间的对应关系,通常由区块链系统开发者预先设定,参见表3所示。当需要向区块链系统中接入新的类型时,可以增加新的对应关系,以满足系统扩展的需要。通常,设定业务特征信息时,按照N的自然数递增的方式为各种业务类型分配业务特征信息的值,参见表3所示。The following example illustrates this situation. Assume that a blockchain system integrates multiple types of business data. In addition to the seller business with a business feature information value of 20 and the mobile phone authentication business with a business feature information value of 21 mentioned in the above example, this also includes a mobile phone registration business with a business feature information value of 22 (in this case, the value of N is 2). It should be noted that the correspondence between the business feature information values of all business types integrated into the blockchain system and their corresponding actual businesses is typically pre-set by the blockchain system developer, as shown in Table 3. When new types need to be integrated into the blockchain system, new correspondences can be added to meet system expansion needs. Typically, when configuring business feature information, business feature information values are assigned to various business types in an incrementing fashion based on the natural number N, as shown in Table 3.

表3业务特征信息对应表示例Table 3 Example of corresponding table of service characteristic information

业务类型说明Business Type Description 业务特征信息Business characteristic information 卖家业务Seller Business 手机认证业务Mobile phone authentication service 手机注册业务Mobile phone registration service 退款业务Refund business ············

假设区块链系统将卖家业务和手机认证业务接入侧链一,将卖家业务和手机注册业务接入侧链二,则区块链数据记录表如表4所示:Assuming that the blockchain system connects the seller business and mobile phone authentication business to side chain one, and connects the seller business and mobile phone registration business to side chain two, the blockchain data record table is shown in Table 4:

表4区块链数据记录表示例Table 4 Blockchain data record example

业务类型标识信息Business type identification information 最后一个区块hash值The last block hash value 状态信息Status information 时间戳Timestamp ** Code*-1Code*-1 11 2017/2/132017/2/13 33 Code3-1Code3-1 11 2017/2/152017/2/15 55 Code5-1Code5-1 11 2017/2/142017/2/14 ············

当待入链业务数据为卖家业务,其业务特征信息的值为1,则按照前述实施例的方式,业务类型标识信息为3和5的两条区块链都满足第一预设条件的要求,因此,该卖家业务将同时或先后入链到业务类型标识信息为3和5的两条区块链侧链中,并相应的更新这两条区块链的最后区块哈希值,例如哈希值Code3-1更新为哈希值Code3-2,哈希值Code5-1更新为哈希值Code5-2,区块哈希值所对应的时间戳也随着新的区块的生成相应的更新。When the business data to be added to the chain is a seller business and the value of its business characteristic information is 1, then according to the method of the aforementioned embodiment, the two blockchains with business type identification information 3 and 5 both meet the requirements of the first preset condition. Therefore, the seller business will be added to the two blockchain side chains with business type identification information 3 and 5 simultaneously or successively, and the last block hash values of the two blockchains will be updated accordingly. For example, the hash value Code3-1 is updated to the hash value Code3-2, and the hash value Code5-1 is updated to the hash value Code5-2. The timestamp corresponding to the block hash value is also updated accordingly with the generation of the new block.

在此例中,当待入链业务数据为退款业务,其业务特征信息的值为8(23)时,按照前述实施例的方式,将无法在区块链数据记录表中查找到满足第一预设条件的业务类型标识信息,表示区块链系统并未建立侧链处理该类业务。因此,将该待入链业务数据的执行结果写入主链(业务类型标识信息为“*”)中,并相应的更新主链的最后区块哈希值和对应的时间戳,例如,将Code*-1更新为Code*-2。In this example, when the business data to be added to the chain is a refund business and the value of its business characteristic information is 8 (2 3 ), according to the method of the aforementioned embodiment, the business type identification information that meets the first preset condition cannot be found in the blockchain data record table, indicating that the blockchain system has not established a side chain to handle this type of business. Therefore, the execution result of the business data to be added to the chain is written to the main chain (the business type identification information is "*"), and the last block hash value and corresponding timestamp of the main chain are updated accordingly, for example, Code*-1 is updated to Code*-2.

以上详细说明了如何依据区块链数据记录表确定待入链业务数据所匹配的区块链,以完成入链的多种实施例。以下将着重说明在不同情况下对区块链系统中区块链的不同处理方式以及对区块链数据记录表的影响。The above details various implementations of how to determine the matching blockchain for incoming business data based on the blockchain data record table to complete the on-chain process. The following will focus on different approaches to handling blockchains in a blockchain system and their impact on the blockchain data record table under different circumstances.

区块链系统在接收到区块链业务数据写入请求之后,本申请实施例给出的方法还可包括:After the blockchain system receives the blockchain business data write request, the method provided in the embodiment of the present application may further include:

当满足第二预设条件时,在区块链系统中增加新的区块链作为侧链,并在区块链数据记录表中增加与新的区块链及其业务类型标识信息相对应的记录。参见图3和图4中所示,区块链系统可以在一定条件下分出区块链的侧链,用于处理业务特征信息的值为1和2的业务数据,该侧链的业务类型标识符为3。例如,当推出“用手机认证送积分”之类的促进用户进行手机认证的活动时,可以预见到手机认证业务的并发量将会很大,如果全部由区块链系统中的主链处理的话,可能会出现处理滞后的现象,或可能出现与其他类型业务的处理发生资源抢占的现象。在这种情况下,就可以分出一条侧链,将手机认证业务(业务特征信息的值为2)分入该侧链中执行,从而能够满足区块链系统中不同类型的业务数据的处理需求,尤其是某些类型的业务数据的特殊处理需求。When the second pre-set condition is met, a new blockchain is added to the blockchain system as a sidechain, and a record corresponding to the new blockchain and its business type identifier is added to the blockchain data record table. As shown in Figures 3 and 4, the blockchain system can, under certain conditions, create a sidechain to process business data with business feature information values of 1 and 2. The business type identifier of this sidechain is 3. For example, when launching a campaign to encourage users to authenticate their phones, such as "Get points with mobile phone authentication," it is foreseeable that the concurrent volume of mobile phone authentication services will be high. If all of this is handled by the main chain in the blockchain system, processing delays may occur or resource competition may occur with the processing of other types of services. In this case, a sidechain can be created to offload the mobile phone authentication service (with business feature information value of 2) to this sidechain for execution, thereby meeting the processing needs of different types of business data in the blockchain system, especially the special processing requirements of certain types of business data.

具体地,第二预设条件可以是区块链业务数据写入请求中包含的待入链业务数据的业务特征信息与预设业务特征信息相匹配。此时,区块链系统可预先设定将某些业务类型入链到侧链,当新接收到的待入链业务数据属于这一类型时,其业务特征信息将与预设的业务特征信息相匹配,从而可在区块链系统中增加新的区块链作为侧链,并在如表4所示的区块链数据记录表中增加一行予以记录。Specifically, the second preset condition can be that the business characteristic information of the business data to be added to the blockchain, included in the blockchain business data write request, matches the preset business characteristic information. In this case, the blockchain system can pre-set certain business types to be added to the sidechain. When the newly received business data to be added to the chain belongs to this type, its business characteristic information will match the preset business characteristic information. As a result, the new blockchain can be added to the blockchain system as a sidechain, and a row is added to the blockchain data record table shown in Table 4 to record it.

除此之外,也可以在接收到的区块链业务数据写入请求的并发数量达到预设阈值时,和/或预设的增加新的区块链作为侧链的时间到达时,执行上述增加侧链的操作。In addition, the above-mentioned operation of adding a side chain can also be performed when the concurrent number of received blockchain business data write requests reaches a preset threshold and/or when the preset time for adding a new blockchain as a side chain arrives.

除上述增加侧链的操作外,当满足第三预设条件,例如接收到的所述区块链业务数据写入请求的并发数量小于预设阈值和/或侧链的有效时间到达时,也可以在区块链系统中终止作为侧链的区块链,并在区块链数据记录表中更新与被终止的区块链相对应的记录。例如图5所示,区块链系统可以在一定条件下终止区块链的侧链,如图5中业务类型标识信息为3的侧链,该条侧链被终止后,业务特征信息为1和2的两类业务数据都将不再写入这条被终止的侧链,而是合并由主链处理。In addition to the aforementioned operation of adding a sidechain, when a third preset condition is met, such as when the number of concurrent blockchain business data write requests received is less than a preset threshold and/or the sidechain's expiration time has expired, the blockchain system can also terminate the blockchain serving as a sidechain, and update the record corresponding to the terminated blockchain in the blockchain data record table. For example, as shown in Figure 5, the blockchain system can terminate a blockchain's sidechain under certain conditions. For example, in Figure 5, the sidechain with business type identification information of 3 will be terminated. After the sidechain is terminated, the business data of the two types of business characteristics with business characteristics information of 1 and 2 will no longer be written to the terminated sidechain, but will be merged and processed by the main chain.

更具体地,在区块链数据记录表中更新与被终止的区块链相对应的记录时,可以采用多种手段进行,例如可以删除与被终止的区块链相对应的记录,也可以将被终止的区块链的状态信息修改为无效状态。以表4所示区块链数据记录表为例,假设希望使业务类型标识信息为5的区块链终止,将该区块链对应的状态信息的值置为“0”即可。More specifically, when updating the records corresponding to the terminated blockchain in the blockchain data record table, various methods can be used. For example, the records corresponding to the terminated blockchain can be deleted, or the status information of the terminated blockchain can be modified to be invalid. Taking the blockchain data record table shown in Table 4 as an example, assuming that the blockchain with the business type identification information of 5 is to be terminated, the value of the status information corresponding to the blockchain can be set to "0".

除以上详细说明的向区块链系统中写入业务数据的方法之外,本申请实施例还相应的提供了一种向区块链系统中写入业务数据的装置,区块链系统包括至少一条区块链,参见图6,该装置包括:In addition to the method for writing business data into a blockchain system described in detail above, an embodiment of the present application also provides a device for writing business data into a blockchain system. The blockchain system includes at least one blockchain. Referring to FIG6 , the device includes:

请求接收模块101,用于接收区块链业务数据写入请求,区块链业务数据写入请求中包括待入链业务数据的业务特征信息;A request receiving module 101 is configured to receive a blockchain business data write request, wherein the blockchain business data write request includes business feature information of the business data to be added to the blockchain;

入链区块链确定模块102,用于依据区块链数据记录表和待入链业务数据的业务特征信息,确定与待入链业务数据相匹配的区块链;其中,区块链数据记录表中记录有区块链的业务类型标识信息,业务类型标识信息用于反映区块链中已入链业务数据的业务特征信息;The blockchain entry determination module 102 is configured to determine a blockchain that matches the business data to be entered into the blockchain based on the blockchain data record table and the business characteristic information of the business data to be entered into the blockchain. The blockchain data record table records the business type identification information of the blockchain, and the business type identification information is used to reflect the business characteristic information of the business data that has been entered into the blockchain.

入链模块103,用于将待入链业务数据的执行结果写入与待入链业务数据相匹配的区块链。The on-chain module 103 is used to write the execution results of the business data to be on-chain into the blockchain that matches the business data to be on-chain.

上述入链区块链确定模块102,也可称为数据路由模块,用于根据区块链数据记录表体现出的规则确定出待入链业务数据应路由到那条区块链上完成入链。The aforementioned blockchain inclusion determination module 102, which may also be referred to as a data routing module, is configured to determine, based on the rules reflected in the blockchain data record table, to which blockchain the business data to be included should be routed for inclusion.

本申请所称的区块链系统,可以理解为一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一次网络交易的信息,用于验证其信息的有效性并生成下一个区块,区块的存储方式按链式首尾相连。基于链式存储的特性,本申请实施例可根据业务数据的业务类型对业务数据进行分叉、归集,从而调配不同的存储、计算资源、或是扩展额外的逻辑,以满足不同业务类型业务数据的不同处理需求。The blockchain system referred to in this application can be understood as a series of data blocks generated using cryptographic methods. Each data block contains information about a network transaction, which is used to verify the validity of the information and generate the next block. The blocks are stored in a chain-like manner. Based on the characteristics of chain storage, embodiments of this application can fork and aggregate business data according to the business type of the business data, thereby allocating different storage and computing resources, or expanding additional logic to meet the different processing requirements of business data of different business types.

在本申请实施例中提供的方法和装置中,区块链系统在接收到包括有待入链业务数据的业务特征信息的区块链业务数据写入请求后,由于区块链数据记录表中记录有区块链的业务类型标识信息,且这些标识信息能够反映区块链中已入链业务数据的业务特征信息,因此,依据区块链数据记录表和待入链业务数据的业务特征信息,可以确定出与待入链业务数据相匹配的区块链,从而可将待入链业务数据的执行结果写入相匹配的区块链。采用本申请实施例的技术方案,可以根据待入链业务数据的业务特征信息选择相匹配的区块链完成入链,并建立区块链数据记录表能够对与业务类型相对应的各区块链进行记录,因此使得对不同类型业务数据的不同处理成为可能,从而能够满足区块链系统中不同类型的业务数据的处理需求。In the method and apparatus provided in the embodiments of the present application, after the blockchain system receives a blockchain business data write request including business feature information of the business data to be added to the chain, since the blockchain data record table records the business type identification information of the blockchain, and this identification information can reflect the business feature information of the business data already added to the chain in the blockchain, therefore, based on the blockchain data record table and the business feature information of the business data to be added to the chain, a blockchain that matches the business data to be added to the chain can be determined, so that the execution result of the business data to be added to the chain can be written to the matching blockchain. By adopting the technical solution of the embodiments of the present application, a matching blockchain can be selected based on the business feature information of the business data to be added to the chain to complete the addition, and a blockchain data record table can be established to record each blockchain corresponding to the business type, thereby making it possible to process different types of business data differently, thereby meeting the processing requirements of different types of business data in the blockchain system.

本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to the flowcharts and/or block diagrams of the methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of processes and/or boxes in the flowchart and/or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.

内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.

还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.

本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The foregoing is merely an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.

Claims (13)

1.一种向区块链系统中写入业务数据的方法,所述区块链系统包括至少一条区块链,所述方法包括:1. A method for writing business data into a blockchain system, the blockchain system comprising at least one blockchain, the method comprising: 接收区块链业务数据写入请求,所述区块链业务数据写入请求中包括待入链业务数据的业务特征信息,所述待入链业务数据的业务特征信息用于反映所述待入链业务数据的业务类型;Receive a blockchain business data write request, wherein the blockchain business data write request includes business characteristic information of the business data to be added to the chain, and the business characteristic information of the business data to be added to the chain is used to reflect the business type of the business data to be added to the chain. 依据区块链数据记录表和所述待入链业务数据的业务特征信息,确定与所述待入链业务数据相匹配的区块链;其中,所述区块链数据记录表中记录有区块链的业务类型标识信息,用于反映区块链中已入链业务数据的业务特征信息;Based on the blockchain data record table and the business characteristic information of the business data to be added to the blockchain, a blockchain that matches the business data to be added to the blockchain is determined; wherein, the blockchain data record table records the business type identification information of the blockchain, which is used to reflect the business characteristic information of the business data already added to the blockchain. 将所述待入链业务数据的执行结果写入与所述待入链业务数据相匹配的区块链;Write the execution result of the business data to be added to the blockchain into the blockchain that matches the business data to be added to the blockchain; 其中,依据区块链数据记录表和所述待入链业务数据的业务特征信息,确定与所述待入链业务数据相匹配的区块链,包括:Specifically, determining the blockchain that matches the business data to be added to the blockchain, based on the blockchain data record table and the business characteristic information of the business data to be added to the blockchain, includes: 遍历区块链数据记录表,将待入链业务数据的业务特征信息与区块链数据记录表中记录的区块链的业务类型标识信息进行匹配,以确定与所述待入链业务数据相匹配的区块链。Traverse the blockchain data record table and match the business characteristic information of the business data to be added to the blockchain with the business type identification information of the blockchain recorded in the blockchain data record table to determine the blockchain that matches the business data to be added to the blockchain. 2.根据权利要求1所述方法,依据区块链数据记录表和所述待入链业务数据的业务特征信息,确定与所述待入链业务数据相匹配的区块链,包括:2. The method according to claim 1, determining the blockchain that matches the business data to be added to the blockchain based on the blockchain data record table and the business characteristic information of the business data to be added to the blockchain, includes: 当在所述区块链数据记录表中查找到满足第一预设条件的第一业务类型标识信息时,将所述第一业务类型标识信息所对应的区块链确定为与所述待入链业务数据相匹配的区块链;When a first business type identifier that meets the first preset condition is found in the blockchain data record table, the blockchain corresponding to the first business type identifier is determined as the blockchain that matches the business data to be added to the blockchain. 其中,满足所述第一预设条件包括:第一业务类型标识信息与所述待入链业务数据的业务特征信息相匹配。Among them, satisfying the first preset condition includes: the first business type identification information matches the business characteristic information of the business data to be added to the chain. 3.根据权利要求2所述方法,所述业务特征信息取为2的N次幂,其中,所述N为0或正整数;所述区块链的业务类型标识信息取为所述区块链中已入链业务数据的不同业务特征信息之和。3. According to the method of claim 2, the business feature information is taken as a power of 2, where N is 0 or a positive integer; the business type identification information of the blockchain is taken as the sum of different business feature information of the business data that have been added to the blockchain. 4.根据权利要求3所述方法,第一业务类型标识信息与所述待入链业务数据的业务特征信息相匹配,具体为:4. According to the method of claim 3, the first business type identification information is matched with the business characteristic information of the business data to be added to the chain, specifically as follows: 若所述第一业务类型标识信息的值与所述待入链业务数据的业务特征信息的值的逻辑与操作等于所述待入链业务数据的业务特征信息的值,则所述第一业务类型标识信息与所述待入链业务数据的业务特征信息相匹配。If the logical AND operation between the value of the first business type identifier and the value of the business feature information of the business data to be added to the chain is equal to the value of the business feature information of the business data to be added to the chain, then the first business type identifier matches the business feature information of the business data to be added to the chain. 5.根据权利要求2所述方法,依据区块链数据记录表和所述待入链业务数据的业务特征信息,确定与所述待入链业务数据相匹配的区块链,还包括:5. The method according to claim 2, further comprising determining a blockchain that matches the business data to be added to the blockchain based on the blockchain data record table and the business characteristic information of the business data to be added to the blockchain, and further comprising: 当在所述区块链数据记录表中未查找到满足所述第一预设条件的第一业务类型标识信息时,将预设的第二业务类型标识信息所对应的区块链确定为与所述待入链业务数据相匹配的区块链。When no first business type identifier information that meets the first preset condition is found in the blockchain data record table, the blockchain corresponding to the preset second business type identifier information is determined as the blockchain that matches the business data to be added to the blockchain. 6.根据权利要求2所述方法,所述区块链数据记录表中还记录有区块链的状态信息,则,所述第一业务类型标识信息满足所述第一预设条件还包括:6. According to claim 2, if the blockchain data record table further records blockchain status information, then the first business type identifier information satisfying the first preset condition further includes: 所述第一业务类型标识信息所对应的区块链的状态信息为有效状态。The status information of the blockchain corresponding to the first business type identifier information is in a valid state. 7.根据权利要求1~6之任一所述方法,所述区块链数据记录表中还记录有区块链的最后区块哈希值和对应的时间戳,则将所述待入链业务数据的执行结果写入与所述待入链业务数据相匹配的区块链,包括:7. According to any one of claims 1 to 6, if the blockchain data record table further records the last block hash value and corresponding timestamp of the blockchain, then writing the execution result of the business data to be added to the blockchain into the blockchain that matches the business data to be added to the blockchain includes: 提取与所述待入链业务数据相匹配的区块链所对应的最后区块哈希值和对应的时间戳;Extract the last block hash value and corresponding timestamp of the blockchain that matches the business data to be added to the chain; 将所述待入链业务数据的执行结果、所述最后区块哈希值和对应的时间戳写入所述区块链中的新的区块中;The execution result of the business data to be added to the chain, the hash value of the last block, and the corresponding timestamp are written into a new block in the blockchain; 将所述新的区块的哈希值和对应的时间戳作为新的最后区块哈希值和对应的时间戳更新到所述区块链数据记录表中。The hash value and corresponding timestamp of the new block are updated in the blockchain data record table as the new last block hash value and corresponding timestamp. 8.根据权利要求1~6之任一所述方法,所述区块链系统中包含一条作为主链的区块链,在接收区块链业务数据写入请求之后,所述方法还包括:8. The method according to any one of claims 1 to 6, wherein the blockchain system includes a blockchain as the main chain, and after receiving a blockchain business data write request, the method further includes: 当满足第二预设条件时,在所述区块链系统中增加新的区块链作为侧链,并在所述区块链数据记录表中增加与所述新的区块链及其业务类型标识信息相对应的记录。When the second preset condition is met, a new blockchain is added as a sidechain in the blockchain system, and a record corresponding to the new blockchain and its business type identification information is added to the blockchain data record table. 9.根据权利要求8所述方法,满足所述第二预设条件包括:9. The method according to claim 8, wherein satisfying the second preset condition includes: 所述区块链业务数据写入请求中包含的待入链业务数据的业务特征信息与预设业务特征信息相匹配;和/或The business characteristic information of the blockchain business data to be written to the chain contained in the blockchain business data writing request matches the preset business characteristic information; and/or 接收到的所述区块链业务数据写入请求的并发数量达到预设阈值;和/或The number of concurrent blockchain business data write requests received reaches a preset threshold; and/or 预设的增加新的区块链作为侧链的时间到达。The pre-defined time for adding a new blockchain as a sidechain has arrived. 10.根据权利要求1~6之任一所述方法,所述区块链系统中包含一条作为主链的区块链和至少一条作为侧链的区块链,则在接收区块链业务数据写入请求之后,所述方法还包括:10. The method according to any one of claims 1 to 6, wherein the blockchain system includes one blockchain as the main chain and at least one blockchain as a side chain, then after receiving the blockchain business data write request, the method further includes: 当满足第三预设条件时,在所述区块链系统中终止作为侧链的区块链,并在所述区块链数据记录表中更新与被终止的所述区块链相对应的记录。When the third preset condition is met, the blockchain serving as a sidechain is terminated in the blockchain system, and the record corresponding to the terminated blockchain is updated in the blockchain data record table. 11.根据权利要求10所述方法,满足所述第三预设条件包括:11. The method according to claim 10, wherein satisfying the third preset condition includes: 接收到的所述区块链业务数据写入请求的并发数量小于预设阈值;和/或The number of concurrent blockchain business data write requests received is less than a preset threshold; and/or 侧链的有效时间到达。The effective time for the sidechain has arrived. 12.根据权利要求10所述方法,在所述区块链数据记录表中更新与被终止的所述区块链相对应的记录,包括:12. The method of claim 10, updating the record corresponding to the terminated blockchain in the blockchain data record table, comprising: 删除与被终止的所述区块链相对应的记录;或者,Delete the record corresponding to the terminated blockchain; or, 当所述区块链数据记录表中记录有被终止的所述区块链的状态信息时,将被终止的所述区块链的状态信息修改为无效状态。When the blockchain data record table contains the status information of a terminated blockchain, the status information of the terminated blockchain is modified to an invalid state. 13.一种向区块链系统中写入业务数据的装置,所述区块链系统包括至少一条区块链,所述装置包括:13. An apparatus for writing business data into a blockchain system, the blockchain system comprising at least one blockchain, the apparatus comprising: 请求接收模块,用于接收区块链业务数据写入请求,所述区块链业务数据写入请求中包括待入链业务数据的业务特征信息,所述待入链业务数据的业务特征信息用于反映所述待入链业务数据的业务类型;The request receiving module is used to receive a blockchain business data writing request. The blockchain business data writing request includes business characteristic information of the business data to be added to the chain. The business characteristic information of the business data to be added to the chain is used to reflect the business type of the business data to be added to the chain. 入链区块链确定模块,用于依据区块链数据记录表和所述待入链业务数据的业务特征信息,确定与所述待入链业务数据相匹配的区块链;其中,所述区块链数据记录表中记录有区块链的业务类型标识信息,所述业务类型标识信息用于反映区块链中已入链业务数据的业务特征信息;The blockchain entry determination module is used to determine the blockchain that matches the business data to be entered into the blockchain based on the blockchain data record table and the business characteristic information of the business data to be entered into the blockchain; wherein, the blockchain data record table records the business type identification information of the blockchain, and the business type identification information is used to reflect the business characteristic information of the business data already entered into the blockchain. 入链模块,用于将所述待入链业务数据的执行结果写入与所述待入链业务数据相匹配的区块链;The on-chain module is used to write the execution result of the business data to be on-chain into the blockchain that matches the business data to be on-chain; 其中,入链区块链确定模块,用于:The blockchain entry determination module is used for: 遍历区块链数据记录表,将待入链业务数据的业务特征信息与区块链数据记录表中记录的区块链的业务类型标识信息进行匹配,以确定与所述待入链业务数据相匹配的区块链。Traverse the blockchain data record table and match the business characteristic information of the business data to be added to the blockchain with the business type identification information of the blockchain recorded in the blockchain data record table to determine the blockchain that matches the business data to be added to the blockchain.
HK18106136.2A 2018-05-11 Method and device for writing business data in block chain system HK1246893B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
HK18106136.2A HK1246893B (en) 2018-05-11 Method and device for writing business data in block chain system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
HK18106136.2A HK1246893B (en) 2018-05-11 Method and device for writing business data in block chain system

Publications (2)

Publication Number Publication Date
HK1246893A1 HK1246893A1 (en) 2018-09-14
HK1246893B true HK1246893B (en) 2021-04-01

Family

ID=

Similar Documents

Publication Publication Date Title
CN107368259B (en) Method and device for writing service data into block chain system
CN108335206B (en) Asset management method and device, electronic equipment
KR102175226B1 (en) Methods and devices for controlling data risk
JP2019004463A (en) Method, apparatus and non-transitory computer readable storage medium for transaction execution and validation in blockchain (transaction execution and validation in blockchain)
CN110599177A (en) Transaction verification method and related equipment
CN111667270A (en) Region-based digital currency using method and device and electronic equipment
CN112286968A (en) Service identification method, equipment, medium and electronic equipment
CN113592639B (en) Block chain transaction deleting method and system
CN109583861B (en) Data compression method, access method and system in key-value database
CN110162274B (en) Data processing method, device and equipment based on block chain
CN111401875A (en) Block chain transfer method and device based on account model
CN113673844A (en) Information feedback method, device and equipment
CN113114678A (en) Service execution method and device
HK1246893B (en) Method and device for writing business data in block chain system
US20240089128A1 (en) Blockchain monitoring platform
CN113507432B (en) Alliance chain authority management method and device
CN116708430A (en) Registration center cluster scheduling method, device, computer equipment and storage medium
CN116166747A (en) Block chain intelligent contract data processing method and device
HK40039792A (en) Method and device for writing service data into blockchain system
HK1246893A1 (en) Method and device for writing business data in block chain system
US12400224B1 (en) Policy-based blockchain transactions
WO2020233422A1 (en) Receipt storage method and node based on user type
CN115760366B (en) Batch business processing method and system
CN111383008A (en) Blockchain transfer method and device based on account model
US12293411B2 (en) Secure decentralized system and method