CN116342123A - Method and device for reading data of hardware wallet - Google Patents

Method and device for reading data of hardware wallet Download PDF

Info

Publication number
CN116342123A
CN116342123A CN202310623840.2A CN202310623840A CN116342123A CN 116342123 A CN116342123 A CN 116342123A CN 202310623840 A CN202310623840 A CN 202310623840A CN 116342123 A CN116342123 A CN 116342123A
Authority
CN
China
Prior art keywords
data
field
service
index
index number
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.)
Granted
Application number
CN202310623840.2A
Other languages
Chinese (zh)
Other versions
CN116342123B (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.)
Guowang Xiongan Finance Technology Group Co ltd
State Grid Huitong Jincai Beijing Information Technology Co ltd
Digital Currency Institute of the Peoples Bank of China
Marketing Service Center of State Grid Shandong Electric Power Co Ltd
Original Assignee
Guowang Xiongan Finance Technology Group Co ltd
State Grid Huitong Jincai Beijing Information Technology Co ltd
Digital Currency Institute of the Peoples Bank of China
Marketing Service Center of State Grid Shandong Electric Power 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 Guowang Xiongan Finance Technology Group Co ltd, State Grid Huitong Jincai Beijing Information Technology Co ltd, Digital Currency Institute of the Peoples Bank of China, Marketing Service Center of State Grid Shandong Electric Power Co Ltd filed Critical Guowang Xiongan Finance Technology Group Co ltd
Priority to CN202310623840.2A priority Critical patent/CN116342123B/en
Publication of CN116342123A publication Critical patent/CN116342123A/en
Application granted granted Critical
Publication of CN116342123B publication Critical patent/CN116342123B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/30Payment architectures, schemes or protocols characterised by the use of specific devices or networks
    • G06Q20/36Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes
    • G06Q20/367Payment architectures, schemes or protocols characterised by the use of specific devices or networks using electronic wallets or electronic money safes involving electronic purses or money safes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • General Business, Economics & Management (AREA)
  • Strategic Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method and a device for reading data of a hardware wallet, which are applied to the technical field of computers. In the present application, an index table is pre-established in a storage space of the hardware wallet. The index table stores keywords required for retrieval and reference records corresponding to the keywords, and each keyword is provided with an index number. It is determined whether the retrieved target read data, i.e., the keyword, has been written in the index table. If not, the keyword can be written into the index table, and the corresponding reference record and the corresponding index number can be written, so that the keyword can be directly read in the index table later. If written, the keywords may be determined directly by referencing the records and index numbers. By establishing the index table, the service data can be stored in an index address mode, and slow reading speed caused by overlarge stored data can be avoided. Therefore, the data reading efficiency of the hardware wallet can be improved, and effective data can be conveniently read.

Description

