CN109542945B - Block chain data statistical analysis method, device and storage medium - Google Patents

Block chain data statistical analysis method, device and storage medium Download PDF

Info

Publication number
CN109542945B
CN109542945B CN201811221268.2A CN201811221268A CN109542945B CN 109542945 B CN109542945 B CN 109542945B CN 201811221268 A CN201811221268 A CN 201811221268A CN 109542945 B CN109542945 B CN 109542945B
Authority
CN
China
Prior art keywords
data
blockchain
chain
message queue
statistics
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.)
Active
Application number
CN201811221268.2A
Other languages
Chinese (zh)
Other versions
CN109542945A (en
Inventor
孟君
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201811221268.2A priority Critical patent/CN109542945B/en
Publication of CN109542945A publication Critical patent/CN109542945A/en
Application granted granted Critical
Publication of CN109542945B publication Critical patent/CN109542945B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a blockchain technology and discloses a blockchain data statistical analysis method, an electronic device and a storage medium. And then, the method reads the data to be written into the blockchain system from the message queue, and writes the data written into the blockchain system into a data table of the relational database after designing a table structure according to a preset statistical dimension. Finally, the method receives the block chain service data statistics request, reads the data table related to the service statistics request from the relational database, screens the data fields related to the statistics conditions input by the user from the read data table, and calculates to obtain the statistics result. The invention can avoid the processing bottleneck problem caused by excessive data and improve the stability of the block chain system.

Description

Block chain data statistical analysis method, device and storage medium
Technical Field
The present invention relates to the field of blockchain technologies, and in particular, to a blockchain data statistical analysis method, a device and a computer readable storage medium.
Background
Blockchains are novel application modes of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. The data in the blockchain is safe and reliable, but based on the blockchain, statistics and analysis of the data cannot be completed quickly, meanwhile, the data written into the blockchain is written according to a transaction scene, and when the statistics is performed, only information in transaction units can be counted. While data statistics are typically performed by organizations or enterprises, they involve analysis of large amounts of data across large durations from multiple dimensions, and existing blockchain-based data statistics cannot meet statistical requirements.
Disclosure of Invention
In view of the above, the present invention provides a method, apparatus and computer readable storage medium for statistical analysis of blockchain data, which are mainly aimed at increasing the speed of blockchain data statistics and improving the stability of blockchain systems.
In order to achieve the above object, the present invention provides a blockchain data statistical analysis method, which includes:
a receiving step: receiving a block chain service data writing request, and caching the to-be-input chain data into a message queue;
writing: reading the data to be written into the block chain system from the message queue, and writing the data written into the block chain system into a data table of a relational database after designing a table structure according to a preset statistical dimension;
the calculation steps are as follows: and receiving a block chain service data statistics request, reading a data table related to the service statistics request from a relational database, screening data fields related to the statistics conditions input by a user from the read data table, and calculating to obtain a statistics result.
Preferably, the writing step includes:
when the to-be-in chain data is read from the message queue, the preset number of to-be-in chain data with the longest waiting time can be extracted from the message queue and written into the blockchain system, and when the information processing is finished, the preset number of to-be-in chain data is extracted from the message queue.
Preferably, the writing step includes:
when the to-be-in chain data is read from the message queue, extracting preset quantity of to-be-in chain data from the message queue at preset time intervals, and writing the to-be-in chain data into the blockchain system so as to ensure that the currently processed to-be-in chain data is kept within a preset quantity range.
Preferably, the receiving step may further include: and carrying out user authority identification on the client side initiating the blockchain service data writing request, caching the to-be-input chain data to a message queue if the user authority identification passes, and rejecting the blockchain service data writing request of the user if the user authority identification fails.
Preferably, the data table includes a table name, a field in the table, a field type, and a field attribute.
Preferably, the method further comprises:
and searching a corresponding block from the block chain system according to the primary key of the data table read from the relational database, and verifying the data information recorded by the data table according to the data information recorded by the searched block.
In addition, the invention also provides an electronic device, which comprises: the system comprises a memory, a processor and a display, wherein the memory stores a blockchain data statistical analysis program, and the blockchain data statistical analysis program is executed by the processor and can realize the following steps:
a receiving step: receiving a block chain service data writing request, and caching the to-be-input chain data into a message queue;
writing: reading the data to be written into the block chain system from the message queue, and writing the data written into the block chain system into a data table of a relational database after designing a table structure according to a preset statistical dimension;
the calculation steps are as follows: and receiving a block chain service data statistics request, reading a data table related to the service statistics request from a relational database, screening data fields related to the statistics conditions input by a user from the read data table, and calculating to obtain a statistics result.
Preferably, the receiving step may further include: and carrying out user authority identification on the client side initiating the blockchain service data writing request, caching the to-be-input chain data to a message queue if the user authority identification passes, and rejecting the blockchain service data writing request of the user if the user authority identification fails.
Preferably, the blockchain data statistical analysis program when executed by the processor further includes:
and searching a corresponding block from the block chain system according to the primary key of the data table read from the relational database, and verifying the data information recorded by the data table according to the data information recorded by the searched block.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium including therein a blockchain data statistical analysis program that, when executed by a processor, can implement any of the steps in the blockchain data statistical analysis method as described above.
The invention provides a block chain data statistical analysis method, a device and a computer readable storage medium, which are used for caching the data to be input into a message queue by receiving a block chain service data writing request, then reading the data to be input into a block chain system from the message queue, writing the data written into the block chain system into a data table of a relational database according to a preset statistical dimension design table structure, finally receiving the block chain service data statistical request, reading the data table related to the service statistical request from the relational database, screening data fields related to statistical conditions input by a user from the read data table, and calculating to obtain a statistical result, thereby solving the problem that the block chain is slow in data statistics and improving the stability of the block chain system.
Drawings
FIG. 1 is a schematic diagram of an electronic device according to a preferred embodiment of the invention;
FIG. 2 is a block diagram of a block chain data statistics analysis process of FIG. 1 according to a preferred embodiment;
FIG. 3 is a flowchart of a blockchain data statistical analysis method according to a preferred embodiment of the present invention;
FIG. 4 is a schematic diagram of an application environment of the blockchain data statistical analysis method of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Fig. 1 is a schematic diagram of a preferred embodiment of an electronic device 1 according to the present invention.
In this embodiment, the electronic apparatus 1 may be a rack server, a blade server, a tower server, or a cabinet server, and the electronic apparatus 1 may be an independent server or a server cluster formed by a plurality of servers.
The electronic device 1 includes, but is not limited to: memory 11, processor 12, display 13, and network interface 14. The electronic device 1 is connected to a network through a network interface 14 to obtain the original data. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, GSM), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, or a call network.
The memory 11 includes at least one type of readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), programmable Read Only Memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the storage 11 may be an internal storage unit of the electronic device 1, such as a hard disk or a memory of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic apparatus 1, for example, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are equipped in the electronic apparatus 1. Of course, the memory 11 may also comprise both an internal memory unit and an external memory device of the electronic apparatus 1. In this embodiment, the memory 11 is generally used for storing an operating system and various application software installed in the electronic device 1, such as program codes of the blockchain data statistics analysis program 10. Further, the memory 11 may be used to temporarily store various types of data that have been output or are to be output. For example, pending link data buffered in a message queue.
The processor 12 may be a central processing unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 12 is typically used for controlling the overall operation of the electronic device 1, e.g. performing data interaction or communication related control and processing, etc. In this embodiment, the processor 12 is configured to execute the program code stored in the memory 11 or process data, such as the program code of the blockchain data statistics analysis program 10.
The display 13 may be referred to as a display screen or a display unit. The display 13 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an Organic Light-Emitting Diode (OLED) touch device, or the like in some embodiments. The display 13 is used for displaying information processed in the electronic device 1 and for displaying a visual work interface, for example displaying the results of data statistics.
The network interface 14 may alternatively comprise a standard wired interface, a wireless interface (e.g. WI-FI interface), which network interface 14 is typically used for establishing a communication connection between the electronic apparatus 1 and other electronic devices.
Fig. 1 shows only an electronic device 1 having components 11-14 and a blockchain data statistics analysis program 10, but it should be understood that not all of the illustrated components are required to be implemented, and that more or fewer components may alternatively be implemented.
Optionally, the electronic device 1 may further comprise a user interface, which may comprise an input unit such as a Keyboard (Keyboard), a voice output device such as a sound box, a headset, etc., and optionally a standard wired interface, a wireless interface.
Optionally, the electronic device 1 further comprises a touch sensor. The area provided by the touch sensor for the user to perform a touch operation is referred to as a touch area. Further, the touch sensors described herein may be resistive touch sensors, capacitive touch sensors, and the like. The touch sensor may include not only a contact type touch sensor but also a proximity type touch sensor. Furthermore, the touch sensor may be a single sensor or may be a plurality of sensors arranged in an array, for example. The user may initiate the blockchain data statistics analysis program 10 by touching the touch area.
The area of the display 13 of the electronic device 1 may be the same as or different from the area of the touch sensor. Optionally, the display 13 is stacked with the touch sensor to form a touch display screen. The electronic device 1 detects a touch operation triggered by a user based on a touch display screen.
The electronic device 1 may further include Radio Frequency (RF) circuits, sensors and audio circuits, etc., which will not be described in detail herein.
FIG. 2 is a block diagram of the block chain data statistics analysis program 10 of FIG. 1 according to a preferred embodiment. The invention may refer to a series of computer program instruction segments capable of performing a specified function.
In this embodiment, the blockchain data statistical analysis program 10 includes: the functions or operation steps implemented by the modules 110-130 are as follows:
the receiving module 110 is configured to receive a blockchain service data writing request, and cache the pending chain data in the message queue. The blockchain service data writing request comprises service characteristic information of the to-be-chained service data, wherein the service characteristic information comprises identification information of service types, such as contract service, transfer service and the like, and identification information of institutions or individuals involved in the service. For example, when the to-be-chained data is a contract application file, the service characteristic information includes an identification of a contract type service, an identification of a participant of the contract, an approval authority, a signing authority, and the like.
In another embodiment, the method further comprises the step of performing user authority identification on the client side initiating the blockchain service data writing request before the to-be-in-chain data is cached in the message queue, wherein the user authority identification passes through the step of caching the to-be-in-chain data in the message queue, and the step of rejecting the blockchain service data writing request of the user when the user authority identification fails. And when the request is received, judging whether the authority of the user initiating the request is in the special block, if the authority of the user exists in the special block, agreeing to the writing request of the user, and caching the data to be written into the chain of the user into a message queue, otherwise, refusing the writing request of the user. For example, when the blockchain is used for statistically analyzing contract-like services, it is determined whether the authority of the user who initiates the request exists in a dedicated block, and if the authority of the user does not exist, the writing request of the user is denied.
The writing module 120 is configured to read the to-be-written chain data from the message queue, write the to-be-written chain data into the blockchain system, and write the data written into the blockchain system into a data table of the relational database after designing the table structure according to a preset statistical dimension. Wherein the blockchain system includes one or more blockchains. When multiple blockchains are included, one of the blockchains serves as the backbone of the blockchain system, while the remaining blockchains serve as the side chains of the blockchain system. Under the condition of no special configuration, the execution results of various business data accessed by the blockchain system are written into the main chain by default. And when needed, the blockchain system can separate one or more side chains, and each side chain correspondingly processes the business data of one or more different business types. The method for reading the to-be-written chain data from the message queue and writing the to-be-written chain data into the blockchain system includes, but is not limited to, extracting the preset number of to-be-written chain data with the longest waiting time from the message queue when the to-be-written chain data is read from the message queue, extracting the preset number of to-be-written chain data from the message queue after the information processing is completed, or extracting the preset number of to-be-written chain data from the message queue at intervals of preset time when the to-be-written chain data is read from the message queue and writing the to-be-written chain data into the blockchain system, so that the currently processed to-be-written chain data is kept within a preset number range. Each data table of the relational database, such as mysql, includes a table name, a field in the table, a field type, a field attribute, and the like. The field comprises a primary key field which can uniquely identify the data table, namely a primary key (key), and the field is positioned into the blockchain according to the key value of the data table to acquire accurate blockchain data. The design table structure comprises a definition data table name, a field contained in the definition data table, a field name of each field, a field type, an attribute and a width. For example, when the pending chain data is a contract application, the key value may be a block identifier in a blockchain related to the contract, where the statistical dimension includes an application time of the contract, an application party, a related approval process, an approval mechanism related to the approval process, and a signing mechanism, and an approval record of each mechanism includes an approval time, an approval opinion, and an electronic signature, and a final processing result and a completion time of the contract.
The calculating module 130 is configured to receive the blockchain service data statistics request, read a data table related to the service statistics request from the relational database, screen a data field related to the statistics condition input by the user from the read data table, and calculate to obtain a statistics result. The blockchain service data statistics request comprises statistics condition information, wherein the statistics condition information comprises identification information of service types, such as contract type service, transfer type service and the like, and statistics targets, such as statistics electronic signature, statistics time period and identification information of a statistical organization or person. For example, if the user wants to count how many electronic signatures are related to a contract, the data table of the contract can be called from the relational database, and the electronic signature records of each institution related to the contract are read from the data table to be summarized so as to obtain the statistical result of the electronic signatures of the contract. For another example, if the user wants to count the electronic signature of a mechanism within a preset time, all the data tables containing the fields of the mechanism are called from the relational database, and the electronic signature records of the mechanism are extracted from the transactions related to each database to be summarized to obtain a result.
In another embodiment, the method may further include: after the statistics is finished, searching corresponding blocks from the block chain system according to the key value, namely the main key, of the data table read from the relational database, and verifying the data information recorded by the data table according to the data information recorded by the searched blocks. For example, after the relational database completes data statistics, if the authenticity of the data needs to be verified, or the details of the data are displayed, the blocks in the blockchain system can be positioned according to the key values of the data table to obtain the data information of the block records, so as to verify whether the data in the data table originate from the blockchain.
FIG. 3 is a flow chart of a block chain data statistical analysis method according to a preferred embodiment of the present invention.
In the present embodiment, the processor 12 implements the blockchain data statistical analysis method when executing the computer program of the blockchain data statistical analysis program 10 stored in the memory 11, including: step S10 to step S30. In connection with fig. 4: the implementation of the invention is illustrated by an application environment diagram of the blockchain data statistical analysis method.
In step S10, the receiving module 110 receives a blockchain service data writing request, and caches the pending chain data in the message queue. In the prior art, fixed-length data is generally written into a blockchain in a blockwise manner, and when processing information enters the blockchain, a blockchain processing node sequentially processes various requests according to the sequence of the information to be processed. However, if too many requests are made instantaneously, the system may create a bottleneck, and the system resources are exhausted, especially in the case of a coalition chain. Therefore, before the data to be written into the blockchain is written into the blockchain, the information to be processed is buffered in the message queue, the progress of the blockchain for processing the information is controlled, and the peak processing bottleneck problem is effectively avoided. The blockchain service data writing request comprises service characteristic information of the to-be-chained service data, wherein the service characteristic information comprises identification information of service types, such as contract service, transfer service and the like, and identification information of institutions or individuals involved in the service. For example, when the to-be-chained data is a contract application file, the service characteristic information includes an identification of a contract type service, an identification of a participant of the contract, an approval authority, a signing authority, and the like.
Furthermore, before the to-be-in-chain data is cached to the message queue, user authority identification can be performed on the client side initiating the blockchain service data writing request, if the user authority identification passes, the to-be-in-chain data is cached to the message queue, and if the user authority identification fails, the blockchain service data writing request of the user is refused. And when the request is received, judging whether the authority of the user initiating the request is in the special block, if the authority of the user exists in the special block, agreeing to the writing request of the user, and caching the data to be written into the chain of the user into a message queue, otherwise, refusing the writing request of the user. For example, when the blockchain is used for statistically analyzing contract-like services, it is determined whether the authority of the user who initiates the request exists in a dedicated block, and if the authority of the user does not exist in the dedicated block, the request of the user is denied.
In step S20, the writing module 120 reads the data to be written into the blockchain system from the message queue, and writes the data written into the blockchain system into the data table of the relational database after designing the table structure according to the preset statistical dimension. The blockchain system in the embodiment of the invention comprises one or more blockchains. When multiple blockchains are included, one of the blockchains serves as the backbone of the blockchain system, while the remaining blockchains serve as the side chains of the blockchain system. Under the condition of no special configuration, the execution results of various business data accessed by the blockchain system are written into the main chain by default. And when needed, the blockchain system can separate one or more side chains, and each side chain correspondingly processes the business data of one or more different business types. The method for reading the to-be-written chain data from the message queue and writing the to-be-written chain data into the blockchain system includes, but is not limited to, extracting the preset number of to-be-written chain data with the longest waiting time from the message queue when the to-be-written chain data is read from the message queue, extracting the preset number of to-be-written chain data from the message queue after the information processing is completed, or extracting the preset number of to-be-written chain data from the message queue at intervals of preset time when the to-be-written chain data is read from the message queue and writing the to-be-written chain data into the blockchain system, so that the currently processed to-be-written chain data is kept within a preset number range.
Each data table of the relational database, such as mysql, includes a table name, a field in the table, a field type, a field attribute, and the like. The field comprises a primary key field which can uniquely identify the data table, namely a primary key (key), and the field is positioned into the blockchain according to the key value of the data table to acquire accurate blockchain data. The design table structure comprises a definition data table name, a field contained in the definition data table, a field name of each field, a field type, an attribute and a width. For example, when the pending chain data is a contract application, the key value may be a block identifier in a blockchain related to the contract, where the statistical dimension includes an application time of the contract, an application party, a related approval process, an approval mechanism related to the approval process, and a signing mechanism, and an approval record of each mechanism includes an approval time, an approval opinion, and an electronic signature, and a final processing result and a completion time of the contract.
In step S30, the calculation module 130 receives the blockchain service data statistics request, reads the data table related to the service statistics request from the relational database, screens the data fields related to the statistics condition input by the user from the read data table, and calculates the statistics result. The blockchain service data statistics request comprises statistics condition information, wherein the statistics condition information comprises identification information of service types, such as contract type service, transfer type service and the like, and statistics targets, such as statistics electronic signature, statistics time period and identification information of a statistical organization or person. For example, if the user wants to count how many electronic signatures are related to a contract, the data table of the contract can be called from the relational database, and the electronic signature records of each institution related to the contract are read from the data table to be summarized so as to obtain the statistical result of the electronic signatures of the contract. For another example, if the user wants to count the electronic signature of a mechanism within a preset time, all the data tables containing the fields of the mechanism are called from the relational database, and the electronic signature records of the mechanism are extracted from the transactions related to each database to be summarized to obtain a result.
Further, after the statistics is finished, the corresponding block can be searched from the block chain system according to the key value, namely the main key, of the data table read from the relational database, and the data information recorded in the data table can be verified according to the data information recorded in the searched block. For example, after the relational database completes data statistics, if the authenticity of the data needs to be verified, or the details of the data are displayed, the blocks in the blockchain system can be positioned according to the key values of the data table to obtain the data information of the block records, so as to verify whether the data in the data table originate from the blockchain.
According to the block chain data statistical analysis method, the block chain service data writing request is received, the to-be-written chain data is cached to the message queue, then the to-be-written chain data is read from the message queue and written into the block chain system, the data written into the block chain system is written into the data table of the relational database after being designed into the table structure according to the preset statistical dimension, finally the block chain service data statistical request is received, the data table related to the service statistical request is read from the relational database, the data field related to the statistical condition input by the user is screened from the read data table, and the statistical result is obtained through calculation, so that the problem that the block chain data is slow in statistics is solved, the data statistical rate is improved, and the stability of the block chain system is improved.
In addition, an embodiment of the present invention further proposes a computer readable storage medium, where the computer readable storage medium includes a blockchain data statistics analysis program 10, where the blockchain data statistics analysis program 10 implements the following operations when executed by a processor:
a receiving step: receiving a block chain service data writing request, and caching the to-be-input chain data into a message queue;
writing: reading the data to be written into the block chain system from the message queue, and writing the data written into the block chain system into a data table of a relational database after designing a table structure according to a preset statistical dimension;
the calculation steps are as follows: and receiving a block chain service data statistics request, reading a data table related to the service statistics request from a relational database, screening data fields related to the statistics conditions input by a user from the read data table, and calculating to obtain a statistics result.
Preferably, the writing step includes:
when the to-be-in chain data is read from the message queue, the preset number of to-be-in chain data with the longest waiting time can be extracted from the message queue and written into the blockchain system, and when the information processing is finished, the preset number of to-be-in chain data is extracted from the message queue.
Preferably, the writing step includes:
when the to-be-in chain data is read from the message queue, extracting preset quantity of to-be-in chain data from the message queue at preset time intervals, and writing the to-be-in chain data into the blockchain system so as to ensure that the currently processed to-be-in chain data is kept within a preset quantity range.
Preferably, the receiving step may further include: and carrying out user authority identification on the client side initiating the blockchain service data writing request, caching the to-be-input chain data to a message queue if the user authority identification passes, and rejecting the blockchain service data writing request of the user if the user authority identification fails.
Preferably, the data table includes a table name, a field in the table, a field type, and a field attribute.
Preferably, the method further comprises:
and searching a corresponding block from the block chain system according to the primary key of the data table read from the relational database, and verifying the data information recorded by the data table according to the data information recorded by the searched block.
The embodiment of the computer readable storage medium of the present invention is substantially the same as the embodiment of the blockchain data statistical analysis method described above, and will not be described herein.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, apparatus, article, or method. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, apparatus, article or method that comprises the element.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description of the preferred embodiments of the present invention should not be taken as limiting the scope of the invention, but rather should be understood to cover all modifications, equivalents, and alternatives falling within the scope of the invention as defined by the following description and drawings, or by direct or indirect application to other relevant art(s).

