CN112527828B - Tax control record storage method and retrieval query method for tax control machine - Google Patents

Tax control record storage method and retrieval query method for tax control machine Download PDF

Info

Publication number
CN112527828B
CN112527828B CN202011435046.8A CN202011435046A CN112527828B CN 112527828 B CN112527828 B CN 112527828B CN 202011435046 A CN202011435046 A CN 202011435046A CN 112527828 B CN112527828 B CN 112527828B
Authority
CN
China
Prior art keywords
information
index table
date
receipt information
report information
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
CN202011435046.8A
Other languages
Chinese (zh)
Other versions
CN112527828A (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.)
Fujian Newland Payment Technology Co ltd
Original Assignee
Fujian Newland Payment Technology 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 Fujian Newland Payment Technology Co ltd filed Critical Fujian Newland Payment Technology Co ltd
Priority to CN202011435046.8A priority Critical patent/CN112527828B/en
Publication of CN112527828A publication Critical patent/CN112527828A/en
Application granted granted Critical
Publication of CN112527828B publication Critical patent/CN112527828B/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/2453Query optimisation
    • 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
    • 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/248Presentation of query results
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07GREGISTERING THE RECEIPT OF CASH, VALUABLES, OR TOKENS
    • G07G1/00Cash registers
    • G07G1/12Cash registers electronically operated

Landscapes

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

Abstract

The invention discloses a tax control record storage method and a retrieval and query method of a tax control machine, wherein the storage method comprises the following steps: s100, generating receipt information; s200, generating report information; s300, storing receipt information and report information; s400, judging whether the stored receipt information and the report information meet preset conditions or not, and S500, establishing a receipt information index table and a report information index table for retrieval and query; the receipt information index table and the report information index table at least comprise dates when the receipt information index table and the report information index table are correspondingly established; in addition, when the receipt information and the report information are stored, the date when the receipt information and the report information are correspondingly established is not written; according to the invention, the date and the tax control data are stored separately by adding the index table, so that the redundancy of the tax control data can be greatly reduced, the storable data volume is greatly improved under the condition of not increasing the space of a memory, and the technical effects of data tamper resistance and high data retrieval speed are realized under the condition of ensuring the safety and reliability of data storage.

Description

