CN108304475B - Data query method and device and electronic equipment - Google Patents

Data query method and device and electronic equipment Download PDF

Info

Publication number
CN108304475B
CN108304475B CN201711464975.XA CN201711464975A CN108304475B CN 108304475 B CN108304475 B CN 108304475B CN 201711464975 A CN201711464975 A CN 201711464975A CN 108304475 B CN108304475 B CN 108304475B
Authority
CN
China
Prior art keywords
block
query
index
data
storage
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
CN201711464975.XA
Other languages
Chinese (zh)
Other versions
CN108304475A (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.)
Ant Mining Technology Co ltd
Original Assignee
Bitmain Technologies 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 Bitmain Technologies Ltd filed Critical Bitmain Technologies Ltd
Priority to CN201711464975.XA priority Critical patent/CN108304475B/en
Publication of CN108304475A publication Critical patent/CN108304475A/en
Application granted granted Critical
Publication of CN108304475B publication Critical patent/CN108304475B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to a data query method, a data query device and electronic equipment, and belongs to the technical field of information processing. The method comprises the following steps: acquiring query conditions of a user, wherein the query conditions at least comprise one or more of block height, block address, transaction information, transaction amount and transaction time of a block to be queried; generating a query index based on the query condition, wherein the query index is used for querying the storage position of the block to be queried; and inquiring the block to be inquired according to the inquiry index to obtain the block data of the block to be inquired. According to the method and the device, the query conditions at least comprising one or more of the block height, the block address, the transaction information, the transaction amount and the transaction time of the block to be queried are obtained, the query index is generated, the block to be queried is queried according to the query index, and the block data is obtained, so that the block data of the block can be queried according to various query conditions, the limitation of data query is small, the data query process is simplified, the intelligence is good, and the user viscosity is high.

Description