Claims (8)

1. A blockchain data statistical analysis method applied to an electronic device, the method comprising:
a receiving step: receiving a block chain service data writing request, and caching the to-be-input chain data into a message queue;
writing: reading data to be written into a blockchain system from a message queue, and writing the data written into the blockchain system into a data table of a relational database according to a preset statistical dimension design table structure, wherein the design table structure comprises defining data table names, determining fields contained in the data table, field names of all fields, field types, attributes and widths;
the calculation steps are as follows: receiving a block chain service data statistics request, reading a data table related to the service statistics request from a relational database, screening data fields related to statistics conditions input by a user from the read data table, calculating to obtain a statistics result, searching a corresponding block from a block chain system according to a main key of the data table read from the relational database, and verifying data information recorded by the data table according to the data information recorded by the searched block.
2. The blockchain data statistical analysis method of claim 1, wherein the writing step includes:
when the to-be-in chain data is read from the message queue, the preset number of to-be-in chain data with the longest waiting time can be extracted from the message queue and written into the blockchain system, and when the information processing is finished, the preset number of to-be-in chain data is extracted from the message queue.
3. The blockchain data statistical analysis method of claim 1, wherein the writing step includes:
when the to-be-in chain data is read from the message queue, extracting preset quantity of to-be-in chain data from the message queue at preset time intervals, and writing the to-be-in chain data into the blockchain system so as to ensure that the currently processed to-be-in chain data is kept within a preset quantity range.
4. The blockchain data statistical analysis method of claim 1, wherein the receiving step further comprises:
and carrying out user authority identification on the client side initiating the blockchain service data writing request, caching the to-be-input chain data to a message queue if the user authority identification passes, and rejecting the blockchain service data writing request of the user if the user authority identification fails.
5. The blockchain data statistical analysis method of claim 1, wherein the data table includes a table name, a field in the table, a field type, and a field attribute.
6. An electronic device, the electronic device comprising: the system comprises a memory, a processor and a display, wherein the memory is stored with a blockchain data statistical analysis program, and the blockchain data statistical analysis program is executed by the processor and can realize the following steps:
a receiving step: receiving a block chain service data writing request, and caching the to-be-input chain data into a message queue;
writing: reading data to be written into a blockchain system from a message queue, and writing the data written into the blockchain system into a data table of a relational database according to a preset statistical dimension design table structure, wherein the design table structure comprises defining data table names, determining fields contained in the data table, field names of all fields, field types, attributes and widths;
the calculation steps are as follows: receiving a block chain service data statistics request, reading a data table related to the service statistics request from a relational database, screening data fields related to statistics conditions input by a user from the read data table, calculating to obtain a statistics result, searching a corresponding block from a block chain system according to a main key of the data table read from the relational database, and verifying data information recorded by the data table according to the data information recorded by the searched block.
7. The electronic device of claim 6, wherein the receiving step further comprises: and carrying out user authority identification on the client side initiating the blockchain service data writing request, caching the to-be-input chain data to a message queue if the user authority identification passes, and rejecting the blockchain service data writing request of the user if the user authority identification fails.
8. A computer readable storage medium, wherein a blockchain data statistical analysis program is included in the computer readable storage medium, and the blockchain data statistical analysis program, when executed by a processor, can implement the steps of the blockchain data statistical analysis method according to any of claims 1 to 5.
CN201811221268.2A 2018-10-19 2018-10-19 Block chain data statistical analysis method, device and storage medium Active CN109542945B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811221268.2A CN109542945B (en) 2018-10-19 2018-10-19 Block chain data statistical analysis method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811221268.2A CN109542945B (en) 2018-10-19 2018-10-19 Block chain data statistical analysis method, device and storage medium