Tax control record storage method and retrieval query method for tax control machine
Technical Field
The invention relates to the technical field of tax-control cash register systems, in particular to a tax-control record storage method and a retrieval query method of a tax-control machine.
Background
The tax-controlled cash register is a cash register with tax-counting function and with legal seriousness and indestructibility, and it has internal tax-counting memory capable of automatically recording, but not changing and erasing, and records daily business data and tax amount, and is the evidence for paying tax to tax authority.
The tax-control cash register is required to ensure the correct generation, reliable storage and safe transmission of the operation data and can meet the requirements of tax authority management, data verification and the like, so that how to store the tax-control data and realize the efficient query of the tax-control data is very important.
However, the existing storage mechanism of the tax control machine usually needs a large amount of stored operation record data, long time for storage, limited storage space, complex association between tax control data, difficult realization of data query algorithm, and low query efficiency, thereby affecting the use experience of the tax control machine to a certain extent.
Disclosure of Invention
In view of the above, the present invention provides a tax control record storage method and a retrieval query method for a tax control machine, which can greatly reduce data redundancy and improve data storage and retrieval efficiency.
In order to achieve the technical purpose, the technical scheme adopted by the invention is as follows:
a tax control record storage method of a tax control machine comprises the following steps:
generating receipt information;
generating report information;
storing receipt information and reporting information;
when the stored receipt information and the report information meet the preset conditions, a receipt information index table and a report information index table are established for retrieval and query;
the receipt information index table and the report information index table at least comprise dates when the receipt information index table and the report information index table are correspondingly established;
when the receipt information and the report information are stored, the date when the receipt information and the report information are associated with each other is not written.
As a possible implementation manner, further, when the receipt information and the report information are not generated within the date, the receipt information index table and the report information index table are established for searching and querying.
As a preferred embodiment, it is preferred that the receipt information index table at least includes: the creation date of the index table, the storage address of the first receipt information stored at the date, and the checksum;
the report information index table at least comprises: the date of creation of the index table, the storage address of the first piece of report information stored at that date, and the checksum.
As a preferred alternative, it is preferred that the stored receipt information includes at least: transaction amount, tax amount, check sum and sequence number of report information synchronously generated with the check sum;
the stored reporting information includes: the serial number of the information reported in this item, the total transaction amount of all receipt information counted by the information reported in this item, the total tax amount of all receipt information counted by the information reported in this item, the total transaction amount of all receipt information, the total tax amount of all receipt information, the receipt information number counted by the information reported in this item, and the checksum.
As a preferred alternative, it is preferable that the method for storing the receipt information includes the steps of:
s1, obtaining a last receipt information index table in a tax control machine;
s2, acquiring the serial number of the last piece of reported information in the tax control machine;
s3, acquiring an available receipt information storage address, writing receipt information, wherein the serial number of report information corresponding to the receipt information is the serial number of the report information acquired in the step S2 plus 1, and if the serial number of the report information is not acquired in the step S2, the serial number of the report information corresponding to the receipt information established in the step is set to be 1;
s4, if the receipt information index table is not acquired in the step S1, directly executing the step S5; otherwise, judging whether the generation date of the written receipt information is larger than the recording date of the receipt information index table acquired in the step S1, if so, executing the step S5, otherwise, ending;
and S5, acquiring a storage address of an available receipt information index table, and writing the receipt information index table, wherein the establishment date of the receipt information index table is the generation date of the corresponding receipt information, and the storage address of the first receipt information in the date is recorded in the receipt information index table.
As a preferred alternative, it is preferable that the method for storing the report information includes the following steps:
s1, obtaining a last report information index table in a tax control machine;
s2, acquiring an available report information storage address, and writing the report information into the address;
s3, if the report information index table is not acquired in the step S1, directly executing the step S4; otherwise, judging whether the generation date of the written report information is larger than the recording date of the report information index table acquired in the step S1, if so, executing the step S4, and if not, ending the step;
and S4, acquiring a storage address of the available report information index table, writing the report information index table, wherein the establishment date of the report information index table is the generation date of the corresponding report information, and the storage address of the first piece of report information in the date is recorded in the report information index table.
Based on the storage method of the tax control records of the tax control machine, the invention also provides a retrieval and query method of the tax control records of the tax control machine, which comprises the storage method of the tax control records of the tax control machine, and the retrieval and query method comprises the following steps:
retrieving and inquiring receipt information according to a date range;
and searching and inquiring the report information according to the date range.
As a preferred alternative, the step of retrieving and querying receipt information by date range is preferably as follows:
s1, traversing a receipt information index table, judging whether the date of the index table is larger than the retrieval ending date, if so, ending traversal, and if not, executing the step S2;
s2, judging whether the date of the index table is larger than or equal to the retrieval starting date, if so, recording the date of the corresponding index table and the storage address of the first receipt information of the date contained in the index table, and executing the step S3, otherwise, executing the step S1;
s3, judging whether the current index is the last index, if so, executing a step S6, otherwise, executing a step S4;
s4, reading a next receipt information index table, and calculating how many receipts are contained in the date according to the difference between the receipt information address in the next index table and the receipt information storage address in the current index;
s5, reading receipt information from the first receipt information storage address read in the step S2, wherein the number of the read receipt information is the number of the receipt information calculated in the step S3, and executing the step S1;
s6, obtaining a storage address of the last receipt information, and calculating how many receipts are contained in the date according to the difference between the last receipt information address and the receipt information storage address in the current index table;
and S7, reading the receipt information from the first receipt information storage address on the date read in the step S2, wherein the number of the read receipt information is the number of the receipt information calculated in the step S6, and ending the flow.
As a preferred alternative, the step of searching and querying the report information by date range is preferably as follows:
s1, traversing a report information index table, judging whether the date of the index table is larger than the end date, if so, ending traversal, and if not, executing the step S2;
s2, judging whether the date of the index table is larger than or equal to the starting date, if so, recording the date of the index table and a storage address of the first piece of report information of the current day contained in the index table, and executing the step S3, otherwise, executing the step S1;
s3, judging whether the current index table is the last index table or not, if so, executing a step S6, and otherwise, executing a step S4;
s4, reading a next report information index table, and calculating the number of the report information contained in the date according to the difference value between the report information address in the next index and the report information address in the current index;
s5, reading the report information from the first report information storage address of the current day read in the step S2, wherein the number of the read report information is the number of the report information calculated in the step S3, and executing the step S1;
s6, obtaining a storage address of the last piece of report information, and calculating the number of pieces of report information contained in the date according to the difference value between the address of the last piece of report information and the address of the report information in the current index;
and S7, reading the report information from the first report information storage address of the current day read in the step S2, wherein the number of the read report information is the number of the report information calculated in the step S6, and ending the process.
Based on the foregoing solution, the present invention further provides a computer-readable storage medium, where at least one instruction, at least one program, a code set, or an instruction set is stored in the storage medium, and the at least one instruction, at least one program, at least one code set, or an instruction set is loaded by a processor and executed to implement the foregoing tax-control record storage method of the tax-control machine or to implement the foregoing tax-control record retrieval query method of the tax-control machine.
By adopting the technical scheme, compared with the prior art, the invention has the beneficial effects that: according to the invention, the date and the tax control data are stored separately by adding the index table, so that the redundancy of the tax control data can be greatly reduced, the storable data volume is greatly improved under the condition of not increasing the space of a memory, and the technical effects of data tamper resistance and high data retrieval speed are realized under the condition of ensuring the safety and reliability of data storage.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of the method for storing tax control records of the tax control machine of the present invention;
FIG. 2 is a schematic flow chart of the receipt information storage in the tax control record of the tax control machine according to the present invention;
FIG. 3 is a schematic flow chart of the storage of the report information in the tax control record of the tax control machine according to the present invention;
FIG. 4 is a schematic flow chart of the receipt information query by date in the tax control record of the tax control machine according to the present invention;
FIG. 5 is a schematic flow chart of the information report inquired by date in tax control record of tax control machine.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be noted that the following examples are only illustrative of the present invention, and do not limit the scope of the present invention. Likewise, the following examples are only some examples, not all examples, and all other examples obtained by those skilled in the art without any inventive work are within the scope of the present invention.
Generally, the data that the tax control machine needs to store includes two types, namely, a script (i.e., receipt information) and a Z Report (i.e., report information), the script is a single transaction record and includes a transaction amount, a tax amount and a transaction date, and the Z Report is a summary of all transaction records in a period of time and includes a total transaction amount, a total tax amount, a date and the like of all scripts in the period of time.
The conventional tax control machine stores the following data structures of Recipt and Z Report:
table 1 conventional script data
Sale Total Amount of transaction 4bytes
Tax Total Tax amount 4bytes
Date Date 3bytes
Z1 Count Sequence number of corresponding Z Report 2bytes
Check sum Checksum 2bytes
Total:15bytes
TABLE 2 legacy Z Report data
Figure BDA0002828246080000061
Total:41bytes
Since multiple sets of the recent and Z-Report may be stored in the same day, and their dates are completely the same, if each data is accompanied by a date, the redundancy of the data is high, which results in a waste of storage space and a smaller amount of storable data.
Aiming at the problem, the invention designs that the date and the tax control data are separately stored in an index table mode, only one index table of the first piece of the current date or the first piece of the current date is stored in each day, and the date is not contained in the data of the first piece of the current date or the first piece of the current date. The specific data structure is as follows:
table 3 Recipt index Table
Date Date 3bytes
ReceiptOffset Address The first Recipt memory Address of the day 4bytes
Check sum Checksum 2bytes
Total:9bytes
TABLE 4 Recipt data
Sale Total Amount of transaction 4bytes
Tax Total Tax amount 4bytes
Z1 Count Sequence number of corresponding Z Report 2bytes
Check sum Checksum 2bytes
Total:12bytes
TABLE 5Z Report index Table
Date Date 3bytes
Z Report Offset Address The first Z Report memory address of the day 4bytes
Check sum Checksum 2bytes
Total:9bytes
TABLE 6Z Report data
Z1 Count Sequence number of Z Report 2bytes
Sal Total Total transaction amounts for all Recipts for Current Z Report statistics 8bytes
Tax Total Total tax of all Recipt for Current Z Report statistics 8bytes
Cumulative Sale Total transaction amount of all Recipt 8bytes
Cumulative Tax Total tax of all Recipt 8bytes
Number of receipts Number of Recipts for Z Report statistics 2bytes
Check sum Checksum 2bytes
Total:38bytes
The present embodiment provides the following specific implementation method to explain the concept of the above scheme in detail.
As shown in fig. 1, the method for storing tax control records of a tax control machine in the present scheme includes the following steps:
s100, generating receipt information;
s200, generating report information;
s300, storing receipt information and report information;
s400, judging whether the stored receipt information and the report information meet preset conditions, and if so, executing S500;
s500, establishing a receipt information index table and a report information index table for retrieval and query.
The receipt information index table and the report information index table at least comprise dates when the receipt information index table and the report information index table are correspondingly established;
when the receipt information and the report information are stored, the date when the receipt information and the report information are correspondingly established is not written.
In this embodiment, as a possible implementation manner, further, when a receipt information index table and a report information index table are not established in the date of generation of the receipt information and the report information, the receipt information index table and the report information index table are established for retrieval and query.
In addition, as a preferred alternative embodiment, it is preferable that the receipt information index table includes at least: the creation date of the index table, the storage address of the first receipt information stored at the date, and the checksum;
the report information index table at least comprises: the date of creation of the index table, the address at which the first piece of report information is stored on that date, and the checksum.
In this embodiment, it is preferable that the stored receipt information includes at least: transaction amount, tax amount, check sum and sequence number of report information synchronously generated with the check sum;
the stored reporting information includes: the serial number of the information reported in this item, the total transaction amount of all the receipt information counted by the information reported in this item, the total tax amount of all the receipt information counted by the information reported in this item, the total transaction amount of all the receipt information, the total tax amount of all the receipt information, the number of the receipt information counted by the information reported in this item, and the checksum.
As shown in fig. 2, in this embodiment, as a preferred alternative, it is preferable that the method for storing the receipt information includes the following steps:
s1, obtaining a last receipt information index table in a tax control machine;
s2, acquiring the serial number of the last piece of report information in the tax control machine;
s3, acquiring an available receipt information storage address, writing receipt information, wherein the serial number of report information corresponding to the receipt information is the serial number of the report information acquired in the step S2 plus 1, and if the serial number of the report information is not acquired in the step S2, the serial number of the report information corresponding to the receipt information established in the step is set to be 1;
s4, if the receipt information index table is not acquired in the step S1, directly executing the step S5; otherwise, judging whether the generation date of the written receipt information is larger than the recording date of the receipt information index table acquired in the step S1, if so, executing the step S5, otherwise, ending;
and S5, acquiring a storage address of an available receipt information index table, and writing the receipt information index table, wherein the establishment date of the receipt information index table is the generation date of the corresponding receipt information, and the storage address of the first receipt information in the date is recorded in the receipt information index table.
As shown in fig. 3, as a preferred alternative, it is preferable that the method for storing the report information includes the following steps:
s1, obtaining a last report information index table in a tax control machine;
s2, acquiring an available report information storage address, and writing the report information in the available report information storage address;
s3, if the report information index table is not acquired in the step S1, directly executing the step S4; otherwise, judging whether the generation date of the written report information is larger than the recording date of the report information index table acquired in the step S1, if so, executing the step S4, and if not, ending the step;
and S4, acquiring a storage address of the available report information index table, writing the report information index table, wherein the establishment date of the report information index table is the generation date of the corresponding report information, and the storage address of the first piece of report information in the date is recorded in the report information index table.
Based on the tax control record storage method of the tax control machine, the invention also provides a method for retrieving and inquiring the tax control record of the tax control machine, which comprises the tax control record storage method of the tax control machine, and the retrieving and inquiring method comprises the following steps:
retrieving and inquiring receipt information according to a date range;
and searching and inquiring the report information according to the date range.
As shown in fig. 4, in this embodiment, as a preferred embodiment, the step of searching and querying receipt information by date range preferably includes:
s1, traversing a receipt information index table, judging whether the date of the index table is larger than the retrieval ending date, if so, ending traversal, and if not, executing the step S2;
s2, judging whether the date of the index table is more than or equal to the retrieval starting date, if so, recording the date of the corresponding index table and the storage address of the first receipt information of the date contained in the index table, and executing the step S3, otherwise, executing the step S1;
s3, judging whether the current index is the last index, if so, executing a step S6, otherwise, executing a step S4;
s4, reading a next receipt information index table, and calculating how many receipts are contained in the date according to the difference between the receipt information address in the next index table and the receipt information storage address in the current index;
s5, reading receipt information from the first receipt information storage address read in the step S2, wherein the number of the read receipt information is the number of the receipt information calculated in the step S3, and executing the step S1;
s6, obtaining a storage address of the last receipt information, and calculating how many receipts are contained in the date according to the difference between the last receipt information address and the receipt information storage address in the current index table;
and S7, reading the receipt information from the first receipt information storage address read in the step S2, wherein the number of the read receipt information is the number of the receipt information calculated in the step S6, and ending the flow.
As shown in fig. 5, in this embodiment, as a preferred embodiment, it is preferable that the step of searching and querying the report information by date range includes:
s1, traversing a report information index table, judging whether the date of the index table is larger than the end date, if so, ending traversal, and if not, executing the step S2;
s2, judging whether the date of the index table is larger than or equal to the starting date, if so, recording the date of the index table and a storage address of the first piece of report information of the current day contained in the index table, and executing the step S3, otherwise, executing the step S1;
s3, judging whether the current index table is the last index table or not, if so, executing a step S6, and otherwise, executing a step S4;
s4, reading a next report information index table, and calculating the number of the report information contained in the date according to the difference value between the report information address in the next index and the report information address in the current index;
s5, reading the report information from the first report information storage address of the current day read in the step S2, wherein the number of the read report information is the number of the report information calculated in the step S3, and executing the step S1;
s6, obtaining a storage address of the last piece of report information, and calculating the number of pieces of report information contained in the date according to the difference value between the address of the last piece of report information and the address of the report information in the current index;
and S7, reading the report information from the first report information storage address of the current day read in the step S2, wherein the number of the read report information is the number of the report information calculated in the step S6, and then ending the process.
Based on the above specific implementation, it can be seen that the date and the tax control data are separately stored by adding the index table, so that data redundancy is greatly reduced, data storage capacity is improved, and data retrieval efficiency is improved.
Taking the example of storing 1000 copies and 4Z reports per day, the traditional tax control machine needs 15 bytes for storing 1 copy, and 41 bytes for storing 1Z Report, so the total number of bytes needed for 1 day is 1000 + 15+4 + 41=15164 bytes. The invention needs 12 bytes for storing 1 piece of Recipt, 38 bytes for storing 1 piece of Z Report, 9 bytes for storing 1 piece of Recipt index and 9 bytes for storing 1 piece of Z Report index, so the required total bytes are 1000 bytes, 12+4 + 38+9+ 12170 bytes.
TABLE 7 data quantity comparison table
Storage space 1 day 100 days 1000 days 3650 days
Traditional tax control machine 15164 bytes 1516400 bytes 15164000 bytes 55348600 bytes
Scheme of the invention 12170 bytes 1217000 bytes 12170000 bytes 44420500 bytes
As shown in the above table, compared with the traditional tax control machine, the space required by the present invention for storing the same amount of data is significantly less, which can save about 20% of space, and the advantages of the present invention are greater and greater with the increase of the storage capacity.
In addition, when querying the relocation or Z Report data by date, the traditional tax control machine needs to traverse the data from the beginning, and determine whether each piece of data matches the query condition, which results in very low query efficiency. The data query of the invention is to find the data storage address of the corresponding date from the index table and then take out the data from the corresponding address, so that the query efficiency is greatly improved.
The following table shows that when 1000 Recipts and 5Z reports are stored every day, only the data of the last day is read, and the time required by the traditional tax control machine and the invention is as follows:
table 8 time-consuming comparison table for data retrieval and query
Storage space 1 day 100 days 1000 days 3650 days
Traditional tax control machine 1.33 seconds 134 seconds 1335 seconds 4856.5 seconds
Scheme of the invention 1.34 seconds 1.36 seconds 1.37 seconds 1.39 seconds
It can be seen from the above table that, as the amount of stored data increases, the query efficiency of data will be obviously reduced, but the solution of the present invention does not have this problem, and as the amount of search query increases, the advantages of the solution of the present invention also become larger and larger.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units may be integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may substantially or partially contribute to the prior art, or all or part of the technical solution may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk, and various media capable of storing program codes.
The above description is only a part of the embodiments of the present invention, and not intended to limit the scope of the present invention, and all equivalent devices or equivalent processes performed by the present invention through the contents of the specification and the drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (5)