Data query method and device and electronic equipment
Technical Field
The present invention relates to the field of information processing technologies, and in particular, to a data query method and apparatus, and an electronic device.
Background
With the continuous development of information technology, the blockchain is greatly developed as a new technology. The block chain technology is a bit coin technology appearing in 2008, and is a bottom layer technology of the bit coin. The block chain is a string of blocks generated by correlation by using a cryptographic method, and the block data in each block in the block chain is associated with the block data in the previous block, so that cheating cannot be performed by tampering the block data, the block data on any block can be ensured to be public and transparent, and the safety of input information is improved. In order to ensure that the blocks in the block chain can be generated quickly and ensure the correctness of the data in the blocks, in a data sharing system applying the block chain technology, there may be an ore machine node generating the blocks, the ore machine node accesses to a mine system in the data sharing system and listens to the shared broadcast in the data sharing system through a P2P (Peer-to-Peer) network, confirms the shared broadcast, and generates the blocks including the shared broadcast. After the above-mentioned work is completed, the mine system settles the work of the mining nodes so that the mining nodes can earn virtual money for accelerating the processing of the shared broadcast. At present, with the vigorous development of virtual currency, more and more virtual currencies of different currencies are developed, so that the currencies of the virtual currencies related to the blocks of the block chain are more and more, and when a transaction is completed, in order to confirm whether the statistics of the virtual currencies related to the current transaction are correct, a user generally needs to query the data of the blocks in the block chain, and then verify the queried data.
In the related art, when the terminal detects that a user requests to query data of a block, the terminal needs to obtain a feature value, such as a hash value, of the block to be queried, which is input by the user to indicate a block height of the block to be queried, and to query the block according to the block height or the feature value.
In the process of implementing the invention, the inventor finds that the related art has at least the following problems:
when the terminal queries the data of the block, the block can only be queried according to the block height and the characteristic value of the block, and if the user does not clearly determine the block height or the characteristic value of the block to be queried, the data of the block cannot be queried, so that the data query limitation is high, the data query process is complicated, the intelligence is low, and the user viscosity is low.
Disclosure of Invention
The invention provides a method for searching data, which aims to solve the problems of high limitation of data searching, complex data searching process, low intelligence and low user viscosity in the prior art.
According to a first aspect of embodiments of the present invention, there is provided a data query method, including:
acquiring query conditions of a user, wherein the query conditions at least comprise one or more of block height, block address, transaction information, transaction amount and transaction time of a block to be queried;
generating a query index based on the query condition, wherein the query index is used for querying the storage position of the block to be queried;
and inquiring the block to be inquired according to the inquiry index to obtain the block data of the block to be inquired.
In another embodiment, before obtaining the query condition of the user, the method further includes:
acquiring block data of at least one block, wherein the block data at least comprises block height, block characteristic value, transaction information, transaction amount, transaction time and father block information;
for any block in the at least one block, generating a storage index of the block based on block data of the block, wherein the storage index is used for indicating a storage position of the block data;
and storing the block data of the block to the storage position indicated by the storage index.
In another embodiment, the obtaining block data of at least one block includes:
downloading the at least one block;
and analyzing the at least one block based on a block analysis tool to obtain block data of the at least one block.
In another embodiment, the generating a query index based on the query condition comprises:
determining a preset analysis algorithm, wherein the preset analysis algorithm at least comprises a word segmentation algorithm;
and analyzing the query condition based on the preset analysis algorithm to generate the query index.
In another embodiment, the querying the block to be queried according to the query index, and the obtaining block data of the block to be queried includes:
acquiring at least one storage index of at least one block;
querying a specified storage index in the at least one storage index based on the query index, wherein the specified storage index is matched with the query index;
and acquiring the block data of the block to be queried at the storage position indicated by the specified storage index.
According to a second aspect of the embodiments of the present invention, there is provided a data query apparatus, including:
the system comprises a condition acquisition module, a condition acquisition module and a condition acquisition module, wherein the condition acquisition module is used for acquiring query conditions of a user, and the query conditions at least comprise one or more of block height, block address, transaction information, transaction amount and transaction time of a block to be queried;
a first generating module, configured to generate a query index based on the query condition, where the query index is used to query a storage location of the block to be queried;
and the query module is used for querying the block to be queried according to the query index and acquiring the block data of the block to be queried.
In another embodiment, the apparatus further comprises:
the data acquisition module is used for acquiring block data of at least one block, wherein the block data at least comprises block height, block characteristic values, transaction information, transaction amount, transaction time and father block information;
a second generating module, configured to, for any block in the at least one block, generate a storage index of the block based on block data of the block, where the storage index is used to indicate a storage location of the block data;
and the storage module is used for storing the block data of the block to the storage position indicated by the storage index.
In another embodiment, the data acquisition module comprises:
a download sub-module for downloading the at least one block;
and the analysis submodule is used for analyzing the at least one block based on a block analysis tool to obtain block data of the at least one block.
In another embodiment, the first generating module comprises:
the determining submodule is used for determining a preset analysis algorithm, and the preset analysis algorithm at least comprises a word segmentation algorithm;
and the analysis submodule is used for analyzing the query condition based on the preset analysis algorithm to generate the query index.
In another embodiment, the query module comprises:
the index acquisition submodule is used for acquiring at least one storage index of at least one block;
the query submodule is used for querying a specified storage index in the at least one storage index based on the query index, and the specified storage index is matched with the query index;
and the data acquisition submodule is used for acquiring the block data of the block to be queried at the storage position indicated by the specified storage index.
According to a third aspect of the embodiments of the present invention, there is provided an electronic device, including the data query apparatus according to the second aspect.
According to a fourth aspect of embodiments of the present invention, there is provided an electronic apparatus, including: a memory for storing executable instructions; and a processor, for communicating with the memory to execute the executable instructions to perform the operations of the data query method of the first aspect.
The technical scheme provided by the embodiment of the invention can have the following beneficial effects:
by acquiring one or more query conditions at least comprising the block height, the block address, the transaction information, the transaction amount and the transaction time of the block to be queried, generating a query index based on the query conditions, querying the block to be queried according to the query index, and acquiring the block data of the block to be queried, the block data of the block can be queried according to various query conditions, the data query limitation is small, the data query process is simplified, the intelligence is excellent, and the user viscosity is high.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow diagram illustrating a method of data querying in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating a method of data querying in accordance with an exemplary embodiment;
FIG. 3A is a block diagram illustrating a data query device in accordance with an exemplary embodiment;
FIG. 3B is a block diagram illustrating a data query device in accordance with an exemplary embodiment;
FIG. 3C is a block diagram illustrating a data query device in accordance with an exemplary embodiment;
FIG. 3D is a block diagram illustrating a data query device in accordance with an exemplary embodiment;
FIG. 3E is a block diagram illustrating a data query device in accordance with an exemplary embodiment;
FIG. 4 is a block diagram illustrating a data querying device 400, according to an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
Fig. 1 is a flowchart illustrating a data query method according to an exemplary embodiment, and the method includes the following steps, as shown in fig. 1.
In step 101, a query condition of a user is obtained, where the query condition at least includes one or more of a block height of a block to be queried, a block address, transaction information, a transaction amount, and a transaction time.
In step 102, based on the query condition, a query index is generated, and the query index is used for querying the storage location of the block to be queried.
In step 103, the block to be queried is queried according to the query index, and block data of the block to be queried is obtained.
According to the method provided by the embodiment of the invention, the block data of the block to be inquired is acquired by acquiring the inquiry condition at least comprising one or more of the block height, the block address, the transaction information, the transaction amount and the transaction time of the block to be inquired, generating the inquiry index based on the inquiry condition, and inquiring the block to be inquired according to the inquiry index, so that the block data of the block to be inquired can be inquired according to various inquiry conditions, the data inquiry limitation is small, the data inquiry process is simplified, the intelligence is excellent, and the user viscosity is high.
In another embodiment, before obtaining the query condition of the user, the method further includes:
acquiring block data of at least one block, wherein the block data at least comprises block height, block characteristic value, transaction information, transaction amount, transaction time and father block information;
for any block in the at least one block, generating a storage index of the block based on block data of the block, wherein the storage index is used for indicating a storage position of the block data;
and storing the block data of the block to the storage position indicated by the storage index.
In another embodiment, the obtaining block data of at least one block includes:
downloading the at least one block;
and analyzing the at least one block based on a block analysis tool to obtain block data of the at least one block.
In another embodiment, the generating a query index based on the query condition comprises:
determining a preset analysis algorithm, wherein the preset analysis algorithm at least comprises a word segmentation algorithm;
and analyzing the query condition based on the preset analysis algorithm to generate the query index.
In another embodiment, the querying the block to be queried according to the query index, and the obtaining block data of the block to be queried includes:
acquiring at least one storage index of at least one block;
querying a specified storage index in the at least one storage index based on the query index, wherein the specified storage index is matched with the query index;
and acquiring the block data of the block to be queried at the storage position indicated by the specified storage index.
All the above-mentioned optional technical solutions can be combined arbitrarily to form the optional embodiments of the present invention, and are not described herein again.
Fig. 2 is a flow chart illustrating a method of data acquisition, as shown in fig. 2, according to an exemplary embodiment, including the following steps.
In step 201, at least one block is downloaded, and the at least one block is analyzed based on the block analysis tool to obtain block data of the at least one block, wherein the block data at least includes block height, block characteristic value, transaction information, transaction amount, transaction time, and parent block information.
The inventor realizes that when a block data query is performed, a user is usually required to input a certain fixed block data in a block, such as a block height, a block characteristic value and the like, and further determine the block according to the data input by the user to acquire all block data in the block.
In order to query the block to be queried according to any query condition input by a user when querying the block data of the block, the block data in at least one block needs to be stored, so that at least one block needs to be downloaded. Since the block data stored in the block is data related to virtual currencies of different currencies and the blocks of the virtual currencies of different currencies are isolated, that is, the blocks of the virtual currencies of different currencies are stored in different all-node servers, when downloading at least one block, the terminal needs to be connected to the plurality of all-node servers to further download all the blocks stored in the plurality of all-node servers. When the terminal is connected with the full-node servers, the server addresses of the full-node servers can be obtained, the server addresses of the full-node servers are accessed, data connection is further established with the full-node servers, and all blocks are downloaded in the full-node servers based on the data connection.
After downloading the blocks in the multiple full-node servers successfully, in order to acquire the block data in each block, each block needs to be analyzed, and then the block data in each block is acquired. When the block is analyzed, the acquired at least one block may be analyzed based on a block analysis tool to obtain block data of the at least one block. When the block is analyzed, a block analysis tool such as a block crawler may be used for analyzing the block, and the method for analyzing the block is not particularly limited in the embodiments of the present invention.
In step 202, for any block in the at least one block, a storage index of the block is generated based on the block data of the block, and the block data of the block is stored to the storage location indicated by the storage index, where the storage index is used to indicate the storage location of the block data.
In the embodiment of the present invention, after acquiring the block data of at least one block, in order to enable subsequent query of the block data in the block according to a query condition including the block data input by a user, for any block in the at least one block, a storage index of the block may be generated based on the block data of the block, so as to store the block data of the block to a storage location indicated by the storage index. The generated storage index may be an inverted index, and since the inverted index can search the storage location of the data according to the attribute value of the data in practical application, the inverted index may be generated based on the block data, and the inverted index is used as the storage index of the block data.
After the storage index of at least one block is generated, the block identifier of the block can be acquired, and the block identifier of the block and the storage index are correspondingly stored, so that the correct corresponding relation between the block and the storage index is ensured, and the confusion between the at least one block and the at least one storage index is avoided. When the correspondence between the block and the storage index is stored, the first index list shown in table 1 may be generated. In the practical application process, if the storage index generated by the terminal is the inverted index, the terminal may generate the second index list shown in table 2 when storing the storage index, list each piece of data in the block data, store the data corresponding to the storage index, and ensure that the storage index can be determined according to any piece of data in the block data, so that the query condition input by the user is not limited, and the block data can be queried according to the query condition as long as the user inputs the query condition related to the block data. Since the contents of the block data stored in different blocks are different, it is necessary to generate table 2 based on the actual block data stored in the blocks. In the actual application process, the terminal may further generate an index library, and store the storage indexes of all the blocks into the index library.
TABLE 1
Block identification Storage index
Block A (3;1)
Block B (5;1)
TABLE 2
Figure BDA0001530959820000081
In step 203, query conditions of the user are obtained, where the query conditions at least include one or more of block height of the block to be queried, block address, transaction information, transaction amount, and transaction time.
In the embodiment of the present invention, since all the block data in each block is stored in the terminal, when querying the block data in the block, the user only needs to input one or more block data of the block, that is, the query condition input by the user at least includes one or more of the block height, the block address, the transaction information, the transaction amount, and the transaction time of the block to be queried.
The terminal can provide a data query entry on the screen, and when the data query entry is detected to be triggered by a user, a data query page is displayed, wherein the data query page at least comprises a condition type selection box and a condition input box. The condition type selection box comprises a plurality of selectable query condition types such as block height, block address, transaction information, transaction amount and transaction time, and after any query condition type selected by the user in the condition type selection box is detected, the query condition input by the user in the condition input box is obtained. It should be noted that, in the process of practical application, a condition type selection box may not be provided on the query page, a condition input box is directly provided, the query condition input by the user in the condition input box is acquired, and the acquired query condition is identified. The embodiment of the present invention does not specifically limit the manner of obtaining the query condition input by the user.
In step 204, a preset analysis algorithm is determined, the query condition is analyzed based on the preset analysis algorithm, and a query index is generated, wherein the preset analysis algorithm at least comprises a word segmentation algorithm, and the query index is used for querying a storage location of the block to be queried.
In the embodiment of the present invention, since the block data of the block is stored according to the indication of the storage index, after the query condition of the user is obtained, in order to determine the storage location of the block based on the query condition, the query condition needs to be analyzed, a query index matched with the form of the storage index is generated, the storage index of the block is determined according to the query index, the storage location of the block is determined according to the storage index, and the block data of the block is obtained. When the query condition is analyzed, a preset analysis algorithm may be determined, and the query condition is analyzed based on the preset analysis algorithm. The preset analysis algorithm can be a word segmentation algorithm, if the preset analysis algorithm is the word segmentation algorithm, when a query index is generated based on the preset analysis algorithm, word segmentation is carried out on the query condition of the user to obtain a plurality of words; subsequently, the obtained multiple words are connected by using connecting words such as "and", "or", and the like, and a query index matching the form of the stored index is generated.
In step 205, at least one storage index of the at least one block is obtained, based on the query index, a designated storage index is queried in the at least one storage index, block data of the block to be queried is obtained at a storage location indicated by the designated storage index, and the designated storage index is matched with the query index.
In the embodiment of the invention, after the query index is generated according to the query condition of the user, the specified storage index matched with the query index can be determined according to the query index, and then the storage position of the block to be queried is determined according to the specified storage index, so that the block data in the block to be queried is acquired. Since the storage indexes of all blocks are stored in the terminal, when the specified storage index is determined, all the storage indexes are compared with the query index, and the specified storage index matched with the query index is determined in all the storage indexes. It should be noted that, when all the storage indexes are compared with the query indexes, because the number of the storage indexes stored in the terminal is large, the comparison can be performed according to the storage sequence of the terminal for the storage indexes, when it is determined that a certain storage index is matched with the query index, the comparison process between the storage index and the query index can be stopped, it is not necessary to compare the remaining storage indexes which are not compared with the query index, and the storage index matched with the query index is directly determined as the designated storage index. The embodiment of the present invention does not specifically limit the manner of determining the storage index matching the query index.
In the embodiment of the invention, the block data of the block to be inquired is acquired by acquiring the inquiry condition at least comprising one or more of the block height, the block address, the transaction information, the transaction amount and the transaction time of the block to be inquired, generating the inquiry index based on the inquiry condition, and inquiring the block to be inquired according to the inquiry index, so that the block data of the block to be inquired can be inquired according to various inquiry conditions, the data inquiry limitation is small, the data inquiry process is simplified, the intelligence is excellent, and the user viscosity is high.
FIG. 3A is a block diagram illustrating a data query device in accordance with an exemplary embodiment. Referring to fig. 3A, the apparatus includes a condition acquisition module 301, a first generation module 302, and a query module 303.
The condition obtaining module 301 is configured to obtain a query condition of a user, where the query condition at least includes one or more of a block height of a block to be queried, a block address, transaction information, a transaction amount, and a transaction time;
the first generating module 302 is configured to generate a query index based on the query condition, where the query index is used to query a storage location of a block to be queried;
the query module 303 is configured to query the block to be queried according to the query index, and obtain block data of the block to be queried.
According to the device provided by the embodiment of the invention, the query condition at least comprising one or more of the block height, the block address, the transaction information, the transaction amount and the transaction time of the block to be queried is obtained, the query index is generated based on the query condition, the block to be queried is queried according to the query index, and the block data of the block to be queried is obtained, so that the block data of the block can be queried according to various query conditions, the data query limitation is small, the data query process is simplified, the intelligence is good, and the user viscosity is high.
In another embodiment, referring to fig. 3B, the apparatus further comprises a data acquisition module 304, a second generation module 305, and a storage module 306.
The data obtaining module 304 is configured to obtain block data of at least one block, where the block data at least includes block height, block characteristic value, transaction information, transaction amount, transaction time, and parent block information;
the second generating module 305 is configured to, for any block in the at least one block, generate a storage index of the block based on the block data of the block, where the storage index is used to indicate a storage location of the block data;
the storage module 306 is configured to store the block data of the block to the storage location indicated by the storage index.
In another embodiment, referring to fig. 3C, the data obtaining module 304 includes a downloading submodule 3041 and a parsing submodule 3042.
The download submodule 3041 is configured to download at least one block;
the parsing sub-module 3042 is configured to parse at least one block based on a block parsing tool to obtain block data of the at least one block.
In another embodiment, referring to fig. 3D, the first generation module 302 includes a determination submodule 3021 and a parsing submodule 3022.
The determining submodule 3021 is configured to determine a preset parsing algorithm, where the preset parsing algorithm at least includes a word segmentation algorithm;
the parsing submodule 3022 is configured to parse the query condition based on a preset parsing algorithm to generate a query index.
In another embodiment, referring to fig. 3E, the query module 303 includes an index acquisition sub-module 3031, a query sub-module 3032 and a data acquisition sub-module 3033.
The index obtaining submodule 3031 is configured to obtain at least one storage index of at least one block;
the query submodule 3032 is configured to query, based on the query index, a specified storage index from the at least one storage index, where the specified storage index is matched with the query index;
the data obtaining sub-module 3033 is configured to obtain the block data of the block to be queried at the storage location indicated by the specified storage index.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 4 is a block diagram illustrating a data querying device 400, according to an example embodiment. For example, the apparatus 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 4, the apparatus 400 may include one or more of the following components: processing component 402, memory 404, power component 406, multimedia component 408, audio component 410, interface to I/O (Input/Output) 412, sensor component 414, and communication component 416.
The processing component 402 generally controls overall operation of the apparatus 400, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 402 may include one or more processors 420 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 402 can include one or more modules that facilitate interaction between the processing component 402 and other components. For example, the processing component 402 can include a multimedia module to facilitate interaction between the multimedia component 408 and the processing component 402.
The memory 404 is configured to store various types of data to support operations at the apparatus 400. Examples of such data include instructions for any application or method operating on the device 400, contact data, phonebook data, messages, pictures, videos, and so forth. The Memory 404 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as an SRAM (Static Random Access Memory), an EEPROM (Electrically-Erasable Programmable Read-Only Memory), an EPROM (Erasable Programmable Read-Only Memory), a PROM (Programmable Read-Only Memory), a ROM (Read-Only Memory), a magnetic Memory, a flash Memory, a magnetic disk, or an optical disk.
Power supply components 406 provide power to the various components of device 400. The power components 406 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 400.
The multimedia component 408 includes a screen that provides an output interface between the device 400 and the user. In some embodiments, the screen may include an LCD (Liquid Crystal Display) and a TP (Touch Panel). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 408 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the apparatus 400 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 410 is configured to output and/or input audio signals. For example, the audio component 410 may include a Microphone (MIC) configured to receive external audio signals when the device 400 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 404 or transmitted via the communication component 416. In some embodiments, audio component 410 also includes a speaker for outputting audio signals.
The I/O interface 412 provides an interface between the processing component 402 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 414 includes one or more sensors for providing various aspects of status assessment for the apparatus 400. For example, the sensor component 414 can detect the open/closed state of the device 400, the relative positioning of components, such as a display and keypad of the apparatus 400, the sensor component 414 can also detect a change in the position of the apparatus 400 or a component of the apparatus 400, the presence or absence of user contact with the apparatus 400, orientation or acceleration/deceleration of the apparatus 400, and a change in the temperature of the apparatus 400. The sensor assembly 414 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 414 may also include a light sensor, such as a CMOS (Complementary Metal Oxide Semiconductor) or CCD (Charge-coupled Device) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 414 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 416 is configured to facilitate wired or wireless communication between the apparatus 400 and other devices. The apparatus 400 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 416 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the Communication component 416 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on an RFID (Radio Frequency Identification) technology, an IrDA (infrared-Data Association) technology, an UWB (Ultra Wideband) technology, a BT (Bluetooth) technology, and other technologies.
In an exemplary embodiment, the apparatus 400 may be implemented by one or more ASICs (Application Specific Integrated circuits), DSPs (Digital signal processors), DSPDs (Digital signal processing devices), PLDs (Programmable Logic devices), FPGAs (Field Programmable Gate arrays), controllers, microcontrollers, microprocessors or other electronic components for performing the above-described data query method.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 404 comprising instructions, executable by the processor 420 of the apparatus 400 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a RAM (Random Access Memory), a CD-ROM (Compact Disc Read-Only Memory), a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium, wherein instructions of the storage medium, when executed by a processor of a data query device, enable the data query device to perform the above data query method.
A1, a data query method, comprising:
acquiring query conditions of a user, wherein the query conditions at least comprise one or more of block height, block address, transaction information, transaction amount and transaction time of a block to be queried;
generating a query index based on the query condition, wherein the query index is used for querying the storage position of the block to be queried;
and inquiring the block to be inquired according to the inquiry index to obtain the block data of the block to be inquired.
A2, the method as claimed in claim 1, wherein before the obtaining the query condition of the user, the method further comprises:
acquiring block data of at least one block, wherein the block data at least comprises block height, block characteristic value, transaction information, transaction amount, transaction time and father block information;
for any block in the at least one block, generating a storage index of the block based on block data of the block, wherein the storage index is used for indicating a storage position of the block data;
and storing the block data of the block to the storage position indicated by the storage index.
The method of claim 2, wherein said obtaining block data of at least one block comprises:
downloading the at least one block;
and analyzing the at least one block based on a block analysis tool to obtain block data of the at least one block.
The method of claim 1, wherein generating a query index based on the query condition comprises:
determining a preset analysis algorithm, wherein the preset analysis algorithm at least comprises a word segmentation algorithm;
and analyzing the query condition based on the preset analysis algorithm to generate the query index.
A5 the method as claimed in claim 1, wherein the querying the block to be queried according to the query index, and the obtaining block data of the block to be queried includes:
acquiring at least one storage index of at least one block;
querying a specified storage index in the at least one storage index based on the query index, wherein the specified storage index is matched with the query index;
and acquiring the block data of the block to be queried at the storage position indicated by the specified storage index.
A6, a data inquiry apparatus, comprising:
the system comprises a condition acquisition module, a condition acquisition module and a condition acquisition module, wherein the condition acquisition module is used for acquiring query conditions of a user, and the query conditions at least comprise one or more of block height, block address, transaction information, transaction amount and transaction time of a block to be queried;
a first generating module, configured to generate a query index based on the query condition, where the query index is used to query a storage location of the block to be queried;
and the query module is used for querying the block to be queried according to the query index and acquiring the block data of the block to be queried.
A7, the device of claim 6, wherein the device further comprises:
the data acquisition module is used for acquiring block data of at least one block, wherein the block data at least comprises block height, block characteristic values, transaction information, transaction amount, transaction time and father block information;
a second generating module, configured to, for any block in the at least one block, generate a storage index of the block based on block data of the block, where the storage index is used to indicate a storage location of the block data;
and the storage module is used for storing the block data of the block to the storage position indicated by the storage index.
A8, the device of claim 7, wherein the data acquisition module comprises:
a download sub-module for downloading the at least one block;
and the analysis submodule is used for analyzing the at least one block based on a block analysis tool to obtain block data of the at least one block.
A9, the device as claimed in claim 6, wherein the first generating module comprises:
the determining submodule is used for determining a preset analysis algorithm, and the preset analysis algorithm at least comprises a word segmentation algorithm;
and the analysis submodule is used for analyzing the query condition based on the preset analysis algorithm to generate the query index.
A10, the apparatus of claim 6, wherein the query module comprises:
the index acquisition submodule is used for acquiring at least one storage index of at least one block;
the query submodule is used for querying a specified storage index in the at least one storage index based on the query index, and the specified storage index is matched with the query index;
and the data acquisition submodule is used for acquiring the block data of the block to be queried at the storage position indicated by the specified storage index.
A11, an electronic device, comprising the data query device of any one of claims 6 to 10.
A12, an electronic device, comprising: a memory for storing executable instructions;
and a processor in communication with the memory to execute the executable instructions to perform the operations of the data query method of any one of claims 1 to 5.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

