WO2020259417A1 - Procédé et dispositif d'analyse de données pour chaîne de blocs - Google Patents

Procédé et dispositif d'analyse de données pour chaîne de blocs Download PDF

Info

Publication number
WO2020259417A1
WO2020259417A1 PCT/CN2020/097235 CN2020097235W WO2020259417A1 WO 2020259417 A1 WO2020259417 A1 WO 2020259417A1 CN 2020097235 W CN2020097235 W CN 2020097235W WO 2020259417 A1 WO2020259417 A1 WO 2020259417A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
event
data analysis
code
data
Prior art date
Application number
PCT/CN2020/097235
Other languages
English (en)
Chinese (zh)
Inventor
张龙
范瑞彬
张开翔
毛嘉宇
Original Assignee
深圳前海微众银行股份有限公司
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 深圳前海微众银行股份有限公司 filed Critical 深圳前海微众银行股份有限公司
Publication of WO2020259417A1 publication Critical patent/WO2020259417A1/fr

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing
    • 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

Definitions

  • the present invention relates to the field of Fintech, in particular to a data analysis method and device of a blockchain.
  • Blockchain technology has made the traditional financial industry gradually transforming into Finteh.
  • technology finance combined with blockchain technology, it is more important to process data in the blockchain (for example, contract account data, transaction data, and event data), such as analyzing data or synchronizing data.
  • the first solution is to design a set of dedicated interfaces at the level of smart contracts.
  • the dedicated interfaces in the smart contracts are intelligently invoked to analyze the data in the blockchain.
  • the second solution save the address of the data to be parsed on the blockchain in advance, and then call the relevant interface according to the address to obtain the data.
  • the dedicated interface since the code of the dedicated interface needs to occupy a certain amount of storage space, especially when the number of dedicated interfaces is large, the dedicated interface will cause a large storage space overhead and cause higher costs. Moreover, when the dedicated interface is complicated, it may be necessary to call different interfaces multiple times to obtain data, resulting in poor performance.
  • the second solution since the address is for a specific smart contract, when there is a new business or smart contract change, it cannot be reused, and the code needs to be revised by the technical staff, and the second solution is getting For data, it is necessary to calculate the data address according to the addressing rules in the data structure definition, which increases the amount of calculation.
  • the invention provides a block chain data analysis method and device, which are used to reduce the cost of analyzing data in the block chain and improve the performance of data analysis.
  • the first aspect of the present invention provides a block chain data analysis method, the method includes:
  • the smart contract including a construction method, an event method, and a non-constant method for creating and realizing the user service;
  • a data analysis code is generated.
  • the data analysis code includes event data analysis code for analyzing event data of the user service and Transaction data analysis code for analyzing transaction data of the user service;
  • the data analysis code is used to analyze the data in each block in the blockchain to obtain the event data and the transaction data.
  • the process of generating the event data analysis code and the transaction data analysis code has different generation methods depending on the method that it relies on.
  • generating the event data parsing code according to at least one of the construction method, event method, and non-constant method includes:
  • the JAVA contract file includes at least an acquisition method for acquiring an event object in the event method and an event class corresponding to the event method
  • the binary code of the smart contract includes at least the construction method, the event method, and the non-constant method each of which accesses the field type of the blockchain;
  • the field in the event class with the same type as the first field is converted into a JAVA object, thereby obtaining the first POJO corresponding to the event class Object, the first field type is a field type used to access the blockchain in the event method;
  • the first POJO object is filled into a preset event data analysis template to generate the event data analysis code.
  • the preset event data analysis function template at least includes a calling module, a first analysis module, and a first instantiation Module and a first storage module, the calling module is used to call the acquisition method, the first parsing module is used to parse the event object and obtain the parsed event data, the first instantiation module is used to The parsed event data is converted into a first POJO object instance, and the first storage module is used to insert the first POJO object instance into a database table, and the database table is used to store the event data and the transaction data.
  • using the event data analysis code to analyze the data in each block in the blockchain to obtain the event data includes:
  • Run the event data analysis code obtain a list of event objects in the block through the calling module in the event data analysis code, the event object list including at least one value of the event object;
  • the at least one parsed event data is respectively converted into at least one first POJO object instance through the instantiation module in the event data analysis code, and the at least one first POJO object instance and the at least one parsed One-to-one correspondence of event data;
  • the at least one POJO object instance is inserted into the database table through the storage module in the event data analysis code.
  • generating the transaction data analysis code according to at least one of the construction method, the event method, and the non-constant method includes:
  • the JAVA contract file includes at least the binary code and binary string of the smart contract, and the binary code of the smart contract includes at least the Each of the construction method and the non-constant method accesses the field type of the blockchain, and the binary string is the recursive length prefix code of the smart contract;
  • the field in the transaction method with the same type as the second field is converted into a JAVA object, thereby obtaining the second POJO corresponding to the transaction method Object, the second field type is a field type used to access the blockchain in the transaction method;
  • the second POJO object is filled with a preset transaction data analysis template to generate the transaction data analysis code.
  • the preset transaction data analysis template includes at least a matching module, a second analysis module, a second instantiation module, and a first Two storage modules, the matching module is used to determine whether the transaction method is the construction method or the non-constant method, the second analysis module is used to parse the transaction method and obtain transaction data, the second The instantiation module is used to convert transaction data into a second POJO object instance, and the second storage module is used to insert the second POJO object instance into a database table that is used to store the event data and The transaction data.
  • obtaining transaction data according to the transaction data analysis code may include but not limited to the following two situations:
  • using the transaction data analysis code to analyze the data in each block in the blockchain to obtain the transaction data includes:
  • Run the transaction data analysis code obtain the target field in the first transaction through the matching module in the transaction data analysis code, and determine the transaction type of the first transaction according to the target field, the transaction type including the first transaction A transaction type and a second transaction type, the first transaction type is a transaction type corresponding to the construction method, the second transaction type is a transaction type corresponding to the non-constant method, and the target field is used for Indicating the transaction partner of the first transaction;
  • the transaction type of the first transaction is the first transaction type
  • the first remaining character string is parsed through the second parsing module in the transaction data analysis code to obtain the first transaction data of the first transaction, and the first remaining character string is the In the recursive length prefix encoding of the first transaction, the character string after removing the same symbol as the binary character string;
  • the second POJO object instance is inserted into the database table through the second storage module in the transaction data analysis code.
  • the target field in the first transaction is obtained through the matching module in the transaction data analysis code, and the transaction type of the first transaction is determined according to the target field .
  • the method further includes:
  • the transaction type of the first transaction is the second transaction type
  • the second remaining code is analyzed through the second analysis module in the transaction data analysis code to obtain the second transaction data of the first transaction, and the second remaining code is the first
  • the code of the transaction removes the character string after the same symbol as the signature
  • a second aspect of the present invention provides an electronic device, including:
  • At least one processor and,
  • a memory communicatively connected with the at least one processor; wherein,
  • the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can execute the blockchain data analysis method.
  • a third aspect of the present invention provides a non-transitory computer-readable storage medium, the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions are used to make the computer execute the data analysis of the blockchain method.
  • a computing device includes: a memory for storing a computer program; a processor for calling the computer program stored in the memory, and executing various possible designs as in the first aspect according to the obtained program The method described in.
  • the code for analyzing data can be automatically generated according to the smart contract of the user's business. That is to say, for different user services, the user only needs to import the smart contract corresponding to each user's business. New interfaces or no need to pre-store the code for data analysis, which can reduce the storage space occupied by the code for data analysis, and can reduce the cost of parsing data in the blockchain. Moreover, the code generated according to the smart contract corresponds to the interface in the smart contract one-to-one. Therefore, during data analysis, there is no need to call multiple interfaces or calculate the address of the data to be parsed, which can improve data analysis. performance.
  • FIG. 1 is a structural block diagram of a system architecture applicable to a data analysis method provided by an embodiment of the present invention
  • FIG. 2 is a flowchart of a data analysis method of a blockchain provided by an embodiment of the present invention
  • FIG. 3 is a flowchart of generating event data analysis code in an embodiment of the present invention.
  • FIG. 5 is a flowchart of analyzing event data in a block in an embodiment of the present invention.
  • FIG. 6 is a flowchart of analyzing transaction data of the first transaction in a block in an embodiment of the present invention.
  • FIG. 7 is a structural diagram of another example of data analysis of the blockchain provided in the embodiment of the present invention.
  • the invention provides a block chain data analysis method and device, which are used to reduce the cost of analyzing data in the block chain and improve the performance of data analysis.
  • Blockchain A chain composed of a series of blocks. In addition to recording the data of the block, each block also records the Hash value of the previous block. In this way, a chain is formed.
  • a block consists of a block header and a block body.
  • the block header definition includes important fields such as the block height h, the hash value prevHash of the previous block, and the block body mainly stores transaction data.
  • Smart contract It is a computer protocol designed to spread, verify or execute the contract in an information-based way.
  • the execution process of the smart contract will be agreed and confirmed on the blockchain in the form of a transaction, which allows the absence of a third party Conduct trusted transactions, which are traceable and irreversible.
  • web3jsdk The bridging layer for JAVA language to access the blockchain, and provides related application programming interfaces (Application Programming Interface, API) to access the blockchain.
  • API Application Programming Interface
  • Solidity A high-level language for smart contracts, running on the Ethernet Virtual Machine (EVM), mainly used to write smart contracts.
  • EVM Ethernet Virtual Machine
  • JAVA An object-oriented programming language for writing desktop applications, Web applications, distributed systems, and embedded system applications.
  • opcode The operating instructions after the smart contract is compiled.
  • Event A method type of smart contract that can store parameters in the transaction log to facilitate tracking of the execution of the smart contract.
  • Simple Java Objects (Plain Ordinary Java Object, POJO): Actually they are ordinary JavaBeans, which can be understood as interfaces, classes and objects in JAVA.
  • RLP Recursive Length Prefix
  • ABSI Application Binary Interface
  • first and second in the embodiment of the present invention are only used to distinguish different objects, and do not indicate the importance or priority of each object.
  • FIG. 1 exemplarily shows a system architecture applicable to a data analysis method provided by an embodiment of the present invention.
  • the system architecture may include a data analysis device 100 and a blockchain 200. It should be noted that in FIG. 1, the data analysis device 100 and the blockchain 200 are two independent modules. In other examples, the data analysis device 100 can also be installed in the blockchain 200, which is not used here. limit.
  • the blockchain 200 may include multiple blocks.
  • the blockchain 200 includes two blocks, namely block A and block B.
  • multiple smart contracts can be set according to the user's business.
  • smart contract 1 is set in block A
  • smart contract 2 is set in block B.
  • the data analysis device 100 can obtain and analyze any type of data in each block in the blockchain 200 through different interfaces. For example, it can obtain contract account data through a contract interface, and block data can be obtained through a block interface. These two kinds of data are not parsed. However, since the event data and transaction data in the blockchain rely on smart contracts and are relatively complicated, the data analysis device 100 needs to analyze these two types of data.
  • the present invention provides a data analysis method for blockchain, which is applied to the data analysis device 100 shown in FIG. 1. Please refer to Figure 2 for the flow chart of the method, which is described as follows:
  • the data analysis device 100 may obtain the smart contract provided by the user through a preset interface, or may also obtain the smart contract in other ways, which is not limited in the embodiment of the present invention.
  • Smart contracts can be written in different programming languages. For the convenience of explanation, the following uses smart contracts as smart contracts written in the Solidity programming language as an example.
  • the UserInfo smart contract obtained by the data analysis device 100 may be as follows:
  • the UserInfo smart contract includes a construction method for creating an instance of the UserInfo smart contract, namely:
  • event modifyUserNameEvent (bytes32userName, uint8sex, address con).
  • a constant method for modifying the user's name namely:
  • the smart contract only includes a composition method, an event method, and a non-constant method. It should be understood as an example of a smart contract, rather than restricting the smart contract to only include one construction method, An event method and a non-constant method. In actual use, a smart contract can also include multiple construction methods or multiple event methods or multiple non-constant methods, which will not be repeated here.
  • the generated data analysis code includes event data analysis code for analyzing the event data of the user service and The transaction data analysis code for analyzing the transaction data of the user service.
  • Figure 3 is a flowchart for generating event data analysis code. The flowchart is described as follows:
  • the smart contract Before generating the event data analysis code according to the smart contract, the smart contract must be compiled through the compiler to obtain the compiled contract file.
  • a smart contract can be compiled into a JAVA code file by a compiler.
  • the code to compile the UserInfo smart contract can be as follows:
  • the contract file can also be other types of files.
  • the type of contract file is not limited here.
  • the contract file is a JAVA file as an example.
  • the JAVA contract file includes at least an acquisition method for acquiring an event object in the event method, an event class corresponding to the event method, and the binary code of the smart contract.
  • the binary code in the smart contract includes at least the construction method, the event method, and the non-constant method to access the field type of the blockchain.
  • JAVA file including but not limited to the following contents can be obtained:
  • getModifyUserNameEventEvents is the method used to obtain the event object in the event method
  • public static class ModifyUserNameEventResponse ⁇ is the event class corresponding to the event method
  • String ABI is the binary code of the smart contract
  • the ABI is Including the types, input parameters, output parameters of all methods in the smart contract, and the field types and field names used by each method to access the blockchain.
  • the binary string is the RLP code of the smart contract and is used to The contract instance is signed.
  • the JAVA file may also include other content, and no examples are given here.
  • the event class is modifyUserNameEvent class.
  • the first field type is the field type used to access the blockchain in the event method.
  • the first field type may be a web3jsdk type.
  • the modifyUserNameEvent class after obtaining the modifyUserNameEvent class in the JAVA file, first locate the field in the modifyUserNameEvent class whose field type is the web3jsdk type.
  • the web3jsdk type field may include Bytes32, Uint8, and Address.
  • the field is converted into a JAVA object.
  • the first mapping relationship may be: Bytes32 corresponds to String, Uint8 corresponds to int, and Address corresponds to String.
  • the first mapping relationship may be pre-stored in the data analysis apparatus 100.
  • the first POJO object corresponding to the modifyUserNameEvent class can be generated.
  • the code of the POJO object with modifyUserNameEvent class is as follows:
  • the applicant has studied the event data analysis process and learned that: for all event data, the processing process is basically the same, which can be divided into the following steps: call the get function to obtain the event object, then parse the event object, and obtain the event data of the event object , And then convert the parsed event data into a JAVA object instance, thereby inserting the JAVA object instance into the database table.
  • the processing flow can be preset to multiple modules to form a preset event data analysis template, which is stored in the data analysis device 100, so that when the event in the smart contract to be analyzed is obtained After the object, directly fill the event object into the preset event data analysis template according to the field type, so as to obtain the event data analysis code for analyzing the event data in the smart contract.
  • the implementation method is simple, and secondary development is supported.
  • the preset event data analysis function template includes at least a calling module, a first analysis module, a first instantiation module, and a first storage module.
  • the calling module is used to call the obtaining method
  • the first parsing module is used to parse the event object and obtain the parsed event data
  • the first instantiation module is used to convert the parsed event data into the first A POJO object instance
  • the first storage module is used to insert the first POJO object instance into a database table
  • the database table is used to store the event data and the transaction data.
  • the JAVA contract file includes at least the binary code and the binary string of the smart contract, and the binary code includes at least the construction method and each of the non-constant methods.
  • the field type of the blockchain, the binary string is the recursive length prefix code of the smart contract.
  • Step S41 is the same as step S31, and will not be repeated here.
  • the transaction method includes the construction method and the non-constant method in step S21, which will not be repeated here.
  • the transaction method can also be obtained from an operation instruction (opcode), for example, after obtaining the opcode in the JAVA file, the opcode is parsed to obtain the transaction method in the opcode.
  • opcode operation instruction
  • the second field type is the field type used to access the blockchain in the transaction method.
  • the second field type is the field type used to access the blockchain in the transaction method.
  • the second field type may be the same as the first field type, for example, web3jsdk type, or the second field type may also be another type different from the first field type, which is not limited here.
  • Step S43 is similar to step S33 and will not be repeated here.
  • step S34 Similar to the principle in step S34, the applicant obtains the transaction data processing process by studying the transaction data analysis process and is divided into steps: because transaction data analysis is more complicated, there is no way to directly locate it like event data (for example, different directly through get Function acquisition), the transaction can only be matched by the matching method, so as to determine whether the transaction method is a construction method or a non-constant method, and then analyze the encoding string of the transaction method (such as RLP encoding string) to obtain the transaction data of the transaction method, In this way, the parsed transaction data is converted into a POJO object instance, and the POJO object instance is inserted into the database table according to the field type.
  • event data for example, different directly through get Function acquisition
  • the transaction can only be matched by the matching method, so as to determine whether the transaction method is a construction method or a non-constant method, and then analyze the encoding string of the transaction method (such as RLP encoding string) to obtain the transaction data of the transaction method, In this way, the
  • the processing flow can be preset to multiple modules to form a preset transaction data analysis template, which is stored in the data analysis device 100, so that when the transaction in the smart contract to be analyzed is obtained
  • the POJO object corresponding to the transaction method is directly filled into the preset transaction data analysis template, so as to obtain the transaction data analysis code used to analyze the transaction data in the smart contract.
  • the preset transaction data analysis template includes at least a matching module, a second analysis module, a second instantiation module, and a second storage module.
  • the matching module is used to determine whether the transaction method is the construction method or the non-constant method
  • the second analysis module is used to analyze the transaction method and obtain transaction data
  • the second instantiation module is used to The transaction data is converted into a second POJO object instance
  • the second storage module is used to insert the second POJO object instance into a database table.
  • the data analysis device 100 may first generate the event data analysis code and then generate the transaction data analysis code; or it may first generate the transaction data analysis code and then regenerate The event data analysis code is generated, or the transaction data analysis code and the event data analysis code are generated in parallel, and the order of execution is not restricted here.
  • the data analysis device 100 can obtain each block in the block chain in turn. For example, taking the block chain shown in FIG. 1 as an example, block A is first obtained, and after analyzing the event data in block A, Get block B. Alternatively, the data analysis device 100 can also randomly acquire one of the blocks, which is not limited here. It should be noted that, for each block, the method of obtaining the event data in the block is the same. In the following, one of the blocks in the blockchain is used as an example for description.
  • the data analysis device 100 After the data analysis device 100 acquires a block, it calls the generated event data analysis code, and determines whether there is event data corresponding to the smart contract in the block by calling the module. It can be understood that if the corresponding module can be obtained by calling the module A list of event objects indicates that there is event data corresponding to the smart contract in the block, otherwise, the event data corresponding to the smart contract is not included.
  • the calling module will obtain the corresponding event data list through the get function, for example, getModifyUserNameEventEvents, for example, List ⁇ ModifyUserNameEventResponse>. If the List ⁇ ModifyUserName--EventResponse> can be obtained, it indicates the block Event data exists in the block, otherwise, there is no event data in the block.
  • getModifyUserNameEventEvents for example, List ⁇ ModifyUserNameEventResponse>. If the List ⁇ ModifyUserName--EventResponse> can be obtained, it indicates the block Event data exists in the block, otherwise, there is no event data in the block.
  • the event object list includes at least one value of the event object. For example, for the userName in the aforementioned UserInfo smart contract, at the first moment, the user sets userName as the first value, and at the second moment, the user sets userName as the second value, then the event object list corresponding to userName , It includes the first value and the second value.
  • the UserInfo smart contract includes only one event method, so that the data analysis device 100 only generates one event data analysis code, but in actual use, a smart contract may include Multiple event methods, thus, the data analysis device 100 generates multiple event data analysis codes for one smart contract.
  • the data analysis device 100 analyzes event data in a block, it needs to traverse multiple event data analysis codes corresponding to the smart contract. If all event data analysis codes are run, the event data cannot be obtained. List, it means that there is no event data in the block, otherwise there is event data in the block.
  • S53 Parse at least one value of the event object through the parsing module in the event data parsing code to obtain at least one parsed event data.
  • the at least one value is analyzed by the parsing module, so as to obtain corresponding event data.
  • the at least one POJO first object instance corresponds to the at least one parsed event data in a one-to-one correspondence. For example, if the event object includes two values, the two values are parsed to obtain two event data, and then each event data is converted into a POJO object instance to obtain two first POJO object instances.
  • Figure 6 is a flow chart of using transaction data analysis code to obtain transaction data.
  • the flow chart is described as follows:
  • Step S601 is the same as step S51, and will not be repeated here.
  • the transaction acquisition interface is similar to that in the prior art, and will not be repeated here.
  • the transaction type includes a first transaction type and a second transaction type
  • the first transaction type is a transaction type corresponding to the construction method
  • the second transaction type is related to the extraordinary transaction type.
  • the target field is used to indicate the transaction object of the first transaction.
  • the target field is the To field.
  • step S604 to step S606 and step S610 are executed, and when the transaction type of the first transaction is determined to be the second transaction type, execute Step S607 to step S610.
  • the data analysis device 100 if the data analysis device 100 generates multiple transaction data analysis codes for a smart contract, the data analysis device 100 needs to traverse multiple transaction data analysis codes corresponding to the smart contract. In the embodiment, an example of running a transaction data analysis code is described.
  • the storage format of the transaction data corresponding to the construction method is: binary+encode(data), where binary is the RLP encoded string of the smart contract, and encode is the encoding function of the transaction data. Therefore, when it is determined that the transaction type of the first transaction is the transaction type corresponding to the construction method, it is necessary to compare the binary strings of all smart contracts to determine which smart contract construction method corresponds to the transaction.
  • the construction method in the aforementioned UserInfo smart contract is UserInfo(bytes32userName,uint8sex).
  • the binary (length M) in the JAVA file of the UserInfo smart contract is obtained, and then the RLP code (length N) of the first transaction is obtained.
  • the first M strings of the RLP code of the transaction are the same as the binary in the JAVA file, and the first transaction is obtained by executing the construction method of the UserInfo smart contract.
  • the first transaction is obtained from the execution of the UserInfo smart contract construction method, and the values of the field userName and the field sex can be obtained by parsing, and then the values of these two fields are parsed, and the first transaction is obtained At least one first transaction data.
  • S606 Convert the first transaction data into a second POJO object instance through the second instantiation module in the transaction data analysis code.
  • Step S606 is similar to step S54 and will not be repeated here.
  • the storage format of the transaction data corresponding to the non-constant method is: functionSignature+encode(data), where the functionSignature is the signature of the non-constant method. Therefore, when the transaction type of the first transaction is determined to be the transaction type corresponding to the non-constant method, it is necessary to compare the signatures of the non-constant method of all smart contracts to determine which non-constant method corresponds to the transaction.
  • the non-constant method in the aforementioned UserInfo smart contract is modifyUserName(bytes32userName).
  • the signature of the modifyUserName (bytes32userName) method in the JAVA file of the UserInfo smart contract (length L) is obtained, and then the RLP code (length Is N). If the first L character strings of the RLP encoding of the first transaction are the same as the signature of the modifyUserName(bytes32userName) method, then the first transaction is obtained by executing the non-constant method of the UserInfo smart contract.
  • the first transaction is obtained by executing the non-constant method of the UserInfo smart contract, and the values of the fields userName, sex, and address can be obtained by parsing, and then the values of these three fields are analyzed to obtain At least one piece of first transaction data in the first transaction.
  • S609 Convert the second transaction data into a second POJO object instance through the second instantiation module in the transaction data analysis code.
  • Steps S609 to S610 are similar to steps S54 to S55, and will not be repeated here.
  • the code for analyzing data is generated automatically according to the smart contract of the user's business. That is to say, for different user's business, only the user needs to import the smart contract corresponding to each user's business. Adding an interface or pre-storing the code for data analysis can reduce the storage space occupied by the code for data analysis, and can reduce the cost of parsing data in the blockchain. Moreover, the code generated according to the smart contract corresponds to the interface in the smart contract one-to-one. Therefore, during data analysis, there is no need to call multiple interfaces or calculate the address of the data to be parsed, which can improve data analysis. performance.
  • a third aspect of the present invention provides a block chain data analysis device. Please refer to FIG. 7, which is a structural diagram of the data analysis device.
  • the data analysis device includes a processor 701, a transceiver 702, and a memory 703.
  • the processor 701, the memory 703, and the transceiver 702 are connected through a bus interface;
  • the processor 701 controls the transceiver 702 to obtain a smart contract of a user service, and the smart contract includes a construction method, an event method, and a non-constant method for creating and realizing the user service;
  • the processor 701 generates data analysis code according to at least one of the construction method, the event method, and the non-constant method.
  • the data analysis code includes event data analysis code for analyzing event data of the user service and Transaction data analysis code used to analyze the transaction data of the user service; and,
  • the data analysis code is used to analyze the data in each block in the blockchain to obtain the event data and the transaction data.
  • the processor 701 may specifically be a central processing unit, an application specific integrated circuit (English: Application Specific Integrated Circuit, abbreviated as: ASIC), may be one or more integrated circuits used to control program execution, and may be used on-site
  • ASIC Application Specific Integrated Circuit
  • the hardware circuit developed by the programmable gate array (English: Field Programmable Gate Array, referred to as FPGA) can be a baseband processor.
  • the processor 701 may include at least one processing core.
  • the electronic device further includes a memory 703.
  • the memory 703 may include a read-only memory (English: Read Only Memory, abbreviated as: ROM), a random access memory (English: Random Access Memory, abbreviated as: RAM), and a disk storage.
  • the memory 703 is used to store data required by the processor 701 during operation.
  • the number of memories is one or more.
  • a fourth aspect of the present invention provides a computer device, which includes:
  • At least one processor and,
  • the memory stores instructions that can be executed by the at least one processor, and the at least one processor executes the instructions shown in FIGS. 2 to 6 through the communication interface by executing the instructions stored in the memory.
  • the method in the example is the example.
  • the fifth aspect of the present invention provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and when the computer instructions run on a computer, the computer executes the steps shown in FIGS. 2-6 The method in the embodiment.
  • the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes.
  • a computer-usable storage media including but not limited to disk storage, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (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)
  • Stored Programmes (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

La présente invention concerne un procédé et un dispositif d'analyse de données pour une chaîne de blocs, utilisés pour réduire le coût d'analyse de données dans une chaîne de blocs et améliorer les performances d'analyse de données. Ledit procédé comprend : l'acquisition d'un contrat intelligent d'un service d'utilisateur, le contrat intelligent comprenant un procédé de construction, un procédé d'événement et un procédé non constant qui sont utilisés pour créer et mettre en œuvre le service d'utilisateur (S21) ; la génération de codes d'analyse de données selon au moins un procédé parmi le procédé de construction, le procédé d'événement et le procédé non constant, les codes d'analyse de données comprenant des codes d'analyse de données d'événement destinés à analyser des données d'événement du service d'utilisateur et des codes d'analyse de données de transaction destinés à analyser des données de transaction du service d'utilisateur (S22) ; et l'utilisation des codes d'analyse de données pour analyser des données dans tous les blocs d'une chaîne de blocs, de façon à acquérir les données d'événement et les données de transaction (S23).
PCT/CN2020/097235 2019-06-24 2020-06-19 Procédé et dispositif d'analyse de données pour chaîne de blocs WO2020259417A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910550186.0 2019-06-24
CN201910550186.0A CN110264361A (zh) 2019-06-24 2019-06-24 一种区块链的数据解析方法及装置

Publications (1)

Publication Number Publication Date
WO2020259417A1 true WO2020259417A1 (fr) 2020-12-30

Family

ID=67920915

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/097235 WO2020259417A1 (fr) 2019-06-24 2020-06-19 Procédé et dispositif d'analyse de données pour chaîne de blocs

Country Status (2)

Country Link
CN (1) CN110264361A (fr)
WO (1) WO2020259417A1 (fr)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110264361A (zh) * 2019-06-24 2019-09-20 深圳前海微众银行股份有限公司 一种区块链的数据解析方法及装置
CN110738567B (zh) * 2019-09-25 2021-02-09 支付宝(杭州)信息技术有限公司 基于fpga的安全智能合约处理器的交易处理方法及装置
CN110827034B (zh) * 2019-10-31 2021-10-22 支付宝(杭州)信息技术有限公司 用于发起区块链交易的方法及装置
CN111161059B (zh) * 2019-11-29 2023-10-31 合肥学院 一种将事务处理泛化成交易的方法
CN112860712B (zh) * 2021-04-13 2024-02-09 深圳前海移联科技有限公司 一种基于区块链的交易数据库构建方法、系统及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107038242A (zh) * 2017-04-24 2017-08-11 杭州趣链科技有限公司 一种面向区块链全局智能合约业务数据解析方法
CN107274186A (zh) * 2017-05-11 2017-10-20 上海点融信息科技有限责任公司 在区块链中获得智能合约接口的方法和设备
CN107918666A (zh) * 2017-11-24 2018-04-17 中钞信用卡产业发展有限公司杭州区块链技术研究院 一种区块链上的数据同步方法和系统
US20180268152A1 (en) * 2017-03-19 2018-09-20 International Business Machines Corporation Cognitive blockchain automation and management
CN110264361A (zh) * 2019-06-24 2019-09-20 深圳前海微众银行股份有限公司 一种区块链的数据解析方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180268152A1 (en) * 2017-03-19 2018-09-20 International Business Machines Corporation Cognitive blockchain automation and management
CN107038242A (zh) * 2017-04-24 2017-08-11 杭州趣链科技有限公司 一种面向区块链全局智能合约业务数据解析方法
CN107274186A (zh) * 2017-05-11 2017-10-20 上海点融信息科技有限责任公司 在区块链中获得智能合约接口的方法和设备
CN107918666A (zh) * 2017-11-24 2018-04-17 中钞信用卡产业发展有限公司杭州区块链技术研究院 一种区块链上的数据同步方法和系统
CN110264361A (zh) * 2019-06-24 2019-09-20 深圳前海微众银行股份有限公司 一种区块链的数据解析方法及装置

Also Published As

Publication number Publication date
CN110264361A (zh) 2019-09-20

Similar Documents

Publication Publication Date Title
WO2020259417A1 (fr) Procédé et dispositif d'analyse de données pour chaîne de blocs
CN110096338B (zh) 智能合约执行方法、装置、设备及介质
US10026041B2 (en) Interoperable machine learning platform
US10635420B2 (en) Overriding a migrated method in an updated type
TWI536263B (zh) 將作業系統之原始應用程式介面投射至其它程式語言
CN110688122B (zh) 编译和执行智能合约的方法及装置
CN110704063B (zh) 编译和执行智能合约的方法及装置
CN110704064B (zh) 编译和执行智能合约的方法及装置
WO2019233293A1 (fr) Procédé et appareil de développement de programme d'application
US8464232B2 (en) Compiler compiler system with syntax-controlled runtime and binary application programming interfaces
WO2020005649A1 (fr) Rendu de fonctions lambda dans des applications de tableur
EP1717719A1 (fr) Conversion de l'application des données sources
WO2021175053A1 (fr) Procédé et appareil pour exécuter un module fonctionnel dans une machine virtuelle
TWI713015B (zh) 語言識別方法及裝置
CN113434147B (zh) 基于ProtoBuf协议的消息解析方法及装置
US11366704B2 (en) Configurable analytics for microservices performance analysis
CN110941655B (zh) 一种数据格式转换方法及装置
US20180321916A1 (en) Method, computer readable storage medium, computer program product and computer
US9836305B1 (en) Systems and methods for task parallelization
US10726201B1 (en) Creating and handling lambda functions in spreadsheet applications
CN110737431B (zh) 软件开发方法、开发平台、终端设备及存储介质
CN112925523A (zh) 对象比较方法、装置、设备及计算机可读介质
CN106815003A (zh) 一种计算机语言的交互系统及交互方法
JP2007141248A (ja) ジャバ言語におけるメソッド参照のサポート
US20190114150A1 (en) Method of optimizing vargs in object- oriented programming languages

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20832113

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20832113

Country of ref document: EP

Kind code of ref document: A1