CN115344647A - Block chain data processing method, device, equipment and medium - Google Patents

Block chain data processing method, device, equipment and medium Download PDF

Info

Publication number
CN115344647A
CN115344647A CN202211282968.9A CN202211282968A CN115344647A CN 115344647 A CN115344647 A CN 115344647A CN 202211282968 A CN202211282968 A CN 202211282968A CN 115344647 A CN115344647 A CN 115344647A
Authority
CN
China
Prior art keywords
contract
data
transaction
type
bottom layer
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
CN202211282968.9A
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.)
China Academy of Information and Communications Technology CAICT
Original Assignee
China Academy of Information and Communications Technology CAICT
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 China Academy of Information and Communications Technology CAICT filed Critical China Academy of Information and Communications Technology CAICT
Priority to CN202211282968.9A priority Critical patent/CN115344647A/en
Publication of CN115344647A publication Critical patent/CN115344647A/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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Abstract

The embodiment of the disclosure discloses a method, a device, equipment and a medium for processing block chain data, which relate to the field of block chains, wherein the method comprises the following steps: acquiring bottom layer data of a block chain; determining a transaction type of the underlying data; analyzing the bottom layer data based on the transaction type to obtain contract data corresponding to the bottom layer data; and (4) persisting the contract data to a preset relational database. The method has the advantages that contract data can be analyzed from the bottom data of the block chain, the strong relevance of the contract data is reserved by using the relational database, when the contract data needs to be queried, analyzed and the like from the business layer, corresponding data can be directly extracted from the relational database, extra processing steps are not needed, accordingly, the business process is simplified, the method is particularly suitable for visualization processing of the contract data, and the visualization processing efficiency can be remarkably improved.

Description