1. A method for data query, the method comprising:
obtaining block data of at least one block through downloading, wherein the block data at least comprises block height, block characteristic value, transaction information, transaction amount, transaction time and father block information;
for any block in the at least one block, generating a storage index of the block based on block data of the block, wherein the storage index is used for indicating a storage position of the block data;
storing the block data of the block to the storage position indicated by the storage index;
acquiring query conditions of a user, wherein the query conditions at least comprise one or more of block height, block address, transaction information, transaction amount and transaction time of a block to be queried;
generating a query index based on the query condition, wherein the query index is used for querying the storage position of the block to be queried;
and inquiring the block to be inquired according to the inquiry index to obtain the block data of the block to be inquired.
2. The method of claim 1, wherein the obtaining block data of at least one block comprises:
and analyzing the at least one block based on a block analysis tool to obtain block data of the at least one block.
3. The method of claim 1, wherein generating a query index based on the query condition comprises:
determining a preset analysis algorithm, wherein the preset analysis algorithm at least comprises a word segmentation algorithm;
and analyzing the query condition based on the preset analysis algorithm to generate the query index.
4. The method of claim 1, wherein the querying the block to be queried according to the query index, and obtaining block data of the block to be queried comprises:
acquiring at least one storage index of the at least one block;
querying a specified storage index in the at least one storage index based on the query index, wherein the specified storage index is matched with the query index;
and acquiring the block data of the block to be queried at the storage position indicated by the specified storage index.
5. A data query apparatus, characterized in that the apparatus comprises:
a download submodule for downloading at least one block;
the data acquisition module is used for acquiring block data of the at least one block, wherein the block data at least comprises block height, block characteristic values, transaction information, transaction amount, transaction time and father block information;
a second generating module, configured to, for any block in the at least one block, generate a storage index of the block based on block data of the block, where the storage index is used to indicate a storage location of the block data;
the storage module is used for storing the block data of the block to the storage position indicated by the storage index;
the system comprises a condition acquisition module, a condition acquisition module and a condition acquisition module, wherein the condition acquisition module is used for acquiring query conditions of a user, and the query conditions at least comprise one or more of block height, block address, transaction information, transaction amount and transaction time of a block to be queried;
a first generating module, configured to generate a query index based on the query condition, where the query index is used to query a storage location of the block to be queried;
and the query module is used for querying the block to be queried according to the query index and acquiring the block data of the block to be queried.
6. The apparatus of claim 5, wherein the data acquisition module comprises:
and the analysis submodule is used for analyzing the at least one block based on a block analysis tool to obtain block data of the at least one block.
7. The apparatus of claim 5, wherein the first generating module comprises:
the determining submodule is used for determining a preset analysis algorithm, and the preset analysis algorithm at least comprises a word segmentation algorithm;
and the analysis submodule is used for analyzing the query condition based on the preset analysis algorithm to generate the query index.
8. The apparatus of claim 5, wherein the query module comprises:
the index acquisition submodule is used for acquiring at least one storage index of the at least one block;
the query submodule is used for querying a specified storage index in the at least one storage index based on the query index, and the specified storage index is matched with the query index;
and the data acquisition submodule is used for acquiring the block data of the block to be queried at the storage position indicated by the specified storage index.
9. An electronic device, characterized by comprising the data query apparatus of any one of claims 5 to 8.
10. An electronic device, comprising: a memory for storing executable instructions;
and a processor in communication with the memory to execute the executable instructions to perform the operations of the data query method of any one of claims 1 to 4.
CN201711464975.XA 2017-12-28 2017-12-28 Data query method and device and electronic equipment Active CN108304475B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711464975.XA CN108304475B (en) 2017-12-28 2017-12-28 Data query method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711464975.XA CN108304475B (en) 2017-12-28 2017-12-28 Data query method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN108304475A CN108304475A (en) 2018-07-20
CN108304475B true CN108304475B (en) 2020-11-10