Method and device for reading data of hardware wallet
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for reading data from a hardware wallet.
Background
The digital currency hardware wallet refers to storing the private key of the digital asset in a single chip, isolated from the internet, and plug and play. The hardware wallet can complete payment transaction operation through key information such as wallet ID, signature and the like when interacting with a cash register in a near field communication mode. When the hardware wallet is used for transaction, related data of the transaction are stored, and frequent business transaction can enable a large amount of repeated data to be stored in the storage space of the hardware wallet.
Typically, transaction data is stored by packaging the data and storing it in its entirety in the memory space of a hardware wallet. When data is read, the efficiency of data inquiry is positively correlated with the stored data quantity, and the larger the stored data is, the slower the data reading speed is. This can result in reduced data reading efficiency for the hardware wallet and difficulty in reading valid data.
Disclosure of Invention
Based on the above problems, the application provides a method and a device for reading data of a hardware wallet, which can improve the efficiency of reading data of the hardware wallet and facilitate reading effective data.
The embodiment of the application discloses the following technical scheme:
in a first aspect, the present application provides a method for data reading of a hardware wallet, including:
Traversing an index table pre-established in a hardware wallet storage space, and determining whether target read data is written in the index table, wherein the index table comprises an index number field, a keyword field and a reference record field;
if not, writing the target read data into the index table, and writing the data of the reference record field corresponding to the target read data and the data of the corresponding index number field so as to read the target read data, wherein the target read data is the data of the keyword field;
and if the target read data is written, reading the target read data according to the data of the reference record field and the data of the index number field.
Optionally, after the writing the target read data into the index table, the method further includes:
a service data table is established in advance, and the service data table comprises a service identification code field and a first service data field;
determining the data of the service identification code field consistent with the data of the reference record field in the pre-established service data table, and writing the data of the index number field corresponding to the target read data into the first service data field; the data of the reference record field comprises data of at least one of the service identification code fields, and the data of the first service data field comprises data of at least one of the index number fields.
Optionally, the reading the target read data according to the data of the reference record field and the data of the index number field specifically includes:
acquiring data of the first service data field according to the data of the service identification code field of the service data table, or acquiring data of the first service data field according to the data of the service identification code field of the service data table and the data of the first service data field;
searching the data of the reference record field corresponding to the data of the service identification code field and the data of the index number field corresponding to the data of the first service data field in the index table;
and reading the target read data according to the data of the reference record field and the data of the index number field.
Optionally, the method further comprises:
a service attribute mapping table is established in advance, and the service attribute mapping table comprises a service attribute field and a second service data field;
writing the data in the first service data field into the second service data field in the pre-established service attribute mapping table, and writing the service attribute corresponding to the data in the second service data field into the service attribute field, wherein the data in the second service data field comprises the data of at least one index number field.
Optionally, the reading the target read data according to the data of the reference record field and the data of the index number field specifically includes:
acquiring data of the second service data field and data of the service attribute field in the service attribute mapping table;
searching the data of the reference record field corresponding to the data of the service identification code field and the data of the index number field corresponding to the data of the second service data field in the index table according to the known data of the service identification code field corresponding to the data of the service attribute field;
and reading the target read data according to the data of the reference record field and the data of the index number field.
Optionally, the method further comprises:
when all the data of the reference record field in one index record is deleted, deleting the data of the keyword field and the data of the index number field in the index record, wherein the index record comprises the data of the index number field, the data of the keyword field and the data of the reference record field.
Optionally, the method further comprises:
when the data of part of the index number field of the first service data field in one service data record is deleted, after the data of the corresponding reference record field in the index table is searched according to the data of the service identification code, the data of the corresponding service identification code field in the reference record field is deleted.
In a second aspect, the present application provides an apparatus for data reading for a hardware wallet, comprising:
the judging module is used for traversing an index table pre-established in a hardware wallet storage space and determining whether target read data is written in the index table or not, wherein the index table comprises an index number field, a keyword field and a reference record field;
the writing module is used for writing the target read data into the index table and writing the data of the reference record field and the data of the index number field corresponding to the target read data so as to read the target read data, wherein the target read data is the data of the keyword field;
and the reading module is used for reading the target read data according to the data of the reference record field and the data of the index number field.
Optionally, the writing module further includes:
a service data table is established in advance, and the service data table comprises a service identification code field and a first service data field;
determining the data of the service identification code field consistent with the data of the reference record field in the pre-established service data table, and writing the data of the index number field corresponding to the target read data into the first service data field; the data of the reference record field comprises data of at least one of the service identification code fields, and the data of the first service data field comprises data of at least one of the index number fields.
Optionally, the reading module is specifically configured to:
acquiring data of the first service data field according to the data of the service identification code field of the service data table, or acquiring data of the first service data field according to the data of the service identification code field of the service data table and the data of the first service data field;
searching the data of the reference record field corresponding to the data of the service identification code field and the data of the index number field corresponding to the data of the first service data field in the index table;
And reading the target read data according to the data of the reference record field and the data of the index number field.
Optionally, the writing module further includes:
a service attribute mapping table is established in advance, and the service attribute mapping table comprises a service attribute field and a second service data field;
writing the data in the first service data field into the second service data field in the pre-established service attribute mapping table, and writing the service attribute corresponding to the data in the second service data field into the service attribute field, wherein the data in the second service data field comprises the data of at least one index number field.
Optionally, the reading module is specifically configured to:
acquiring data of the second service data field and data of the service attribute field in the service attribute mapping table;
searching the data of the reference record field corresponding to the data of the service identification code field and the data of the index number field corresponding to the data of the second service data field in the index table according to the known data of the service identification code field corresponding to the data of the service attribute field;
And reading the target read data according to the data of the reference record field and the data of the index number field.
Optionally, the apparatus further comprises: deleting the module;
when all the data of the reference record field in one index record are deleted, deleting the data of the keyword field and the data of the index number field corresponding to the data in the index record, wherein the index record comprises the data of the index number field, the data of the keyword field and the data of the reference record field.
Optionally, the deletion module is further configured to:
when the data of part of the index number field of the first service data field in one service data record is deleted, after the data of the corresponding reference record field in the index table is searched according to the data of the service identification code, the data of the corresponding service identification code field in the reference record field is deleted.
Compared with the prior art, the application has the following beneficial effects:
in the present application, an index table is pre-established in the storage space of the hardware wallet. The index table stores the keywords needed by the search and the reference records corresponding to the keywords, and each keyword has an index number. It is determined whether the retrieved target read data, which is the keyword, has been written in the index table. If not, the keyword can be written into the index table, and the corresponding reference record and the corresponding index number can be written, so that the keyword can be directly read in the index table later. If written, the target read data, i.e., the key, can be determined directly by referencing the record and index number. By establishing the index table, the service data can be stored in an index address mode, and slow reading speed caused by overlarge stored data can be avoided. Therefore, the data reading efficiency of the hardware wallet can be improved, and effective data can be conveniently read.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive faculty for a person skilled in the art.
Fig. 1 is a flowchart of a method for reading data from a hardware wallet according to an embodiment of the present application;
FIG. 2 is another flow chart of a method for data reading for a hardware wallet provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a device for reading data from a hardware wallet according to an embodiment of the present application.
Detailed Description
In order to enable those skilled in the art to more clearly understand the technical solutions of the present application, the application scenario of the present application solution is first described below.
The digital currency hardware wallet provides a convenient way of payment. When the hardware wallet interacts with the cash register in a near field communication mode, payment transaction operation can be completed through key information such as wallet ID, signature and the like. The near field communication (Near Field Communication, NFC) is a short-range high-frequency radio technology, and is a communication mode for exchanging data by establishing a channel under the condition that devices are close to each other by means of electromagnetic waves. In a practical application scenario, a business operation often occurs along with a payment operation, and complete business data is generally required for completing the business operation, the business data needs to be stored, and a large amount of repeated data is stored in a storage space of a hardware wallet in a frequent transaction process.
Currently, in the payment of a power fee, a digital money hardware wallet may be used for payment. All or part of the payment information can be stored on the hardware wallet, which is of great importance to both parties to the transaction. The transaction data is stored by packing the data and storing the data in the storage space of the hardware wallet. According to different services, the payment service data to be stored is different, and the service data of the electric charge generally comprises necessary service data which are inquired in the electric charge process such as a user number, a power supply unit, an electric address and the like. When data is read, the efficiency of data inquiry is positively correlated with the stored data quantity, and the more data are stored, the higher the data repetition rate is, the slower the data reading speed is. This can result in reduced data reading efficiency for the hardware wallet and difficulty in reading valid data. In addition, the digital currency hardware wallet has limited storage space, and storing a large amount of repeated data can cause waste of the storage space, so that the number of transaction records stored is reduced.
In order to solve the technical problems, the application provides a method and a device for reading data of a hardware wallet. In the present application, an index table is pre-established in the storage space of the hardware wallet. The index table stores the keywords needed by the search and the reference records corresponding to the keywords, and each keyword has an index number. It is determined whether the retrieved target read data, which is the keyword, has been written in the index table. If not, the keyword can be written into the index table, and the corresponding reference record and the corresponding index number can be written, so that the keyword can be directly read in the index table later. If written, the target read data, i.e., the key, can be determined directly by referencing the record and index number. By establishing the index table, the service data can be stored in an index address mode, and slow reading speed caused by overlarge stored data can be avoided. Therefore, the data reading efficiency of the hardware wallet can be improved, and effective data can be conveniently read.
In order to make the present application solution better understood by those skilled in the art, the following description will clearly and completely describe the technical solution in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
Fig. 1 is a flowchart of a method for reading data from a hardware wallet according to an embodiment of the present application. As shown in fig. 1, the method includes:
s101: traversing an index table pre-established in a hardware wallet storage space, and determining whether target read data are written in the index table.
An interval with a fixed size is defined in the storage space of the hardware wallet in advance, and an index table is established in the space and used for storing data of related services.
The structured data table can unify the storage data formats of all service systems, and determine the byte length of the read data and accurately limit the read range of the data according to different services, so that the data can be accurately analyzed in each service system.
The index table is a table indicating correspondence between logical records and physical records. Each item of index item keys or logic record numbers in the index table are arranged in sequence. In an index order file, an index entry may be created for a set of records.
The index table can compress and encrypt the data to be stored to the greatest extent, so that the hardware wallet can store as much data as possible on the premise of data security. The index table here refers to a private dynamic index table, that is, in this embodiment, only the index data of the electric charge system is stored, and the index table may be dynamically changed according to addition, deletion, and modification of the index data.
Specifically, the index table includes an index number field, a keyword field, and a reference record field, as shown in table 1.
Table 1 index table
Figure SMS_1
Each cell in the index number field stores an index number, which is a data index value when an index record is generated, and one index record corresponds to one index number. The index number also represents the address of the key words in the index table in the index record, so that the corresponding key words can be obtained by directly connecting other data tables with the index number field, and the space required by the data memory can be effectively compressed. For example, the index number may be x001, x002, etc.
Each cell in the keyword field stores a keyword, which is the target read data. Keywords may store relatively long words corresponding to the business, for example, specific power supply units may be stored: xx city xx district xx company, specific electric charge user number: 12345678901, etc. It should be noted, however, that the length of the keyword content also needs to be limited, and may not exceed 256 bytes. In addition, if some keywords to be stored are too long, the keywords can be split and stored. For example, the xx-city xx region xx company is divided into an xx-city xx region and an xx company, the index number corresponding to the keyword xx-city xx region is x002, and the index number corresponding to the keyword xx company is x003. Keywords can be used jointly after being split, for example, a service power supply unit can be expressed by x002x 003.
Each cell in the reference record field stores the service identification code to which the key of the index record belongs. Each service has a unique service identification code, and the recording of the service identification code in the reference record field can reduce the byte space occupation ratio. For example, the service name is the service of electricity charge collection, and the service identification code is DFDS. In each cell of the reference record field, a plurality of service identification codes may be written. For example, in one index record, the index number is x001, the corresponding keyword is 12345678901, the corresponding reference record is DFDS and DFDK, wherein DFDK is a service identification code of a service electricity fee deduction.
At the time of data reading, the target read data is traversed in the index table, and whether the target read data has been written in the index table is determined. If not, the process proceeds to S102, and if already written, the process proceeds to S103.
S102: and writing the target read data into the index table, and writing the data of the reference record field corresponding to the target read data and the data of the corresponding index number field.
If the index table does not find the target read data after traversing, the target read data is written into the index table, namely, an index record is newly built.
The target read data is written into the cell corresponding to the keyword field, and simultaneously, a corresponding index number can be generated by a self-increasing method, and the service identification code corresponding to the target read data is also required to be written into the cell corresponding to the reference record field.
After the target read data which is not written before is written into the index table, if the operation instruction for reading the data is available later, the read inquiry can be directly carried out in the index table.
S103: and reading target read data according to the data of the reference record field and the data of the index number field.
If the index table has already written the target read data, that is, the keyword, the content of the target read data can be accurately positioned directly according to the index number and the service identification code in the corresponding reference record. Wherein the target read data may be a plurality of keywords.
In the general process of using the hardware wallet to pay electric fees, various payment devices write various data into the hardware wallet through NFC, and the data content and the format of the data written into the hardware wallet are various, so that the amount of data storable in the hardware wallet is greatly reduced.
When each service system reads the electricity charge data in the hardware wallet, the data format is various when each service system writes the data because of no unified data storage scheme. The complicated data formats can cause complicated data analysis work of the service system, and even the necessary transaction record information cannot be completely restored. The service system includes, but is not limited to, an electric fee service system, and may be related service systems of other departments.
The unification of the data storage modes brings convenience to each business system when reading data. Each service system can rapidly and accurately read and screen out the data required by each service system according to the service identification code. Structured data can be disclosed and kept secret, so that each service system can only read the disclosed data.
In the prior art, the hardware environment of the digital currency hardware wallet is limited and cannot store a large amount of data. The data storage on the hardware wallet does not form a fixed formatted storage form, the data standard is not subjected to unified overall planning, and the data stored in the hardware wallet is disordered. When a particular business needs to use particular data, it is very difficult or even impossible to extract valid data from the cluttered data heap.
In the present application, an index table is pre-established in the storage space of the hardware wallet. The index table stores the keywords needed by the search and the reference records corresponding to the keywords, and each keyword has an index number. It is determined whether the retrieved target read data, which is the keyword, has been written in the index table. If not, the keyword can be written into the index table, and the corresponding reference record and the corresponding index number can be written, so that the keyword can be directly read in the index table later. If written, the target read data, i.e., the key, can be determined directly by referencing the record and index number. By establishing the index table, the service data can be stored in an index address mode, and slow reading speed caused by overlarge stored data can be avoided. Therefore, the data reading efficiency of the hardware wallet can be improved, and effective data can be conveniently read.
Fig. 2 is another flowchart of a method for reading data from a hardware wallet according to an embodiment of the present application. As shown in fig. 2, the method includes:
s201: and establishing an index table, a service data table and a service attribute mapping table in the storage space of the hardware wallet.
An interval with a fixed size is defined in the storage space of the hardware wallet in advance, and an index table is established in the space and used for storing data of related services. The foregoing is the same as the method used herein, and will not be described in detail.
The data in the index table is in a dynamic mode.
When data is referenced, the corresponding service identification code is written into the cell of the reference record of the index record, and when the specific service no longer references the service identification code, the corresponding service identification code is deleted from the cell of the reference record.
When there is no service identification code in a cell referencing the record field, the index record is deleted. The dynamic index is updated along with the updating of the data, and the contents of the index tables of different hardware wallets can be different, so that the effect of data security is achieved to a certain extent.
A service data table with a fixed format is created in the storage space of the hardware wallet in advance, specific service contents are recorded in the service data table, detailed service data required by various services are stored, and the length of the service data table is not limited in the storage space.
The operation of adding, deleting and inquiring the service data table can be carried out, the data of the service data table, the index table and the service attribute mapping table have a connection relation, and the data of the service data table can not be modified for the usability and the safety of the data.
Specifically, the service data table includes a service name field, a service identification code field, and a first service data field, as shown in table 2.
The relevant data information of table 2 has an association with table 1.
Table 2 service data table
Figure SMS_2
Each cell in the service name field stores the name of a specific service, such as the service name of electricity charge collection, electricity charge deduction, and the like. The service name is short for a specific service, the written content cannot be too long, and the length is limited, for example, the character length can be limited to 256 bytes.
Each cell in the service identifier field stores a corresponding service identifier, which may be generally an abbreviation of a service name, for example, a service name of electricity charge collection, and a corresponding service identifier is DFDS. The service identification code may be composed of fixed length characters, the service identification codes corresponding to different services being different, that is, the service identification code of each service being unique.
Each cell in the first service data field stores service data of the service, and the service data is composed of a plurality of index numbers. For example, the service name is the service of electricity charge, and the corresponding cell of the first service data field should be written with x001|x002x003|x004. That is, the service data of the electricity charge collection service is composed of 12345678901, xx city xx district xx company, zhang Xiaoming.
A service attribute mapping table with a fixed format is created in the storage space of the hardware wallet in advance, the specific meaning of service data stored in the service data table is recorded in the service attribute mapping table, and the length of the service attribute mapping table is not limited in the storage space.
Specifically, the service attribute mapping table includes a service attribute field and a second service data field, as shown in table 3.
The relevant data information of table 3 has an association with tables 1 and 2.
Table 3 service attribute mapping table
Figure SMS_3
Each cell in the service attribute field stores the service attribute of the service data, i.e., the specific meaning of the service data. Heretofore, in the service data table, the meaning of the service data is not explained in a specific and understandable manner, so that further explanation is made in the service attribute mapping table.
Each cell in the second traffic data field stores specific traffic data. The service data of the first service data field in the service data table is the service data of a complete service and comprises the service data of a plurality of service attributes, and the service data of the second service data field in the service attribute mapping table is the component part of the service data of the first service data field and is the service data corresponding to the service attributes. For example, the service attribute is the service of the electricity fee collection address, and the corresponding service data is x002x003. The data corresponding to the index table is the data of xx city xx district xx company with the keyword.
In addition, the service data recorded in the service attribute mapping table is shared data that can be commonly used by a plurality of service systems. For example, the electricity fee deduction user name x002x004 may be data commonly used by an electricity fee system and a water fee system.
S202: writing the data into an index table, a service data table and a service attribute mapping table.
When a new index record is to be written into the index table, traversing whether the key data in the index record has been written into the index table. And if not, writing the keyword data into the idle cells of the keyword field. When the data is written, the service name corresponding to the index record is known, the service identification code of the index record can be clearly known according to the known service name, and the service identification code is written into the cell of the reference record field corresponding to the keyword data. And adding an index number for the keyword data, and writing the index number into the cell of the corresponding index number field. For example, an index record is newly written, the index number is x005, the keyword content is xx cell, and the reference record is DFDS.
Writing the newly added index number into a cell corresponding to the first service data field in the service data table. Here, for example, in the case of writing data by using the above index table, when the service name is electric charge collection, the service identifier is DFDS, the index number x005 is added to the corresponding cell of the first service data field, and the added service data is x001|x002x003|x004|x005. Wherein the first service data field is limited by a fixed service data entry, and new service data cannot be rewritten if the entry of the service data has been added to the maximum limit. For example, if the service identifier is a service of DFDS and the corresponding maximum entry of service data is 5, the service data with index number x006 cannot be rewritten.
When the newly added index number, namely the service data, is shared data, the service data is written into an idle cell in a second service data field in the service attribute mapping table, and the service attribute corresponding to the newly added service data is written. Here, the service attribute is an electric rate user number address, and the service data is x006, which is exemplified by writing data in the index table. When the newly added index number, that is, the service data is not shared data, the service data is not written into the service attribute mapping table.
When the keyword data is written into the index table, but the service identification code read at this time is not written into the reference record, the service identification code read at this time is written into the cell of the corresponding reference record field.
In addition, when one service data in the service data table is deleted, a consistent index number needs to be found in the index table, and the service identification code of the service in the reference record corresponding to the index number is deleted.
In addition, when one index record in the index table is deleted, service data including the index number needs to be found in the service data table, the service data is deleted, and service data including the index number and corresponding service attributes are found in the service attribute mapping table, and the service data and the corresponding service attributes are deleted.
In addition, when a service identification code in a reference record of an index record in the index table is not referenced any more, the service identification code is deleted from the reference record of the index record directly. When a cell referencing the record field no longer contains a service identification code, the index record is deleted.
S203: data is read from an index table, a service data table or a service attribute mapping table.
In this embodiment, the target read data to be read is the keyword data in the index table, and the following methods may exist for the reading:
the method comprises the following steps: and reading the keyword data by using the index table.
Based on the index number in the known index table and the service identification code in the reference record, unique keyword data can be determined.
The second method is as follows: and reading the keyword data by using the index table and the service data table.
According to the known service identification code in the service data table, the relevant service data in the first service data field in the service data table can be read. The index number in the index table can be known from the known service data, and the cell of the reference record field in the index table can be located according to the known service identification code, and the unique keyword data can be determined through the index number and the reference record.
And a third method: and reading the keyword data by using the index table and the service attribute mapping table.
The premise of using the service attribute mapping table is that the service data is shared service data.
When the data of the service attribute field in the service attribute mapping table is known, the service attribute mapping table is scanned to obtain the service data in the second service data field, and the corresponding index number in the index table can be positioned according to the service data. When the data is read by using the service attribute mapping table, the service identification code corresponding to the data of the service attribute field should be known. The data referencing the record field in the index table may be located according to a known service identification code. Unique keyword data can be determined by index number and reference record.
In this embodiment, the service data of the power charge is pooled, the core service data of the power charge is stored by the address or index to which the data belongs, and if the service data is duplicate, the space occupied by the service data in the transaction data can be effectively reduced, and the advantage in a large amount of duplicate data is more obvious, so that as much core service data as possible can be stored. In the process of data use, generally speaking, the efficiency of data query is positively related to the data volume of the bottom scanning, and the data volume of the bottom scanning depends on the data distribution and structure, and the structured data is beneficial to data reading and screening.
In the application, an index table, a service data table and a service attribute mapping table are established on the hardware wallet. More private keywords related to the service data can be stored in a dynamic index mode, so that the method has greater advantages for storing the same service data, and the efficient multiplexing of the data can be realized through the index table, so that the storage cost is effectively reduced, and the storage efficiency is improved. The adding and deleting mechanism of the business data is also ensured. Meanwhile, the data can be read more quickly, conveniently and efficiently through the index table, so that the reading and screening efficiency of the data can be guaranteed, and the data reading safety is also guaranteed to a certain extent. In addition, different services need to customize the required service data volume, and the actual service data requirement is dynamically expanded through the newly added service. And also establishes a certain standard for reading and writing data.
Fig. 3 is a schematic structural diagram of a device for reading data from a hardware wallet according to an embodiment of the present application. As shown in fig. 3, the apparatus includes:
the judging module 310 is configured to traverse an index table pre-established in the hardware wallet storage space, and determine whether to write target read data in the index table, where the index table includes an index number field, a keyword field, and a reference record field.
The writing module 320 is configured to write target read data into the index table, and write data of a reference record field and data of a corresponding index number field corresponding to the target read data, so that the target read data is read, and the target read data is data of a keyword field.
The reading module 330 is configured to read target read data according to the data of the reference record field and the data of the index number field.
In the present application, an index table is pre-established in the storage space of the hardware wallet. The index table stores the keywords needed by the search and the reference records corresponding to the keywords, and each keyword has an index number. The decision module 310 determines whether the retrieved target read data, which is the key, has been written in the index table. If not, the key may be written to the index table by the writing module 320, and the corresponding reference record and the corresponding index number may be written, so that the key may be directly read from the index table later. If written, the read module 330 may be utilized to determine the target read data, i.e., the key, directly from the reference record and index number. By establishing the index table, the service data can be stored in an index address mode, and slow reading speed caused by overlarge stored data can be avoided. Therefore, the data reading efficiency of the hardware wallet can be improved, and effective data can be conveniently read.
The "first" and "second" in the names of "first", "second" (where present) and the like in the embodiments of the present application are used for name identification only, and do not represent the first and second in sequence.
It should be noted that, in the present specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment is mainly described in a different point from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. The apparatus embodiments described above are merely illustrative, wherein elements illustrated as separate elements may or may not be physically separate, and elements illustrated as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing is merely one specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (14)