Publications (2)

Publication Number Publication Date
CN109542945A CN109542945A (en) 2019-03-29
CN109542945B true CN109542945B (en) 2023-09-22

Family

ID=65844352

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811221268.2A Active CN109542945B (en) 2018-10-19 2018-10-19 Block chain data statistical analysis method, device and storage medium

Country Status (1)

Country Link
CN (1) CN109542945B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109995666A (en) * 2019-04-12 2019-07-09 深圳市元征科技股份有限公司 A kind of method for message transmission and relevant apparatus
CN110517078A (en) * 2019-08-21 2019-11-29 上海易点时空网络有限公司 Data reporting method and device based on asynchronous process
CN110753084B (en) * 2019-09-06 2023-04-07 平安普惠企业管理有限公司 Uplink data reading method, cache server and computer readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368259A (en) * 2017-05-25 2017-11-21 阿里巴巴集团控股有限公司 A kind of method and apparatus that business datum is write in the catenary system to block
CN107391649A (en) * 2017-07-14 2017-11-24 浙商银行股份有限公司 A kind of system and method for lifting block chain query efficiency
CN107562775A (en) * 2017-07-14 2018-01-09 阿里巴巴集团控股有限公司 A kind of data processing method and equipment based on block chain
CN107657059A (en) * 2017-10-20 2018-02-02 中国银行股份有限公司 Method of data synchronization, middleware and system based on block chain application system
CN108260015A (en) * 2018-01-11 2018-07-06 武汉斗鱼网络科技有限公司 A kind of voting data processing method, device and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368259A (en) * 2017-05-25 2017-11-21 阿里巴巴集团控股有限公司 A kind of method and apparatus that business datum is write in the catenary system to block
CN107391649A (en) * 2017-07-14 2017-11-24 浙商银行股份有限公司 A kind of system and method for lifting block chain query efficiency
CN107562775A (en) * 2017-07-14 2018-01-09 阿里巴巴集团控股有限公司 A kind of data processing method and equipment based on block chain
CN107657059A (en) * 2017-10-20 2018-02-02 中国银行股份有限公司 Method of data synchronization, middleware and system based on block chain application system
CN108260015A (en) * 2018-01-11 2018-07-06 武汉斗鱼网络科技有限公司 A kind of voting data processing method, device and electronic equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
邵奇峰 等.区块链技术:架构及进展.计算机学报.2018,第45卷(第5期),第969-988页. *

