CN114896251A - Processing method and device of table data and server - Google Patents

Processing method and device of table data and server Download PDF

Info

Publication number
CN114896251A
CN114896251A CN202210562451.9A CN202210562451A CN114896251A CN 114896251 A CN114896251 A CN 114896251A CN 202210562451 A CN202210562451 A CN 202210562451A CN 114896251 A CN114896251 A CN 114896251A
Authority
CN
China
Prior art keywords
data
content
header
target
cell
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
CN202210562451.9A
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.)
Bank of China Ltd
Original Assignee
Bank of China 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 Bank of China Ltd filed Critical Bank of China Ltd
Priority to CN202210562451.9A priority Critical patent/CN114896251A/en
Publication of CN114896251A publication Critical patent/CN114896251A/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
    • 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/25Integrating or interfacing systems involving database management systems
    • G06F16/254Extract, transform and load [ETL] procedures, e.g. ETL data flows in data warehouses
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The specification provides a processing method and device of table data and a server. The method relates to the technical field of big data, and based on the method, content data in a target table can be split into first content data of a table header and second content data of a content cell; storing the first content data and the first position information of the header into a first data table according to a first processing rule; converting second content data and second position information of the content cells into corresponding key value pair data according to a second processing rule, and storing the key value pair data into a second data table; the first content data and the first position information, and the second content data and the second position information are separately stored, so that the storage operation of a table with huge data volume can be completed with smaller data processing amount; and based on the storage mode, the form can be read more efficiently subsequently, and the reading waiting time is effectively shortened.

Description

