CPC G06F 16/2246 (2019.01) [G06F 16/2282 (2019.01); G06F 16/244 (2019.01)] | 14 Claims |
1. A method for processing a table, the method comprising:
receiving a content query request for a target table;
obtaining a target tree structure of the target table according to the content query request; wherein, the target tree structure is obtained by performing absorbing processing and merging processing on at least one target cell in the target table;
obtaining to-be-queried content in the content query request; and
querying, from the target tree structure, target content matching the to-be-queried content;
wherein obtaining the target tree structure comprises:
determining the at least one target cell in the target table;
performing absorbing processing, on the at least one target cell to obtain a tree structure corresponding to at least one absorbing cell respectively at an end of the absorbing processing;
performing merging processing on the at least one absorbing cell, to generate a tree structure corresponding, to a target parent node corresponding to a merged absorbing cell; and
using at least one target parent node as at least one target cell to continue performing the absorbing processing and merging processing until all cells are merged into one target tree structure, to obtain the target tree structure corresponding to the table;
wherein determining at least one target cell in the table, comprises:
determining the at least one target cell in the table and determining an absorbing direction corresponding to the at least one target cell respectively; wherein the absorbing direction comprises:
downward absorbing or rightward absorbing;
performing absorbing processing on the at least one target cell to obtain the tree structure corresponding to at least one absorbing cell respectively at the end of the absorbing processing comprises:
performing absorbing processing on the at least one target cell based on the absorbing direction corresponding to the at least one target cell respectively, to obtain the tree structure corresponding to the at least one absorbing cell respectively at the end of the absorbing processing; and
performing merging processing on the at least one absorbing cell, to generate a tree structure corresponding to the target parent node corresponding to the merged absorbing cell comprises:
performing, according to the absorbing direction corresponding to the at least one absorbing cell respectively, merging processing on the tree structure corresponding to the at least one absorbing cell respectively, to generate the tree structure corresponding to the target parent node corresponding to the merged absorbing cell;
wherein performing absorbing processing on the at least one target cell further comprises:
traversing the at least one target cell, and performing a plurality of operations on a current target cell being traversed before an end of the traversal, the operations comprising:
responsive to determining that the current target cell satisfies a parent node selection condition, using the current target cell as an absorbing cell, determining a corresponding to-be-absorbed cell based on an absorbing direction of the absorbing cell, generating a tree structure corresponding to the absorbing cell with the absorbing cell as a parent node and with the to-be-absorbed cell as a child node, and continuing to traverse a next unabsorbed target cell until the end of the traversal; or
responsive to determining that the current target cell does not satisfy a parent node selection condition, using the current target cell directly as an absorbing cell, and traversing a next target cell until the end of the traversal; and
obtaining the tree structure corresponding to the at least one absorbing cell respectively at the end of the absorbing processing.
|