CN109408513A - Data processing method, system and storage medium - Google Patents
Data processing method, system and storage medium Download PDFInfo
- Publication number
- CN109408513A CN109408513A CN201811236906.8A CN201811236906A CN109408513A CN 109408513 A CN109408513 A CN 109408513A CN 201811236906 A CN201811236906 A CN 201811236906A CN 109408513 A CN109408513 A CN 109408513A
- Authority
- CN
- China
- Prior art keywords
- data
- block
- transaction
- database
- contract
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION 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/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Engineering & Computer Science (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of data processing method, system and storage mediums.Wherein, this method comprises: the block for including in inquiry block chain;Data in the block inquired are resolved into the first data associated with the data in the block;And first data are stored in database, wherein the database supports SQL query.The present invention solves existing primary node and block chain account book data is stored in LevelDB database, but the shortcomings that LevelDB database fetches according to low efficiency there are random write and does not support SQL query, thus cause server that can not block chain account book data be carried out with complicated inquiry and statistics, so that the workload of server increases, and then the technical issues of the working efficiency of server greatly reduces.
Description
Technical field
The present invention relates to computer fields, in particular to a kind of data processing method, system and storage medium.
Background technique
Currently, the primary node storing data of traditional block chain is based on LevelDB database, and LevelDB data inventory
The problem of include: the low efficiency read at random, transaction history data can not be inquired and not support SQL query function etc..
Thus LevelDB database can not carry out complicated inquiry and statistics.Need to inquire the transaction in some period in visitor
In the case where recording and being analyzed, since LevelDB database does not support complicated inquiry, server can not be targeted
Ground carries out random challenge to the data being stored in LevelDB database according to the demand of visitor, can only be to whole data
Inquiry from first to last is carried out, and is analyzed based on the total data inquired, so that the workload of server increases, in turn
The working efficiency of server greatly reduces.
Block chain account book data are stored in LevelDB database, but LevelDB number for above-mentioned existing primary node
According to inventory the shortcomings that random write fetches according to low efficiency and do not support SQL query, thus cause server can not be to block chain account
Notebook data carries out complicated inquiry and statistics, so that the workload of server increases, and then the work of server greatly reduces
The technical issues of making efficiency, currently no effective solution has been proposed.
Summary of the invention
The embodiment of the invention provides a kind of method for obtaining data processing, system and storage mediums, to solve at least
Block chain account book data are stored in LevelDB database by existing primary node, but LevelDB database has random read
Data efficiency is low and the shortcomings that not supporting SQL query, thus it is complicated to cause server that can not carry out to block chain account book data
Inquiry and statistics, so that the workload of server increases, and then the technical issues of the working efficiency of server greatly reduces.
According to an aspect of an embodiment of the present invention, a kind of data processing method is provided, comprising: wrap in inquiry block chain
The block contained;Data in the block inquired are resolved into the first data associated with the data in block;And by
One data are stored in database, and wherein database supports SQL query.
Other side according to an embodiment of the present invention, additionally provides a kind of storage medium, and storage medium includes storage
Program, wherein the above method is executed by processor in program operation.
Other side according to an embodiment of the present invention additionally provides a kind of data processing system, comprising: enquiry module,
For inquiring the block for including in block chain;First parsing module, for resolving to the data in the block inquired and area
Associated first data of data in block;And first memory module, for the first data to be stored in database, wherein counting
SQL query is supported according to library.
Other side according to an embodiment of the present invention additionally provides a kind of data processing system, comprising: processor;With
And memory, it is connect with processor, for providing the instruction for handling following processing step for processor: including in inquiry block chain
Block;Data in the block inquired are resolved into the first data associated with the data in block;And by first
Data are stored in database, and wherein database supports SQL query.
In embodiments of the present invention, the block for including in block chain is inquired by server.Then server will be inquired
Block in data resolve to the first data associated with the data in block.First data are stored in by last server
Database.Wherein database supports SQL query.Specifically, server can first solving to the block for including in block chain
Analysis, and by the parsing data parsed be stored in support SQL statement inquiry database in, such as MySQL database with
MongoDB database.Since the database supports complicated query function.To which server can be according to the demand of visitor
Targetedly the data being stored in the database are inquired, and carry out statistics and analysis based on the data inquired.It is logical
Above-mentioned mode is crossed, allows server that targetedly block chain account book data are carried out with complicated inquiry and statistics, greatly
The work load for alleviating server greatly, improves the working efficiency of server.And then solves existing primary node for area
Block chain account book data are stored in LevelDB database, but LevelDB database is fetched according to low efficiency there are random write and do not supported
The shortcomings that SQL query, thus cause server that can not block chain account book data be carried out with complicated inquiry and statistics, it can only be to complete
The data in portion carry out inquiry from first to last, and are analyzed based on the total data inquired, so that the workload of server
The technical issues of increasing, and then the working efficiency of server greatly reduce.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair
Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 shows a kind of hardware structural diagram of calculating equipment for data processing method;
Fig. 2 shows the structural schematic diagrams of the data processing system according to the scheme of the embodiment of the present disclosure 1;
Fig. 3 shows the flow chart of the data processing method according to the first aspect of the embodiment of the present disclosure 1;
Fig. 4 shows the structural schematic diagram of the data processing system according to the scheme of the embodiment of the present application 2;And
Fig. 5 shows the schematic diagram of the data processing system according to the scheme of the embodiment of the present application 3.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention
Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people
The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work
It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "
Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way
Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or
Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover
Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to
Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product
Or other step or units that equipment is intrinsic.
Embodiment 1
According to embodiments of the present invention, a kind of data processing method embodiment is provided, it should be noted that in the stream of attached drawing
The step of journey illustrates can execute in a computer system such as a set of computer executable instructions, although also, flowing
Logical order is shown in journey figure, but in some cases, it can be to be different from shown or described by sequence execution herein
The step of.
Embodiment of the method provided by the embodiment of the present application one can be in mobile terminal, terminal or similar fortune
It calculates and is executed in device.Fig. 1 shows a kind of hardware of terminal (or mobile device) for realizing data processing method
Structural block diagram.As shown in Figure 1, terminal 10 (or mobile device 10) may include it is one or more (in figure using 102a,
102b ... ..., 102n are shown) (processor 102 can include but is not limited to Micro-processor MCV or programmable patrols processor 102
The processing unit of volume device FPGA etc.), memory 104 for storing data and the transmitting device for communication function
106.It in addition to this, can also include: display, input/output interface (I/O interface), the port universal serial bus (USB)
(a port that can be used as in the port of I/O interface is included), network interface, power supply and/or camera.The common skill in this field
Art personnel are appreciated that structure shown in FIG. 1 is only to illustrate, and do not cause to limit to the structure of above-mentioned electronic device.For example,
Terminal 10 may also include the more perhaps less component than shown in Fig. 1 or match with different from shown in Fig. 1
It sets.
It is to be noted that said one or multiple processors 102 and/or other data processing circuits lead to herein
Can often " data processing circuit " be referred to as.The data processing circuit all or part of can be presented as software, hardware, firmware
Or any other combination.In addition, data processing circuit for single independent processing module or all or part of can be integrated to meter
In any one in other elements in calculation machine terminal 10 (or mobile device).As involved in the embodiment of the present application,
The data processing circuit controls (such as the selection for the variable resistance end path connecting with interface) as a kind of processor.
Memory 104 can be used for storing the software program and module of application software, such as the data in the embodiment of the present invention
Corresponding program instruction/the data storage device of processing method, the software that processor 102 is stored in memory 104 by operation
Program and module realize above-mentioned data processing method thereby executing various function application and data processing.Memory
104 may include high speed random access memory, may also include nonvolatile memory, and such as one or more magnetic storage device dodges
It deposits or other non-volatile solid state memories.In some instances, memory 104 can further comprise relative to processor
102 remotely located memories, these remote memories can pass through network connection to terminal 10.The reality of above-mentioned network
Example includes but is not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Transmitting device 106 is used to that data to be received or sent via a network.Above-mentioned network specific example may include
The wireless network that the communication providers of terminal 10 provide.In an example, transmitting device 106 includes that a network is suitable
Orchestration (Network Interface Controller, NIC), can be connected by base station with other network equipments so as to
Internet is communicated.In an example, transmitting device 106 can be radio frequency (Radio Frequency, RF) module,
For wirelessly being communicated with internet.
Display can such as touch-screen type liquid crystal display (LCD), the liquid crystal display aloow user with
The user interface of terminal 10 (or mobile device) interacts.
Further, Fig. 2 shows the structural representations of the data processing system according to the scheme of the embodiment of the present disclosure 1
Figure.As shown in Fig. 2, the system includes: visitor 101, terminal device 110, server 120, the area being set in server 120
Block chain 121 and the database 122 being set in server 120.Wherein, database 122 supports SQL query.Server 120 is logical
The block that inquiry block chain 121 is included is crossed, and the data in block are resolved into the first data associated with the data.So
First data are stored in the database 122 for supporting SQL query by server 120 afterwards.Therefore, it needs in visitor 101 to area
Block chain account book data are targetedly inquired, and the inquiry request is sent to the feelings of server 120 by terminal device 110
Under condition, server 120 receives the inquiry request from terminal device 110, and is directed to the data being stored in database 122
The inquiry of property.Wherein, hardware configuration shown in FIG. 1 can be used in server 120 shown in Fig. 2.
Under above-mentioned running environment, according to the present embodiment, present disclose provides a kind of data processing method, Fig. 3 is shown
The flow chart of this method.This method can be run in server 120 shown in Fig. 2, and refering to what is shown in Fig. 3, this method
Include:
S310: the block for including in inquiry block chain;
S320: the data in the block inquired are resolved into the first data associated with the data in block;And
S330: being stored in database for the first data, and wherein database supports SQL query.
As described in the background art, block chain account book data are stored in LevelDB data by existing primary node
Library, but there are random writes to fetch according to low efficiency and the shortcomings that do not support SQL query for LevelDB database, thus lead to server
Block chain account book data can not be carried out with complicated inquiry and statistics, can only whole data be carried out with inquiry from first to last,
And analyzed based on the total data inquired, so that the workload of server increases, and then server greatly reduces
Working efficiency.
In order to solve the technical problem, the embodiment of the present invention provides a kind of data processing method, using server 120 by area
Block chain account book data are stored in the database 122 for supporting SQL query.Also, institute in block chain 121 is inquired by server 120
The block for including.Then, the data inquired are resolved to the first data associated with the data by server 120.Finally
First data are stored in database 122 by server 120.Such as, but not limited to, database 122 can for MySQL database and
MongoDB database, the two databases support complicated query function.Thus need in visitor 101 to block chain account book
Data are targetedly inquired, and in the case where the inquiry request is sent to server 120 by terminal device 110, clothes
Device 120 be engaged in from the reception of terminal device 110 inquiry request, and the data being stored in database 122 are targetedly looked into
It askes.
To allow server 120 targetedly to the area being stored in database 122 by above-mentioned mode
121 account book data of block chain carry out complicated inquiry and statistics, significantly reduce the work load of server 120, improve service
The working efficiency of device 120.And then solve existing primary node and block chain account book data are stored in LevelDB database,
But the shortcomings that LevelDB database fetches according to low efficiency there are random write and does not support SQL query, thus cause server can not
Block chain account book data are carried out with complicated inquiry and statistics, can only whole data be carried out with inquiry from first to last, and base
It is analyzed in the total data inquired, so that the workload of server increases, and then the work of server greatly reduces
The technical issues of making efficiency.
Optionally, further includes: according to the preset period, execute following operation: whether being generated in inquiry block chain new
Block;In the case where producing new block in confirming block chain, the data in new block are resolved to and the number in new block
According to associated second data;And the second data are stored in database.
Specifically, according to Fig.2, server 120 can according to the preset period (such as: every ten minutes inquire
Once), inquire in block chain 121 whether produce new block.There is new block production when server 120 inquires block chain 121
In the case where life, the data in new block are resolved into the second data associated with the data in new block.Then server
The second data that parsing obtains are stored in database 122 by 120.In this way, allow server 120 to block chain
The data updated in account book are timely parsed and the data after parsing are stored in database 122, and then have ensured number
According to the integrality for the data for including in library 122.
Optionally, the first data include third data relevant to logical card transaction, this method further include: by third data solution
Analysis is transaction contract;Determine whether transaction contract is ERC20 intelligence contract;And in contract of trading for ERC20 intelligence contract
In the case of, the 4th data associated with ERC20 intelligence contract are stored in database.
Specifically, third data are resolved to transaction contract by server 120.Such as: the transaction contract can for user it
Between carry out common ETH transaction, or to block chain fictitious assets (such as: the game user based on block chain technology is possessed
Game item) carry out exchange, or the intelligent contract based on block chain technology etc. between stage property.At this point, server 120
It needs to determine whether the transaction contract ERC20 intelligence contract.Its object is to determine transaction corresponding with the transaction contract
Whether traded based on the logical card of block chain.It, will in the case where server 120 determines transaction contract for ERC20 intelligence contract
The 4th data associated with ERC20 intelligence contract are stored in database 122.In this way, server 120 can be by base
It is screened from numerous transaction in the transaction of the logical card of block chain.To in visitor 101 for it based on the logical card of block chain
In the case that transaction record is inquired, server 120 can rapidly transfer the data hair being pre-stored in database 122
It send to terminal device 110 and is browsed for visitor 101.And then effectively raise the usage experience of visitor.
Optionally, determine transaction contract whether be ERC20 intelligence contract operation, comprising: determine the input of logical card transaction
It whether is empty;In the case where the input of logical card transaction is not sky, determine using the ABI of ERC20 intelligence contract to transaction contract
Whether the result parsed is correct;It is correct in the result that the ABI using ERC20 intelligence contract parses transaction contract
In the case of, obtain the code of transaction beneficiary address;In the case where code is not sky, determine whether transaction contract has
Tetra- attributes of name, symbol, decimals, totalSupply;And transaction contract have name, symbol,
In the case where tetra- attributes of decimals, totalSupply, determine that transaction contract is ERC20 intelligence contract.
Specifically, firstly, server 120 determines whether the input of logical card transaction is empty.I.e. the needs of server 120 first are tested
It whether effective demonstrate,proves the logical card transaction of the pen, and is based under effective transaction, perform the following operation: determining to close using ERC20 intelligence
Whether the result that ABI about parses transaction contract is correct, if the interface of ERC20 intelligence contract exists, proving should
Transaction contract is compiled as ERC20 intelligence contract.At this point, server 120 is attempted to obtain the code of transaction beneficiary address,
And judge whether the code is empty.If the code is not sky, prove that there are both sides users for the transaction contract.Then, it takes
Business device 120 determines whether transaction contract has tetra- attributes of name, symbol, decimals, totalSupply, closes at one
In the case where about there are this four attributes of name, symbol, decimals, totalSupply, it was demonstrated that this contract, which is traded, is
ERC20 intelligence contract.In this way, server 120 can accurately determine whether the transaction of this contract is ERC20 intelligence
Can contract, and then avoid server 120 and will not belong to the contract of the logical card transaction of block chain and be stored in database 122, to make
The problem of being polluted at database 122 by nonsignificant data appearance.
Optionally, the 4th data include the information of ERC20 intelligence contract and trade beneficiary address and ERC20 intelligence contract
The map information of address, this method further include: by the information of ERC20 intelligence contract and transaction beneficiary address and ERC20 intelligence
The map information of contract address is stored in database.Such as: ERC20 of the server 120 by visitor 101 about the logical card of block chain
The information of intelligent contract and information and 101 address of visitor that visitor 101 is led to the ERC20 intelligence contract demonstrate,proved about block chain
Map information be stored in database 122.In the case where visitor 101 wants to inquire the pen by transaction record,
Server 120 can be according to the mapping about the transaction information and 101 address of visitor being pre-stored in database 122
Information rapidly transfers out corresponding ERC20 intelligence contract.In this way, looking into for server 120 is further improved
Ask efficiency.
Optionally, the operation of the code of transaction beneficiary address is obtained, comprising: be used for according in remote procedure call protocol
The method for returning to specified address code, obtains the code of transaction beneficiary address.
Specifically, server 120 can according in remote procedure call protocol for the method that returns to specified address code,
Targetedly to the code of transaction beneficiary address (such as: the transaction beneficiary can be visitor 101).Pass through this side
Golang language development can be used in formula, server 120, and quickly obtains the code of transaction beneficiary address, so that service
Device 120 is in the process for obtaining code more safety and stablizes.
Optionally, the first data further include block address, the 5th data relevant to logical card transaction record and user security
Login interface, this method further include: block address, the 5th data and user security login interface are stored in database.
Specifically, block address, the 5th data and user security login interface are stored in database 122 by server 120.
Such as: server 120 can use the form of list, be carried out according to the classification of data to the data being stored in database 122
Classification, and the data classified are stored respectively in each list.At this point, there are block address lists, in database 122
Five data lists and user security login interface list.In this way, server 120 solves block chain account book number
After analysis, purposive category storage can be carried out to the data parsed, so that server 120 can be orderly
The data in database 122 are targetedly inquired in ground.And then ensure that server 120 can be in database 122
Data carry out complicated inquiry and statistics, and greatly improve the working efficiency of server 120.
According to the second aspect of the present embodiment, the disclosure additionally provides a kind of storage medium, and storage medium includes storage
Program, wherein method described in above-mentioned any one executed as processor in program operation.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because
According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention
It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation
The method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very much
In the case of the former be more preferably embodiment.Based on this understanding, technical solution of the present invention is substantially in other words to existing
The part that technology contributes can be embodied in the form of software products, which is stored in a storage
In medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculate
Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Embodiment 2
According to embodiments of the present invention, a kind of data processing system 400 is provided, the data in the system 400 and embodiment 1
Processing method is corresponding.As shown in figure 4, the system includes: enquiry module 410, for inquiring the block for including in block chain;The
One parsing module 420, for the data in the block inquired to be resolved to the first data associated with the data in block;
And first memory module 430, for the first data to be stored in database, wherein database supports SQL query.
As described in the background art, block chain account book data are stored in LevelDB data by existing primary node
Library, but there are random writes to fetch according to low efficiency and the shortcomings that do not support SQL query for LevelDB database, thus lead to server
Block chain account book data can not be carried out with complicated inquiry and statistics, can only whole data be carried out with inquiry from first to last,
And analyzed based on the total data inquired, so that the workload of server increases, and then server greatly reduces
Working efficiency.
In order to solve the technical problem, the embodiment of the present invention provides a kind of data processing method, using system 400 by block
Chain account book data are stored in the database for supporting inquiry.Also, area included in block chain is inquired by enquiry module 410
Block.Then, the data inquired are resolved to the first data associated with the data by the first parsing module 420.Last
First data are stored in database by one memory module 430.Such as, but not limited to, database can for MySQL database and
MongoDB database, the two databases support complicated query function.Thus need in visitor to block chain account book data
It is targetedly inquired, and in the case where the inquiry request is sent to system 400 by terminal device, system 400 is from end
End equipment receives the inquiry request, and is targetedly inquired the data being stored in database profession.
To allow system 400 targetedly to the block chain account being stored in database profession by above-mentioned mode
Notebook data carries out complicated inquiry and statistics, significantly reduces the work load of system 400, improves the work effect of system 400
Rate.And then it solves existing primary node and block chain account book data is stored in LevelDB database, but LevelDB data
Inventory causes server can not be to block chain account book the shortcomings that random write fetches according to low efficiency and do not support SQL query
Data carry out complicated inquiry and statistics, can only whole data be carried out with inquiry from first to last, and complete based on what is inquired
Portion's data are analyzed, so that the workload of server increases, and then the technology of the working efficiency of server greatly reduce
Problem.
Optionally, further includes: execution module, for executing following operation: inquiry submodule according to the preset period
Block, for inquiring in block chain whether generate new block;Analyzing sub-module, confirm block chain in produce new block the case where
Under, the data in new block are resolved into the second data associated with the data in new block;And sub-module stored, it is used for
Second data are stored in database.
Specifically, system 400 can inquire submodule according to preset period (such as: primary every inquiry in ten minutes)
New block whether is produced in block inquiry block chain.There is the case where new block generation when inquiry submodule inquires block chain
Under, the data in new block are resolved to the second data associated with the data in new block by analyzing sub-module.Then it stores
The second data that parsing obtains are stored in database by submodule.In this way, allow system 400 to block chain account
The data updated in this are timely parsed and are stored in database profession the data after parsing, and then have been ensured in database
The integrality for the data for including.
Optionally, the first data include third data relevant to logical card transaction, the system further include: the second parsing mould
Block, for third data to be resolved to transaction contract;Judgment module, for determining whether transaction contract is ERC20 intelligence contract;
And second memory module will be related to ERC20 intelligence contract in the case where contract of trading is ERC20 intelligence contract
4th data of connection are stored in database.
Specifically, third data are resolved to transaction contract by the second parsing module.Such as: the transaction contract can be user
Between carry out common ETH transaction, or to block chain fictitious assets (such as: the game user based on block chain technology is gathered around
Some game items) carry out exchange, or the intelligent contract based on block chain technology etc. between stage property.At this point, judging mould
Block needs determine whether ERC20 intelligence contract to the transaction contract.Its object is to determine friendship corresponding with the transaction contract
Easily whether traded based on the logical card of block chain.In the case where judgment module determines transaction contract for ERC20 intelligence contract, the
The 4th data associated with ERC20 intelligence contract are stored in database by two memory modules.In this way, system 400
Transaction based on the logical card of block chain can be screened from numerous transaction.To be based on block chain for it in visitor
In the case that the transaction record of logical card is inquired, system 400 can rapidly transfer the data being pre-stored in database
Terminal device is sent to for visitor views.And then effectively raise the usage experience of visitor.
Optionally, judgment module, comprising: the first judging submodule, for determining whether the input of logical card transaction is empty;The
Two judging submodules, for determining ABI pairs that uses ERC20 intelligence contract in the case where the input of logical card transaction is not sky
Whether the result that transaction contract is parsed is correct;Acquisition submodule, for the ABI in use ERC20 intelligence contract to transaction
In the correct situation of the result that contract is parsed, the code of transaction beneficiary address is obtained;Third judging submodule is used for
In the case that code is not sky, determine whether transaction contract has name, symbol, decimals, totalSupply tetra- categories
Property;And the 4th judging submodule, for there are name, symbol, decimals, totalSupply tetra- in transaction contract
In the case where attribute, determine that transaction contract is ERC20 intelligence contract.
Specifically, firstly, the first judging submodule determines whether the input of logical card transaction is empty.I.e. system 400 needs first
It whether effective verifies the logical card transaction of the pen, and is based under effective transaction, perform the following operation: second judgment submodule is sentenced
Whether the result parsed surely using the ABI of ERC20 intelligence contract to transaction contract is correct, if ERC20 intelligence contract
Interface exists, then proves that the transaction contract is compiled as ERC20 intelligence contract.At this point, acquisition submodule is attempted to obtain to hand over
The code of easy beneficiary address, and judge whether the code is empty.If the code is not sky, prove that the transaction contract exists
Both sides user.Then, third judging submodule determine transaction contract whether have name, symbol, decimals,
Tetra- attributes of totalSupply have this four attributes of name, symbol, decimals, totalSupply in a contract
In the case where, it was demonstrated that the transaction of this contract is ERC20 intelligence contract.In this way, system 400 can be determined accurately
Whether the transaction of this contract is ERC20 intelligence contract, and then avoids system 400 and will not belong to the contract of the logical card transaction of block chain
It is stored in database, thus the problem of causing database to be polluted by nonsignificant data appearance.
Optionally, the 4th data include the information of ERC20 intelligence contract and trade beneficiary address and ERC20 intelligence contract
The map information of address, the system further include: third memory module, for the information of ERC20 intelligence contract and transaction to be collected money
The map information of square address and ERC20 intelligence contract address is stored in database.
Specifically, third memory module about the information of the ERC20 intelligence contract of the logical card of block chain and will visit visitor
The person of asking is stored in database about the information of ERC20 intelligence contract and the map information of visitor address of the logical card of block chain.?
Visitor wants in the case where being inquired by transaction record the pen, and system 400 can be according to being pre-stored within database
In the map information about the transaction information and visitor address, rapidly transfer out corresponding ERC20 intelligence contract.
In this way, the search efficiency of system 400 is further improved.
Optionally, acquisition submodule, comprising: obtain subelement, address is specified according to the return of remote procedure call protocol
The method of code obtains the code of transaction beneficiary address.
Specifically, obtaining subelement can be according to the side for being used to return specified address code in remote procedure call protocol
Method, targetedly to the code of transaction beneficiary address (such as: the transaction beneficiary can be visitor).Pass through this side
Formula, the code of transaction beneficiary address can quickly be obtained by obtaining subelement, so that obtaining subelement in the mistake for obtaining code
Cheng Gengjia is safe and stablizes.
Optionally, the first data further include block address, the 5th data relevant to logical card transaction record and user security
Login interface, the system further include: the 4th memory module is used for block address, the 5th data and user security login interface
It is stored in database.
Specifically, block address, the 5th data and user security login interface are stored in database by the 4th memory module.
Such as: system 400 can use the form of list, be classified according to the classification of data to the data being stored in database profession,
And the data classified are stored respectively in each list.At this point, there are block address list, the 5th data to arrange in database
Table and user security login interface list.It in this way, can be with after system 400 parses block chain account book number
It is purposive that category storage is carried out to the data parsed so that system 400 can in an orderly manner, it is targetedly right
Data in database are inquired.And then ensured system 400 data in database can be carried out complicated inquiry and
Statistics, and greatly improve the working efficiency of system 400.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because
According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention
It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation
The method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very much
In the case of the former be more preferably embodiment.Based on this understanding, technical solution of the present invention is substantially in other words to existing
The part that technology contributes can be embodied in the form of software products, which is stored in a storage
In medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculate
Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
Embodiment 3
According to embodiments of the present invention, present disclose provides a kind of data processing systems 500, as shown in Figure 5, comprising: processing
Device 510 and memory 520, connect with processor 510, for providing the instruction for handling following processing step for processor 510:
The block for including in inquiry block chain;Data in the block inquired are resolved to associated with the data in block first
Data;And the first data are stored in database, wherein database supports SQL query.
Optionally, memory 520 is used to provide the instruction for handling following processing step for processor 510, further includes: according to
The preset period executes following operation: whether generating new block in inquiry block chain;It is produced in confirmation block chain new
In the case where block, the data in new block are resolved into the second data associated with the data in new block;And by
Two data are stored in database.
Optionally, the first data include third data relevant to logical card transaction, and memory 520 is used to be processor
510 provide the instruction for handling following processing step, further include that third data are resolved to transaction contract;Whether determine transaction contract
For ERC20 intelligence contract;It, will be associated with ERC20 intelligence contract and in the case where contract of trading is ERC20 intelligence contract
The 4th data be stored in database.
Optionally, determine transaction contract whether be ERC20 intelligence contract operation, comprising: determine the input of logical card transaction
It whether is empty;In the case where the input of logical card transaction is not sky, determine using the ABI of ERC20 intelligence contract to transaction contract
It whether correct is parsed;
In the case where carrying out parsing correct situation to transaction contract using the ABI of ERC20 intelligence contract, transaction beneficiary is obtained
The code of address;In the case where code is not sky, determine transaction contract whether have name, symbol, decimals,
Tetra- attributes of totalSupply;And
In the case where contract of trading has tetra- attributes of name, symbol, decimals, totalSupply, determine to hand over
Easy contract is ERC20 intelligence contract.
Optionally, the 4th data include the information of ERC20 intelligence contract and trade beneficiary address and ERC20 intelligence contract
The map information of address, and memory 520 is used to provide the instruction for handling following processing step for processor 510, further includes:
The map information of the information of ERC20 intelligence contract and transaction beneficiary address and ERC20 intelligence contract address is stored in data
Library.
Optionally, the operation of the code of transaction beneficiary address is obtained, comprising: according to the return of remote procedure call protocol
The method of specified address code, obtains the code of transaction beneficiary address.
Optionally, the first data further include block address, the 5th data relevant to logical card transaction record and user security
Login interface, and memory 520 is used to provide the instruction for handling following processing step for processor 510, further includes: by block
Address, the 5th data and user security login interface are stored in database.
The embodiment of the present invention provides a kind of data processing system 500, is stored in block chain account book data using system 500
Support the mode of the database of SQL query.Block included in block chain is inquired by system 500.Then, system 500 will
The data inquired resolve to the first data associated with the data.First data are stored in data by final system 500
Library.Such as, but not limited to, database can be MySQL database and MongoDB database, the two databases are supported complicated
Query function.It thus is needing targetedly to inquire block chain account book data in visitor, and will by terminal device
In the case that the inquiry request is sent to system 500, system 500 receives the inquiry request from terminal device, and to being stored in number
It is targetedly inquired according to the data in library.
To allow system 500 targetedly to the block chain account being stored in database profession by above-mentioned mode
Notebook data carries out complicated inquiry and statistics, significantly reduces the work load of system 500, improves the work effect of system 500
Rate.And then it solves existing primary node and block chain account book data is stored in LevelDB database, but LevelDB data
Inventory causes server can not be to block chain account book the shortcomings that random write fetches according to low efficiency and do not support SQL query
Data carry out complicated inquiry and statistics, can only whole data be carried out with inquiry from first to last, and complete based on what is inquired
Portion's data are analyzed, so that the workload of server increases, and then the technology of the working efficiency of server greatly reduce
Problem.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of
Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because
According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know
It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention
It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation
The method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very much
In the case of the former be more preferably embodiment.Based on this understanding, technical solution of the present invention is substantially in other words to existing
The part that technology contributes can be embodied in the form of software products, which is stored in a storage
In medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculate
Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit
It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of software functional units.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered
It is considered as protection scope of the present invention.
Claims (10)
1. a kind of data processing method characterized by comprising
The block for including in inquiry block chain;
Data in the block inquired are resolved into the first data associated with the data in the block;And
First data are stored in database, wherein the database supports SQL query.
2. the method according to claim 1, wherein further include:
According to the preset period, following operation is executed:
It inquires in the block chain and whether generates new block;
In the case where producing new block in confirming the block chain, by the data in the new block resolve to it is described new
Associated second data of data in block;
And
Second data are stored in the database.
3. the method according to claim 1, wherein first data include third relevant to logical card transaction
Data, this method further include:
The third data are resolved into transaction contract;
Determine whether the transaction contract is ERC20 intelligence contract;And
It, will the 4th number associated with the ERC20 intelligence contract in the case where the transaction contract is ERC20 intelligence contract
According to being stored in the database.
4. according to the method described in claim 3, it is characterized in that, determining whether the transaction contract is ERC20 intelligence contract
Operation, comprising:
Whether the input for determining the logical card transaction is empty;
In the case where the input of the logical card transaction is not sky, determine to close the transaction using the ABI of ERC20 intelligence contract
Whether the result about parsed is correct;
In the correct situation of result parsed using the ABI of ERC20 intelligence contract to the transaction contract, transaction is obtained
The code of beneficiary address;
In the case where the code is not sky, determine the transaction contract whether have name attribute, symbol attribute,
Decimals attribute and totalSupply attribute;And
There are the feelings of name attribute, symbol attribute, decimals attribute and totalSupply attribute in the transaction contract
Under condition, determine that the transaction contract is ERC20 intelligence contract.
5. according to the method described in claim 4, it is characterized in that, the 4th data include the information of ERC20 intelligence contract
With the map information of transaction beneficiary address and ERC20 intelligence contract address, this method further include:
The mapping of the information of the ERC20 intelligence contract and the transaction beneficiary address and ERC20 intelligence contract address is believed
Breath is stored in the database.
6. according to the method described in claim 4, it is characterized in that, obtaining the operation of the code of transaction beneficiary address, comprising:
According to the method in remote procedure call protocol for returning to specified address code, the transaction beneficiary address is obtained
Code.
7. the method according to claim 1, wherein first data further include that block address and logical card are handed over
It is easy to remember to record relevant 5th data and user security login interface, this method further include:
The block address, the 5th data and the user security login interface are stored in the database.
8. a kind of storage medium, which is characterized in that the storage medium includes the program of storage, wherein run in described program
When as processor perform claim require any one of 1 to 7 described in method.
9. a kind of data processing system characterized by comprising
Enquiry module, for inquiring the block for including in block chain;
First parsing module, for the data in the block inquired to be resolved to associated with the data in the block
One data;And
First memory module, for first data to be stored in database, wherein the database supports SQL query.
10. a kind of data processing system characterized by comprising
Processor;And
Memory is connected to the processor, for providing the instruction for handling following processing step for the processor:
The block for including in inquiry block chain;
Data in the block inquired are resolved into the first data associated with the data in the block;And
First data are stored in database, wherein the database supports SQL query.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811236906.8A CN109408513A (en) | 2018-10-23 | 2018-10-23 | Data processing method, system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811236906.8A CN109408513A (en) | 2018-10-23 | 2018-10-23 | Data processing method, system and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109408513A true CN109408513A (en) | 2019-03-01 |
Family
ID=65468350
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811236906.8A Pending CN109408513A (en) | 2018-10-23 | 2018-10-23 | Data processing method, system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109408513A (en) |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110263014A (en) * | 2019-05-15 | 2019-09-20 | 广州致链科技有限公司 | Block chain storage system and method towards timing type data |
CN111104425A (en) * | 2019-11-13 | 2020-05-05 | 腾讯科技(深圳)有限公司 | Data processing method and device |
CN111488613A (en) * | 2020-04-08 | 2020-08-04 | 北京瑞策科技有限公司 | Data efficient query method and device for service data block chain |
CN113434503A (en) * | 2021-06-25 | 2021-09-24 | 上海佩俪信息科技有限公司 | Block chain browsing method and system |
WO2022077916A1 (en) * | 2020-10-16 | 2022-04-21 | 华为技术有限公司 | Data processing system, data processing method based on blockchain, and device |
WO2022140936A1 (en) * | 2020-12-28 | 2022-07-07 | 杭州趣链科技有限公司 | Metering method and device for data query workload in blockchain, and terminal |
US11558180B2 (en) | 2020-01-20 | 2023-01-17 | International Business Machines Corporation | Key-value store with blockchain properties |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105279281A (en) * | 2015-11-17 | 2016-01-27 | 天泽信息产业股份有限公司 | Internet-of-things data access method |
CN107135661A (en) * | 2016-12-26 | 2017-09-05 | 深圳前海达闼云端智能科技有限公司 | Data processing method, device, system and information collecting device |
CN107391649A (en) * | 2017-07-14 | 2017-11-24 | 浙商银行股份有限公司 | A kind of system and method for lifting block chain query efficiency |
CN107767265A (en) * | 2017-11-07 | 2018-03-06 | 中积有限公司 | A kind of data sharing method and server |
CN107943951A (en) * | 2017-11-24 | 2018-04-20 | 中钞***产业发展有限公司杭州区块链技术研究院 | A kind of search method and system of block chain business information |
WO2018072471A1 (en) * | 2016-10-19 | 2018-04-26 | 华为技术有限公司 | Detection method, device and system for copyright protection |
CN108632284A (en) * | 2018-05-10 | 2018-10-09 | 网易(杭州)网络有限公司 | User data authorization method, medium, device and computing device based on block chain |
-
2018
- 2018-10-23 CN CN201811236906.8A patent/CN109408513A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105279281A (en) * | 2015-11-17 | 2016-01-27 | 天泽信息产业股份有限公司 | Internet-of-things data access method |
WO2018072471A1 (en) * | 2016-10-19 | 2018-04-26 | 华为技术有限公司 | Detection method, device and system for copyright protection |
CN107135661A (en) * | 2016-12-26 | 2017-09-05 | 深圳前海达闼云端智能科技有限公司 | Data processing method, device, system and information collecting device |
CN107391649A (en) * | 2017-07-14 | 2017-11-24 | 浙商银行股份有限公司 | A kind of system and method for lifting block chain query efficiency |
CN107767265A (en) * | 2017-11-07 | 2018-03-06 | 中积有限公司 | A kind of data sharing method and server |
CN107943951A (en) * | 2017-11-24 | 2018-04-20 | 中钞***产业发展有限公司杭州区块链技术研究院 | A kind of search method and system of block chain business information |
CN108632284A (en) * | 2018-05-10 | 2018-10-09 | 网易(杭州)网络有限公司 | User data authorization method, medium, device and computing device based on block chain |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110263014A (en) * | 2019-05-15 | 2019-09-20 | 广州致链科技有限公司 | Block chain storage system and method towards timing type data |
CN111104425A (en) * | 2019-11-13 | 2020-05-05 | 腾讯科技(深圳)有限公司 | Data processing method and device |
US11558180B2 (en) | 2020-01-20 | 2023-01-17 | International Business Machines Corporation | Key-value store with blockchain properties |
CN111488613A (en) * | 2020-04-08 | 2020-08-04 | 北京瑞策科技有限公司 | Data efficient query method and device for service data block chain |
WO2022077916A1 (en) * | 2020-10-16 | 2022-04-21 | 华为技术有限公司 | Data processing system, data processing method based on blockchain, and device |
WO2022140936A1 (en) * | 2020-12-28 | 2022-07-07 | 杭州趣链科技有限公司 | Metering method and device for data query workload in blockchain, and terminal |
CN113434503A (en) * | 2021-06-25 | 2021-09-24 | 上海佩俪信息科技有限公司 | Block chain browsing method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109408513A (en) | Data processing method, system and storage medium | |
CN108765070A (en) | A kind of service providing method, system, equipment and computer readable storage medium | |
CN108960992A (en) | A kind of information recommendation method and relevant device | |
US11570214B2 (en) | Crowdsourced innovation laboratory and process implementation system | |
CN110086877A (en) | Application program sharing, sharing information display methods, device, equipment and medium | |
CN103858118A (en) | Dynamically acquiring computing resources in a networked computing environment | |
CN104572968B (en) | A kind of method for updating pages and device | |
CN110019540A (en) | Implementation method, methods of exhibiting and the device of enterprise's map, equipment | |
CN110225104A (en) | Data capture method, device and terminal device | |
CN109408696A (en) | It is a kind of for search for boarding program method and apparatus | |
CN103493083A (en) | Information processing apparatus, information processing method, and program | |
CN109284326A (en) | A kind of data bank access method and device | |
CN108628687A (en) | The system and method for product information are provided | |
CN109359237A (en) | It is a kind of for search for boarding program method and apparatus | |
CN107862352A (en) | A kind of Quick Response Code sharing method and Quick Response Code share equipment | |
CN110347667A (en) | A kind of data cleaning method and device | |
CN109472615A (en) | Service processing method, device and equipment and readable medium | |
KR101348347B1 (en) | Server for providing service of trading golf things | |
CN110210898A (en) | Advertisement sending method, device and equipment based on user behavior | |
JP2023103229A (en) | Integration plugin for identifying and presenting associated items on web page | |
CN103347029A (en) | Method, terminal, server and system for service data interaction | |
KR101706141B1 (en) | Oline commerce method and system | |
CN102103606A (en) | Technology for realizing advanced search of commodities on mobile phone client | |
CN113704493A (en) | Display information determining method, device, equipment and computer readable storage medium | |
CN107220120A (en) | Method and apparatus for delivering software solution |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190301 |