Also Published As

Publication number Publication date
CN109542945A (en) 2019-03-29

Similar Documents

Publication Publication Date Title
CN109542945B (en) Block chain data statistical analysis method, device and storage medium
US20170070525A1 (en) Systems and methods for matching and scoring sameness
US20160014224A1 (en) System and method for real time delivery of context based content from the cloud to mobile devices
WO2019153592A1 (en) User authority data management device and method, and computer readable storage medium
CN111782943A (en) Information recommendation method, device, equipment and medium based on historical data record
US11157650B1 (en) Identity security architecture systems and methods
US10546348B1 (en) Cleaning noise words from transaction descriptions
CN111813573B (en) Communication method of management platform and robot software and related equipment thereof
WO2019136812A1 (en) Electronic device, data calling log generation and query method, and storage medium
US20210042150A1 (en) Method-call-chain tracking method, electronic device, and computer readable storage medium
CN106095816B (en) Information delivery method and device
CN112511632B (en) Object pushing method, device and equipment based on multi-source data and storage medium
CN112528305B (en) Access control method, device, electronic equipment and storage medium
WO2021051932A1 (en) Data updating method and apparatus, and computer device and storage medium
US9525687B2 (en) Template for customer attributes
CN110443441B (en) Rule efficiency monitoring method, device, computer equipment and storage medium
CN114090689A (en) Intelligent contract data processing method based on alliance chain and related equipment thereof
CN115481002A (en) Abnormal behavior identification method, device, equipment and storage medium
CN114490719A (en) Data query method and device, electronic equipment and storage medium
CN111131393B (en) User activity data statistical method, electronic device and storage medium
CN108874923B (en) Virtual article distribution method, server, and computer-readable storage medium
CN112182107A (en) Method and device for acquiring list data, computer equipment and storage medium
CN110851346A (en) Method, device and equipment for detecting boundary problem of query statement and storage medium
JP5578689B1 (en) Data input system and data input method in verify input
KR101748116B1 (en) Smishing blocking appatatus on cloud mobile environments

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
GR01 Patent grant
GR01 Patent grant