1. A tax control record storage method of a tax control machine is characterized by comprising the following steps:
generating receipt information;
generating report information;
storing receipt information and report information;
when the stored receipt information and the report information meet the preset conditions, a receipt information index table and a report information index table are established for retrieval and query;
wherein, the first and the second end of the pipe are connected with each other,
when the receipt information and the report information are stored, the date when the receipt information and the report information are correspondingly established is not written;
when a receipt information index table and a report information index table are not established in the date of generating the receipt information and the report information, establishing the receipt information index table and the report information index table for retrieval and query;
the receipt information index table is composed of the establishment date of the index table, the storage address of the first piece of receipt information stored on the date and the check sum;
the report information index table is composed of the establishing date of the index table, the storage address of the first piece of report information stored under the date, the inspection sum;
in addition, the retrieval query of the receipt information and the report information comprises:
retrieving and inquiring receipt information according to a date range;
searching and inquiring the report information according to the date range;
the step of searching and querying the receipt information according to the date range comprises the following steps:
s1, traversing a receipt information index table, judging whether the date of the index table is larger than the retrieval ending date, if so, ending traversal, otherwise, executing a step S2;
s2, judging whether the date of the index table is larger than or equal to the retrieval starting date, if so, recording the date of the corresponding index table and the storage address of the first receipt information of the date contained in the index table, and executing the step S3, otherwise, executing the step S1;
s3, judging whether the current index is the last index, if so, executing a step S6, otherwise, executing a step S4;
s4, reading a next receipt information index table, and calculating how many receipt information are contained in the date according to the difference value between the receipt information address in the next index table and the receipt information storage address in the current index;
s5, reading receipt information from the first receipt information storage address read in the step S2, wherein the number of the read receipt information is the number of the receipt information calculated in the step S3, and executing the step S1;
s6, obtaining a storage address of the last receipt information, and calculating how many receipts are contained in the date according to the difference between the last receipt information address and the receipt information storage address in the current index table;
s7, reading receipt information from the first receipt information storage address read in the step S2, wherein the number of the read receipt information is the number of the receipt information calculated in the step S6, and then ending the process;
in addition, the steps of searching and querying the report information according to the date range are as follows:
s01, traversing the report information index table, judging whether the date of the index table is larger than the ending date, if so, ending traversal, and if not, executing the step S02;
s02, judging whether the date of the index table is more than or equal to the starting date, if so, recording the date of the index table and the storage address of the first piece of report information of the current day contained in the index table, and executing the step S03, otherwise, executing the step S01;
s03, judging whether the current index table is the last index table, if so, executing a step S6, otherwise, executing a step S04;
s04, reading a next report information index table, and calculating the number of the report information contained in the date according to the difference value between the report information address in the next index and the report information address in the current index;
s05, reading the report information from the first report information storage address of the current day read in the step S02, wherein the number of the read report information is the number of the report information calculated in the step S03, and executing the step S01;
s06, obtaining a storage address of the last piece of report information, and calculating how many pieces of report information are contained in the date according to the difference value between the last piece of report information address and the report information address in the current index;
and S07, reading the report information from the first report information storage address of the current day read in the step S02, wherein the number of the read report information is the number of the report information calculated in the step S06, and ending the process.
2. The tax control record storage method of claim 1, wherein the stored receipt information at least comprises: transaction amount, tax amount, check sum and sequence number of report information synchronously generated with the check sum;
the stored reporting information includes: the serial number of the information reported in this item, the total transaction amount of all the receipt information counted by the information reported in this item, the total tax amount of all the receipt information counted by the information reported in this item, the total transaction amount of all the receipt information, the total tax amount of all the receipt information, the number of the receipt information counted by the information reported in this item, and the checksum.
3. The tax control record storage method of claim 2, wherein the receipt information storage method comprises the following steps:
s001, acquiring a last receipt information index table in the tax control machine;
s002, acquiring the serial number of the last piece of reported information in the tax control machine;
s003, acquiring an available receipt information storage address, writing the receipt information, wherein the serial number of the report information corresponding to the receipt information is the serial number of the report information acquired in the step S002 plus 1, and if the serial number of the report information is not acquired in the step S002, the serial number of the report information corresponding to the receipt information established in the step is set to be 1;
s004, if the receipt information index table is not acquired in the step S001, directly executing the step S005; otherwise, judging whether the generation date of the written receipt information is larger than the recording date of the receipt information index table acquired in the step S001, if so, executing the step S005, otherwise, ending;
and S005, acquiring a storage address of an available receipt information index table, and writing the receipt information index table, wherein the establishment date of the receipt information index table is the generation date of the corresponding receipt information, and the receipt information index table records the storage address of the first receipt information in the date.
4. The tax control record storage method of claim 3, wherein the said method for storing the reported information comprises the following steps:
s0001, acquiring a last report information index table in the tax control machine;
s0002, acquiring an available report information storage address, and writing the report information into the storage address;
s0003, if the report information index table is not acquired in the step S0001, directly executing the step S0004; otherwise, judging whether the generation date of the written report information is larger than the recording date of the report information index table acquired in the step S0001, if so, executing the step S0004, otherwise, ending;
s0004, obtaining the storage address of the available report information index table, writing the report information index table, wherein the establishment date of the report information index table is the generation date of the corresponding report information, and the storage address of the first report information in the date is recorded in the report information index table.
5. A computer-readable storage medium, characterized in that: the storage medium stores at least one instruction, at least one program, code set or instruction set, which is loaded by a processor and executed to implement the tax control record storage method of the tax control machine according to one of claims 1 to 4.
CN202011435046.8A 2020-12-10 2020-12-10 Tax control record storage method and retrieval query method for tax control machine Active CN112527828B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011435046.8A CN112527828B (en) 2020-12-10 2020-12-10 Tax control record storage method and retrieval query method for tax control machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011435046.8A CN112527828B (en) 2020-12-10 2020-12-10 Tax control record storage method and retrieval query method for tax control machine