Processing method and device of table data and server
Technical Field
The specification belongs to the technical field of big data, and particularly relates to a processing method, device and server of table data.
Background
In a business processing scenario involving large data, it is often necessary to store and read tables with huge data volumes.
When the existing processing method is used for storing the table, the related data processing amount is often large, and when the stored table is subsequently read, the reading efficiency is low, and the reading waiting time of a user is long.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The specification provides a method, a device and a server for processing table data, which can rapidly finish the storage operation of a table with huge data volume with smaller data processing amount; and based on the above-mentioned mode of depositing, follow-up can be comparatively high-efficient to the form read operation, shorten reading latency effectively.
The present specification provides a method for processing table data, including:
receiving a form storage request; the table storage request at least carries a target table to be stored;
responding to the table storage request, acquiring and extracting first content data and first position information of a table header from the target table according to table header parameters of the target table;
storing first content data and first position information of a header into a first data table according to a first processing rule and a table identifier of a target table; the first data table is used for storing related data of a table header in a table;
determining content cells in the target table except the table head according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell;
according to a second processing rule, second content data and second position information of the content cells are utilized to construct key value pair data corresponding to the content cells;
storing the key-value pair data into a second data table according to the table identification of the target table; and the second data table is used for storing the related data of the content cells in the table.
In one embodiment, the second data table comprises a relational database table.
In one embodiment, the first data table and the second data table comprise data tables in a write block chain.
In one embodiment, obtaining header parameters of the target table includes:
reading a header freezing parameter from the setting parameter carried by the target table; determining the row number and the column number of the header in the target table according to the header freezing parameters to obtain header parameters of the target table;
or the like, or, alternatively,
and receiving and determining the row number and the column number of the header in the target table according to the user-defined parameters set by the user so as to obtain the header parameters of the target table.
In one embodiment, after detecting and extracting the first content data and the first location information of the header from the target table according to the header parameters of the target table, the method further includes:
detecting whether the position area where the gauge outfit is positioned is a merging cell;
under the condition that the position area where the header is located is determined to be a merging cell, acquiring and generating a merging indication label of the header according to the cell identifier of the cell contained in the merging cell;
correspondingly, storing the first content data and the first position information of the header into the first data table comprises:
the first content data of the header, the first position information, and the merge instruction tag are stored in the first data table.
In one embodiment, determining the content cells in the target table except the header according to the first position information comprises:
determining a candidate position area in the target table except the table head according to the first position information;
and screening out the cells with non-empty data values as content cells by detecting the data values of the cells in the candidate position area.
In one embodiment, constructing key-value pair data corresponding to the content cell using the second content data and the second location information of the content cell according to the second processing rule includes:
and combining the second content data and the second position information corresponding to the same content cell as a value and a key value respectively to obtain key value pair data corresponding to the content cell.
In one embodiment, after storing the key-value pair data in the second data table according to the table identification of the target table, the method further comprises:
and splitting the key value pair data in the second data table into a plurality of sub data tables for storage according to a preset splitting rule.
In one embodiment, splitting the key-value pair data in the second data table into a plurality of sub-data tables according to a preset splitting rule includes:
determining the number of the sub data tables according to the number of the key value pair data contained in the second data table;
respectively carrying out Hash operation on the cell identifiers of the content cells in the second data table to obtain Hash values of the cell identifiers of the content cells;
and calculating and dividing the key value pair data of the content cell into corresponding sub data tables according to a remainder obtained by dividing the hash value of the cell identifier of the content cell by the number of the sub data tables.
In one embodiment, after storing the first content data and the first location information of the header in the first data table, the method further comprises:
detecting whether a drop-down frame exists in a target table or not;
under the condition that the drop-down box exists in the target table, third content data and third position information of the drop-down box are obtained; and storing the third content data and the third location information of the drop-down box in a third data table.
In one embodiment, the method further comprises:
receiving a table reading request; the table reading request at least carries a table identifier of a target table to be read;
determining a corresponding first data table and a second data table according to the table identification of the target table;
reconstructing a target table according to the first data table and the second data table;
and displaying the target table to a user.
The present specification also provides a table data processing apparatus including:
the receiving module is used for receiving a table storage request; the table storage request at least carries a target table to be stored;
the first extraction module is used for responding to the table storage request, acquiring and extracting first content data and first position information of a table header from the target table according to table header parameters of the target table;
the first storage module is used for storing the first content data and the first position information of the header into a first data table according to the first processing rule and the table identifier of the target table; the first data table is used for storing related data of a table header in a table;
the second extraction module is used for determining content cells except the table head in the target table according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell;
the processing module is used for constructing key value pair data corresponding to the content cells by utilizing the second content data and the second position information of the content cells according to a second processing rule;
the second storage module is used for storing the key value pair data into a second data table according to the table identification of the target table; and the second data table is used for storing the related data of the content cells in the table.
In one embodiment, the apparatus further comprises a reading module;
the receiving module is further configured to receive a table reading request; the table reading request at least carries a table identifier of a target table to be read;
the reading module is used for determining a corresponding first data table and a second data table according to the table identification of the target table; reconstructing a target table according to the first data table and the second data table; and displaying the target table to a user.
The present specification also provides a server comprising a processor and a memory for storing processor-executable instructions, the processor implementing the steps associated with the method of processing tabular data when executing the instructions.
The present specification also provides a computer program product comprising a computer program which, when executed by a processor, implements the relevant steps of the method for processing tabular data.
When a target form is stored, a form storage request can be received and responded, first content data and first position information of a form header are detected and extracted from the target form according to a form header parameter of the target form; storing first content data and first position information of a header into a first data table according to a first processing rule and a table identifier of a target table; determining content cells in the target table except the table head according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell; according to a second processing rule, second content data and second position information of the content cells are utilized to construct key value pair data corresponding to the content cells; and storing the key value pair data into a second data table according to the table identification of the target table. Content data in a target table is divided into first content data of a table header and second content data of a content cell; storing the first content data and the first position information of the header into a first data table according to a first processing rule; meanwhile, second content data and second position information of the content cells are converted into corresponding key value pair data according to a second processing rule and then stored into a second data table; the first content data and the first position information of the table header and the second content data and the second position information of the content cells are stored separately, so that the storage operation of a table with huge data volume can be completed quickly with small data processing amount; and based on the storage mode, the form can be read more efficiently subsequently, and the reading waiting time during reading the form is effectively shortened.
Drawings
In order to more clearly illustrate the embodiments of the present specification, the drawings needed to be used in the embodiments will be briefly described below, and the drawings in the following description are only some of the embodiments described in the specification, and it is obvious to those skilled in the art that other drawings can be obtained based on the drawings without any inventive work.
Fig. 1 is a flowchart illustrating a processing method of table data according to an embodiment of the present specification;
FIG. 2 is a diagram illustrating an embodiment of a method for processing table data according to an embodiment of the present disclosure;
FIG. 3 is a diagram illustrating an embodiment of a method for processing table data according to an embodiment of the present disclosure;
FIG. 4 is a diagram illustrating an embodiment of a method for processing table data according to an embodiment of the present disclosure;
FIG. 5 is a diagram illustrating an embodiment of a method for processing table data according to an embodiment of the present disclosure;
FIG. 6 is a schematic structural component diagram of a server provided in an embodiment of the present description;
fig. 7 is a schematic structural composition diagram of a processing apparatus for table data provided in an embodiment of the present specification;
fig. 8 is a schematic structural diagram of a table data processing apparatus according to another embodiment of the present specification.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
Referring to fig. 1, an embodiment of the present disclosure provides a method for processing table data. The method is specifically applied to one side of the cloud server. In specific implementation, the method may include the following:
s101: receiving a form storage request; the table storage request at least carries a target table to be stored;
s102: responding to the table storage request, acquiring and extracting first content data and first position information of a table header from the target table according to table header parameters of the target table;
s103: storing first content data and first position information of a header into a first data table according to a first processing rule and a table identifier of a target table; the first data table is used for storing related data of a table header in a table;
s104: determining content cells in the target table except the table head according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell;
s105: according to a second processing rule, second content data and second position information of the content cells are utilized to construct key value pair data corresponding to the content cells;
s106: storing the key-value pair data into a second data table according to the table identification of the target table; and the second data table is used for storing the related data of the content cells in the table.
In some data processing scenarios, a user needs to import the sorted form data into the cloud server through the terminal device for storage, so as to backup the form data and use the form data later.
In this embodiment, the cloud server may specifically include a background server that is applied to one side of the cloud service platform and can implement functions such as data transmission and data processing. Specifically, the cloud server may be, for example, an electronic device having data operation, storage function, and network interaction function. Or, the cloud server may also be a software program that runs in the electronic device and provides support for data processing, storage, and network interaction. In this embodiment, the number of servers included in the cloud server is not specifically limited. The cloud server may be specifically one server, or may be several servers, or a server cluster formed by a plurality of servers.
In this embodiment, the terminal device may specifically include a front-end device that is applied to a user side and can implement functions such as data acquisition and data transmission. Specifically, the terminal device may be, for example, an electronic device such as a desktop computer, a tablet computer, a notebook computer, and a mobile phone. Alternatively, the terminal device may be a software application capable of running in the electronic device. For example, it may be some APP running on a cell phone, etc.
In some embodiments, referring to fig. 2, the target form may be specifically understood as a form to be stored by a user indication. Specifically, the target table may include two parts, namely a header and a table content.
Referring to fig. 2, the gauge head may specifically include: the table name of the target table at the top of the table, the label information in the head cell at each row, each column in the table, etc. The table name of the target table located at the top of the table, the tag information in the head cell located in each row and each column in the table, and the like can be marked as the first content data of the header. The row number and the column number of the position area where the first content data is located in the table may be recorded as corresponding first position information.
Referring to fig. 2, the table contents may specifically include: the specific data in the content cell except the header in the table may be referred to as second content data of the content cell. The row number and the column number of the content cell in which the second content data is located in the table may be recorded as corresponding second location information.
In some embodiments, when a user needs to store a target form, a storing operation may be initiated by the terminal device. And the terminal equipment receives and responds to the storage operation to generate a corresponding table storage request. And the table storage request at least carries a target table to be stored. Then, the terminal device can send the table storing request to the cloud server. Correspondingly, the cloud server can receive the table storage request, respond to the table storage request, and store the target table into the table database or the block chain.
In some embodiments, the table entry request may further specifically carry a user identifier. After receiving the form storage request, the server may perform user authentication on the form storage request according to the user identifier. Specifically, the server may query the user database of the platform according to the user identifier to determine whether the user initiating the form request belongs to a registered user of the platform. Under the condition that the same user identification is matched in the user database, the user initiating the form request can be determined to belong to the registered user of the platform, the user passes the verification, and the subsequent form data processing can be triggered. On the contrary, under the condition that the same user identification is not matched in the user database, the user initiating the form request can be determined not to belong to the registered user of the platform, and if the user verification fails, the subsequent form data processing is not triggered; further, a user registration prompt may be generated and sent to the terminal device to prompt the user to perform user registration first.
It should be noted that the data related to the user referred to in this specification are all collected and used under the condition that the user knows and agrees. Moreover, the acquisition, storage, use, processing and the like of the data related to the user all conform to the relevant regulations of national laws and regulations.
In some embodiments, the header parameter may specifically be a row number and a column number of a location area of the header in the table.
In some embodiments, the obtaining of the header parameter of the target table may include the following steps: reading a header freezing parameter from the setting parameter carried by the target table; determining the row number and the column number of the header in the target table according to the header freezing parameters to obtain header parameters of the target table; or receiving and determining the row number and the column number of the header in the target table according to the user-defined parameters set by the user so as to obtain the header parameters of the target table.
The header freezing parameter may be specifically configured to limit a position area where the header is located in the form from sliding correspondingly when the form is browsed.
The self-defined parameters may be specifically setting parameters actively set for indicating a row number and a column number of a position area where a header is located in a table when a user generates a table storing request through the terminal device. Correspondingly, the form storing request can also carry user-defined parameters actively set by the user.
Based on the embodiment, in specific implementation, whether the self-defined parameters actively set by the user exist in the form storage request can be detected, and when the self-defined parameters exist, the form head parameters of the target form can be directly determined according to the self-defined parameters; when the user-defined parameters do not exist, the set parameters of the target form can be detected to obtain the header freezing parameters of the target form, and then the header parameters of the target form can be determined according to the header freezing parameters.
In some embodiments, in specific implementation, a position area where the header is located may be determined in the target table according to the header parameters of the target table; carrying out finer detection and identification on the position area of the gauge head to obtain first content data of the gauge head; meanwhile, the row number and the column number of the first content data in the target table can be determined, and the first position information of the first content data is obtained.
In some embodiments, the first data table may be specifically configured to store data related to a header in the table, for example, the first content data of the header, the first location information of the first content data, and the like.
The table identifier may be specifically understood as indicating information that can correspond to the target table, for example, a table name, a table number, and the like of the target table.
In specific implementation, the table storage request may carry a table identifier of the target table; accordingly, the table identifier of the target table can be extracted from the table deposit request. Alternatively, the first content data that can be matched to the entire target table may be filtered out from the extracted first content data as the table identifier of the target table.
In some embodiments, the storing the first content data and the first location information of the header into the first data table according to the first processing rule and the table identifier of the target table may include: constructing an initial first data table corresponding to the table identification of the target table; and determining the corresponding relation between the first content data and the first position information, and respectively storing the first content data and the first position information which correspond to each other into an initial first data table in sequence according to the corresponding relation to obtain a first data table. Further, the first data table may further include a correspondence between the first content data and the first location information.
In some embodiments, after detecting and extracting the first content data and the first location information of the header from the target table according to the header parameter of the target table, when the method is implemented, the following may be further included:
s1: detecting whether the position area where the gauge outfit is positioned is a merging cell;
s2: under the condition that the position area where the header is located is determined to be a merging cell, acquiring and generating a merging indication label of the header according to the cell identifier of the cell contained in the merging cell;
correspondingly, the storing the first content data and the first location information of the header into the first data table may specifically include: the first content data of the header, the first position information, and the merge instruction tag are stored in the first data table.
The merging indication label can indicate that the first content data of the merged cell exists, and the cell of the specifically merged cell is identified.
The cell identifier corresponds to a cell. Specifically, the cell identifier of a cell may be obtained based on the combination of the row number and the column number of the cell in the table.
In some embodiments, the determining, according to the first location information, a content cell in the target table except for the header may include the following, in implementation:
s1: determining a candidate position area in the target table except the table head according to the first position information;
s2: and screening out the cells with non-empty data values as content cells by detecting the data values of the cells in the candidate position area.
In specific implementation, according to the first position information, screening out other cells in the target table except for the position area where the table head is located as candidate position areas; further, data value detection may be performed separately for the cells in the candidate location area to determine whether each cell is empty, that is, whether the data value of each cell is empty. Under the condition that the data value of a certain cell is determined to be empty, if the content data does not exist in the cell, the subsequent storage operation is not carried out, so that the data processing amount is reduced. On the contrary, in the case that the data value of a certain cell is determined to be not null, the content data in the cell can be judged, and the cell is screened out as the content cell for subsequent storage operation.
In some embodiments, in a specific implementation, only the content cells may be detected and identified more finely to obtain the second content data of the content cells; meanwhile, the row number and the column number of the second content data (i.e. the content cell) in the target table can be determined, and the second position information of the second content data is obtained. And the cells other than the content cell in the candidate location area are not processed. Therefore, the data processing amount can be effectively reduced, and the overall processing efficiency is improved.
In some embodiments, the above-mentioned constructing the key-value pair data corresponding to the content cell by using the second content data and the second location information of the content cell according to the second processing rule may include the following when implemented specifically: and combining the second content data and the second position information corresponding to the same content cell as a value and a key value respectively to obtain key value pair data corresponding to the content cell.
Specifically, for a certain content cell, the second content data is: "SZ City"; the second position information is: column 9, row 1. The key-value pair data corresponding to the content cell may be represented in the form: SZ City- (9, 1).
In this embodiment, it is considered that the format of the target table (e.g., the total number of rows and the total number of columns included) is not fixed, and the format of the second data table used on the cloud server side for convenience of management and maintenance is uniform and fixed. In this case, for a target table with an unfixed and non-uniform format, the second content data and the second location information may be combined in a key-value pair manner to obtain key-value pair data simultaneously including the second content data and the second location information of the content cell; and then the key-value pair data is independently stored in a second data table as one data. Therefore, on one hand, the target table with different formats can be processed by using the second data table with fixed and uniform format; on the other hand, the data storage amount stored in the second data table can be reduced, and the storage load can be reduced.
In some embodiments, in order to facilitate subsequent query reading and improve the efficiency of subsequent query reading, after storing the key-value pair data in the second data table according to the table identifier of the target table, when the method is implemented, the method may further include: and splitting the key value pair data in the second data table into a plurality of sub data tables for storage according to a preset splitting rule. Therefore, the second data table with huge data size originally can be divided into a plurality of sub data tables for storage respectively, so that subsequent query and reading are facilitated.
In some embodiments, the storing the key-value pair data into the second data table according to the table identifier of the target table may include: storing the key-value pair data into a second data table corresponding to the table identifier of the target table; and the second data table also stores the corresponding relation between the key value pair data and the table identifier of the content unit table.
In some embodiments, referring to fig. 3, the splitting the key-value pair data in the second data table into a plurality of sub data tables according to a preset splitting rule for storage may include the following steps:
s301: determining the number of the sub data tables according to the number of the key value pair data contained in the second data table;
s302: respectively carrying out Hash operation on the cell identifiers of the content cells in the second data table to obtain Hash values of the cell identifiers of the content cells;
s303: and calculating and dividing the key value pair data of the content cell into corresponding sub data tables according to a remainder obtained by dividing the hash value of the cell identifier of the content cell by the number of the sub data tables.
In some embodiments, in the case that the target table contains a large amount of data and the number of key-value pair data is large, the number of sub-data tables may be set to be relatively large. In the case where the target table contains a small amount of data and the key-value pair data contains a small amount of data, the number of sub-data tables may be set relatively small.
Specifically, the corresponding relationship between the remainder value and each sub-data table may be determined according to the number of the sub-data tables. Carrying out Hash operation on the cell identification of each content cell to obtain a Hash value of the cell identification corresponding to the content cell; and dividing the hash value of the cell identifier of each content cell by the number of the sub-data tables, and splitting the key value pair data of the content cell into the corresponding sub-data tables according to the obtained remainder value.
Therefore, a large amount of key value pair data can be split into a plurality of sub data tables uniformly, and subsequent query and reading are facilitated.
When inquiring and reading are carried out subsequently, the remainder obtained by dividing the hash value of the cell identifier of each content cell by the number of the sub data table can be calculated firstly; determining a sub data table where the key value pair data of each content cell is located according to the remainder; furthermore, only one sub data table is searched, the key value pair data of the content cell can be read and obtained.
In some embodiments, after storing the first content data and the first location information of the header in the first data table, when the method is implemented, the following may be further included:
s1: detecting whether a drop-down frame exists in a target table or not;
s2: under the condition that the drop-down box exists in the target table, third content data and third position information of the drop-down box are obtained; and storing the third content data and the third location information of the drop-down box in a third data table.
Specifically, one or more option information may be stored in a drop-down box of the target table, and the option information may be recorded as third content data of the drop-down box; the location parameter of the location area where the drop-down box is located can be recorded as the third location information.
In some embodiments, referring to fig. 4, when the method is implemented, the following may be further included:
s401: receiving a table reading request; the table reading request at least carries a table identifier of a target table to be read;
s402: determining a corresponding first data table and a second data table according to the table identification of the target table;
s403: reconstructing a target table according to the first data table and the second data table;
s404: and displaying the target table to a user.
In this embodiment, in implementation, the corresponding first data table and the second data table may be retrieved from the blockchain identified by the table identifier of the target table. According to the first data table, the first content data and the first position information of the header may be acquired, and the indication tag may be merged. According to the second data table, key-value pair data of the content cell can be obtained; and further acquiring second content data and second location information of each content cell based on the key-value pair data. The header can be reconstructed in the initial table according to the first content data and the first position information of the header and the merging indication label; reconstructing the content cells according to the second content data and the second position information of each content cell; and sets the content data of the remaining cells to null. Therefore, the target table can be reconstructed quickly and accurately. Further, the target form can be sent to a terminal device, and the target form is shown to the user through the terminal device.
Therefore, reading and reconstruction can be completed quickly and accurately, the target form is displayed to the user in time, the reading waiting time of the user is effectively shortened, and the user can obtain better interactive experience.
In some embodiments, the target form includes a transaction data processing record form, and may also include a business employee information form, and may also include an item settlement form, and the like. Of course, the above listed target table is only a schematic illustration. In specific implementation, the target table may further include tables with other contents according to specific application scenarios and processing requirements. The present specification is not limited to this.
In some embodiments, after presenting the target table to the user, referring to fig. 5, when the method is implemented, the following may be further included:
s405: acquiring operation data of a user on cells in the displayed target table;
s406: and updating the first data table and/or the second data table according to the operation data.
In this embodiment, in specific implementation, the updated content data may be determined according to the operation data. Wherein the operation data comprises: deleting operation and modifying operation of original content data; and performing operation on newly added content data of a cell with empty original content data. Then, the first content data in the first data table and/or the second content data in the second data table may be respectively updated according to the updated content data. Therefore, the stored target table can be updated and maintained efficiently and conveniently in time.
In some embodiments, the second data table may specifically comprise a relational database table. Further, the first data table may be a relational data table.
The relational database may be a database that is created on the basis of a relational data model and processes data by using mathematical concepts and methods such as set algebra. Such as Oracle, MySQL, DB2, etc.
By using the relational database table as the second data table, the method can be more efficient and convenient when query and reading are subsequently performed, and effectively shortens the reading waiting time.
In some embodiments, the first data table and the second data table may specifically include data tables written in a block chain.
Because the first data table and the second data table are written into the block chain, the content data in the first data table and the second data table are difficult to be tampered, and the method has high safety and reliability. In addition, because the first data table and the second data table are written into the block chain, the first data table and the second data table also support decentralized operation, and then a user or a manager can operate related data in the first data table and the second data table more conveniently and efficiently.
As can be seen from the above, according to the method for processing table data provided in the embodiments of the present specification, when a target table is stored, a table storage request may be received and responded, and first content data and first location information of a header are detected and extracted from the target table according to a header parameter of the target table; storing first content data and first position information of a header into a first data table according to a first processing rule and a table identifier of a target table; determining content cells in the target table except the table head according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell; according to a second processing rule, second content data and second position information of the content cells are utilized to construct key value pair data corresponding to the content cells; and storing the key value pair data into a second data table according to the table identification of the target table. Content data in a target table is divided into first content data of a table header and second content data of a content cell; storing the first content data and the first position information of the header into a first data table according to a first processing rule; according to a second processing rule, second content data and second position information of the content cells are converted into corresponding key value pair data and then stored into a second data table, so that the storage operation of a table with large data quantity can be completed with small data processing quantity; and based on the storage mode, the form can be read more efficiently subsequently, and the reading waiting time during reading the form is effectively shortened.
Embodiments of the present specification further provide a server, including a processor and a memory for storing processor-executable instructions, where the processor, when implemented, may perform the following steps according to the instructions: receiving a form storage request; the table storage request at least carries a target table to be stored; responding to the table storage request, acquiring and extracting first content data and first position information of a table header from the target table according to table header parameters of the target table; storing first content data and first position information of a header into a first data table according to a first processing rule and a table identifier of a target table; the first data table is used for storing related data of a table header in a table; determining content cells in the target table except the table head according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell; according to a second processing rule, second content data and second position information of the content cells are utilized to construct key value pair data corresponding to the content cells; storing the key-value pair data into a second data table according to the table identification of the target table; and the second data table is used for storing the related data of the content cells in the table.
In order to more accurately complete the above instructions, referring to fig. 6, another specific server is provided in the embodiments of the present specification, where the server includes a network communication port 601, a processor 602, and a memory 603, and the above structures are connected by an internal cable, so that the structures may perform specific data interaction.
The network communication port 601 may be specifically configured to receive a table storage request; and the table storage request at least carries a target table to be stored.
The processor 602 may be specifically configured to respond to the table storage request, acquire and extract first content data and first location information of a table header from the target table according to a table header parameter of the target table; storing first content data and first position information of a header into a first data table according to a first processing rule and a table identifier of a target table; the first data table is used for storing related data of a table header in a table; determining content cells in the target table except the table head according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell; according to a second processing rule, second content data and second position information of the content cells are utilized to construct key value pair data corresponding to the content cells; storing the key-value pair data into a second data table according to the table identification of the target table; and the second data table is used for storing the related data of the content cells in the table.
The memory 603 may be specifically configured to store a corresponding instruction program.
In this embodiment, the network communication port 601 may be a virtual port bound with different communication protocols, so that different data can be sent or received. For example, the network communication port may be a port responsible for web data communication, a port responsible for FTP data communication, or a port responsible for mail data communication. In addition, the network communication port can also be a communication interface or a communication chip of an entity. For example, it may be a wireless mobile network communication chip, such as GSM, CDMA, etc.; it can also be a Wifi chip; it may also be a bluetooth chip.
In this embodiment, the processor 602 may be implemented in any suitable manner. For example, the processor may take the form of, for example, a microprocessor or processor and a computer-readable medium that stores computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, an embedded microcontroller, and so forth. The description is not intended to be limiting.
In this embodiment, the memory 603 may include multiple layers, and in a digital system, the memory may be any memory as long as binary data can be stored; in an integrated circuit, a circuit without a physical form and with a storage function is also called a memory, such as a RAM, a FIFO and the like; in the system, the storage device in physical form is also called a memory, such as a memory bank, a TF card and the like.
The present specification further provides a computer storage medium based on the above table data processing method, where the computer storage medium stores computer program instructions, and when the computer program instructions are executed, the computer storage medium implements: receiving a form storage request; the table storage request at least carries a target table to be stored; responding to the table storage request, acquiring and extracting first content data and first position information of a table header from the target table according to table header parameters of the target table; storing first content data and first position information of a header into a first data table according to a first processing rule and a table identifier of a target table; the first data table is used for storing related data of a table header in a table; determining content cells in the target table except the table head according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell; according to a second processing rule, second content data and second position information of the content cells are utilized to construct key value pair data corresponding to the content cells; storing the key-value pair data into a second data table according to the table identification of the target table; and the second data table is used for storing the related data of the content cells in the table.
In this embodiment, the storage medium includes, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Cache (Cache), a Hard Disk Drive (HDD), or a Memory Card (Memory Card). The memory may be used to store computer program instructions. The network communication unit may be an interface for performing network connection communication, which is set in accordance with a standard prescribed by a communication protocol.
In this embodiment, the functions and effects specifically realized by the program instructions stored in the computer storage medium can be explained by comparing with other embodiments, and are not described herein again.
Embodiments of the present specification further provide a computer program product, which includes a computer program, and when the computer program is executed by a processor, the computer program implements the following steps: receiving a form storage request; the table storage request at least carries a target table to be stored; responding to the table storage request, acquiring and extracting first content data and first position information of a table header from the target table according to table header parameters of the target table; storing first content data and first position information of a header into a first data table according to a first processing rule and a table identifier of a target table; the first data table is used for storing related data of a table header in a table; determining content cells in the target table except the table head according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell; according to a second processing rule, second content data and second position information of the content cells are utilized to construct key value pair data corresponding to the content cells; storing the key-value pair data into a second data table according to the table identification of the target table; the second data table is used for storing relevant data of the content cells in the table.
Referring to fig. 7, in a software level, an embodiment of the present specification further provides a table data processing apparatus, which may specifically include the following structural modules:
the receiving module 701 may be specifically configured to receive a table storage request; the table storage request at least carries a target table to be stored;
the first extracting module 702 may be specifically configured to respond to the table storage request, acquire and extract first content data and first location information of a header from the target table according to a header parameter of the target table;
the first storing module 703 may be specifically configured to store the first content data and the first location information of the header in the first data table according to the first processing rule and the table identifier of the target table; the first data table is used for storing related data of a table header in a table;
the second extracting module 704 may be specifically configured to determine, according to the first location information, content cells in the target table except for the table header; processing the content cell to extract and obtain second content data and second position information of the content cell;
the processing module 705 may be specifically configured to construct, according to a second processing rule, key-value pair data corresponding to the content cell by using second content data and second location information of the content cell;
the second storing module 706 may be specifically configured to store the key-value pair data in a second data table according to the table identifier of the target table; and the second data table is used for storing the related data of the content cells in the table.
In some embodiments, the second data table may specifically comprise a relational database table or the like.
In some embodiments, the first data table and the second data table may specifically include data tables in a write block chain.
In some embodiments, when the first extracting module 702 is implemented, the header parameters of the target table may be obtained as follows: reading a header freezing parameter from the setting parameter carried by the target table; determining the row number and the column number of the header in the target table according to the header freezing parameters to obtain header parameters of the target table; or receiving and determining the row number and the column number of the header in the target table according to the user-defined parameters set by the user so as to obtain the header parameters of the target table.
In some embodiments, the first extracting module 702 may be further configured to, after detecting and extracting the first content data and the first location information of the header from the target table according to the header parameter of the target table, detect whether a location area where the header is located is a merge cell; and under the condition that the position area where the header is positioned is determined to be the merging cell, acquiring and generating a merging indication label of the header according to the cell identifier of the cell contained in the merging cell.
Accordingly, when the first storing module 703 is implemented, the first content data and the first location information of the header may be stored in the first data table according to the following manner: the first content data of the header, the first position information, and the merge instruction tag are stored in the first data table.
In some embodiments, when the second extracting module 704 is implemented, the content cells in the target table except the header may be determined according to the first location information in the following manner: determining a candidate position area in the target table except the table head according to the first position information; and screening out the cells with non-empty data values as content cells by detecting the data values of the cells in the candidate position area.
In some embodiments, when the processing module 705 is implemented, the key-value pair data corresponding to the content cell may be constructed by using the second content data and the second location information of the content cell according to the following manner according to the second processing rule: and combining the second content data and the second position information corresponding to the same content cell as a value and a key value respectively to obtain key value pair data corresponding to the content cell.
In some embodiments, after the second storing module 706 stores the key-value pair data in the second data table according to the table identifier of the target table, the second storing module may be further configured to split the key-value pair data in the second data table into a plurality of sub data tables according to a preset splitting rule for storage.
In some embodiments, when the second logging module 706 is implemented specifically, the key value pair data in the second data table may be split into multiple sub data tables according to a preset splitting rule in the following manner: determining the number of the sub data tables according to the number of the key value pair data contained in the second data table; respectively carrying out Hash operation on the cell identifiers of the content cells in the second data table to obtain Hash values of the cell identifiers of the content cells; and calculating and dividing the key value pair data of the content cell into corresponding sub data tables according to a remainder obtained by dividing the hash value of the cell identifier of the content cell by the number of the sub data tables.
In some embodiments, the first extracting module 702 may be further configured to detect whether a drop-down box exists in the target table after the first content data and the first location information of the header are stored in the first data table; under the condition that the drop-down box exists in the target table, third content data and third position information of the drop-down box are obtained; and storing the third content data and the third location information of the drop-down box in a third data table.
In some embodiments, referring to fig. 8, the apparatus may further include a reading module 707; the reading module 707 is connected to the receiving module 701. The receiving module 701 may be further configured to receive a table reading request; the table reading request at least carries a table identifier of a target table to be read; the reading module 707 is specifically configured to determine a first data table and a second data table corresponding to the table identifier of the target table; reconstructing a target table according to the first data table and the second data table; and displaying the target table to a user.
It should be noted that, the units, devices, modules, etc. illustrated in the above embodiments may be implemented by a computer chip or an entity, or implemented by a product with certain functions. For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. It is to be understood that, in implementing the present specification, functions of each module may be implemented in one or more pieces of software and/or hardware, or a module that implements the same function may be implemented by a combination of a plurality of sub-modules or sub-units, or the like. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
As can be seen from the above, the processing apparatus for table data provided in the embodiments of the present specification, when a target table is stored, may receive and respond to a table storage request, and first obtain and extract first content data and first location information of a header from the target table according to a header parameter of the target table; storing first content data and first position information of a header into a first data table according to a first processing rule and a table identifier of a target table; determining content cells in the target table except the table head according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell; according to a second processing rule, second content data and second position information of the content cells are utilized to construct key value pair data corresponding to the content cells; and storing the key value pair data into a second data table according to the table identification of the target table. Therefore, the storage operation of the table with huge data volume can be finished with smaller data processing amount; and based on the storage mode, the form can be read more efficiently subsequently, and the reading waiting time is effectively shortened.
Although the present specification provides method steps as described in the examples or flowcharts, additional or fewer steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an apparatus or client product in practice executes, it may execute sequentially or in parallel (e.g., in a parallel processor or multithreaded processing environment, or even in a distributed data processing environment) according to the embodiments or methods shown in the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the presence of additional identical or equivalent elements in a process, method, article, or apparatus that comprises the recited elements is not excluded. The terms first, second, etc. are used to denote names, but not any particular order.
Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may therefore be considered as a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
From the above description of the embodiments, it is clear to those skilled in the art that the present specification can be implemented by software plus necessary general hardware platform. With this understanding, the technical solutions in the present specification may be essentially embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments in the present specification.
The embodiments in the present specification are described in a progressive manner, and the same or similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. The description is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
While the specification has been described with examples, those skilled in the art will appreciate that there are numerous variations and permutations of the specification that do not depart from the spirit of the specification, and it is intended that the appended claims include such variations and modifications that do not depart from the spirit of the specification.

