Movatterモバイル変換


[0]ホーム

URL:


CN107277108B - A message processing method, device and system at a node of a blockchain - Google Patents

A message processing method, device and system at a node of a blockchain
Download PDF

Info

Publication number
CN107277108B
CN107277108BCN201710353248.XACN201710353248ACN107277108BCN 107277108 BCN107277108 BCN 107277108BCN 201710353248 ACN201710353248 ACN 201710353248ACN 107277108 BCN107277108 BCN 107277108B
Authority
CN
China
Prior art keywords
message
logic processing
processing service
processed
business logic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201710353248.XA
Other languages
Chinese (zh)
Other versions
CN107277108A (en
Inventor
陈姝
杨治彬
卢小明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Peersafe Technology Co ltd
Original Assignee
Beijing Peersafe Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Peersafe Technology Co ltdfiledCriticalBeijing Peersafe Technology Co ltd
Priority to CN201710353248.XApriorityCriticalpatent/CN107277108B/en
Publication of CN107277108ApublicationCriticalpatent/CN107277108A/en
Application grantedgrantedCritical
Publication of CN107277108BpublicationCriticalpatent/CN107277108B/en
Expired - Fee Relatedlegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

本申请公开了一种区块链的节点处的消息处理方法、装置及系统,涉及通信技术,对于每个区块链的节点,均设置有代理业务逻辑处理服务实体,该代理业务逻辑处理服务实体接收客户端发送的待处理消息,并将待处理消息转发至业务逻辑处理服务实体,由业务逻辑处理服务实体处理待处理消息,由于代理业务逻辑处理服务实体的标识是不根据版本改变的,所以不需要在业务逻辑改变时,因为业务逻辑处理服务实体标识的改变而修改客户端,提高了用户体验。

Figure 201710353248

The present application discloses a message processing method, device and system at a node of a blockchain, and relates to communication technology. For each node of the blockchain, a proxy business logic processing service entity is set. The proxy business logic processing service The entity receives the pending message sent by the client, and forwards the pending message to the business logic processing service entity, and the business logic processing service entity processes the pending message. Since the identity of the proxy business logic processing service entity does not change according to the version, Therefore, when the business logic is changed, the client is not required to be modified because the business logic handles the change of the service entity identifier, which improves the user experience.

Figure 201710353248

Description

Translated fromChinese
一种区块链的节点处的消息处理方法、装置及系统A message processing method, device and system at a node of a blockchain

技术领域technical field

本公开一般涉及通信技术,具体涉及区块链技术,尤其涉及一种区块链的节点处的消息处理方法、装置及系统。The present disclosure generally relates to communication technologies, in particular to blockchain technologies, and in particular, to a method, device, and system for processing messages at nodes of a blockchain.

背景技术Background technique

区块链是一种新型去中心化协议,能安全地存储交易数据,信息不可伪造和篡改,可以灵活的发布并执行智能合约,无需任何中心化机构的审核。交易既可以是类似比特币这样的数字货币,也可以是债权、股权、版权等数字资产,区块链技术解决了拜占庭将军问题,大大降低了现实经济的信任成本与会计成本,重新定义了互联网时代的产权制度。Blockchain is a new type of decentralized protocol that can securely store transaction data, information cannot be forged and tampered with, and can flexibly issue and execute smart contracts without any centralized agency review. Transactions can be digital currencies like Bitcoin, or digital assets such as debt, equity, copyright, etc. Blockchain technology solves the Byzantine general problem, greatly reduces the cost of trust and accounting in the real economy, and redefines the Internet The property rights system of the era.

在现有的区块链技术中,所使用的节点是集业务逻辑处理和数据存储为一体的。用户的业务逻辑处理服务是发布到区块链的验证节点(VP)上的,类似智能合约的可编程代码(CC)。而每一个CC都对应一个唯一的ID,客户端(client)想要执行操作时,必须拿到这个唯一的ID(标识)。并且在区块链上落账的时候,也会使用这个唯一的ID当做Key(密钥),来保存这个CC所有业务逻辑处理的结果。In the existing blockchain technology, the nodes used are integrated with business logic processing and data storage. The user's business logic processing service is published on the verification node (VP) of the blockchain, similar to the programmable code (CC) of the smart contract. And each CC corresponds to a unique ID, and the client (client) must get this unique ID (identity) when it wants to perform an operation. And when the account is placed on the blockchain, this unique ID is also used as the Key (key) to save the results of all business logic processing of this CC.

在区块链中,所有业务逻辑相关的数据都保存在世界状态中。Bucket-tree(桶树)是世界状态的组织方式的实现。为了下面描述的目的,世界状态的key(密钥)被表示成两个组件(CC的ID and ckey)的通过nil(无值)字节的级联,如:key=CCID+nil+cKey。cKey是由用户自定义的key加上区块链的规则生成的,而CCID是在落账时,由框架自动拼接的。因此,CC的业务逻辑发生改变,CCID随之发生改变,就会导致之前版本的数据无法获取。In the blockchain, all business logic related data is kept in the world state. Bucket-tree is an implementation of how the world state is organized. For the purposes of the description below, the world state key is represented as a concatenation of two components (CC's ID and ckey) via nil (no value) bytes, eg: key=CCID+nil+cKey. cKey is generated by user-defined key plus blockchain rules, and CCID is automatically spliced by the framework when the account is settled. Therefore, the business logic of the CC changes, and the CCID changes accordingly, which will cause the data of the previous version to be unavailable.

下面结合图1对消息处理的流程进行说明,首先是由VP启动,提供监听客户端请求、共识交易以及操作账本的服务。接着客户端发起在VP中部署CC的请求,由VP创建docker(一个开源的应用容器引擎)容器,并在容器中启动CC,提供业务处理的服务。在每发起一笔交易(TX)时,客户端要拿到所要操作的CC的ID和其中一个VP建立连接,然后发送到VP;再由VP节点传输到CC进行业务逻辑处理。最后由CC反馈到VP,再由VP传达给客户端。The following describes the flow of message processing with reference to Figure 1. First, it is started by the VP to provide services such as monitoring client requests, consensus transactions, and operating the ledger. Then the client initiates a request to deploy the CC in the VP, the VP creates a docker (an open source application container engine) container, and starts the CC in the container to provide business processing services. When initiating a transaction (TX), the client needs to get the ID of the CC to be operated and establish a connection with one of the VPs, and then send it to the VP; then the VP node transmits it to the CC for business logic processing. Finally, the CC feeds back to the VP, and then the VP conveys it to the client.

因此,当CC的业务逻辑发生改变时,就需要重新发布新的一个CC1。客户端也需要通过重装或者更新来更改自己所要连接的CC1的ID1,并且想要读取上一个版本的CC的数据时,也是难以实现的。Therefore, when the business logic of the CC changes, a new CC1 needs to be reissued. The client also needs to change the ID1 of the CC1 to be connected by reinstalling or updating, and it is also difficult to read the data of the previous version of the CC.

可见,当CC的代码发生改变时,客户需要频繁的修改配置文件中的CC ID,并且需要卸载重新安装;CC代码的发生改变重新发布后,之前保存的数据会丢失,造成业务缺失,严重影响已上线版本的使用;当CC代码中的数据库字段或者业务逻辑发生改变后,还可能会导致未升级的客户端功能异常,不能正常使用。It can be seen that when the CC code changes, the customer needs to frequently modify the CC ID in the configuration file, and needs to uninstall and reinstall; after the CC code is changed and republished, the previously saved data will be lost, resulting in business loss and serious impact. The use of the online version; when the database fields or business logic in the CC code are changed, it may also cause the unupgraded client to function abnormally and not be used normally.

发明内容SUMMARY OF THE INVENTION

鉴于现有技术中的上述缺陷或不足,期望提供一种区块链的节点处的消息处理方法、装置及系统,以提高业务逻辑发生改变时的用户体验。In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a message processing method, device and system at a node of a blockchain to improve user experience when business logic changes.

第一方面,本发明实施例提供一种区块链的节点处的消息处理方法,所述方法包括:In a first aspect, an embodiment of the present invention provides a message processing method at a node of a blockchain, the method comprising:

代理业务逻辑处理服务实体接收客户端发送的待处理消息;The proxy business logic processing service entity receives the pending message sent by the client;

代理业务逻辑处理服务实体将所述待处理消息转发至业务逻辑处理服务实体,由所述业务逻辑处理服务实体处理所述待处理消息。The proxy business logic processing service entity forwards the to-be-processed message to the business logic processing service entity, and the business logic processing service entity processes the to-be-processed message.

进一步,所述代理业务逻辑处理服务实体将所述待处理消息转发至业务逻辑处理服务实体,由所述业务逻辑处理服务实体处理所述消息,具体包括:Further, the proxy business logic processing service entity forwards the to-be-processed message to the business logic processing service entity, and the business logic processing service entity processes the message, specifically including:

所述代理业务逻辑处理服务实体根据所述待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体,由相应的业务逻辑处理服务实体处理所述消息。The proxy business logic processing service entity forwards the to-be-processed message to the corresponding business logic processing service entity according to the version information in the to-be-processed message, and the corresponding business logic processing service entity processes the message.

更进一步,所述根据所述待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体,具体包括:Further, according to the version information in the to-be-processed message, forwarding the to-be-processed message to the corresponding business logic processing service entity specifically includes:

根据所述待处理消息中的版本信息,确定所述待处理消息的业务逻辑处理服务标识;According to the version information in the to-be-processed message, determine the business logic processing service identifier of the to-be-processed message;

将所述待处理消息转发至所述业务逻辑处理服务标识对应的业务逻辑处理服务实体。The to-be-processed message is forwarded to the business logic processing service entity corresponding to the business logic processing service identifier.

优选的,其特征在于,所述业务逻辑处理服务实体处理所述待处理消息,具体包括:Preferably, it is characterized in that the processing of the to-be-processed message by the business logic processing service entity specifically includes:

所述业务逻辑处理服务实体从数据库实体中读写数据,并对所述待处理消息进行处理。The business logic processing service entity reads and writes data from the database entity, and processes the to-be-processed message.

进一步,所述代理业务逻辑处理服务实体、业务逻辑处理服务实体和数据库实体均集成设置在验证节点中。Further, the proxy business logic processing service entity, the business logic processing service entity and the database entity are integrated and set in the verification node.

第二方面,本发明实施例提供一种区块链的节点处的消息处理装置,所述装置包括:In a second aspect, an embodiment of the present invention provides a message processing apparatus at a node of a blockchain, the apparatus comprising:

接收单元,用于接收客户端发送的待处理消息;a receiving unit, configured to receive the pending message sent by the client;

转发单元,用于将所述待处理消息转发至业务逻辑处理服务实体,由所述业务逻辑处理服务实体处理所述待处理消息。A forwarding unit, configured to forward the to-be-processed message to a business logic processing service entity, where the business logic processing service entity processes the to-be-processed message.

进一步,所述转发单元具体用于:Further, the forwarding unit is specifically used for:

根据所述待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体,由相应的业务逻辑处理服务实体处理所述消息。According to the version information in the to-be-processed message, the to-be-processed message is forwarded to a corresponding business logic processing service entity, and the corresponding business logic processing service entity processes the message.

更进一步,所述转发单元根据所述待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体,具体包括:Further, the forwarding unit forwards the to-be-processed message to the corresponding business logic processing service entity according to the version information in the to-be-processed message, specifically including:

根据所述待处理消息中的版本信息,确定所述待处理消息的业务逻辑处理服务标识;According to the version information in the to-be-processed message, determine the business logic processing service identifier of the to-be-processed message;

将所述待处理消息转发至所述业务逻辑处理服务标识对应的业务逻辑处理服务实体。The to-be-processed message is forwarded to the business logic processing service entity corresponding to the business logic processing service identifier.

第三方面,本发明实施例提供一种区块链的节点处的消息处理系统,该系统包括:代理业务逻辑处理服务实体和业务逻辑处理服务实体,其中In a third aspect, an embodiment of the present invention provides a message processing system at a node of a blockchain, the system comprising: a proxy business logic processing service entity and a business logic processing service entity, wherein

代理业务逻辑处理服务实体,用于接收客户端发送的待处理消息,将所述待处理消息转发至所述业务逻辑处理服务实体;A proxy business logic processing service entity, configured to receive a pending message sent by the client, and forward the pending message to the business logic processing service entity;

业务逻辑处理服务实体,用于接收所述代理业务逻辑处理服务实体转发的待处理消息,并处理所述待处理消息。The business logic processing service entity is configured to receive the to-be-processed message forwarded by the proxy business logic processing service entity, and process the to-be-processed message.

进一步,所述代理业务逻辑处理服务实体具体用于:Further, the proxy business logic processing service entity is specifically used for:

接收客户端发送的待处理消息,根据所述待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体。Receive the to-be-processed message sent by the client, and forward the to-be-processed message to the corresponding business logic processing service entity according to the version information in the to-be-processed message.

更进一步,所述代理业务逻辑处理服务实体根据所述待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体,具体包括:Further, the proxy business logic processing service entity forwards the to-be-processed message to the corresponding business logic processing service entity according to the version information in the to-be-processed message, specifically including:

根据所述待处理消息中的版本信息,确定所述待处理消息的业务逻辑处理服务标识;According to the version information in the to-be-processed message, determine the business logic processing service identifier of the to-be-processed message;

将所述待处理消息转发至所述业务逻辑处理服务标识对应的业务逻辑处理服务实体。The to-be-processed message is forwarded to the business logic processing service entity corresponding to the business logic processing service identifier.

优选的,还包括数据库实体;Preferably, it also includes database entities;

所述业务逻辑处理服务实体处理所述待处理消息,具体包括:The business logic processing service entity processes the to-be-processed message, specifically including:

所述业务逻辑处理服务实体从数据库实体中读写数据,并对所述待处理消息进行处理。The business logic processing service entity reads and writes data from the database entity, and processes the to-be-processed message.

进一步,所述代理业务逻辑处理服务实体、业务逻辑处理服务实体和数据库实体均集成设置在验证节点中。Further, the proxy business logic processing service entity, the business logic processing service entity and the database entity are integrated and set in the verification node.

第四方面,本发明实施例提供一种设备,包括处理器和存储器;其特征在于:In a fourth aspect, an embodiment of the present invention provides a device, including a processor and a memory; it is characterized in that:

所述存储器包含可由所述处理器执行的指令以使得所述处理器执行:The memory contains instructions executable by the processor to cause the processor to perform:

接收客户端发送的待处理消息;Receive pending messages sent by the client;

将所述待处理消息转发至业务逻辑处理服务实体,由所述业务逻辑处理服务实体处理所述待处理消息。The to-be-processed message is forwarded to a business logic processing service entity, and the to-be-processed message is processed by the business logic processing service entity.

第五方面,本发明实施例提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序用于:In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and the computer program is used for:

接收客户端发送的待处理消息;Receive pending messages sent by the client;

将所述待处理消息转发至业务逻辑处理服务实体,由所述业务逻辑处理服务实体处理所述待处理消息。The to-be-processed message is forwarded to a business logic processing service entity, and the to-be-processed message is processed by the business logic processing service entity.

本发明实施例提供一种区块链的节点处的消息处理方法、装置及系统,对于每个区块链的节点,均设置有代理业务逻辑处理服务实体,该代理业务逻辑处理服务实体接收客户端发送的待处理消息,并将待处理消息转发至业务逻辑处理服务实体,由业务逻辑处理服务实体处理待处理消息,由于代理业务逻辑处理服务实体的标识是不根据版本改变的,所以不需要在业务逻辑改变时,因为业务逻辑处理服务实体标识的改变而修改客户端,提高了用户体验。The embodiments of the present invention provide a message processing method, device and system at a node of a blockchain. For each node of the blockchain, a proxy business logic processing service entity is set, and the proxy business logic processing service entity receives customers. The pending message sent by the terminal, and forwards the pending message to the business logic processing service entity, and the business logic processing service entity processes the pending message. Since the identification of the proxy business logic processing service entity does not change according to the version, it is not necessary to When the business logic changes, the client is modified because the business logic handles the change of the service entity identifier, which improves the user experience.

附图说明Description of drawings

通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:

图1为现有技术中区块链的节点的结构示意图;1 is a schematic structural diagram of a node of a blockchain in the prior art;

图2为本发明实施例提供的区块链的节点处的消息处理方法流程图;2 is a flowchart of a message processing method at a node of a blockchain provided by an embodiment of the present invention;

图3为本发明实施例提供的区块链的节点的结构示意图;3 is a schematic structural diagram of a node of a blockchain provided by an embodiment of the present invention;

图4为本发明实施例提供的区块链的节点处的消息处理装置结构示意图;4 is a schematic structural diagram of a message processing apparatus at a node of a blockchain according to an embodiment of the present invention;

图5为本发明实施例提供的区块链的节点处的消息处理系统结构示意图;5 is a schematic structural diagram of a message processing system at a node of a blockchain provided by an embodiment of the present invention;

图6为本发明实施例提供的较佳的区块链的节点处的消息处理系统结构示意图;6 is a schematic structural diagram of a message processing system at a node of a preferred blockchain according to an embodiment of the present invention;

图7为本发明实施例提供的适于用来实现本申请实施例的设备的结构示意图。FIG. 7 is a schematic structural diagram of a device provided by an embodiment of the present invention and suitable for implementing the embodiment of the present application.

具体实施方式Detailed ways

下面结合附图和实施例对本申请作进一步的详细说明。可以理解的是,此处所描述的具体实施例仅仅用于解释相关发明,而非对该发明的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与发明相关的部分。The present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the related invention, but not to limit the invention. In addition, it should be noted that, for the convenience of description, only the parts related to the invention are shown in the drawings.

需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。下面将参考附图并结合实施例来详细说明本申请。It should be noted that the embodiments in the present application and the features of the embodiments may be combined with each other in the case of no conflict. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.

请参考图2,本发明实施例提供的区块链的节点处的消息处理方法包括:Referring to FIG. 2, the message processing method at the node of the blockchain provided by the embodiment of the present invention includes:

步骤S201、代理业务逻辑处理服务实体接收客户端发送的待处理消息;Step S201, the proxy business logic processing service entity receives the message to be processed sent by the client;

步骤S202、代理业务逻辑处理服务实体将待处理消息转发至业务逻辑处理服务实体,由业务逻辑处理服务实体处理待处理消息。Step S202, the proxy business logic processing service entity forwards the message to be processed to the business logic processing service entity, and the business logic processing service entity processes the to-be-processed message.

由于每个区块链的节点,均设置有代理业务逻辑处理服务实体,该代理业务逻辑处理服务实体接收客户端发送的待处理消息,并将待处理消息转发至业务逻辑处理服务实体,由业务逻辑处理服务实体处理待处理消息,由于代理业务逻辑处理服务实体的标识是不根据版本改变的,所以不需要在业务逻辑改变时,因为业务逻辑处理服务实体标识的改变而修改客户端,提高了用户体验。Because each blockchain node is provided with a proxy business logic processing service entity, the proxy business logic processing service entity receives the pending message sent by the client, and forwards the pending message to the business logic processing service entity. The logic processing service entity processes the messages to be processed. Since the identification of the proxy business logic processing service entity is not changed according to the version, it is not necessary to modify the client because the business logic processing service entity identification changes when the business logic changes. user experience.

应当注意,尽管在附图中以特定顺序描述了本发明方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。相反,流程图中描绘的步骤可以改变执行顺序。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。It should be noted that although the operations of the methods of the present invention are depicted in the figures in a particular order, this does not require or imply that the operations must be performed in that particular order, or that all illustrated operations must be performed to achieve desirable results . Rather, the steps depicted in the flowcharts may change the order of execution. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined to be performed as one step, and/or one step may be decomposed into multiple steps to be performed.

进一步,通过本发明实施例提供的方法,可以使得多个业务逻辑并存,当多个业务逻辑并存时,客户端发送的待处理消息中携带有自身业务逻辑对应的版本号,代理业务逻辑处理服务实体根据版本号将该待处理消息转发至相应的业务逻辑处理服务实体,此时,步骤S202中,代理业务逻辑处理服务实体将待处理消息转发至业务逻辑处理服务实体,由业务逻辑处理服务实体处理消息,具体包括:Further, through the method provided by the embodiment of the present invention, multiple business logics can coexist. When multiple business logics coexist, the to-be-processed message sent by the client carries the version number corresponding to its own business logic, and the proxy business logic processes the service. The entity forwards the pending message to the corresponding business logic processing service entity according to the version number. At this time, in step S202, the proxy business logic processing service entity forwards the pending message to the business logic processing service entity, and the business logic processing service entity Process messages, including:

代理业务逻辑处理服务实体根据待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体,由相应的业务逻辑处理服务实体处理消息。The proxy business logic processing service entity forwards the to-be-processed message to the corresponding business logic processing service entity according to the version information in the to-be-processed message, and the corresponding business logic processing service entity processes the message.

更进一步,根据业务逻辑处理服务实体的寻址方式,是需要根据业务逻辑处理服务标识进行业务逻辑处理服务实体的寻址的,此时,根据待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体,具体包括:Further, according to the addressing mode of the business logic processing service entity, it is necessary to address the business logic processing service entity according to the business logic processing service identifier. At this time, according to the version information in the pending message, the pending message is processed. Forwarded to the corresponding business logic processing service entity, including:

根据待处理消息中的版本信息,确定待处理消息的业务逻辑处理服务标识;Determine the business logic processing service identifier of the to-be-processed message according to the version information in the to-be-processed message;

将待处理消息转发至业务逻辑处理服务标识对应的业务逻辑处理服务实体。Forward the to-be-processed message to the business logic processing service entity corresponding to the business logic processing service identifier.

优选的,还可以进一步把数据库独立于业务逻辑处理服务实体设置,以便于业务逻辑处理服务实体不受版本限制的读写所需要的数据,此时,业务逻辑处理服务实体处理待处理消息,具体包括:Preferably, the database can be further set independently of the business logic processing service entity, so that the business logic processing service entity can read and write data that is not limited by version restrictions. At this time, the business logic processing service entity processes the messages to be processed. Specifically, include:

业务逻辑处理服务实体从数据库实体中读写数据,并对待处理消息进行处理。The business logic processes the service entity to read and write data from the database entity and process the messages to be processed.

数据库实体独立于业务逻辑处理服务实体设置以后,数据库实体使用其单独的CCID(业务逻辑处理服务标识),所有业务逻辑处理服务实体均使用数据库实体的CCID对数据库实体进行读写,当业务逻辑发生改变时,仅是业务逻辑处理服务实体发生改变,或者改变业务逻辑处理服务实体的CCID,或者增加新的业务逻辑处理服务实体,数据库实体及数据库实体的CCID并不发生改变,所以各个业务逻辑处理服务实体均可以对数据库实体中的所有数据进行读写。After the database entity is set independently of the business logic processing service entity, the database entity uses its separate CCID (business logic processing service identifier), and all business logic processing service entities use the CCID of the database entity to read and write the database entity. When the business logic occurs When changing, only the business logic processing service entity changes, or the CCID of the business logic processing service entity is changed, or a new business logic processing service entity is added. The database entity and the CCID of the database entity do not change, so each business logic processing All service entities can read and write all data in the database entity.

本发明实施例中的代理业务逻辑处理服务实体、业务逻辑处理服务实体和数据库实体的连接关系如图3所示,本发明实施例中的代理业务逻辑处理服务实体、业务逻辑处理服务实体和数据库实体均可以集成设置在验证节点中,也可以独立于验证节点设置。The connection relationship between the proxy business logic processing service entity, the business logic processing service entity and the database entity in the embodiment of the present invention is shown in Figure 3. The proxy business logic processing service entity, the business logic processing service entity and the database in the embodiment of the present invention Entities can be integrated in the verification node, or can be set independently of the verification node.

在区块链中,每个节点发起的业务逻辑上的请求,可以称为交易。当一个节点发起一笔交易的时,都会广播(transaction)到网络中的所有节点。此时,消息中附带的有自己的节点编号、消息的内容、消息的编号(标识执行消息数量的自增序列)、自己的私钥以及对上述三部分的签名和摘要。当其他节点收到该广播时,会先验证签名是否正确。如果正确,接着会验证摘要是否正确。上述两个验证都执行通过时,会判断自己是否收到过该节点编号发过来的同样消息编号的消息。如果有,则判断摘要是否相同,不同则不执行;如果没有,则执行该交易,并执行写账本操作。In the blockchain, the business logic request initiated by each node can be called a transaction. When a node initiates a transaction, it will broadcast (transaction) to all nodes in the network. At this time, the message is accompanied by its own node number, the content of the message, the number of the message (identifying the self-incrementing sequence of the number of execution messages), its own private key, and the signature and digest of the above three parts. When other nodes receive the broadcast, they will first verify whether the signature is correct. If correct, the digest is then verified to be correct. When the above two verifications are executed successfully, it will judge whether it has received a message with the same message number sent by the node number. If so, judge whether the digests are the same or not; if not, execute the transaction and execute the ledger write operation.

首先由客户端发起一笔交易到VP(验证节点),然后由VP通过CC的内部调用传输到代理CC(业务逻辑处理服务实体),再由代理CC根据版本号通过CC的内部调用传达给相应的CC。接着CC再通过CC的内部调用数据库(DB)去进行数据的读写操作。最后,调用再逐层返回到VP,由VP对客户端的请求给出相应,进而完成整笔交易。First, the client initiates a transaction to the VP (verification node), and then the VP transmits it to the proxy CC (business logic processing service entity) through the internal call of the CC, and then the proxy CC communicates it to the corresponding agent through the internal call of the CC according to the version number. CC. Then the CC calls the database (DB) through the CC to perform data read and write operations. Finally, the call is returned to the VP layer by layer, and the VP responds to the client's request, and then completes the entire transaction.

由于最外层的代理CC只做交易转发,不牵涉到任何和业务逻辑相关的功能,不需要重新发布。因此,客户端在发起交易时,所使用的配置文件中的CCID就不用更改。给迭代开发中的客户端提供了很大的方便,使客户端不必因CC业务逻辑的更改或者问题的修复而频繁的修改配置文件中的CCID。Since the outermost proxy CC only performs transaction forwarding, it does not involve any functions related to business logic and does not need to be republished. Therefore, when the client initiates a transaction, the CCID in the configuration file used does not need to be changed. It provides great convenience to the client in iterative development, so that the client does not need to frequently modify the CCID in the configuration file due to the change of the CC business logic or the repair of the problem.

由于数据库实体只提供读写操作,和业务逻辑没有任何关系,因此也不需要重新发布。这样数据库实体是固定的,因此,数据库实体的ID也是固定的,任何版本的CC操作的结果也是可以读取到的。Since database entities only provide read and write operations and have nothing to do with business logic, there is no need to republish. In this way, the database entity is fixed, therefore, the ID of the database entity is also fixed, and the result of the CC operation of any version can also be read.

由于有外层的代理CC做转发,可以在代理CC中把版本号和业务逻辑的CC ID做映射,实现多版本业务逻辑的CC并存。Since there is an outer proxy CC for forwarding, the version number and the CC ID of the business logic can be mapped in the proxy CC to realize the coexistence of CCs with multiple versions of the business logic.

本发明实施例还相应提供一种区块链的节点处的消息处理装置,该装置可以具体为代理业务逻辑处理服务实体,如图4所示,该装置包括:The embodiment of the present invention also provides a message processing device at a node of the blockchain. The device may specifically be a proxy business logic processing service entity. As shown in FIG. 4 , the device includes:

接收单元401,用于接收客户端发送的待处理消息;A receivingunit 401, configured to receive a message to be processed sent by a client;

转发单元402,用于将待处理消息转发至业务逻辑处理服务实体,由业务逻辑处理服务实体处理待处理消息。Theforwarding unit 402 is configured to forward the to-be-processed message to the business logic processing service entity, and the business logic processing service entity processes the to-be-processed message.

进一步,转发单元402具体用于:Further, theforwarding unit 402 is specifically used for:

根据待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体,由相应的业务逻辑处理服务实体处理消息。According to the version information in the to-be-processed message, the to-be-processed message is forwarded to the corresponding business logic processing service entity, and the corresponding business logic processing service entity processes the message.

更进一步,转发单元402根据待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体,具体包括:Further, theforwarding unit 402 forwards the to-be-processed message to the corresponding business logic processing service entity according to the version information in the to-be-processed message, which specifically includes:

根据待处理消息中的版本信息,确定待处理消息的业务逻辑处理服务标识;Determine the business logic processing service identifier of the to-be-processed message according to the version information in the to-be-processed message;

将待处理消息转发至业务逻辑处理服务标识对应的业务逻辑处理服务实体。Forward the to-be-processed message to the business logic processing service entity corresponding to the business logic processing service identifier.

应当理解,该装置中记载的诸单元或模块与参考图2描述的方法中的各个步骤相对应。由此,上文针对方法描述的操作和特征同样适用于该装置及其中包含的单元,在此不再赘述。该装置可以预先实现在电子设备的浏览器或其他安全应用中,也可以通过下载等方式而加载到电子设备的浏览器或其安全应用中。该装置中的相应单元可以与电子设备中的单元相互配合以实现本申请实施例的方案。It should be understood that the units or modules described in the apparatus correspond to the respective steps in the method described with reference to FIG. 2 . Therefore, the operations and features described above with respect to the method are also applicable to the apparatus and the units contained therein, and are not repeated here. The apparatus may be pre-implemented in a browser of an electronic device or other security applications, and may also be loaded into the browser of the electronic device or its security application by downloading or the like. Corresponding units in the apparatus may cooperate with units in the electronic device to implement the solutions of the embodiments of the present application.

本发明实施例还提供一种区块链的节点处的消息处理系统,该系统可以具体为验证节点中的各个实体系统,如图5所示,该系统包括:代理业务逻辑处理服务实体501和业务逻辑处理服务实体502,其中The embodiment of the present invention also provides a message processing system at the node of the blockchain, the system may be specific to each entity system in the verification node, as shown in FIG. 5 , the system includes: a proxy business logicprocessing service entity 501 and The business logic handles theservice entity 502, where

代理业务逻辑处理服务实体501,用于接收客户端发送的待处理消息,将待处理消息转发至业务逻辑处理服务实体;The proxy business logicprocessing service entity 501 is configured to receive the pending message sent by the client, and forward the pending message to the business logic processing service entity;

业务逻辑处理服务实体502,用于接收代理业务逻辑处理服务实体转发的待处理消息,并处理待处理消息。The business logicprocessing service entity 502 is configured to receive the pending messages forwarded by the proxy business logic processing service entity, and process the pending messages.

进一步,代理业务逻辑处理服务实体501具体用于:Further, the proxy business logicprocessing service entity 501 is specifically used for:

接收客户端发送的待处理消息,根据待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体。Receive the pending message sent by the client, and forward the pending message to the corresponding business logic processing service entity according to the version information in the pending message.

更进一步,代理业务逻辑处理服务实体502根据待处理消息中的版本信息,将该待处理消息转发至相应的业务逻辑处理服务实体,具体包括:Further, the proxy business logicprocessing service entity 502 forwards the to-be-processed message to the corresponding business logic processing service entity according to the version information in the to-be-processed message, which specifically includes:

根据待处理消息中的版本信息,确定待处理消息的业务逻辑处理服务标识;Determine the business logic processing service identifier of the to-be-processed message according to the version information in the to-be-processed message;

将待处理消息转发至业务逻辑处理服务标识对应的业务逻辑处理服务实体。Forward the to-be-processed message to the business logic processing service entity corresponding to the business logic processing service identifier.

优选的,如图6所示,该系统中还包括数据库实体503;Preferably, as shown in FIG. 6 , the system also includes adatabase entity 503;

此时,业务逻辑处理服务实体502处理待处理消息,具体包括:At this time, the business logicprocessing service entity 502 processes the to-be-processed message, which specifically includes:

业务逻辑处理服务实体从数据库实体503中读写数据,并对待处理消息进行处理。The business logic processing service entity reads and writes data from thedatabase entity 503 and processes the messages to be processed.

进一步,代理业务逻辑处理服务实体501、业务逻辑处理服务实体502和数据库实体503均集成设置在验证节点中。Further, the proxy business logicprocessing service entity 501, the business logicprocessing service entity 502 and thedatabase entity 503 are integrated and set in the verification node.

下面参考图7,其示出了适于用来实现本申请实施例的设备的结构示意图。Referring next to FIG. 7 , it shows a schematic structural diagram of a device suitable for implementing the embodiments of the present application.

如图7所示,该设备包括中央处理单元(CPU)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有节点操作所需的各种程序和数据。CPU701、ROM702以及RAM703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。As shown in FIG. 7, the apparatus includes a central processing unit (CPU) 701, which can be processed according to a program stored in a read only memory (ROM) 702 or a program loaded from astorage section 708 into a random access memory (RAM) 703 Various appropriate actions and processes are performed. In theRAM 703, various programs and data necessary for node operation are also stored. TheCPU 701 , theROM 702 , and theRAM 703 are connected to each other through abus 704 . An input/output (I/O)interface 705 is also connected tobus 704 .

以下部件连接至I/O接口705:包括键盘、鼠标等的输入部分706;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分707;包括硬盘等的存储部分708;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器710也根据需要连接至I/O接口705。可拆卸介质711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器710上,以便于从其上读出的计算机程序根据需要被安装入存储部分708。The following components are connected to the I/O interface 705: aninput section 706 including a keyboard, a mouse, etc.; anoutput section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; astorage section 708 including a hard disk, etc. ; and acommunication section 709 including a network interface card such as a LAN card, a modem, and the like. Thecommunication section 709 performs communication processing via a network such as the Internet. Adrive 710 is also connected to the I/O interface 705 as needed. Aremovable medium 711, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is mounted on thedrive 710 as needed so that a computer program read therefrom is installed into thestorage section 708 as needed.

特别地,根据本公开的实施例,上文参考图2描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括有形地包含在机器可读介质上的计算机程序,所述计算机程序包含用于执行图2的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质711被安装。In particular, according to an embodiment of the present disclosure, the process described above with reference to FIG. 2 may be implemented as a computer software program. For example, embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing the method of FIG. 2 . In such an embodiment, the computer program may be downloaded and installed from the network via thecommunication portion 709 and/or installed from theremovable medium 711 .

附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,所述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logic for implementing the specified logic Executable instructions for the function. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.

描述于本申请实施例中所涉及到的单元或模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元或模块也可以设置在处理器中,例如,可以描述为:一种处理器包括XX单元、YY单元以及ZZ单元。其中,这些单元或模块的名称在某种情况下并不构成对该单元或模块本身的限定,例如,XX单元还可以被描述为“用于XX的单元”。The units or modules involved in the embodiments of the present application may be implemented in a software manner, and may also be implemented in a hardware manner. The described units or modules can also be provided in the processor, for example, it can be described as: a processor includes a XX unit, a YY unit and a ZZ unit. Wherein, the names of these units or modules do not constitute a limitation on the units or modules themselves under certain circumstances, for example, the XX unit may also be described as a "unit for XX".

作为另一方面,本申请还提供了一种计算机可读存储介质,该计算机可读存储介质可以是上述实施例中所述装置中所包含的计算机可读存储介质;也可以是单独存在,未装配入设备中的计算机可读存储介质。计算机可读存储介质存储有一个或者一个以上程序,所述程序被一个或者一个以上的处理器用来执行描述于本申请的公式输入方法。As another aspect, the present application also provides a computer-readable storage medium, and the computer-readable storage medium may be the computer-readable storage medium included in the apparatus described in the foregoing embodiments; A computer-readable storage medium that fits into a device. The computer-readable storage medium stores one or more programs used by one or more processors to execute the formula input method described in this application.

以上描述仅为本申请的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本申请中所涉及的发明范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离所述发明构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本申请中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present application and an illustration of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, and should also cover the above-mentioned technical features without departing from the inventive concept. Other technical solutions formed by any combination of its equivalent features. For example, a technical solution is formed by replacing the above-mentioned features with the technical features disclosed in this application (but not limited to) with similar functions.

Claims (12)

CN201710353248.XA2017-05-182017-05-18 A message processing method, device and system at a node of a blockchainExpired - Fee RelatedCN107277108B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201710353248.XACN107277108B (en)2017-05-182017-05-18 A message processing method, device and system at a node of a blockchain

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201710353248.XACN107277108B (en)2017-05-182017-05-18 A message processing method, device and system at a node of a blockchain

Publications (2)

Publication NumberPublication Date
CN107277108A CN107277108A (en)2017-10-20
CN107277108Btrue CN107277108B (en)2020-09-08

Family

ID=60064017

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201710353248.XAExpired - Fee RelatedCN107277108B (en)2017-05-182017-05-18 A message processing method, device and system at a node of a blockchain

Country Status (1)

CountryLink
CN (1)CN107277108B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN107947980B (en)*2017-11-232020-05-08深圳壹账通智能科技有限公司Distributed system operation method and system
CN109102272A (en)*2018-08-012018-12-28中国联合网络通信集团有限公司Digital literary property protection method, device, equipment and storage medium
CN113688175B (en)*2020-05-182024-10-18北京沃东天骏信息技术有限公司Data processing method and device
CN113190532A (en)*2021-05-202021-07-30腾讯科技(深圳)有限公司Data processing method, device, equipment and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105404701A (en)*2015-12-312016-03-16浙江图讯科技股份有限公司Peer-to-peer network-based heterogeneous database synchronization method
CN106385319A (en)*2016-09-292017-02-08江苏通付盾科技有限公司Verification method for information in block chain network and verification system thereof
CN106530083A (en)*2016-10-272017-03-22上海亿账通区块链科技有限公司Multi-chain management method and system based on block chain
CN106603698A (en)*2016-12-282017-04-26北京果仁宝科技有限公司Block chain consensus method based on DPOS and nodes
CN106650344A (en)*2016-12-072017-05-10清华大学Block chain-based data storage method with third-party authentication

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2016022791A2 (en)*2014-08-062016-02-11Mido Play Inc.Single platform system for multiple jurisdiction lotteries

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105404701A (en)*2015-12-312016-03-16浙江图讯科技股份有限公司Peer-to-peer network-based heterogeneous database synchronization method
CN106385319A (en)*2016-09-292017-02-08江苏通付盾科技有限公司Verification method for information in block chain network and verification system thereof
CN106530083A (en)*2016-10-272017-03-22上海亿账通区块链科技有限公司Multi-chain management method and system based on block chain
CN106650344A (en)*2016-12-072017-05-10清华大学Block chain-based data storage method with third-party authentication
CN106603698A (en)*2016-12-282017-04-26北京果仁宝科技有限公司Block chain consensus method based on DPOS and nodes

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"区块链颠覆全球金融业";秦谊;《金融电子化》;20160315;全文*

Also Published As

Publication numberPublication date
CN107277108A (en)2017-10-20

Similar Documents

PublicationPublication DateTitle
US20250181574A1 (en)System and method for a hybrid contract execution environment
US10942918B2 (en)Self-cleaning token vault
US10963400B2 (en)Smart contract creation and monitoring for event identification in a blockchain
CN110121727B (en)Method and system for providing authenticated, auditable and immutable input for intelligent contracts
US20190188706A1 (en)Transference tracking
US20200074458A1 (en)Privacy preserving transaction system
US11720545B2 (en)Optimization of chaincode statements
CN109472678B (en)Accounting book management method based on block chain, electronic device and readable storage medium
US20200184470A1 (en)Identity ecosystem
US10614454B1 (en)Remote population and redaction of high security data
US20200380505A1 (en)Auto-pilot transactions using smart contracts
US11032083B2 (en)Atomic transactional processing
CN111311407B (en) Data processing method, device and electronic device based on blockchain system
CN107277108B (en) A message processing method, device and system at a node of a blockchain
CN111598575A (en)Business process control method and device, electronic equipment and readable storage medium
WO2020055413A1 (en)Blockchain for audit
US12063166B1 (en)Resource management for services
CN113835780A (en) Incident response method and device
CN114637801A (en) Data import method, apparatus, computer equipment and storage medium
KR20230132878A (en) Reduce transaction cancellations in execute-order-verify blockchain models
WO2020155167A1 (en)Application of cross-organizational transactions to blockchain
CN113592645B (en) Data verification methods and devices
US11348101B2 (en)Post-settlement processes
CN118520001A (en)Method, system, terminal and storage medium for verifying idempotency of method operation
CN118018602A (en)Data processing method, device, equipment and medium based on block chain

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
CF01Termination of patent right due to non-payment of annual fee
CF01Termination of patent right due to non-payment of annual fee

Granted publication date:20200908


[8]ページ先頭

©2009-2025 Movatter.jp