1. A method of data reading for a hardware wallet, comprising:
traversing an index table pre-established in a hardware wallet storage space, and determining whether target read data is written in the index table, wherein the index table comprises an index number field, a keyword field and a reference record field;
if not, writing the target read data into the index table, and writing the data of the reference record field corresponding to the target read data and the data of the corresponding index number field so as to read the target read data, wherein the target read data is the data of the keyword field;
and if the target read data is written, reading the target read data according to the data of the reference record field and the data of the index number field.
2. The method of claim 1, wherein after the writing of the target read data to the index table, the method further comprises:
a service data table is established in advance, and the service data table comprises a service identification code field and a first service data field;
determining the data of the service identification code field consistent with the data of the reference record field in the pre-established service data table, and writing the data of the index number field corresponding to the target read data into the first service data field; the data of the reference record field comprises data of at least one of the service identification code fields, and the data of the first service data field comprises data of at least one of the index number fields.
3. The method according to claim 2, wherein the reading the target read data according to the data of the reference record field and the data of the index number field specifically includes:
acquiring data of the first service data field according to the data of the service identification code field of the service data table, or acquiring data of the first service data field according to the data of the service identification code field of the service data table and the data of the first service data field;
Searching the data of the reference record field corresponding to the data of the service identification code field and the data of the index number field corresponding to the data of the first service data field in the index table;
and reading the target read data according to the data of the reference record field and the data of the index number field.
4. The method according to claim 2, wherein the method further comprises:
a service attribute mapping table is established in advance, and the service attribute mapping table comprises a service attribute field and a second service data field;
writing the data in the first service data field into the second service data field in the pre-established service attribute mapping table, and writing the service attribute corresponding to the data in the second service data field into the service attribute field, wherein the data in the second service data field comprises the data of at least one index number field.
5. The method according to claim 4, wherein the reading the target read data according to the data of the reference record field and the data of the index number field specifically includes:
Acquiring data of the second service data field and data of the service attribute field in the service attribute mapping table;
searching the data of the reference record field corresponding to the data of the service identification code field and the data of the index number field corresponding to the data of the second service data field in the index table according to the known data of the service identification code field corresponding to the data of the service attribute field;
and reading the target read data according to the data of the reference record field and the data of the index number field.
6. The method according to claim 1, wherein the method further comprises:
when all the data of the reference record field in one index record is deleted, deleting the data of the keyword field and the data of the index number field in the index record, wherein the index record comprises the data of the index number field, the data of the keyword field and the data of the reference record field.
7. The method according to claim 2, wherein the method further comprises:
when the data of part of the index number field of the first service data field in one service data record is deleted, after the data of the corresponding reference record field in the index table is searched according to the data of the service identification code, the data of the corresponding service identification code field in the reference record field is deleted.
8. An apparatus for data reading for a hardware wallet, comprising:
the judging module is used for traversing an index table pre-established in a hardware wallet storage space and determining whether target read data is written in the index table or not, wherein the index table comprises an index number field, a keyword field and a reference record field;
the writing module is used for writing the target read data into the index table and writing the data of the reference record field and the data of the index number field corresponding to the target read data so as to read the target read data, wherein the target read data is the data of the keyword field;
and the reading module is used for reading the target read data according to the data of the reference record field and the data of the index number field.
9. The apparatus of claim 8, wherein the writing module further comprises:
a service data table is established in advance, and the service data table comprises a service identification code field and a first service data field;
determining the data of the service identification code field consistent with the data of the reference record field in the pre-established service data table, and writing the data of the index number field corresponding to the target read data into the first service data field; the data of the reference record field comprises data of at least one of the service identification code fields, and the data of the first service data field comprises data of at least one of the index number fields.
10. The apparatus of claim 9, wherein the reading module is specifically configured to:
acquiring data of the first service data field according to the data of the service identification code field of the service data table, or acquiring data of the first service data field according to the data of the service identification code field of the service data table and the data of the first service data field;
searching the data of the reference record field corresponding to the data of the service identification code field and the data of the index number field corresponding to the data of the first service data field in the index table;
and reading the target read data according to the data of the reference record field and the data of the index number field.
11. The apparatus of claim 9, wherein the writing module further comprises:
a service attribute mapping table is established in advance, and the service attribute mapping table comprises a service attribute field and a second service data field;
writing the data in the first service data field into the second service data field in the pre-established service attribute mapping table, and writing the service attribute corresponding to the data in the second service data field into the service attribute field, wherein the data in the second service data field comprises the data of at least one index number field.
12. The apparatus of claim 11, wherein the reading module is specifically configured to:
acquiring data of the second service data field and data of the service attribute field in the service attribute mapping table;
searching the data of the reference record field corresponding to the data of the service identification code field and the data of the index number field corresponding to the data of the second service data field in the index table according to the known data of the service identification code field corresponding to the data of the service attribute field;
and reading the target read data according to the data of the reference record field and the data of the index number field.
13. The apparatus of claim 8, wherein the apparatus further comprises: deleting the module;
when all the data of the reference record field in one index record are deleted, deleting the data of the keyword field and the data of the index number field corresponding to the data in the index record, wherein the index record comprises the data of the index number field, the data of the keyword field and the data of the reference record field.
14. The apparatus of claim 9, wherein the apparatus further comprises: the deletion module is used for:
when the data of part of the index number field of the first service data field in one service data record is deleted, after the data of the corresponding reference record field in the index table is searched according to the data of the service identification code, the data of the corresponding service identification code field in the reference record field is deleted.
CN202310623840.2A 2023-05-30 2023-05-30 Method and device for reading data of hardware wallet Active CN116342123B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310623840.2A CN116342123B (en) 2023-05-30 2023-05-30 Method and device for reading data of hardware wallet

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310623840.2A CN116342123B (en) 2023-05-30 2023-05-30 Method and device for reading data of hardware wallet