Claims (15)

1. A method for processing tabular data, comprising:
receiving a form storage request; the table storage request at least carries a target table to be stored;
responding to the table storage request, acquiring and extracting first content data and first position information of a table header from the target table according to table header parameters of the target table;
storing first content data and first position information of a header into a first data table according to a first processing rule and a table identifier of a target table; the first data table is used for storing related data of a table header in a table;
determining content cells in the target table except the table head according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell;
according to a second processing rule, second content data and second position information of the content cells are utilized to construct key value pair data corresponding to the content cells;
storing the key-value pair data into a second data table according to the table identification of the target table; and the second data table is used for storing the related data of the content cells in the table.
2. The method of claim 1, wherein the second data table comprises a relational database table.
3. The method of claim 1, wherein the first and second data tables comprise data tables written in a block chain.
4. The method of claim 1, wherein obtaining header parameters of the target table comprises:
reading a header freezing parameter from the setting parameter carried by the target table; determining the row number and the column number of the header in the target table according to the header freezing parameters to obtain header parameters of the target table;
or the like, or, alternatively,
and receiving and determining the row number and the column number of the header in the target table according to the user-defined parameters set by the user so as to obtain the header parameters of the target table.
5. The method of claim 4, wherein after detecting and extracting the first content data and the first location information of the header from the target table according to the header parameters of the target table, the method further comprises:
detecting whether the position area where the gauge outfit is positioned is a merging cell;
under the condition that the position area where the header is located is determined to be a merging cell, acquiring and generating a merging indication label of the header according to the cell identifier of the cell contained in the merging cell;
correspondingly, storing the first content data and the first position information of the header into the first data table comprises:
the first content data of the header, the first position information, and the merge instruction tag are stored in the first data table.
6. The method of claim 1, wherein determining the content cells in the target table other than the header based on the first location information comprises:
determining a candidate position area in the target table except the table head according to the first position information;
and screening out the cells with non-empty data values as content cells by detecting the data values of the cells in the candidate position area.
7. The method according to claim 1, wherein constructing key-value pair data corresponding to the content cell using the second content data and the second location information of the content cell according to a second processing rule comprises:
and combining the second content data and the second position information corresponding to the same content cell as a value and a key value respectively to obtain key value pair data corresponding to the content cell.
8. The method of claim 7, wherein after storing the key-value pair data in a second data table according to a table identification of a target table, the method further comprises:
and splitting the key value pair data in the second data table into a plurality of sub data tables for storage according to a preset splitting rule.
9. The method of claim 8, wherein splitting the key-value pair data in the second data table into a plurality of sub-data tables according to a preset splitting rule comprises:
determining the number of the sub data tables according to the number of the key value pair data contained in the second data table;
respectively carrying out Hash operation on the cell identifiers of the content cells in the second data table to obtain Hash values of the cell identifiers of the content cells;
and calculating and dividing the key value pair data of the content cell into corresponding sub data tables according to a remainder obtained by dividing the hash value of the cell identifier of the content cell by the number of the sub data tables.
10. The method of claim 1, wherein after storing the first content data and the first location information of the header in the first data table, the method further comprises:
detecting whether a drop-down frame exists in a target table or not;
under the condition that the drop-down box exists in the target table, third content data and third position information of the drop-down box are obtained; and storing the third content data and the third location information of the drop-down box in a third data table.
11. The method of claim 1, further comprising:
receiving a table reading request; the table reading request at least carries a table identifier of a target table to be read;
determining a corresponding first data table and a second data table according to the table identification of the target table;
reconstructing a target table according to the first data table and the second data table;
and displaying the target table to a user.
12. An apparatus for processing tabular data, comprising:
the receiving module is used for receiving a table storage request; the table storage request at least carries a target table to be stored;
the first extraction module is used for responding to the table storage request, acquiring and extracting first content data and first position information of a table header from the target table according to the table header parameters of the target table;
the first storage module is used for storing the first content data and the first position information of the header into a first data table according to the first processing rule and the table identifier of the target table; the first data table is used for storing related data of a table header in a table;
the second extraction module is used for determining content cells except the table head in the target table according to the first position information; processing the content cell to extract and obtain second content data and second position information of the content cell;
the processing module is used for constructing key value pair data corresponding to the content cells by utilizing the second content data and the second position information of the content cells according to a second processing rule;
the second storage module is used for storing the key value pair data into a second data table according to the table identification of the target table; and the second data table is used for storing the related data of the content cells in the table.
13. The apparatus of claim 12, further comprising a reading module;
the receiving module is further used for receiving a table reading request; the table reading request at least carries a table identifier of a target table to be read;
the reading module is used for determining a corresponding first data table and a second data table according to the table identification of the target table; reconstructing a target table according to the first data table and the second data table; and displaying the target table to a user.
14. A server comprising a processor and a memory for storing processor-executable instructions which, when executed by the processor, implement the steps of the method of any one of claims 1 to 11.
15. A computer program product comprising a computer program which, when executed by a processor, carries out the steps of the method according to any one of claims 1 to 11.
CN202210562451.9A 2022-05-23 2022-05-23 Processing method and device of table data and server Pending CN114896251A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210562451.9A CN114896251A (en) 2022-05-23 2022-05-23 Processing method and device of table data and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210562451.9A CN114896251A (en) 2022-05-23 2022-05-23 Processing method and device of table data and server