Family

ID=62867710

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711464975.XA Active CN108304475B (en) 2017-12-28 2017-12-28 Data query method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN108304475B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109189782A (en) * 2018-08-02 2019-01-11 哈尔滨工程大学 A kind of indexing means in block chain commodity transaction inquiry
CN109408551B (en) * 2018-08-06 2021-07-06 杭州复杂美科技有限公司 Data query method and system, consensus method and system, device and storage medium
CN108876383A (en) * 2018-08-27 2018-11-23 广东工业大学 A kind of data trade method, device and equipment based on block chain
CN109213797A (en) * 2018-09-30 2019-01-15 中国联合网络通信集团有限公司 A kind of querying method and device of block chain
CN109471905B (en) * 2018-11-16 2020-08-25 华东师范大学 Block chain indexing method supporting time range and attribute range compound query
WO2020103105A1 (en) * 2018-11-22 2020-05-28 北京比特大陆科技有限公司 Data processing apparatus
CN109684408A (en) * 2018-12-07 2019-04-26 深圳市智税链科技有限公司 Data managing method, device, medium and the electronic equipment of block catenary system
WO2020223901A1 (en) * 2019-05-07 2020-11-12 比特大陆科技有限公司 Data query method, and server
CN110347748B (en) * 2019-06-20 2023-05-16 创新先进技术有限公司 Data verification method, system, device and equipment based on inverted index
CN110489413A (en) * 2019-07-15 2019-11-22 杭州复杂美科技有限公司 A kind of storage of transaction record, querying method and system, equipment and storage medium
CN111339086B (en) * 2020-02-18 2021-04-20 腾讯科技(深圳)有限公司 Block processing method, and data query method and device based on block chain
CN113343292A (en) * 2021-05-28 2021-09-03 网易(杭州)网络有限公司 Transaction number processing method and device, storage medium and computer equipment
CN113282662B (en) * 2021-06-03 2023-11-03 广东辰宜信息科技有限公司 Block information processing method, device, equipment and medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740440A (en) * 2016-02-01 2016-07-06 上海凭安网络科技有限公司 Indexing method for quickening block chain query
CN106055597A (en) * 2016-05-24 2016-10-26 布比(北京)网络技术有限公司 Digital transaction system, and account information query method therefor
CN106528746A (en) * 2016-10-26 2017-03-22 江苏通付盾科技有限公司 Trade information inquiring method, device and system
CN107247773A (en) * 2017-06-07 2017-10-13 北京邮电大学 A kind of method that inquiry is traded in distributed data base based on block chain
CN107273556A (en) * 2017-08-23 2017-10-20 上海点融信息科技有限责任公司 Block chain data index method and equipment
CN107291862A (en) * 2017-06-12 2017-10-24 腾讯科技(深圳)有限公司 Business datum storage method, device, storage medium and electronic equipment
CN107391649A (en) * 2017-07-14 2017-11-24 浙商银行股份有限公司 A kind of system and method for lifting block chain query efficiency
CN107464117A (en) * 2017-08-04 2017-12-12 平安科技(深圳)有限公司 Data managing method and block catenary system based on block chain
CN107688649A (en) * 2017-08-31 2018-02-13 江西博瑞彤芸科技有限公司 Querying method based on ideal money service platform
CN107943951A (en) * 2017-11-24 2018-04-20 中钞信用卡产业发展有限公司杭州区块链技术研究院 A kind of search method and system of block chain business information

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102346783B (en) * 2011-11-09 2014-09-17 华为技术有限公司 Data retrieval method and device
CN102915382A (en) * 2012-11-21 2013-02-06 亚信联创科技(中国)有限公司 Method and device for carrying out data query on database based on indexes
CN106779527A (en) * 2016-11-10 2017-05-31 北京物资学院 Commodity circulation information inquiry system and method based on block chain

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105740440A (en) * 2016-02-01 2016-07-06 上海凭安网络科技有限公司 Indexing method for quickening block chain query
CN106055597A (en) * 2016-05-24 2016-10-26 布比(北京)网络技术有限公司 Digital transaction system, and account information query method therefor
CN106528746A (en) * 2016-10-26 2017-03-22 江苏通付盾科技有限公司 Trade information inquiring method, device and system
CN107247773A (en) * 2017-06-07 2017-10-13 北京邮电大学 A kind of method that inquiry is traded in distributed data base based on block chain
CN107291862A (en) * 2017-06-12 2017-10-24 腾讯科技(深圳)有限公司 Business datum storage method, device, storage medium and electronic equipment
CN107391649A (en) * 2017-07-14 2017-11-24 浙商银行股份有限公司 A kind of system and method for lifting block chain query efficiency
CN107464117A (en) * 2017-08-04 2017-12-12 平安科技(深圳)有限公司 Data managing method and block catenary system based on block chain
CN107273556A (en) * 2017-08-23 2017-10-20 上海点融信息科技有限责任公司 Block chain data index method and equipment
CN107688649A (en) * 2017-08-31 2018-02-13 江西博瑞彤芸科技有限公司 Querying method based on ideal money service platform
CN107943951A (en) * 2017-11-24 2018-04-20 中钞信用卡产业发展有限公司杭州区块链技术研究院 A kind of search method and system of block chain business information