Block chain data processing method, device, equipment and medium
Technical Field
The present disclosure relates to the field of block chain technologies, and in particular, to a method, an apparatus, a device, and a medium for processing block chain data.
Background
The non-relational database has the characteristics of high flexibility, strong expansibility, good concurrent read-write support and the like, and is more suitable for storing a large amount of data. In the field of blockchains, to improve data storage performance on the chain, non-relational data is typically employed to persist underlying data of the blockchain.
In some service scenarios, the data on the link needs to be processed according to the relevance of the data, for example, a supervision node queries and audits contract data, and because the non-relational database cannot preserve the relevance between the data, the underlying data directly acquired from the block chain cannot meet such service requirements.
Disclosure of Invention
The embodiment of the disclosure provides a processing method, device, equipment and medium of block chain data.
In one aspect of the embodiments of the present disclosure, a method for processing block chain data is provided, including: acquiring bottom layer data of a block chain; determining a transaction type of the underlying data; analyzing the bottom layer data based on the transaction type to obtain contract data corresponding to the bottom layer data; and (4) persisting the contract data to a preset relational database.
In some embodiments, parsing the underlying data based on the transaction type to obtain contract data corresponding to the underlying data includes: determining an operation type of the transaction based on the transaction type; and analyzing the bottom layer data based on the operation type to obtain contract data.
In some embodiments, determining the type of operation of the transaction based on the transaction type includes: in response to the transaction type being to create an account and the value of the payment login field in the underlying data not being null, determining the operation type as to create a contract; in response to the transaction type being the payment asset and the target address in the underlying data being an address of a calling contract, determining the operation type as a calling contract.
In some embodiments, parsing the underlying data based on the operation type to obtain contract data includes: acquiring a contract address from the bottom data in response to the operation type being contract creation; acquiring contract codes and hash information from bottom data based on the contract addresses; the contract address, the contract code, and the hash information are recorded to a contract information table as contract data.
In some embodiments, parsing the underlying data based on the operation type to obtain contract data further comprises: responding to the operation type of calling the contract, and acquiring input parameters of the contract from the bottom data; determining a contract calling method from the input parameters; determining contract transaction data from the underlying data based on the contract calling method; and recording the contract calling method and the contract transaction data into a contract transaction table as contract data.
According to another aspect of the embodiments of the present disclosure, there is provided a processing apparatus of blockchain data, including an obtaining unit configured to obtain underlying data of a blockchain; a determining unit configured to determine a transaction type of the underlying data; the analysis unit is configured to analyze the bottom layer data based on the transaction type to obtain contract data corresponding to the bottom layer data; a storage unit configured to persist the contract data to a preset relational database.
In some embodiments, the parsing unit comprises: a type determination module configured to determine an operation type of the transaction based on the transaction type; and the analysis module is configured to analyze the bottom layer data based on the operation type to obtain contract data.
In some embodiments, the type determination module comprises: a first sub-module configured to determine the operation type as a contract creation in response to the transaction type being an account creation and the value of the payment login field in the underlying data not being null; a second submodule configured to determine the operation type to be a calling contract in response to the transaction type being a payment asset and the target address in the underlying data being an address of the calling contract.
According to still another aspect of an embodiment of the present disclosure, there is provided an electronic device including: a memory for storing a computer program product; a processor for executing the computer program product stored in the memory, and when the computer program product is executed, the method of any of the above embodiments is implemented.
According to yet another aspect of an embodiment of the present disclosure, there is provided a computer-readable storage medium having stored thereon computer program instructions, which, when executed by a processor, implement the method of any of the above embodiments.
According to the processing method of the block chain data, the bottom layer data of the block chain can be obtained, the transaction type of the bottom layer data is determined, and then the bottom layer data is analyzed according to the transaction type to obtain contract data corresponding to the bottom layer data; thereafter, the contract data is persisted to a preset relational database. The contract data can be analyzed from the bottom data of the block chain, the strong relevance of the contract data is reserved by using the relational database, when the contract data needs to be inquired, analyzed and the like from the business layer, the corresponding data can be directly extracted from the relational database without extra processing steps, so that the business process is simplified, the method is particularly suitable for the visualization processing of the contract data, and the visualization processing efficiency can be obviously improved.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description, serve to explain the principles of the disclosure.
The present disclosure may be more clearly understood from the following detailed description, taken with reference to the accompanying drawings, in which:
fig. 1 is a flowchart illustrating an embodiment of a method for processing blockchain data according to the present disclosure;
fig. 2 is a flowchart illustrating a processing method of blockchain data according to another embodiment of the disclosure;
fig. 3 is a schematic structural diagram of an embodiment of a device for processing blockchain data according to the present disclosure;
fig. 4 is a schematic structural diagram of an application embodiment of the electronic device of the present disclosure.
Detailed Description
Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present disclosure are used merely to distinguish one element from another, and are not intended to imply any particular technical meaning, nor is the necessary logical order between them.
It is also understood that in embodiments of the present disclosure, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the present disclosure may be generally understood as one or more, unless explicitly defined otherwise or indicated to the contrary hereinafter.
In addition, the term "and/or" in the present disclosure is only one kind of association relationship describing the association object, and indicates that three relationships may exist, for example, a and/or B, may indicate: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the former and latter associated objects are in an "or" relationship.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The disclosed embodiments may be applied to electronic devices such as terminal devices, computer systems, servers, etc., which are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
In the process of implementing the present disclosure, the inventor finds that, in the related art, by using the underlying data of the non-relational database persistent block chain, although the storage performance on the chain can be improved, the non-relational database cannot retain the relevance between the data, which causes inconvenience to some specific service scenarios. For example, when contract data on a chain needs to be queried or audited based on relevance of the data, additional analysis, summarization and other processing needs to be performed on the underlying data, thereby affecting the efficiency of data processing.
The processing method of the blockchain data of the present disclosure is exemplarily described below with reference to fig. 1, and fig. 1 shows a flowchart of an embodiment of the processing method of the blockchain data of the present disclosure. As shown in fig. 1, the process includes the following steps:
step 110, acquiring bottom layer data of the block chain.
In this embodiment, the underlying data refers to basic data that can be directly acquired through an underlying interface of the blockchain, for example, data such as account information, block information, and transaction information.
As an example, the execution body may be a terminal device loaded with a blockchain client. The terminal device can call the bottom layer interface of the block chain to obtain the bottom layer data of the block chain.
Step 120, determine the transaction type of the underlying data.
As an example, the execution principal may determine the transaction type of the underlying data by retrieving key fields contained in the underlying data. For example, the transaction type may include create account (create _ account), pay asset (pay _ asset or pay _ coin).
And step 130, analyzing the bottom layer data based on the transaction type to obtain contract data corresponding to the bottom layer data.
Generally, data associated with different transaction types also differ, and therefore, the corresponding resolution modes of the underlying data of different transaction types also differ.
In this embodiment, the execution main body may determine a matching parsing manner according to the transaction type, and perform processing such as extraction and cleaning on the underlying data, so as to parse data related to the transaction from the underlying data, and obtain contract data corresponding to the underlying data.
As an example, for underlying data whose transaction type is create account (create _ account), the execution subject may parse data such as source address (source _ address), destination address (dest _ address), contract code (contract _ code), hash information (hash) from the underlying data as contract data of the underlying data.
For another example, for underlying data with a transaction type of payment asset (pay _ asset or pay _ coin), the executing entity needs to obtain a value of a method field (method) from an input parameter (input) of the underlying data to parse out a calling method of the contract, and further obtain contract transaction data, and use the calling method and the transaction data of the contract as contract data of the underlying data.
In some optional embodiments of this embodiment, a corresponding relationship list between the transaction type and the analysis manner may be pre-constructed, the analysis manner may include an analysis object, an analysis step, and the like, and the execution subject may determine an analysis manner corresponding to the underlying data according to the corresponding relationship list, and further analyze the underlying data.
Step 140, persisting the contract data to a preset relational database.
In this embodiment, the execution agent may perform persistence processing on the contract data, convert the contract data obtained in step 130 into a relational model, and store the relational model in a preset relational database.
The processing method for block chain data provided by this embodiment can analyze contract data from the bottom layer data of the block chain, and retain the strong association of the contract data by using the relational database, and when the contract data needs to be queried, analyzed, and the like from the business layer, corresponding data can be directly extracted from the relational database without additional processing steps, so that the business process is simplified, and the processing method is particularly suitable for the visualization processing of the contract data, and can significantly improve the efficiency of the visualization processing.
In implementing the present disclosure, the inventors have also found that there may be a case where a transaction fails or is suspended when a user operates on a blockchain, in which case, although the user does not operate on a contract, an operation record is still stored in the underlying data, and the operation record has no analytic value. At this time, if the underlying data is subjected to parsing processing such as extraction, cleaning, etc. based on only the transaction type, an invalid operation may be generated, thereby wasting the computing resources.
In view of the above, in some embodiments of the present disclosure, the underlying data may be parsed as follows: determining an operation type of the transaction based on the transaction type; and analyzing the bottom layer data based on the operation type to obtain contract data.
In this embodiment, the operation type represents the processing manner that the user takes for the contract, and may include, for example, creating the contract or invoking the contract. The processes characterized by different operation types also differ, and the resulting transaction data also differs.
As an example, the executing agent may determine whether an operation was performed on the contract, and thus determine the type of operation, from the associated data of the transaction. For example, when the transaction type is create account (create _ account), the operation type of the contract may be determined by the value of the field payment login (pay _ load), and when the value of the payment login (pay _ load) is null, it indicates that the operation of creating the contract is failed or terminated, and at this time, it is not necessary to perform parsing on the underlying data; when the value of the payment login (pay _ load) is not null, it indicates that the operation type of the transaction is contract creation.
In this embodiment, the operation type of the transaction is determined based on the transaction type, and the underlying data is parsed according to the operation type to obtain contract data. The analysis processing of the bottom layer data without analysis value can be avoided, and the resource waste is prevented.
In some alternative embodiments of the present implementation, the operation type of the contract may be determined by: in response to the transaction type being a create account and the value of the payment login field in the underlying data not being null, determining the operation type as a create contract; in response to the transaction type being the payment asset and the target address in the underlying data being an address of a calling contract, determining the operation type as a calling contract.
In this embodiment, for the underlying data of which the transaction type is the create account (create _ account), the operation type may be determined according to the value of the payment login (pay _ load), for example, when the value of the payment login (pay _ load) is null, it indicates that the operation of creating the contract fails or terminates, that is, no operation is performed on the contract, and thus there is no operation type; when the value of the payment login (pay _ load) is not null, it represents that the operation of creating the contract is successfully executed, and the operation type of the transaction may be determined as the contract creation.
For underlying data with a transaction type of a payment asset (pay _ asset or pay _ coin), determining an operation type of the underlying data according to a target address (dest _ address), wherein if the target address (dest _ address) is not an address of a calling contract, the execution of the operation of the calling contract is failed or suspended, that is, no operation type exists; if the target address (dest _ address) is the address of the calling contract, which indicates that the operation of the calling contract is successfully executed, the operation type of the transaction may be determined as the calling contract.
Optionally, if the operation type does not exist in the underlying data, the parsing operation is abandoned.
In the embodiment, the operation type of the transaction is determined according to the associated data of the transaction aiming at the transaction type of the bottom data, the transaction type can be accurately determined to be the operation type of the transaction for creating the account and paying the assets, the analysis operation of data generated by contract creating failure and contract calling failure can be avoided, and the resource waste is avoided.
Referring now to fig. 2, fig. 2 illustrates a flow chart of one embodiment of the processing method of blockchain data of the present disclosure, as shown in fig. 2, the flow chart includes the following steps.
Step 210, obtaining the bottom layer data of the block chain.
Step 220, determine the transaction type of the underlying data.
In this embodiment, after determining the transaction type of the underlying data, step 230 or step 240 may be performed according to the transaction type. Step 230 to step 233 correspond to an analysis flow of creating the underlying data of the contract class; steps 240 through 244 correspond to invoking a parsing flow of the underlying data of the contract class.
Step 230, responsive to the transaction type being to create an account and the value of the payment login field in the underlying data not being null, determines the operation type as to create a contract.
Step 231, in response to the operation type being contract creation, retrieves a contract address from the underlying data.
In this embodiment, when the operation type is creating a contract, the underlying data needs to be parsed to obtain a contract address, for example, values of a source address (source _ address) and a target address (dest _ address) field may be extracted from the underlying data to obtain the contract address.
Step 232, contract codes and hash information are obtained from the underlying data based on the contract addresses.
As an example, the execution body may extract a field contract code (contract _ code) and hash information (hash) corresponding to the contract address from the underlying data according to the contract address, resulting in the contract code and hash information.
Step 233, record the contract address, the contract code, and the hash information to the contract information table as contract data.
In this embodiment, through steps 230 to 233, the underlying data for creating the contract class may be parsed, the contract address, the contract code and the hash information therein may be obtained to generate the contract information table, and the contract information table may be used as the contract data corresponding to the underlying data, which may ensure that the data related to the behavior of creating the contract in the underlying data is all included in the contract data, thereby ensuring that the contract data matches the behavior of creating the contract.
Step 240, in response to the transaction type being a payment asset and the target address in the underlying data being an address of a calling contract, determines the operation type to be a calling contract.
And 241, responding to the fact that the operation type is the calling contract, and acquiring input parameters of the contract from the bottom data.
In this embodiment, when the operation type of the transaction is to invoke a contract, the execution principal may extract a parameter value of a field input from the underlying data to obtain an input parameter of the contract.
Step 242, determine contract invocation methods from the input parameters.
As an example, the execution agent may extract the value of the field method from the input parameter value, i.e., may get the contract call method.
Step 243, based on the contract calling method, determines contract transaction data from the underlying data.
As an example, the executing entity may extract data related to the transaction from the underlying data according to the contract calling method, and the contract transaction data may include information such as transaction time, the identity of the initiator, the identity of the receiver, and the like.
Step 244, the contract invocation method and the contract transaction data are recorded to the contract transaction table as contract data.
In this embodiment, through steps 240 to 244, the underlying data of the invoked contract class may be analyzed, the analyzed contract invoking method and the contract transaction data are recorded in the contract transaction table, and the contract transaction table is used as the contract data, which may ensure that data related to the behavior of invoking the contract are all included in the contract data, thereby ensuring that the contract data matches with the behavior of invoking the contract.
The embodiment shown in fig. 2 embodies that different analysis modes are respectively adopted for two types of underlying data of creating a contract and invoking the contract, different data are extracted to generate contract data, so that the contract data can be ensured to be matched with the operation behavior of a user, and the accuracy of representing the operation behavior of the user by the contract data is improved.
Referring to fig. 3, fig. 3 is a schematic structural diagram of an embodiment of the device for processing blockchain data according to the present disclosure, and as shown in fig. 3, the device includes: an obtaining unit 310 configured to obtain underlying data of a blockchain; a determining unit 320 configured to determine a transaction type of the underlying data; the analysis unit 330 is configured to analyze the bottom layer data based on the transaction type to obtain contract data corresponding to the bottom layer data; the storage unit 340 is configured to persist the contract data to a preset relational database so as to perform visualization processing on the contract data.
In one embodiment, the parsing unit 330 includes: a type determination module configured to determine an operation type of the transaction based on the transaction type; and the analysis module is configured to analyze the bottom layer data based on the operation type to obtain contract data.
In one embodiment, the type determining module comprises: a first sub-module configured to determine the operation type as a contract creation in response to the transaction type being an account creation and the value of the payment login field in the underlying data not being null; a second submodule configured to determine the operation type to be a calling contract in response to the transaction type being a payment asset and the target address in the underlying data being an address of the calling contract.
In one embodiment, the parsing module is further configured to: acquiring a contract address from the bottom data in response to the operation type being contract creation; acquiring contract codes and hash information from bottom data based on the contract addresses; the contract address, the contract code, and the hash information are recorded to a contract information table as contract data.
In one embodiment, the parsing module is further configured to: responding to the operation type of calling the contract, and acquiring input parameters of the contract from the bottom data; determining a contract calling method from the input parameters; determining contract transaction data from the underlying data based on the contract calling method; and recording the contract calling method and the contract transaction data into a contract transaction table as contract data.
In addition, an embodiment of the present disclosure also provides an electronic device, including: a memory for storing a computer program; a processor, configured to execute the computer program stored in the memory, and when the computer program is executed, implement the processing method of the blockchain data according to any of the above embodiments of the present disclosure.
Fig. 4 is a schematic structural diagram of an application embodiment of the electronic device of the present disclosure. Next, an electronic apparatus according to an embodiment of the present disclosure is described with reference to fig. 4.
As shown in fig. 4, the electronic device includes one or more processors and memory.
The processor may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
The memory may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by a processor to implement the processing methods of blockchain data of the various embodiments of the present disclosure described above and/or other desired functions.
In one example, the electronic device may further include: an input device and an output device, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input device may also include, for example, a keyboard, mouse, and the like.
The output device may output various information including the determined distance information, direction information, and the like to the outside. The output devices may include, for example, a display, speakers, printer, and a communication network and its connected remote output devices, among others.
Of course, for simplicity, only some of the components of the electronic device relevant to the present disclosure are shown in fig. 4, omitting components such as buses, input/output interfaces, and so forth. In addition, the electronic device may include any other suitable components, depending on the particular application.
In addition to the above methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the method of processing blockchain data according to the various embodiments of the present disclosure described in the above section of this specification.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the method of processing blockchain data according to the various embodiments of the present disclosure described in the above section of the present specification.
The computer readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Those of ordinary skill in the art will understand that: all or part of the steps of implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer-readable storage medium, and when executed, executes the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure will be described in detail with reference to specific details.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, devices, systems involved in the present disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by one skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The method and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the apparatus, devices, and methods of the present disclosure, various components or steps may be broken down and/or re-combined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, the description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (10)