Publications (2)

Publication Number Publication Date
CN112527828A CN112527828A (en) 2021-03-19
CN112527828B true CN112527828B (en) 2023-03-14

Family

ID=74999130

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011435046.8A Active CN112527828B (en) 2020-12-10 2020-12-10 Tax control record storage method and retrieval query method for tax control machine

Country Status (1)

Country Link
CN (1) CN112527828B (en)

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1851708A (en) * 2006-04-30 2006-10-25 山东浪潮电子设备有限公司 Indefinite-long tax-controlled electronic invoice storage method
EP2490135A1 (en) * 2011-02-21 2012-08-22 Amadeus S.A.S. Method and system for providing statistical data from a data warehouse
CN103544790B (en) * 2012-07-11 2016-06-01 北京旋极信息技术股份有限公司 The treatment process of a kind of invoice tax control data
CN102902797B (en) * 2012-10-11 2015-05-20 福建亿同世纪软件有限公司 Method for storing and retrieving real-time monitored data of large-volume equipment
CN105446991B (en) * 2014-07-07 2018-10-30 阿里巴巴集团控股有限公司 Date storage method, querying method and equipment
CN104778203B (en) * 2015-02-10 2017-12-15 武汉阿迪克电子股份有限公司 Take the storage of load record block index and querying method in control intelligent electric energy meter
CN106933836B (en) * 2015-12-29 2021-07-06 航天信息股份有限公司 Data storage method and system based on sub-tables
CN108205562B (en) * 2016-12-19 2022-04-08 千寻位置网络有限公司 Positioning data storage and retrieval method and device for geographic information system
WO2020211569A1 (en) * 2019-04-18 2020-10-22 创新先进技术有限公司 Method for constructing index of data record
CN110347679B (en) * 2019-06-20 2020-08-04 阿里巴巴集团控股有限公司 Data storage method, device and equipment based on receipt