Also Published As

Publication number Publication date
CN108304475A (en) 2018-07-20

Similar Documents

Publication Publication Date Title
CN108304475B (en) Data query method and device and electronic equipment
CN104462296B (en) File management method and device and terminal
CN106445189B (en) Candidate word display method and device
CN105354005A (en) Method and apparatus for renovating point ranking
CN107402767B (en) Method and device for displaying push message
CN107608714B (en) Byte alignment method, device and computer readable storage medium
CN104951522B (en) Method and device for searching
CN106506808B (en) Method and device for prompting communication message
CN106447747B (en) Image processing method and device
CN110913276B (en) Data processing method, device, server, terminal and storage medium
CN110213062B (en) Method and device for processing message
CN108304491B (en) Data query method and device and electronic equipment
CN111382161A (en) State data processing method and device, electronic equipment and storage medium
CN105677435A (en) Function invoking method, apparatus and terminal
CN112333233B (en) Event information reporting method and device, electronic equipment and storage medium
CN112862349B (en) Data processing method, device and equipment based on ABS service data
CN110489155B (en) Data file management method, device, electronic equipment and medium
CN108241438B (en) Input method, input device and input device
CN106897876B (en) Terminal payment processing method and device
CN114238728B (en) Vehicle data processing method, device and equipment
CN113191792B (en) Task processing method, device, electronic equipment, storage medium and program product
CN112102081B (en) Method, device, readable storage medium and blockchain network for generating blockchain
CN114422811B (en) Method, device, equipment and storage medium for task allocation and task template generation
CN113157703B (en) Data query method and device, electronic equipment and storage medium
US20230267493A1 (en) Electronic voucher assigning method, apparatus, device and storage medium

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180921

Address after: 26 Ying Yun street, Singapore

Applicant after: Bit continent Technology Co., Ltd.

Address before: 100029 Beijing Haidian District Austria north industrial base project 6 Building 2 level.

Applicant before: BEIJING BITMAIN TECHNOLOGY CO., LTD.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210120

Address after: Room A1, 11 / F, punctuality building, 245-251 Hennessy Road, Hong Kong, China

Patentee after: BITMAIN TECHNOLOGY Co.,Ltd.

Address before: 26 Ying Yun street, Singapore

Patentee before: BITMAIN TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210513

Address after: 2701, 27th floor, Central Plaza, 18 Harbour Road, Wanchai, Hong Kong, China

Patentee after: Ant Mining Technology Co.,Ltd.

Address before: Room A1, 11 / F, punctuality building, 245-251 Hennessy Road, Hong Kong, China

Patentee before: BITMAIN TECHNOLOGY Co.,Ltd.