1. A method for processing block chain data, comprising:
acquiring bottom layer data of a block chain;
determining a transaction type of the underlying data;
analyzing the bottom layer data based on the transaction type to obtain contract data corresponding to the bottom layer data;
and persisting the contract data to a preset relational database.
2. The method of claim 1, wherein parsing the underlying data based on the transaction type to obtain contract data corresponding to the underlying data comprises:
determining an operation type of the transaction based on the transaction type;
and analyzing the bottom layer data based on the operation type to obtain the contract data.
3. The method of claim 2, wherein determining the type of operation for the transaction based on the transaction type comprises:
in response to the transaction type being a create account and a value of a payment login field in the underlying data not being null, determining the operation type as a create contract;
in response to the transaction type being a payment asset and the target address in the underlying data being an address of a calling contract, determining that the operation type is a calling contract.
4. The method of claim 3, wherein parsing the underlying data based on the operation type to obtain the contract data comprises:
in response to the operation type being contract creation, obtaining a contract address from the underlying data;
acquiring contract codes and hash information from the bottom layer data based on the contract addresses;
recording the contract address, the contract code, and the hash information to a contract information table as the contract data.
5. The method of claim 4, wherein parsing the underlying data based on the operation type to obtain the contract data further comprises:
responding to the operation type of calling the contract, and acquiring input parameters of the contract from the bottom layer data;
determining a contract calling method from the input parameters;
determining contract transaction data from the underlying data based on the contract invocation method;
recording the contract invocation method and the contract transaction data to a contract transaction table as the contract data.
6. An apparatus for processing blockchain data, comprising:
an acquisition unit configured to acquire underlying data of a block chain;
a determining unit configured to determine a transaction type of the underlying data;
the analysis unit is configured to analyze the bottom layer data based on the transaction type to obtain contract data corresponding to the bottom layer data;
a storage unit configured to persist the contract data to a preset relational database.
7. The apparatus of claim 6, wherein the parsing unit comprises:
a type determination module configured to determine an operation type of a transaction based on the transaction type;
and the analysis module is configured to analyze the bottom layer data based on the operation type to obtain the contract data.
8. The apparatus of claim 7, wherein the type determining module comprises:
a first sub-module configured to determine the operation type as creating a contract in response to the transaction type being creating an account and a value of a payment login field in the underlying data not being null;
a second submodule configured to determine the operation type to be a calling contract in response to the transaction type being a payment asset and a target address in the underlying data being an address of a calling contract.
9. An electronic device, comprising: a memory for storing a computer program product; a processor for executing the computer program product stored in the memory, and when executed, implementing the method of any of the preceding claims 1-5.
10. A computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the method of any of claims 1-5.
CN202211282968.9A 2022-10-20 2022-10-20 Block chain data processing method, device, equipment and medium Pending CN115344647A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211282968.9A CN115344647A (en) 2022-10-20 2022-10-20 Block chain data processing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211282968.9A CN115344647A (en) 2022-10-20 2022-10-20 Block chain data processing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115344647A true CN115344647A (en) 2022-11-15

