CN112001796A - Method and device for processing service in block chain system - Google Patents

Method and device for processing service in block chain system Download PDF

Info

Publication number
CN112001796A
CN112001796A CN202011154679.1A CN202011154679A CN112001796A CN 112001796 A CN112001796 A CN 112001796A CN 202011154679 A CN202011154679 A CN 202011154679A CN 112001796 A CN112001796 A CN 112001796A
Authority
CN
China
Prior art keywords
transaction
blockchain
blockchains
corresponds
determining
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.)
Pending
Application number
CN202011154679.1A
Other languages
Chinese (zh)
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.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information 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 Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202011154679.1A priority Critical patent/CN112001796A/en
Publication of CN112001796A publication Critical patent/CN112001796A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Health & Medical Sciences (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • Technology Law (AREA)
  • General Business, Economics & Management (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

An embodiment of the present specification provides a method and an apparatus for performing service processing in a blockchain system, where the blockchain system includes N independent blockchains, and the method includes: acquiring a first transaction based on the received service processing request; determining, based on a predetermined rule, that a first transaction corresponds to a first blockchain of the N blockchains; and sending the first transaction to the first blockchain for service processing.

Description

Method and device for processing service in block chain system
Technical Field
The embodiment of the present specification relates to the technical field of blockchain, and more particularly, to a method and an apparatus for performing service processing in a blockchain system.
Background
The block chain technology is also called as distributed book technology, is decentralized distributed database technology and is characterized by decentralized, transparent disclosure, no tampering and trusty. Each transaction of the blockchain is broadcast to the blockchain nodes of the whole network, and each whole node has full and consistent data. In a federation chain, a user terminal typically uses a blockchain to perform service processing, such as processing for certificate storage and transfer, through a blockchain platform. However, in a single chain scenario, long runs accumulate large amounts of stored data, and accounts are becoming larger and larger, so that the processing power of the single chain is reduced. In addition, during periods of more concurrent transactions (e.g., twenty-one periods), the access pressure of a single chain increases, so that the processing of the single chain cannot meet the traffic demand.
Disclosure of Invention
The embodiments of the present disclosure are directed to provide a more efficient method for performing service processing in a blockchain system, so as to solve the deficiencies in the prior art.
To achieve the above object, one aspect of the present specification provides a method for performing service processing in a blockchain system, where the blockchain system includes N independent blockchains, and the method includes:
acquiring a first transaction based on the received service processing request;
determining, based on a predetermined rule, that a first transaction corresponds to a first blockchain of the N blockchains;
and sending the first transaction to the first blockchain for service processing.
In one embodiment, the method further includes, after determining that a first transaction corresponds to a first blockchain of the N blockchains based on a predetermined rule, recording a correspondence of the first transaction to the first blockchain.
In one embodiment, the method is performed by a blockchain platform, and the blockchain platform is connected to the N blockchains, respectively, wherein the received service processing request is the first transaction.
In one embodiment, determining that a first transaction corresponds to a first blockchain of the N blockchains based on a predetermined rule includes determining that the first transaction corresponds to the first blockchain based on a number of the first transaction.
In one embodiment, determining that a first transaction corresponds to a first blockchain of the N blockchains based on a predetermined rule includes determining that the first transaction corresponds to the first blockchain by calculating a hash value of the first transaction based on a predetermined hash algorithm.
In one embodiment, sending the first transaction to the first blockchain for transaction processing includes sending the first transaction to the first blockchain for credentialing transaction processing.
In one embodiment, the first contract is invoked in the first transaction, the method further comprising:
receiving a third transaction for deploying the first contract;
sending the third transactions to the N blockchains, respectively, to deploy the first contracts in the N blockchains, respectively.
In one embodiment, the method further includes, after determining that the first transaction corresponds to a first blockchain of the N blockchains based on a predetermined rule, obtaining an identifier of the first transaction, where a predetermined bit of the identifier of the first transaction is used to indicate the first blockchain.
In one embodiment, obtaining the identity of the first transaction includes calculating a hash value of the first transaction, and generating the identity of the first transaction based on the hash value of the first transaction.
Another aspect of the present specification provides an apparatus for performing service processing in a blockchain system, where the blockchain system includes N independent blockchains, the apparatus including:
an acquisition unit configured to acquire a first transaction based on the received service processing request;
a determining unit configured to determine, based on a predetermined rule, that a first transaction corresponds to a first blockchain of the N blockchains;
a first sending unit configured to send the first transaction to the first blockchain for service processing.
In one embodiment, the apparatus further includes a recording unit configured to record a correspondence relationship between a first transaction and a first blockchain of the N blockchains after determining that the first transaction corresponds to the first blockchain based on a predetermined rule.
In one embodiment, the apparatus is deployed on a blockchain platform, and the blockchain platform is connected to the N blockchains, respectively, where the received service processing request is the first transaction.
In one embodiment, the determining unit is further configured to determine that the first transaction corresponds to the first blockchain based on a number of the first transaction.
In one embodiment, the determining unit is further configured to determine that the first transaction corresponds to the first blockchain by calculating a hash value of the first transaction based on a predetermined hash algorithm.
In one embodiment, the first sending unit is further configured to send the first transaction to the first blockchain for performing a credentialing business process.
In one embodiment, the first contract is invoked in the first transaction, the apparatus further comprising:
a receiving unit configured to receive a third transaction for deploying the first contract;
a second sending unit configured to send the third transactions to the N blockchains, respectively, so as to deploy the first contracts in the N blockchains, respectively.
In one embodiment, the apparatus further includes an obtaining unit configured to obtain an identifier of the first transaction after determining that the first transaction corresponds to a first blockchain of the N blockchains based on a predetermined rule, where a predetermined bit of the identifier of the first transaction is used to indicate the first blockchain.
In one embodiment, the obtaining unit includes a calculating subunit configured to calculate a hash value of the first transaction, and a generating subunit configured to generate the identification of the first transaction based on the hash value of the first transaction.
Another aspect of the present specification provides a computer readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform any one of the above methods.
Another aspect of the present specification provides a computing device comprising a memory having stored therein executable code, and a processor that, when executing the executable code, implements any of the methods described above.
By means of the scheme for performing service processing in the blockchain system according to the embodiment of the present disclosure, transactions are evenly distributed to a plurality of blockchains for processing, so that the blockchain system can be provided with parallel expanded capacity and processing capability through the plurality of blockchains, and compared with a single blockchain, the read/write pressure is reduced, the processing efficiency of the blockchain system is improved, and especially in a traffic burst period, the capacity and the processing capability can be quickly expanded and the pressure can be dispersed in parallel.
Drawings
The embodiments of the present specification may be made more clear by describing the embodiments with reference to the attached drawings:
FIG. 1 illustrates a schematic diagram of a blockchain system in accordance with embodiments of the present disclosure;
FIG. 2 is a flow diagram illustrating a method for performing traffic processing in a blockchain system according to an embodiment of the present disclosure;
FIG. 3 shows a content diagram of transaction 1 (Tx 1);
FIG. 4 shows a schematic diagram of a process for generating an identification of transaction 1;
fig. 5 illustrates an apparatus 500 for performing traffic processing in a blockchain system according to an embodiment of the present disclosure.
Detailed Description
The embodiments of the present specification will be described below with reference to the accompanying drawings.
Fig. 1 shows a schematic diagram of a blockchain system according to an embodiment of the present disclosure. As shown in fig. 1, the blockchain system includes a blockchain platform 11, i.e., a blockchain platform server, and a plurality of user terminals (schematically shown as user terminals 12, 13, and 14). The user terminal is connected to the blockchain platform 11, and operates the blockchain through the blockchain platform 11. The blockchain platform 11 is connected to a plurality of independent blockchains, which are schematically illustrated in fig. 1 as blockchain 1, blockchain 2 and blockchain 3. The blockchain 1, the blockchain 2 and the blockchain 3 can be called as parallel chains of a blockchain system, and operate independently of each other, so as to process user requests respectively and store transaction data respectively, thereby improving the processing capacity and data storage capacity of the system.
The blockchain system including the blockchain 1 to the blockchain 3 is, for example, a system for storing certificates, the user a may send a request to the blockchain platform 11 through, for example, the user terminal 12, to send a transaction to the blockchain system, after receiving the request, the blockchain platform 11 sends the corresponding transaction to one of the blockchain 1 to the blockchain 3, to store the transaction into the corresponding blockchain, and returns an identifier of the transaction to the user terminal 12, where the identifier of the transaction may be a hash value of the transaction. Subsequently, when user a wishes to query for the transaction, user a may provide an identification of the transaction to blockchain platform 11 for querying for the transaction. The transactions are distributed to the blockchain 1, the blockchain 2 and the blockchain 3 respectively to be processed, so that the effect of load balancing is achieved.
It is to be understood that the blockchain system shown in fig. 1 is merely exemplary, and the blockchain system according to embodiments of the present disclosure is not limited thereto. For example, each user terminal may assign transactions to and connect with a blockchain through a local client, thereby eliminating the need for assignment through blockchain platform 11. The above-described processing will be described in detail below.
Fig. 2 is a flowchart illustrating a method for performing service processing in a blockchain system according to an embodiment of the present specification, where the blockchain system includes N independent blockchains, and the method includes:
step S202, transaction 1 is obtained based on the received service processing request;
step S204, determining that the transaction 1 corresponds to the block chain 1 based on a predetermined rule;
step S206, sending the transaction 1 to the blockchain 1 for performing service processing.
In one embodiment, the method of FIG. 2 is performed by the blockchain platform 11 of FIG. 1.
First, in step S202, transaction 1 is acquired based on the received service processing request.
The blockchain system may be used to handle a single service or may be used to handle multiple services. For example, the blockchain system is used to process a credentialing service. For example, user a may use his account a to send a request to the blockchain platform 11 through the user terminal 12 to certify data 1 into the blockchain system.
In one embodiment, the account a may be the only account that user a registered with blockchain platform 11. That is, the account a is managed by the blockchain platform 11, and is not an account in a certain blockchain, for example, the account name of the account a is Alice. In this case, after receiving the deposit request, the blockchain platform 11 generates a transaction 1 corresponding to the deposit request, the transaction 1 may call a contract for deposit deployed in the blockchain 1, and the transaction 1 includes the data 1 to be deposited. Fig. 3 shows a content diagram of transaction 1 (Tx 1). As shown in fig. 3, the sending account of transaction 1 (see "From" field in fig. 3) is account B, where "0 x507a …" is the account address of account B, which is the account in blockchain 1 owned by blockchain platform 11. The receive account field of transaction 1 (i.e., the "To" field in FIG. 3) is the address of contract 1 called in transaction 1, the call To the STORE function in contract 1 is represented in the data field of transaction 1, and data 1 To be passed into the STORE function is included in the data field. In addition, blockchain platform 11 also generates a digital signature of account B for transaction 1.
In another embodiment, the account a may also be a blockchain account (i.e., an account address in a blockchain) applied by the user a, so that the service processing request may be transaction 1. That is, the user terminal 12 generates transaction 1 and sends transaction 1 to the blockchain platform 11. In this case, the form of transaction 1 is substantially the same as that of transaction 1 shown in fig. 3, except that the sending account for transaction 1 in this embodiment is account a, and the user terminal 12 sends the digital signature of transaction 1 through account a to the blockchain platform 11 together.
In one embodiment, in a case that the account a is a blockchain account, a public key of the account a may be obtained in advance in each blockchain, so that each blockchain may receive the transaction sent by the account a, and each blockchain may locally record status information of the account a after the transaction sent by the account a is first received.
The contract 1 may be pre-deployed into each of the blockchains 1 to 3. For example, a transaction for deploying contract 1 in a blockchain may be sent by user terminal 12 to blockchain platform 11, and blockchain platform 11, after receiving the transaction, may send the transaction to each blockchain, so that contract 1 is deployed in each blockchain, so that subsequent transactions for performing a forensic service may be assigned to any one blockchain and undergo forensic processing by calling contract 1 in the blockchain.
In step S204, it is determined that transaction 1 corresponds to blockchain 1 based on a predetermined rule.
Various predetermined allocation rules may be set to allocate transaction 1 to one of blockchains 1 to 3, as long as the predetermined allocation rules substantially evenly allocate transactions to blockchains 1 to 3, thereby load balancing blockchains 1 to 3.
In one embodiment, the blockchain platform 11 may number the received transaction and assign the number according to a remainder of dividing the number by 3, for example, the remainder is 0, 1, 2, and 2, 3.
In another embodiment, the blockchain platform 11 may perform a hash operation on the transaction body of the transaction 1, wherein the hash operation is, for example, some random operation, and the operation result is any one of the values 1, 2, and 3, so that the transaction 1 may be assigned to a blockchain according to the result of the hash operation.
In another embodiment, the blockchain platform 11 may perform a hash operation on the transaction body of transaction 1, for example, a sha256 hash operation, and the hash value of transaction 1 obtained by the hash operation may be used as the unique identifier of transaction 1. After the hash operation is performed, transaction 1 may be assigned to a blockchain according to predetermined bits of the hash value. For example, if the first two digits of the hash value are 01, transaction 1 is assigned to blockchain 1, if the first two digits of the hash value are 10, transaction 1 is assigned to blockchain 2, and if the first two digits of the hash value are 11, transaction 1 is assigned to blockchain 3.
In another embodiment, where transaction 1 is sent by the user terminal to blockchain platform 11, blockchain platform 11 may determine which blockchain to assign transaction 1 to based on the geographic location of the send account for transaction 1. For example, it may be contemplated that transactions from Beijing are assigned to blockchain 1, transactions from Shanghai are assigned to blockchain 2, and transactions from Shenzhen are assigned to blockchain 3.
In step S206, transaction 1 is sent to blockchain 1 for traffic processing.
Blockchain platform 11 may send transaction 1 to any node in blockchain 1. The nodes in blockchain 1, after receiving transaction 1, broadcast transaction 1 into blockchain 1. After the nodes in the blockchain 1 recognize the transaction 1, the transaction 1 is executed in each whole node in the blockchain 1, so that the contract 1 called in the transaction 1 is executed, the state data of the contract 1 is updated, namely, the data 2 acquired by processing the data 1 through executing the contract 1 is stored in the account state of the contract 1, and the transaction 1 is stored in the blockchain database. Alternatively, the data 2 may be stored in a receipt for the transaction 1 for querying. After storing the transaction 1 into the blockchain 1, the node in the blockchain 1 can calculate the hash value of the transaction 1 as the identifier of the transaction 1, and record the association relationship between the hash value of the transaction 1 and the storage location of the transaction 1, so that the transaction content of the transaction 1 can be queried based on the hash value.
After each node in blockchain 1 deposits transaction 1, blockchain platform 11 may obtain an identification (e.g., a hash value) of transaction 1 and/or an identification of data 2 from any node in blockchain 1, or after any node in blockchain 1 executes transaction 1 and deposits transaction 1 in blockchain 1, may actively push the identification of transaction 1 and/or the identification of data 2 to blockchain platform 11. The blockchain platform 11 may then send the identification of transaction 1 and/or the identification of data 2 to the user terminal 12, so that the user terminal 12 may subsequently query for data 2 based on the identification of transaction 1 and/or the identification of data 2.
In one embodiment, after determining that transaction 1 corresponds to blockchain 1 based on predetermined rules, blockchain platform 11 records the correspondence of transaction 1 to blockchain 1. In order to record the correspondence between transaction 1 and blockchain 1, blockchain platform 11 needs to record the correspondence between the unique identifier of transaction 1 and the unique identifier of blockchain 1, so as to perform subsequent query on transaction 1. As described above, after blockchain platform 11 sends transaction 1 to blockchain 1, blockchain 1 may return the hash value (e.g., 0x487b …) for transaction 1 to blockchain platform 11, so that blockchain platform 11 may record a mapping table of hash values for transactions to blockchains as shown in table 1.
TABLE 1
Trading Block chain
0x487b… Block chain 1
0x768a… Block chain 2
0x3876… Block chain 3
As shown in table 1, the blockchain platform 11 may record the correspondence between the hash value of transaction 1 and the blockchain 1 in table 1 stored locally for subsequent query of transaction 1. For example, when user a wishes to query for transaction 1, user a may send a request to the blockchain platform through user terminal 12 to query transaction 1, including the hash value of transaction 1, so that blockchain platform 11 may determine that transaction 1 is assigned to blockchain 1 based on table 1 and read transaction 1 from blockchain 1.
In another embodiment, blockchain platform 11 may obtain the identification of transaction 1 after determining that transaction 1 corresponds to blockchain 1 based on predetermined rules. In one embodiment, blockchain platform 11 may obtain the identification of transaction 1 from any node in blockchain 1. Fig. 4 shows a schematic diagram of a process of generating an identification of transaction 1. As shown in fig. 4, after receiving transaction 1 (TX 1), the node in blockchain 1 may first calculate a hash value of the transaction body of transaction 1 through step (r). After calculating the hash value of transaction 1, the node in blockchain 1 may add a predetermined bit (e.g. a head position) to a predetermined position (e.g. a head position) of a string of the hash value (e.g. "01" in fig. 4) as shown in step (ii), thereby generating an identifier of transaction 1, where the predetermined bit is used to indicate blockchain 1. It is to be understood that although fig. 4 illustrates adding two bits as an example, the embodiments are not limited thereto, for example, in practice, in the case that there are more blockchains included in the blockchain system, more bits may be added, such as 4 bits, 8 bits, etc. Alternatively, the node in the blockchain 1 may modify a predetermined bit (e.g., the first two bits in the string shown in fig. 4) included in the string as shown in step (c), so as to generate the identifier of transaction 1, where the predetermined bit is used to indicate the blockchain 1. The blockchain platform 11 may then obtain the identity of transaction 1 from any node of the blockchain 1. In this case, since transaction 1's assigned blockchain 1 is indicated in transaction 1's identification, there would be no need to record the transaction to blockchain mapping table as described above. In another embodiment, blockchain platform 11 may itself generate the address for transaction 1 based on predetermined calculation rules. For example, the blockchain platform first computes a hash value for transaction 1 and modifies a predetermined bit of the hash value to indicate the blockchain, thereby obtaining an identification of transaction 1. Blockchain platform 11, after obtaining the identification of transaction 1, may send the identification of transaction 1 to the user terminal for querying of transaction 1 by the user terminal based on the identification. After generating the identification of transaction 1 in blockchain 1, the mapping relationship between the identification and the storage location of transaction 1 can be recorded, so that transaction 1 can be read based on the identification.
In another embodiment, the method shown in fig. 2 may be performed by a user terminal. In this case, the user terminal 12 can directly connect to the respective blockchains 1 to 3 without connecting to the respective blockchains through the blockchain platform 11. After receiving an instruction of performing service processing by a user a, a client in the user terminal 12 generates a transaction 1, determines that the transaction 1 corresponds to the blockchain 1 based on a predetermined rule, sends the transaction 1 to the blockchain 1, and then locally records a corresponding relationship between the transaction 1 and the blockchain 1 in the user terminal 12. In the case where other users may query transaction 1, user terminals 12, 13 and 14 may communicate with each other so that the transactions stored by the respective user terminals are consistent with the mapping table of the blockchain. Wherein the user terminals 12, 13 and 14 can communicate directly through the underlying layers. Alternatively, the user terminals 12, 13 and 14 may communicate with each other through the blockchain platform, thereby serving the purpose of unifying mapping tables.
In another embodiment, as indicated above, blockchain platform 11 may calculate a hash value for transaction 1 as the identification of transaction 1 and assign transaction 1 based on predetermined bits of the hash value, e.g., the first two bits of the hash value are 01, then transaction 1 is assigned to blockchain 1. Thus, when transaction 1 is subsequently queried, the blockchain assigned for transaction 1 can be determined directly from the hash value.
Fig. 5 illustrates an apparatus 500 for performing traffic processing in a blockchain system, the blockchain system including N independent blockchains, according to an embodiment of the present disclosure, where the apparatus 500 includes:
an obtaining unit 51 configured to obtain a first transaction based on the received service processing request;
a determining unit 52 configured to determine, based on a predetermined rule, that a first transaction corresponds to a first blockchain of the N blockchains;
a first sending unit 53, configured to send the first transaction to the first blockchain for performing service processing.
In one embodiment, the apparatus 500 further includes a recording unit 54 configured to record a correspondence relationship between a first transaction and a first blockchain of the N blockchains after determining that the first transaction corresponds to the first blockchain based on a predetermined rule.
In one embodiment, the apparatus 500 is deployed on a blockchain platform, and the blockchain platform is connected to the N blockchains respectively, where the received service processing request is the first transaction.
In one embodiment, the determining unit 52 is further configured to determine that the first transaction corresponds to the first blockchain based on the number of the first transaction.
In one embodiment, the determining unit 52 is further configured to determine that the first transaction corresponds to the first blockchain by calculating a hash value of the first transaction based on a predetermined hash algorithm.
In one embodiment, the first sending unit 53 is further configured to send the first transaction to the first blockchain for performing a credentialing business process.
In one embodiment, the first contract is invoked in the first transaction, the apparatus 500 further comprising:
a receiving unit 55 configured to receive a third transaction for deploying the first contract;
a second sending unit 56, configured to send the third transactions to the N blockchains, respectively, so as to deploy the first contracts in the N blockchains, respectively.
In one embodiment, the apparatus 500 further includes an obtaining unit 57 configured to obtain an identifier of the first transaction after determining that the first transaction corresponds to a first blockchain of the N blockchains based on a predetermined rule, where a predetermined bit of the identifier of the first transaction is used to indicate the first blockchain.
In one embodiment, the obtaining unit 57 includes a calculating subunit 571 configured to calculate a hash value of the first transaction, and a generating subunit 572 configured to generate an identifier of the first transaction based on the hash value of the first transaction.
Another aspect of the present specification provides a computer readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform any one of the above methods.
Another aspect of the present specification provides a computing device comprising a memory having stored therein executable code, and a processor that, when executing the executable code, implements any of the methods described above.
By means of the scheme for performing service processing in the blockchain system according to the embodiment of the present disclosure, transactions are evenly distributed to a plurality of blockchains for processing, so that the blockchain system can be provided with parallel expanded capacity and processing capability through the plurality of blockchains, and compared with a single blockchain, the read/write pressure is reduced, the processing efficiency of the blockchain system is improved, and especially in a traffic burst period, the capacity and the processing capability can be quickly expanded and the pressure can be dispersed in parallel.
It is to be understood that the terms "first," "second," and the like, herein are used for descriptive purposes only and not for purposes of limitation, to distinguish between similar concepts.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
It will be further appreciated by those of ordinary skill in the art that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application. The software modules may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (20)

1. A method for traffic processing in a blockchain system, the blockchain system comprising N mutually independent blockchains, the method comprising:
acquiring a first transaction based on the received service processing request;
determining, based on a predetermined rule, that a first transaction corresponds to a first blockchain of the N blockchains;
and sending the first transaction to the first blockchain for service processing.
2. The method of claim 1, further comprising, after determining that a first transaction corresponds to a first blockchain of the N blockchains based on a predetermined rule, recording a correspondence of the first transaction to the first blockchain.
3. The method of claim 1, wherein the method is performed by a blockchain platform, the blockchain platform being connected to the N blockchains, respectively, wherein the received transaction processing request is the first transaction.
4. The method of any of claims 1-3, wherein determining that a first transaction corresponds to a first blockchain of the N blockchains based on a predetermined rule comprises determining that the first transaction corresponds to the first blockchain based on a number of the first transaction.
5. The method of any of claims 1-3, wherein determining that a first transaction corresponds to a first blockchain of the N blockchains based on a predetermined rule comprises determining that the first transaction corresponds to the first blockchain by calculating a hash value for the first transaction based on a predetermined hash algorithm.
6. The method of any of claims 1-3, wherein sending the first transaction to the first blockchain for transaction processing comprises sending the first transaction to the first blockchain for credentialing transaction processing.
7. The method of claim 1, wherein a first contract is invoked in the first transaction, the method further comprising:
receiving a third transaction for deploying the first contract;
sending the third transactions to the N blockchains, respectively, to deploy the first contracts in the N blockchains, respectively.
8. The method of claim 1, further comprising, upon determining, based on a predetermined rule, that a first transaction corresponds to a first blockchain of the N blockchains, obtaining an identification of the first transaction, a predetermined bit of the identification of the first transaction indicating the first blockchain.
9. The method of claim 8, wherein obtaining the identification of the first transaction comprises calculating a hash value of the first transaction, generating the identification of the first transaction based on the hash value of the first transaction.
10. An apparatus for traffic processing in a blockchain system comprising N mutually independent blockchains, the apparatus comprising:
an acquisition unit configured to acquire a first transaction based on the received service processing request;
a determining unit configured to determine, based on a predetermined rule, that a first transaction corresponds to a first blockchain of the N blockchains;
a first sending unit configured to send the first transaction to the first blockchain for service processing.
11. The apparatus according to claim 10, further comprising a recording unit for recording a correspondence of a first transaction with a first blockchain of the N blockchains after determining that the first transaction corresponds to the first blockchain based on a predetermined rule.
12. The apparatus of claim 10, wherein the apparatus is deployed on a blockchain platform, the blockchain platform being connected to the N blockchains, respectively, and wherein the received transaction processing request is the first transaction.
13. The apparatus of any of claims 10-12, wherein the determination unit is further configured to determine that the first transaction corresponds to the first blockchain based on a number of the first transaction.
14. The apparatus according to any of claims 10-12, wherein the determining unit is further configured to determine that the first transaction corresponds to the first blockchain by calculating a hash value of the first transaction based on a predetermined hash algorithm.
15. The apparatus according to any of claims 10-12, wherein the first sending unit is further configured to send the first transaction to the first blockchain for witness handling.
16. The apparatus of claim 10, wherein a first contract is invoked in the first transaction, the apparatus further comprising:
a receiving unit configured to receive a third transaction for deploying the first contract;
a second sending unit configured to send the third transactions to the N blockchains, respectively, so as to deploy the first contracts in the N blockchains, respectively.
17. The apparatus according to claim 10, further comprising an obtaining unit configured to obtain an identification of the first transaction after determining that the first transaction corresponds to a first blockchain of the N blockchains based on a predetermined rule, the predetermined bit of the identification of the first transaction indicating the first blockchain.
18. The apparatus according to claim 17, wherein the obtaining unit comprises a calculating sub-unit configured to calculate a hash value of the first transaction, a generating sub-unit configured to generate the identification of the first transaction based on the hash value of the first transaction.
19. A computer-readable storage medium, on which a computer program is stored which, when executed in a computer, causes the computer to carry out the method of any one of claims 1-9.
20. A computing device comprising a memory having executable code stored therein and a processor that, when executing the executable code, implements the method of any of claims 1-9.
CN202011154679.1A 2020-10-26 2020-10-26 Method and device for processing service in block chain system Pending CN112001796A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011154679.1A CN112001796A (en) 2020-10-26 2020-10-26 Method and device for processing service in block chain system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011154679.1A CN112001796A (en) 2020-10-26 2020-10-26 Method and device for processing service in block chain system

Publications (1)

Publication Number Publication Date
CN112001796A true CN112001796A (en) 2020-11-27

Family

ID=73474460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011154679.1A Pending CN112001796A (en) 2020-10-26 2020-10-26 Method and device for processing service in block chain system

Country Status (1)

Country Link
CN (1) CN112001796A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112435030A (en) * 2021-01-27 2021-03-02 支付宝(杭州)信息技术有限公司 Data processing method and device based on block chain and electronic equipment
CN113194143A (en) * 2021-04-30 2021-07-30 支付宝(杭州)信息技术有限公司 Block chain account creating method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109150607A (en) * 2018-08-22 2019-01-04 中链科技有限公司 Classification management-control method and device for block chain network
US20190327094A1 (en) * 2017-07-14 2019-10-24 Zhongan Information Technology Service Co., Ltd. Information authentication method and system
CN111143371A (en) * 2019-12-27 2020-05-12 中国银联股份有限公司 Data query method, device, equipment, system and medium
CN111724169A (en) * 2020-03-05 2020-09-29 支付宝(杭州)信息技术有限公司 Service processing system, service processing method, device and equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190327094A1 (en) * 2017-07-14 2019-10-24 Zhongan Information Technology Service Co., Ltd. Information authentication method and system
CN109150607A (en) * 2018-08-22 2019-01-04 中链科技有限公司 Classification management-control method and device for block chain network
CN111143371A (en) * 2019-12-27 2020-05-12 中国银联股份有限公司 Data query method, device, equipment, system and medium
CN111724169A (en) * 2020-03-05 2020-09-29 支付宝(杭州)信息技术有限公司 Service processing system, service processing method, device and equipment

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112435030A (en) * 2021-01-27 2021-03-02 支付宝(杭州)信息技术有限公司 Data processing method and device based on block chain and electronic equipment
CN113409045A (en) * 2021-01-27 2021-09-17 支付宝(杭州)信息技术有限公司 Data processing method and device based on block chain and electronic equipment
WO2022161181A1 (en) * 2021-01-27 2022-08-04 支付宝(杭州)信息技术有限公司 Data processing method and apparatus based on blockchain, and electronic device
CN113194143A (en) * 2021-04-30 2021-07-30 支付宝(杭州)信息技术有限公司 Block chain account creating method and device and electronic equipment
CN113194143B (en) * 2021-04-30 2022-09-16 支付宝(杭州)信息技术有限公司 Block chain account creating method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN110443704B (en) Method and device for sending resources in cross-link mode
CN110647559B (en) Data processing method, related node and system
CN110430235B (en) Method, apparatus, storage medium and computing device for cross-chain transmission of authenticatable messages
CN109413202B (en) System and method for sorting block chain transaction information
CN112001796A (en) Method and device for processing service in block chain system
TW201947481A (en) Virtual card generation method, user terminal and token server
CN111966731A (en) Method and device for querying data in block chain system
CN110321225B (en) Load balancing method, metadata server and computer readable storage medium
FI3864798T3 (en) System and method for interoperability of blockchains
CN110570179B (en) Order display method, device, equipment and storage medium
CN112087401A (en) Method and device for realizing service quality in distributed storage
CN113194143B (en) Block chain account creating method and device and electronic equipment
CN114884962A (en) Load balancing method and device and electronic equipment
CN112801797A (en) Method and apparatus for processing ticket data using a down-link trusted device
CN112017052B (en) Method and apparatus for deploying and invoking contracts in blockchain
CN112529709A (en) Ether house intelligent contract implementation method based on multi-sign technology
CN111737000A (en) Method for realizing load balance
CN112001800A (en) Method and device for processing service in block chain system
CN111953931A (en) Data sharing method and device and storage medium
CN114390109B (en) Service processing method, micro-service gateway and data center system
CN113222565A (en) Transaction system, transaction method, apparatus, computer device and storage medium
CN113556407A (en) Interface calling method and device for identification analysis node and electronic equipment
CN113472864A (en) High-performance block chain distributed storage system, method, equipment and storage medium
CN113177843A (en) Cross-bank loan service processing method and device based on block chain
CN112001801A (en) Method and apparatus for resource transfer in a blockchain system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40041118

Country of ref document: HK