Also Published As

Publication number Publication date
CN112527828A (en) 2021-03-19

Similar Documents

Publication Publication Date Title
US8386435B2 (en) Searchable archive
US5390113A (en) Method and electronic apparatus for performing bookkeeping
US6907426B2 (en) Systems and methods for identifying and counting instances of temporal patterns
US7406489B2 (en) Apparatus, system and method for persistently storing data in a data synchronization process
CN107491523A (en) The method and device of data storage object
CN107391544B (en) Processing method, device and equipment of column type storage data and computer storage medium
CN110399380A (en) A kind of data processing method, electronic device and storage medium
CN110399333B (en) Method, apparatus and computer program product for deleting snapshots
CN110096509A (en) Realize that historical data draws the system and method for storage of linked list modeling processing under big data environment
WO2020119143A1 (en) Database deleted record recovery method and system
CN114265834A (en) Distributed time sequence database storage engine method, device and medium
CN115292266A (en) High-reliability log storage method based on memory
CN107729504A (en) A kind of method and system for handling large data objectses
CN109753378A (en) A kind of partition method of memory failure, device, system and readable storage medium storing program for executing
CN108280226B (en) Data processing method and related equipment
CN116257523A (en) Column type storage indexing method and device based on nonvolatile memory
WO2006095356A1 (en) A method of logging transactions and a method of reversing a transaction
CN112527828B (en) Tax control record storage method and retrieval query method for tax control machine
CN113641681B (en) Space self-adaptive mass data query method
CN109408416B (en) Address mapping table entry page management method and device
CN106897174B (en) Fragment recovery method for MYSQL database
GB2614676A (en) Managing least-recently-used data cache with persistent body
TWI630496B (en) Data storage method and system thereof
CN111626736A (en) Method for accelerating transaction response rate of hotspot account
WO2024124717A1 (en) Backup deduplication 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