Family

ID=83957041

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211282968.9A Pending CN115344647A (en) 2022-10-20 2022-10-20 Block chain data processing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115344647A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109146679A (en) * 2018-06-29 2019-01-04 阿里巴巴集团控股有限公司 Intelligent contract call method and device, electronic equipment based on block chain
CN111400303A (en) * 2020-01-13 2020-07-10 复旦大学 Intelligent contract data extraction and synchronization method, system and platform
CN114424182A (en) * 2019-08-22 2022-04-29 区块链控股有限公司 Block chain database management system
CN115129785A (en) * 2022-06-29 2022-09-30 蚂蚁区块链科技(上海)有限公司 Method and device for maintaining block chain data, electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109146679A (en) * 2018-06-29 2019-01-04 阿里巴巴集团控股有限公司 Intelligent contract call method and device, electronic equipment based on block chain
CN114424182A (en) * 2019-08-22 2022-04-29 区块链控股有限公司 Block chain database management system
CN111400303A (en) * 2020-01-13 2020-07-10 复旦大学 Intelligent contract data extraction and synchronization method, system and platform
CN115129785A (en) * 2022-06-29 2022-09-30 蚂蚁区块链科技(上海)有限公司 Method and device for maintaining block chain data, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US10129118B1 (en) Real time anomaly detection for data streams
JP6126672B2 (en) Malicious code detection method and system
US20200125635A1 (en) Systems and methods for intelligently predicting accurate combinations of values presentable in data fields
CN111104652B (en) Authority management method and device, computer readable storage medium and electronic equipment
US9026612B2 (en) Generating a custom parameter rule based on a comparison of a run-time value to a request URL
US20190228100A1 (en) Systems and methods for high efficiency data querying
CN114398396A (en) Data query method, storage medium, and computer program product
US10970200B2 (en) Test result triage for a failed code validation
US20200302078A1 (en) Malicious database request identification
CN110704025A (en) Method and device for generating coding specification tool, storage medium and electronic equipment
CN116756152A (en) Block chain-based data processing method and device, electronic equipment and storage medium
CN110704273B (en) Processing method and device of configuration information, electronic equipment and storage medium
US9189299B2 (en) Framework for system communication for handling data
CN115344647A (en) Block chain data processing method, device, equipment and medium
CN115357827A (en) Block chain browser assembly and electronic equipment
CN111447268B (en) File structure conversion method, device, equipment and storage medium
CN110765003B (en) Code detection method, device and equipment and storage medium
CN113608949A (en) Pressure testing method and device, storage medium and electronic equipment
US20070299849A1 (en) Logging of application messages
CN111324707A (en) User interaction method and device, computer-readable storage medium and electronic equipment
CN114338494B (en) Service dependency topological relation obtaining method and device, storage medium and electronic equipment
US20240104240A1 (en) System and method for agentless detection of sensitive data in computing environments
CN114116071B (en) Information processing method, device, medium and electronic equipment for label assembly
CN110753316B (en) Information sending method and device, computer readable storage medium and electronic equipment
US20160283521A1 (en) Matching untagged data sources to untagged data analysis applications

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20221115

RJ01 Rejection of invention patent application after publication