Publications (2)

Publication Number Publication Date
CN116342123A true CN116342123A (en) 2023-06-27
CN116342123B CN116342123B (en) 2023-08-18

Family

ID=86893430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310623840.2A Active CN116342123B (en) 2023-05-30 2023-05-30 Method and device for reading data of hardware wallet

Country Status (1)

Country Link
CN (1) CN116342123B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630847A (en) * 2014-11-21 2016-06-01 深圳市腾讯计算机系统有限公司 Data storage method as well as data query method, apparatus and system
CN108776682A (en) * 2018-06-01 2018-11-09 南京紫光云信息科技有限公司 The method and system of random read-write object based on object storage
CN110110024A (en) * 2019-04-29 2019-08-09 东南大学 A kind of large capacity VCT file importing spatial database method
US20200257732A1 (en) * 2019-02-07 2020-08-13 TmaxData Co., Ltd. Systems and methods of managing an index
CN114064660A (en) * 2021-11-29 2022-02-18 重庆允成互联网科技有限公司 Data structured analysis method based on ElasticSearch

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105630847A (en) * 2014-11-21 2016-06-01 深圳市腾讯计算机系统有限公司 Data storage method as well as data query method, apparatus and system
CN108776682A (en) * 2018-06-01 2018-11-09 南京紫光云信息科技有限公司 The method and system of random read-write object based on object storage
US20200257732A1 (en) * 2019-02-07 2020-08-13 TmaxData Co., Ltd. Systems and methods of managing an index
CN110110024A (en) * 2019-04-29 2019-08-09 东南大学 A kind of large capacity VCT file importing spatial database method
CN114064660A (en) * 2021-11-29 2022-02-18 重庆允成互联网科技有限公司 Data structured analysis method based on ElasticSearch

