CN110851441A - Data storage method and related equipment - Google Patents

Data storage method and related equipment Download PDF

Info

Publication number
CN110851441A
CN110851441A CN201910975624.8A CN201910975624A CN110851441A CN 110851441 A CN110851441 A CN 110851441A CN 201910975624 A CN201910975624 A CN 201910975624A CN 110851441 A CN110851441 A CN 110851441A
Authority
CN
China
Prior art keywords
data
data table
subject
stored
report
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910975624.8A
Other languages
Chinese (zh)
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.)
Chongqing Financial Assets Exchange LLC
Original Assignee
Chongqing Financial Assets Exchange LLC
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 Chongqing Financial Assets Exchange LLC filed Critical Chongqing Financial Assets Exchange LLC
Priority to CN201910975624.8A priority Critical patent/CN110851441A/en
Publication of CN110851441A publication Critical patent/CN110851441A/en
Pending legal-status Critical Current

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Human Resources & Organizations (AREA)
  • Strategic Management (AREA)
  • General Physics & Mathematics (AREA)
  • Operations Research (AREA)
  • Tourism & Hospitality (AREA)
  • Quality & Reliability (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention discloses a data storage method and related equipment, wherein the method is applied to the technical field of data storage and comprises the following steps: acquiring report information of a report to be stored, wherein the report information comprises a header table corresponding to the report to be stored and a data table corresponding to the report to be stored; counting the number of the reports to be stored, and determining a target storage mode of a header table from at least one preset storage mode of the header table according to the number of the reports to be stored; detecting the number of subject attribute fields and the number of subject fields in a data table, and determining a target storage mode of the data table from at least one preset data table storage mode based on the number of the subject attribute fields and the number of the subject fields; and storing the header table according to the target storage mode of the header table, and storing the data table according to the target storage mode of the data table. By adopting the data storage mode, the occupation of the report data on the storage space can be reduced.

Description

Data storage method and related equipment
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a data storage method and related devices.
Background
With the popularization of intelligent office, enterprise managers can obtain a large amount of enterprise information from data reports. Due to diversification of enterprise business, data in the data report is increased rapidly. In the existing office, a two-dimensional report is generally stored in a mode of converting the two-dimensional report into a one-dimensional report, namely, a report subject and a subject attribute are combined to be used as fields. Therefore, how to reduce the occupation of the storage space by the report data storage becomes a problem to be solved urgently.
Disclosure of Invention
The embodiment of the invention provides a data storage method and related equipment, which can reduce the occupation of report data on storage space.
In a first aspect, an embodiment of the present invention provides a data storage method, where the method is applied to a server, and the method includes:
when a storage instruction for a report to be stored is received, acquiring report information of the report to be stored, wherein the report information comprises a header table corresponding to the report to be stored and a data table corresponding to the report to be stored;
counting the number of the to-be-stored reports, and determining a target storage mode aiming at the header table from at least one preset header table storage mode according to the number of the to-be-stored reports, wherein the at least one preset header table storage mode comprises a one-to-one storage mode and a general table storage mode;
detecting the number of subject attribute fields and the number of subject fields in the data table, and determining a target storage mode aiming at the data table from at least one preset data table storage mode based on the number of the subject attribute fields and the number of the subject fields, wherein the at least one preset data table storage mode comprises a turnover storage mode;
and storing the header table according to the target storage mode of the header table, and storing the data table according to the target storage mode of the data table.
In one embodiment, the number of the report to be stored is at least one, the target storage manner of the header table is the general table storage manner, and the specific implementation manner of storing the header table according to the target storage manner of the header table is as follows:
creating a general table head table aiming at the table head table corresponding to each report to be stored in the at least one report to be stored according to the general table storage mode;
and storing the header tables corresponding to the to-be-stored reports to the universal header table.
In one embodiment, after storing the header table according to the target storage manner of the header table, the memory occupancy rate of the server may be periodically detected; and when the memory occupancy rate is detected to be less than or equal to the preset memory occupancy rate threshold value, storing the header table in the one-to-one storage mode.
In an embodiment, the target storage manner of the data table is the flip storage manner, and the specific implementation manner of storing the data table according to the target storage manner of the data table is as follows:
acquiring subject attribute data corresponding to the subject attribute field and subject data corresponding to the subject field from the data table;
and turning the subject attribute data and the subject data in the data table to obtain a first data table, and storing the first data table to a database.
In an embodiment, after the first data table is stored in the database, when a lookup request for the first data table is detected, subject attribute data corresponding to the subject attribute and subject data corresponding to the subject field may be further acquired from the first data table;
turning the subject attribute data and the subject data in the first data table to obtain a second data table;
and outputting the second data table.
In one embodiment, after the second data table is output, the number of times of reference for the first data table can be counted; and when the reference times are detected to be larger than a preset reference time threshold value, storing the second data table to a database.
Or, in another embodiment, after counting the number of times of reference with respect to the first data table, when it is detected that the number of times of reference is less than or equal to the preset threshold value of number of times of reference, subject attribute data corresponding to the subject attribute and subject data corresponding to the subject field may be obtained from the second data table; turning the subject attribute data and the subject data in the second data table to obtain a turned second data table; and storing the second data table after the turning processing to the database.
In a second aspect, embodiments of the present invention provide a data storage apparatus comprising means for performing the method of the first aspect.
In a third aspect, an embodiment of the present invention provides a server, which includes a processor, a network interface, and a memory, where the processor, the network interface, and the memory are connected to each other, where the network interface is controlled by the processor to send and receive messages, the memory is used to store a computer program that supports the server to execute the above method, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method of the first aspect.
In a fourth aspect, the present invention provides a computer-readable storage medium storing a computer program, the computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method of the first aspect.
In the embodiment of the application, when the server receives a storage instruction for the report to be stored, the header table corresponding to the report to be stored and the data table corresponding to the report to be stored are obtained, and the number of the report to be stored is counted. The server determines a target storage mode aiming at the header table from at least one preset header table storage mode according to the number of the reports to be stored, wherein the at least one preset header table storage mode comprises a one-to-one storage mode and a general table storage mode. Further, the server detects the number of subject attribute fields and the number of subject fields in the data table, and determines a target storage mode for the data table from at least one preset data table storage mode based on the number of subject attribute fields and the number of subject fields, wherein the at least one preset data table storage mode comprises a flip storage mode. Further, the server may store the header table according to a target storage manner of the header table, and store the data table according to a target storage manner of the data table. By adopting the data storage mode, the occupation of the report data on the storage space can be reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a data storage method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a flipping operation according to an embodiment of the present invention;
FIG. 3 is a flow chart of another data storage method provided by the embodiment of the invention;
FIG. 4 is a schematic block diagram of a data storage device provided by an embodiment of the present invention;
fig. 5 is a schematic block diagram of a server according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flowchart of a data storage method provided in an embodiment of the present invention, where the method is applied to a server and may be executed by the server, and as shown in the figure, the data storage method may include:
s101: when a storage instruction for a report to be stored is received, report information of the report to be stored is obtained, wherein the report information comprises a header table corresponding to the report to be stored and a data table corresponding to the report to be stored.
The report to be stored may be a balance sheet, a profit sheet, a cash flow sheet, an owner's equity change sheet, a financial statement note, and the like, which is not specifically limited in this embodiment of the present application.
The storage instruction may be a single storage instruction or a batch storage instruction. In an embodiment, when a user wants to store any report, a single storage instruction can be input for any report through a terminal device, and further, when the server receives the single storage instruction, any report can be determined as a report to be stored, and report information of the report to be stored is acquired.
Or, in another embodiment, when the user wants to store a plurality of reports in batch, the user may select a plurality of reports through the terminal device, input a batch storage instruction for the plurality of reports, and create a to-be-stored report storage space for the plurality of reports, further, the server circularly detects the plurality of reports in the to-be-stored report storage space, when an unprocessed to-be-stored report is detected, determines that the to-be-stored report is an unprocessed report, obtains report information of the to-be-stored report, stores the obtained report information according to the execution steps S102 to S104, and erases the unprocessed report from the to-be-stored report storage space. And when the storage space of the report to be stored is empty, judging that the cycle is ended.
In one embodiment, a user can make a report on a terminal device by editing a data document, and when the terminal device detects that the report is made completely, a storage instruction for the report can be sent to a server. Further, when the server receives the storage instruction, the server can determine the report as a report to be stored, and obtain report information of the report to be stored.
S102: counting the number of the to-be-stored reports, and determining a target storage mode aiming at the header table from at least one preset header table storage mode according to the number of the to-be-stored reports, wherein the at least one preset header table storage mode comprises a one-to-one storage mode and a general table storage mode.
In one embodiment, the system sets a threshold of the number of reports to be stored in advance, and if the number of the reports to be stored is detected to be less than or equal to the threshold of the number of the reports to be stored, a one-to-one storage mode can be determined as a target storage mode from at least one preset header table storage mode; if the number of the reports to be stored is larger than the threshold value of the number of the reports to be stored, the general table storage mode can be determined as the target storage mode from at least one preset table header table storage mode. The report quantity threshold to be stored is preset according to the experimental measurement and calculation data, and can be adjusted subsequently according to requirements.
S103: detecting the number of subject attribute fields and the number of subject fields in a data table, and determining a target storage mode aiming at the data table from at least one preset data table storage mode based on the number of the subject attribute fields and the number of the subject fields, wherein the at least one preset data table storage mode comprises a turnover storage mode.
In one embodiment, after receiving a storage instruction for a to-be-stored report, a server acquires report information of the to-be-stored report, wherein the report information includes a header table of the to-be-stored report and a data table of the to-be-stored report; detecting the number of subject attribute fields and the number of subject fields in a data table, and if the number of the subject fields is larger than the number of the subject attribute fields, determining the turnover storage mode as a target storage mode; and if the number of the subject fields is detected to be less than or equal to the number of the subject attribute fields, determining the non-turnover storage mode as a target storage mode.
The subject attribute field is a first row field of the data table, and the subject field is a first column field of the data table. Illustratively, as shown in Table 1-1:
TABLE 1-1
Figure BDA0002230414620000051
Wherein "end balance", "early year balance" is the subject attribute field in the enterprise balance sheet, and "monetary funds", "advance data", "holding assets for sale" is the subject field in the enterprise balance sheet.
S104: and storing the header table according to the target storage mode of the header table, and storing the data table according to the target storage mode of the data table.
In one embodiment, if the target storage manner of the header table is a one-to-one storage manner, the header table in the report to be stored is stored according to a one-to-one correspondence relationship between the header table and the data table, that is, one header table corresponds to one data table.
Illustratively, the header table stored in the one-to-one storage manner is as shown in tables 1-2:
tables 1 to 2
Figure BDA0002230414620000061
The table with the suffix of _ h is a header table corresponding to each report to be stored, and the table with the suffix of _ d is a data table corresponding to each report to be stored.
If the target storage mode of the header table is a general table storage mode, a general header table aiming at the header table corresponding to each report to be stored in at least one report to be stored is established according to the general table storage mode, and association characters of the data table corresponding to each report to be stored and associated with the header table corresponding to each report to be stored are established in the general header table.
Illustratively, the general header table obtained by the general table storage method is shown in tables 1 to 3:
tables 1 to 3
Figure BDA0002230414620000062
The server can inquire the data tables corresponding to the table head tables through the associated characters, and the second column field in the general table head table is the name of the table head table corresponding to each report form to be stored.
In another embodiment, the target storage mode of the header table is a general table storage mode, the header table is stored according to the target storage mode of the header table, after the general header table is obtained, the memory occupancy rate of the server can be periodically detected, and when the memory occupancy rate is detected to be less than or equal to a preset memory occupancy rate threshold value, the general header table is stored by adopting the one-to-one storage mode. The periodic detection period is preset according to experimental measurement and calculation data, and can be modified subsequently according to requirements.
Illustratively, after storing the header table according to the common table storage manner, the resulting common header table is shown in tables 1 to 3. For this situation, when detecting that the memory occupancy is less than or equal to the preset memory occupancy threshold, the server may obtain each associated character data corresponding to the associated character field in the general header table shown in tables 1 to 3 and each header name data corresponding to the header name field, create each header table according to the each header name data, find the data table name corresponding to each header name according to the each associated character data, name each header table corresponding to the data table with the data table name, and place the name with a different file suffix to indicate the difference. The general header table stored in the one-to-one storage manner is shown in table 1-2. The tables with the suffix of _ h are all header table sub-tables, and the tables with the suffix of _ d are data tables corresponding to all header table sub-tables.
In one embodiment, if the target storage mode of the data table is an inverted storage mode, acquiring subject attribute data corresponding to the number of subject attribute fields of the data table and the subject attribute fields of the data table and subject data corresponding to the number of subject fields of the data table and the subject fields of the data table from the data table, performing inverted processing on the subject attribute data and the subject data in the data table to obtain a first data table, and storing the first data table into a database; and if the target storage mode of the data table is a non-turnover storage mode, storing the data table to a database based on the self format of the data table.
The flipping process includes converting the row field of the data table into the column field, and converting the column field of the data table into the row field. Illustratively, the flipping process is shown in fig. 2, where in fig. 2, tables 2-1 and 2-2 are included, where in table 2-1, the subject attribute field is a field in the first row, and is "end-of-term balance" or "early-of-year balance", respectively. The subject field is the first column of fields, respectively "monetary funds", "derivative financial assets", "prepaid terms", "other accounts receivable". In table 2-1, the subject field is converted into a row field, and the subject attribute field is converted into a column field, so that as shown in table 2-2, the fields with the subject attributes in the first column are "end-of-term balance" and "early-of-year balance", respectively. The subject fields are the fields of the first row, respectively "monetary funds", "derivative financial assets", "prepaid terms", "other accounts receivable".
For example, in the case of the asset liability table, the original asset liability table and the subject attributes need three fields in total, namely end-of-term balance, early-of-year balance and remarks, and the subject field in each report example is 69 fields. In one embodiment, when the table is stored in the database, 7 system fields are needed in addition to the data of the report, and the storage space occupied by the data table is as follows: 69 x (3+7) ═ 690. According to the data storage method in this embodiment, the number of the subject attribute fields is 3 and 69, the subject attribute fields and the subject fields are turned over and then stored, and the storage space occupied by the turned data table is: and 3 × (69+7) ═ 228. Compared with the storage space occupied by the data table before the overturning processing, the storage space of the data table stored after the overturning processing is saved by 70% in total.
When the data table is stored in a flip storage manner, it is necessary to require that the data types of all subject fields of the same subject are consistent, and the data types of the subject attribute fields included in the data table may be inconsistent. For this case, in one embodiment, the server may employ a create data table information branch table to store the subject attribute data for the subject attribute fields of different data types.
Illustratively, the table of data to be stored is shown in tables 1-4:
tables 1 to 4
Subject of the scientific discipline End of term balance Balance at beginning of year Remark information
Subject 1 BigDecimal data type BigDecimal data type Chinese remarks
Subject 2 BigDecimal data type BigDecimal data type Chinese remarks
BigDecimal data type BigDecimal data type Chinese remarks
Subject 69 BigDecimal data type BigDecimal data type Chinese remarks
After the server executes S101-S104, the data table corresponding to the report to be stored is stored in a turnover storage mode, the subject field data corresponding to the subject 1 field comprises end balance data, early balance data and remark information data corresponding to the subject 1 field, and as the data types of the end balance and the early balance attribute field are BigDecimal data types, but the remark information is Chinese remarks, the data type of the remark information attribute field does not belong to the BigDecimal data type, the data table cannot be subjected to turnover processing, and the data table cannot be stored in a turnover storage mode. For this situation, the server may create a remark information branch table, store the remark information field in the subject attribute field in the remark information branch table, and create an identifier of the data table corresponding to the remark information field in the remark information branch table. The data table subject attribute field is changed from three subject attribute fields of end-of-term balance, early-of-year balance and remark information into two subject attribute fields containing end-of-term balance and early-of-year balance. The data table of the note removing information attribute field occupies a storage space of 69 × (2+7) ═ 621. According to the data storage method in this embodiment, the number of the subject attribute fields is 2 and 69, the subject attribute fields and the subject fields are turned over and then stored, and the storage space occupied by the turned data table is: 2 × (69+7) ═ 152. Compared with the storage space occupied by the data table before the overturning processing, the storage space of the data table stored after the overturning processing is saved by 75 percent in total.
In the embodiment of the application, a user can send a single storage instruction or a batch storage instruction for the report to be stored to the server or make the report in a data document editing mode, and when the terminal device detects that the report is made, the terminal device sends the storage instruction for the report to the server. The server receives the storage instruction aiming at the report to be stored, and then obtains the report information of the report to be stored, wherein the report information comprises a header table corresponding to the report to be stored and a data table corresponding to the report to be stored; counting the number of the to-be-stored reports, and determining a target storage mode aiming at the header table from at least one preset header table storage mode according to the number of the to-be-stored reports, wherein the at least one preset header table storage mode comprises a one-to-one storage mode and a general table storage mode. The server detects the number of subject attribute fields and the number of subject fields in the data table, and determines a target storage mode for the data table from at least one preset data table storage mode based on the number of the subject attribute fields and the number of the subject fields, wherein the at least one preset data table storage mode comprises a turnover storage mode. Further, the server stores the header table according to the target storage mode of the header table, and stores the data table according to the target storage mode of the data table. By adopting the data storage mode, the occupation of the report data on the storage space can be reduced.
Referring to fig. 3, fig. 3 is a schematic diagram of another data storage method provided by an embodiment of the present invention, where the method is applied to a server and may be executed by the server, and as shown in the figure, the data storage method may include:
s301: when a storage instruction for a report to be stored is received, report information of the report to be stored is obtained, wherein the report information comprises a header table corresponding to the report to be stored and a data table corresponding to the report to be stored.
S302: counting the number of the to-be-stored reports, and determining a target storage mode aiming at the header table from at least one preset header table storage mode according to the number of the to-be-stored reports, wherein the at least one preset header table storage mode comprises a one-to-one storage mode and a general table storage mode.
S303: detecting the number of subject attribute fields and the number of subject fields in the data table, and determining a target storage mode aiming at the data table from at least one preset data table storage mode based on the number of the subject attribute fields and the number of the subject fields, wherein the target storage mode of the data table is a turnover storage mode. For specific implementation of steps S301 to S303, reference may be made to the detailed description of steps S101 to S103 in the above embodiment, which is not described herein again.
S304: and storing the header table according to the target storage mode of the header table, acquiring subject attribute data corresponding to the subject attribute field and subject data corresponding to the subject field from the data table, turning the subject attribute data and the subject data in the data table to obtain a first data table, and storing the first data table in a database.
S305: when a lookup request aiming at a first data table is detected, acquiring subject attribute data corresponding to a subject attribute field and subject data corresponding to the subject field from the first data table, turning the subject attribute data and the subject data in the first data table to obtain a second data table, and outputting the second data table.
In one embodiment, the data tables that users are accustomed to look up are shown in tables 1-4, the first row field is a subject attribute field, the first column field is a subject field, and the first row field of the first data table is a subject field, the first column field is a subject attribute field, and the data tables do not conform to the users' viewing habits. For the situation, a user sends a lookup request aiming at a first data table to a server through a user terminal connected with the server, when the server detects the lookup request aiming at the first data table, the server acquires subject attribute data corresponding to a subject attribute field and subject data corresponding to the subject field from the first data table, the subject attribute data and the subject data in the first data table are overturned to obtain a second data table, the second data table is output to the user terminal connected with the server, and the second data table is displayed through a display screen of the user terminal.
In one embodiment, when the server executes a lookup request for the first data table, the first data table needs to be turned over to obtain the second data table for the user to look up, and when the first data table is frequently looked up by the user, the lookup rate is relatively low. For the situation, after the second data table is output, counting the number of times of reference aiming at the first data table, and if the number of times of reference is detected to be larger than a preset reference time threshold value, storing the second data table into a database; if the number of times of reference is smaller than or equal to a preset number of times of reference threshold value, acquiring subject attribute data corresponding to the subject attribute and subject data corresponding to the subject field from the second data table, and turning the subject attribute data and the subject data in the second data table to obtain a turned second data table; and storing the second data table after the overturning processing to a database. The preset reference frequency threshold value is preset according to the experimental measurement and calculation data, and can be subsequently modified according to requirements.
In the embodiment of the application, when the server receives a storage instruction for the report to be stored, the header table corresponding to the report to be stored and the data table corresponding to the report to be stored are obtained, and the number of the report to be stored is counted. The server determines a target storage mode aiming at the header table from at least one preset header table storage mode according to the number of the reports to be stored, wherein the at least one preset header table storage mode comprises a one-to-one storage mode and a general table storage mode. Further, the server detects the number of subject attribute fields and the number of subject fields in the data table, and determines a target storage mode for the data table from at least one preset data table storage mode based on the number of subject attribute fields and the number of subject fields, wherein the target storage mode of the data table is an inverted storage mode. Further, the server may store the header table according to a target storage manner of the header table, and store the data table according to a target storage manner of the data table. Further, after the data table corresponding to the report to be stored is stored in the database in the above-mentioned flip storage manner, and the first data table is obtained, when a lookup request for the first data table is received, the subject attribute data corresponding to the subject attribute field and the subject data corresponding to the subject field of the first data table are obtained, the subject attribute data and the subject data in the first data table are subjected to flip processing to obtain a second data table, the second data table is output to the user terminal connected to the server, and the second data table is displayed through the user terminal display screen. By adopting the data storage mode, the occupation of the report data on the storage space can be reduced, and the looking-up habit of a user is kept.
The embodiment of the invention also provides a data storage device. The apparatus includes a module configured to execute the method described in fig. 1 or fig. 3, and is configured to the server. Specifically, referring to fig. 4, a schematic block diagram of a data storage device according to an embodiment of the present invention is provided. The data storage device of the present embodiment includes:
the acquiring module 40 is configured to receive a storage instruction for a report to be stored, and acquire report information of the report to be stored, where the report information includes a header table corresponding to the report to be stored and a data table corresponding to the report to be stored;
the processing module 41 is configured to count the number of the reports to be stored, and determine, according to the number of the reports to be stored, a target storage manner other than the target storage manner for the header table from at least one preset header table storage manner, where the at least one preset header table storage manner includes a one-to-one storage manner and a general table storage manner;
the processing module 41 is further configured to detect the number of subject attribute fields and the number of subject fields in the data table, and determine, based on the number of subject attribute fields and the number of subject fields, a target storage manner for the data table from at least one preset data table storage manner, where the at least one preset data table storage manner includes a flip storage manner;
and the storage module 42 is configured to store the header table according to the target storage manner of the header table, and store the data table according to the target storage manner of the data table.
In an embodiment, the number of the report forms to be stored is at least one, the target storage mode of the header table is the general table storage mode, and the storage module 42 is further configured to create a general header table for the header table corresponding to each report form to be stored in the at least one report form to be stored according to the general table storage mode; and storing the header tables corresponding to the to-be-stored reports to the universal header table.
In an embodiment, the processing module 41 is further configured to periodically detect a memory usage rate of the server; and when the memory occupancy rate is detected to be less than or equal to the preset memory occupancy rate threshold value, storing the header table in the one-to-one storage mode.
In an embodiment, the target storage manner of the data table is the flip storage manner, and the storage module 42 is further configured to obtain, from the data table, subject attribute data corresponding to the subject attribute field and subject data corresponding to the subject field; and turning the subject attribute data and the subject data in the data table to obtain a first data table, and storing the first data table to a database.
In an embodiment, after the first data table is stored in the database, the processing module 41 is further configured to, when a lookup request for the first data table is detected, obtain, from the first data table, subject attribute data corresponding to the subject attribute field and subject data corresponding to the subject field; turning the subject attribute data and the subject data in the first data table to obtain a second data table; and outputting the second data table.
In one embodiment, after the outputting the second data table, the processing module 41 is further configured to count the number of times of referring to the first data table; and when the reference times are detected to be larger than a preset reference time threshold value, storing the second data table to a database.
In an embodiment, the processing module 41 is further configured to, when it is detected that the reference number is less than or equal to the preset reference number threshold, obtain, from the second data table, subject attribute data corresponding to the subject attribute and subject data corresponding to the subject field; turning the subject attribute data and the subject data in the second data table to obtain a turned second data table; and storing the second data table after the turning processing to the database.
It should be noted that the functions of the functional modules of the data storage device described in the embodiment of the present invention may be specifically implemented according to the method in the embodiment of the method described in fig. 1 or fig. 3, and the specific implementation process may refer to the description related to the embodiment of the method in fig. 1 or fig. 3, which is not described herein again.
Referring to fig. 5, fig. 5 is a schematic block diagram of a server according to an embodiment of the present invention, and as shown in fig. 5, the server includes a processor 501, a memory 502, and a network interface 503. The processor 501, the memory 502 and the network interface 503 may be connected by a bus or other means, and are illustrated in fig. 5 as being connected by a bus in the embodiment of the present invention. Wherein the network interface 503 is controlled by the processor for transceiving messages, the memory 502 is for storing a computer program comprising program instructions, and the processor 501 is for executing the program instructions stored by the memory 502. Wherein the processor 501 is configured to call the program instruction to perform: receiving a storage instruction aiming at a report to be stored, and acquiring a header table corresponding to the report to be stored and a data table corresponding to the report to be stored; counting the number of the to-be-stored reports, and determining a target storage mode for the header table from at least one preset header table storage mode according to the number of the to-be-stored reports, wherein the at least one preset header table storage mode comprises a one-to-one storage mode and a general table storage mode; detecting the number of subject attribute fields and the number of subject fields in the data table, and determining a target storage mode aiming at the data table from at least one preset data table storage mode based on the number of the subject attribute fields and the number of the subject fields, wherein the at least one preset data table storage mode comprises a turnover storage mode; and storing the header table according to the target storage mode of the header table, and storing the data table according to the target storage mode of the data table.
In an embodiment, the number of the report forms to be stored is at least one, the target storage manner of the header table is the general table storage manner, and the processor 501 is further configured to create a general header table for the header table corresponding to each report form to be stored in the at least one report form to be stored according to the general table storage manner; and storing the header tables corresponding to the to-be-stored reports to the universal header table.
In an embodiment, the processing module 501 is further configured to periodically detect a memory occupancy rate of the server; and when the memory occupancy rate is detected to be less than or equal to the preset memory occupancy rate threshold value, storing the header table in the one-to-one storage mode.
In an embodiment, the target storage manner of the data table is the flip storage manner, and the storage module 502 is further configured to obtain, from the data table, subject attribute data corresponding to the subject attribute field and subject data corresponding to the subject field; and turning the subject attribute data and the subject data in the data table to obtain a first data table, and storing the first data table to a database.
In an embodiment, after the first data table is stored in the database, the processing module 501 is further configured to, when a lookup request for the first data table is detected, obtain, from the first data table, subject attribute data corresponding to the subject attribute field and subject data corresponding to the subject field; turning the subject attribute data and the subject data in the first data table to obtain a second data table; and outputting the second data table.
In one embodiment, after the outputting the second data table, the processing module 501 is further configured to count the number of times of referring to the first data table; and when the reference times are detected to be larger than a preset reference time threshold value, storing the second data table to a database.
In an embodiment, the processing module 501 is further configured to, when it is detected that the reference number is smaller than or equal to the preset reference number threshold, obtain, from the second data table, subject attribute data corresponding to the subject attribute and subject data corresponding to the subject field; turning the subject attribute data and the subject data in the second data table to obtain a turned second data table; and storing the second data table after the turning processing to the database.
In one embodiment, when a user-side reference request is detected, the server performs the above-mentioned reference request operation and outputs a reference report through the network interface 503.
It should be understood that, in the embodiment of the present invention, the Processor 501 may be a Central Processing Unit (CPU), and the Processor 501 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 502 may include both read-only memory and random access memory, and provides instructions and data to the processor 501. A portion of the memory 502 may also include non-volatile random access memory. For example, the memory 502 may also store device type information.
In a specific implementation, the processor 501, the memory 502, and the network interface 503 described in this embodiment of the present invention may execute the implementation described in the method embodiment shown in fig. 1 or fig. 3 provided in this embodiment of the present invention, and may also execute the implementation of the data storage device described in this embodiment of the present invention, which is not described herein again.
In another embodiment of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing a computer program comprising program instructions that when executed by a processor implement: receiving a storage instruction aiming at least one report to be stored, acquiring a header table corresponding to the report to be stored and a data table corresponding to the report to be stored, and counting the number of the reports to be stored; determining a target storage mode aiming at the header table from at least one preset header table storage mode according to the number of the reports to be stored, wherein the at least one preset header table storage mode comprises a one-to-one storage mode and a general table storage mode; detecting the number of subject attribute fields and the number of subject fields in the data table, and determining a target storage mode aiming at the data table from at least one preset data table storage mode based on the number of the subject attribute fields and the number of the subject fields, wherein the at least one preset data table storage mode comprises a turnover storage mode; the server can store the header table according to the target storage mode of the header table and store the data table according to the target storage mode of the data table. By adopting the data storage method, the occupation of the report data on the storage space can be reduced.
The computer readable storage medium may be an internal storage unit of the server according to any of the foregoing embodiments, for example, a hard disk or a memory of the server. The computer readable storage medium may also be an external storage device of the server, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the server. Further, the computer-readable storage medium may also include both an internal storage unit of the server and an external storage device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the server. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a number of embodiments, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A data storage method is applied to a server and comprises the following steps:
when a storage instruction for a report to be stored is received, acquiring report information of the report to be stored, wherein the report information comprises a header table corresponding to the report to be stored and a data table corresponding to the report to be stored;
counting the number of the to-be-stored reports, and determining a target storage mode aiming at the header table from at least one preset header table storage mode according to the number of the to-be-stored reports, wherein the at least one preset header table storage mode comprises a one-to-one storage mode and a general table storage mode;
detecting the number of subject attribute fields and the number of subject fields in the data table, and determining a target storage mode aiming at the data table from at least one preset data table storage mode based on the number of the subject attribute fields and the number of the subject fields, wherein the at least one preset data table storage mode comprises a turnover storage mode;
and storing the header table according to the target storage mode of the header table, and storing the data table according to the target storage mode of the data table.
2. The method according to claim 1, wherein the number of the report to be stored is at least one, the target storage manner of the header table is the general table storage manner, and the storing of the header table according to the target storage manner of the header table comprises:
creating a general table head table aiming at the table head table corresponding to each report to be stored in the at least one report to be stored according to the general table storage mode;
and storing the header tables corresponding to the to-be-stored reports to the universal header table.
3. The method of claim 2, wherein after storing the header table according to the target storage manner of the header table, the method further comprises:
periodically detecting the memory occupancy rate of the server;
and when the memory occupancy rate is detected to be less than or equal to the preset memory occupancy rate threshold value, storing the header table in the one-to-one storage mode.
4. The method according to claim 1, wherein the target storage manner of the data table is the flip storage manner, and the storing the data table according to the target storage manner of the data table comprises:
acquiring subject attribute data corresponding to the subject attribute field and subject data corresponding to the subject field from the data table;
and turning the subject attribute data and the subject data in the data table to obtain a first data table, and storing the first data table to a database.
5. The method of claim 4, wherein after storing the first data table in a database, the method further comprises:
when a lookup request aiming at the first data table is detected, acquiring subject attribute data corresponding to the subject attribute field and subject data corresponding to the subject field from the first data table;
turning the subject attribute data and the subject data in the first data table to obtain a second data table;
and outputting the second data table.
6. The method of claim 5, wherein after outputting the second data table, the method further comprises:
counting the number of times of reference aiming at the first data table;
and when the reference times are detected to be larger than a preset reference time threshold value, storing the second data table to a database.
7. The method of claim 6, wherein after counting the number of references to the first data table, the method further comprises:
when the reference times are detected to be smaller than or equal to the preset reference time threshold, acquiring subject attribute data corresponding to the subject attributes and subject data corresponding to the subject fields from the second data table;
turning the subject attribute data and the subject data in the second data table to obtain a turned second data table;
and storing the second data table after the turning processing to the database.
8. A data storage device, characterized in that the device comprises:
the device comprises an acquisition module, a storage module and a storage module, wherein the acquisition module is used for receiving a storage instruction for a report to be stored and acquiring report information of the report to be stored, and the report information comprises a header table corresponding to the report to be stored and a data table corresponding to the report to be stored;
the processing module is used for counting the number of the reports to be stored, and determining a target storage mode except for the header table from at least one preset header table storage mode according to the number of the reports to be stored, wherein the at least one preset header table storage mode comprises a one-to-one storage mode and a general table storage mode;
the processing module is further configured to detect the number of subject attribute fields and the number of subject fields in the data table, and determine a target storage manner for the data table from at least one preset data table storage manner based on the number of subject attribute fields and the number of subject fields, where the at least one preset data table storage manner includes a flip storage manner;
and the storage module is used for storing the header table according to the target storage mode of the header table and storing the data table according to the target storage mode of the data table.
9. A server, comprising a processor and a memory, the processor and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, and wherein the processor is configured to invoke the program instructions to perform the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program, which is executed by a processor to implement the method of any one of claims 1-7.
CN201910975624.8A 2019-10-12 2019-10-12 Data storage method and related equipment Pending CN110851441A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910975624.8A CN110851441A (en) 2019-10-12 2019-10-12 Data storage method and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910975624.8A CN110851441A (en) 2019-10-12 2019-10-12 Data storage method and related equipment

Publications (1)

Publication Number Publication Date
CN110851441A true CN110851441A (en) 2020-02-28

Family

ID=69597586

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910975624.8A Pending CN110851441A (en) 2019-10-12 2019-10-12 Data storage method and related equipment

Country Status (1)

Country Link
CN (1) CN110851441A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723210A (en) * 2020-06-29 2020-09-29 深圳壹账通智能科技有限公司 Method and device for storing data table, computer equipment and readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100070491A1 (en) * 2008-09-18 2010-03-18 International Business Machines Corporation Dynamic Contextual Table Headers
CN104461790A (en) * 2014-11-20 2015-03-25 中国科学院自动化研究所 Selectivity triple-modular redundancy method based on lookup table observability measurement
CN104679453A (en) * 2013-12-03 2015-06-03 航天信息股份有限公司 Information input, storage, typesetting and printing general system and information input, storage, typesetting and printing method
CN105335459A (en) * 2015-09-24 2016-02-17 四川长虹电器股份有限公司 XBRL intelligent report platform based statement consolidation data extraction method
CN106156075A (en) * 2015-03-31 2016-11-23 中国科学院声学研究所 A kind of report generation and the method and device of displaying
CN108594943A (en) * 2018-04-27 2018-09-28 阮晓萍 A kind of travel agency tourist data management system
CN109299098A (en) * 2018-09-29 2019-02-01 北京理工大学 The storage and its access method of a kind of table of multiple multilayer gauge outfits in the database

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100070491A1 (en) * 2008-09-18 2010-03-18 International Business Machines Corporation Dynamic Contextual Table Headers
CN104679453A (en) * 2013-12-03 2015-06-03 航天信息股份有限公司 Information input, storage, typesetting and printing general system and information input, storage, typesetting and printing method
CN104461790A (en) * 2014-11-20 2015-03-25 中国科学院自动化研究所 Selectivity triple-modular redundancy method based on lookup table observability measurement
CN106156075A (en) * 2015-03-31 2016-11-23 中国科学院声学研究所 A kind of report generation and the method and device of displaying
CN105335459A (en) * 2015-09-24 2016-02-17 四川长虹电器股份有限公司 XBRL intelligent report platform based statement consolidation data extraction method
CN108594943A (en) * 2018-04-27 2018-09-28 阮晓萍 A kind of travel agency tourist data management system
CN109299098A (en) * 2018-09-29 2019-02-01 北京理工大学 The storage and its access method of a kind of table of multiple multilayer gauge outfits in the database

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SAYYAPARAJU SAGAR VARMA 等: "An efficient methodology to characterize the TSPC flip flop setup time for static timing analysis" *
崔文浩 等: "《科技文献中表格信息的存储及检索方法研究》" *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723210A (en) * 2020-06-29 2020-09-29 深圳壹账通智能科技有限公司 Method and device for storing data table, computer equipment and readable storage medium

Similar Documents

Publication Publication Date Title
CN107665225B (en) Information pushing method and device
CN108376364B (en) Payment system account checking method and device and terminal device
CN106888236B (en) Session management method and session management device
CN110516002B (en) Map-based task display method, device, equipment and storage medium
CN109347898B (en) Scene information sending method, scene information display method, server and mobile terminal
US10963888B2 (en) Payment complaint method, device, server and readable storage medium
CN107909368B (en) Payment control method and device, terminal and readable storage medium
CN112055244A (en) Image acquisition method and device, server and electronic equipment
CN111414727A (en) Method and device for editing header and footer of PDF (Portable document Format) document and electronic equipment
CN109561134B (en) Electronic device, distributed cluster service distribution method and storage medium
CN108829882B (en) Information collection method, device, terminal and medium
CN110851441A (en) Data storage method and related equipment
CN115994830A (en) Method for constructing fetch model, method for collecting data and related device
CN114218283A (en) Abnormality detection method, apparatus, device, and medium
CN112650763A (en) Configuration method of product quota, related equipment and storage medium
CN112328450A (en) Data monitoring method and device, computer equipment and storage medium
CN113724003B (en) Order transaction data-based moistening method, electronic equipment and readable storage medium
CN110290483B (en) Multimedia message transmission method, system and terminal equipment
CN116382924B (en) Recommendation method and device for resource allocation, electronic equipment and storage medium
CN116263792B (en) Method and system for crawling complex internet data
US11244107B1 (en) Electronic apparatus for providing information and data providing method thereof
CN116362750A (en) Data screening method and device, electronic equipment and storage medium
CN117632986A (en) Data processing method, device, equipment and storage medium
CN112215369A (en) Method, device, equipment and storage medium for determining effectiveness of nuclear power plant maintenance
CN116541393A (en) Label storage method and device for database, terminal equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20200228