Publications (1)

Publication Number Publication Date
CN114896251A true CN114896251A (en) 2022-08-12

Family

ID=82722889

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210562451.9A Pending CN114896251A (en) 2022-05-23 2022-05-23 Processing method and device of table data and server

Country Status (1)

Country Link
CN (1) CN114896251A (en)

Similar Documents

Publication Publication Date Title
CN106980573B (en) Method, device and system for constructing test case request object
CN107220142B (en) Method and device for executing data recovery operation
CN105493028B (en) Data consistency and rollback for cloud analysis
CN112491602B (en) Behavior data monitoring method and device, computer equipment and medium
EP4099170B1 (en) Method and apparatus of auditing log, electronic device, and medium
CN111259004B (en) Method for indexing data in storage engine and related device
CN109241014B (en) Data processing method and device and server
CN112052138A (en) Service data quality detection method and device, computer equipment and storage medium
CN112766907A (en) Service data processing method and device and server
WO2022252512A1 (en) Root cause analysis method and apparatus, electronic device, medium, and program
CN114880405A (en) Data lake-based data processing method and system
CN113485999A (en) Data cleaning method and device and server
CN113326247A (en) Cloud data migration method and device and electronic equipment
CN111274283A (en) Track display method and device
CN112328631A (en) Production fault analysis method and device, electronic equipment and storage medium
CN112286827A (en) Software testing method, device, electronic device and storage medium
CN112100182A (en) Data warehousing processing method and device and server
CN113672692B (en) Data processing method, data processing device, computer equipment and storage medium
CN109857806B (en) Synchronous verification method and device for database table
CN112434104A (en) Redundant rule screening method and device for association rule mining
CN114896251A (en) Processing method and device of table data and server
CN116010480A (en) Time sequence database auditing method and system
CN110543426A (en) software performance risk detection method and device
CN115687406A (en) Sampling method, device and equipment of call chain data and storage medium
CN116628042A (en) Data processing method, device, 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