Also Published As

Publication number Publication date
CN116342123B (en) 2023-08-18

Similar Documents

Publication Publication Date Title
CN100498740C (en) Data cache processing method, system and data cache device
KR100285265B1 (en) Db management system and inverted index storage structure using sub-index and large-capacity object
JP2000003321A (en) Message storage structure of high performance
US11625412B2 (en) Storing data items and identifying stored data items
CN110018998A (en) A kind of file management method, system and electronic equipment and storage medium
TWI459202B (en) Data processing method, memory controller and memory storage device
CN100378663C (en) Method, system and module for dynamic downloading of applied programe to user identification
US20060112083A1 (en) Object relation information management program, method, and apparatus
CN111176896A (en) File backup method and device and terminal equipment
CN109918352A (en) The method of storage system and storing data
CN101110026A (en) Resource limited equipment and data access method
CN100524312C (en) Mass storing and managing method of smart card
CN115470156A (en) RDMA-based memory use method, system, electronic device and storage medium
CA2364820A1 (en) Variable length encoding and decoding of ascending numerical sequences
CN116342123B (en) Method and device for reading data of hardware wallet
CN101404797B (en) Storage method, storage management apparatus and storage system for long and short messages
CN111897675A (en) Method for recovering recently deleted files of F2FS file system of mobile phone terminal
CN101384050A (en) Mobile terminal, method and system for resource management
CN101217385A (en) A method and system for the temporary storage and treatment of charging bill
KR20090092455A (en) Security System and Method thereof using Fortable Storage Apparatus, Processor Using the same
CN114265884A (en) Data query method and device, computer equipment and storage medium
KR100610529B1 (en) Compression saving method and search method of card black-list data
CN100571431C (en) The short message storage and the processing method that are used for portable terminal
CN104537523A (en) Method, device and system for finding mail deleted by mistake
CN104834664A (en) Optical disc juke-box oriented full text retrieval system

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