Data processing method and apparatus, storage medium and electronic device
AssigneeTencent Technology (Shenzhen) Company Limited
InventorsHaixiang Li, Sheng Ye
Life of this patent
Estimating the term…
Abstract
This application discloses a data processing method and apparatus, a storage medium and an electronic device. The method includes: obtaining, by the electronic device, at least one target row to be cleared at a target time from a data table of a row-oriented database; storing target attribute values recorded in the at least one target row to target pages in a column-oriented database; and clearing the at least one target row after the target time arrives. The application resolves the technical problem that it is difficult to trace historical data in the related data processing technology.
Claims15
A data processing method, applied to an electronic device having a processor and memory storing a plurality of programs to be executed by the processor, the method comprising:
- obtaining a plurality of target rows to be cleared at a target time from a data table of a row-oriented database, wherein the plurality of target rows are historical data indicative of a plurality of historical versions of a user account's data in the data table of the row-oriented database accumulated before the target time;
- storing target attribute values recorded in the plurality of target rows in target pages of a column-oriented database, including:
- storing the target attribute values recorded in each one of different target columns of the plurality of target rows in a dump transition page associated with the particular target column in an internal memory of the electronic device, different target columns having different associated dump transition pages in the internal memory of the electronic device, wherein the dump transition page associated with the particular target column is used for dumping the target attribute values recorded in the particular target column to a respective one of the target pages of the column-oriented database located at an external storage device associated with the electronic device;
- and
- when the dump transition page is filled with the target attribute values recorded in the particular target column, migrating the target attribute values recorded in the dump transition page in the internal memory of the electronic device to the respective one of the target pages of the column-oriented database located at the external storage device associated with the electronic device;
- clearing the plurality of target rows from the data table of the row-oriented database after the target time arrives;
- receiving query information used for performing a data query on the data table;
- sequentially querying the target pages of the column-oriented database and the data table of the row-oriented database by using the query information, to obtain a query result corresponding to the query information;
- and
- returning the query result.
An electronic device, comprising a processor and memory, the memory storing a plurality of programs that, when executed by the processor, cause the electronic device to perform a plurality of operations including:
- obtaining a plurality of target rows to be cleared at a target time from a data table of a row-oriented database, wherein the plurality of target rows are historical data indicative of a plurality of historical versions of a user account's data in the data table of the row-oriented database accumulated before the target time;
- storing target attribute values recorded in the plurality of target rows in target pages of a column-oriented database, including:
- storing the target attribute values recorded in each one of different target columns of the plurality of target rows in a dump transition page associated with the particular target column in an internal memory of the electronic device, different target columns having different associated dump transition pages in the internal memory of the electronic device, wherein the dump transition page associated with the particular target column is used for dumping the target attribute values recorded in the particular target column to a respective one of the target pages of the column-oriented database located at an external storage device associated with the electronic device;
- and
- when the dump transition page is filled with the target attribute values recorded in the particular target column, migrating the target attribute values recorded in the dump transition page in the internal memory of the electronic device to the respective one of the target pages of the column-oriented database located at the external storage device associated with the electronic device;
- clearing the plurality of target rows from the data table of the row-oriented database after the target time arrives;
- receiving query information used for performing a data query on the data table;
- sequentially querying the target pages of the column-oriented database and the data table of the row-oriented database by using the query information, to obtain a query result corresponding to the query information;
- and
- returning the query result.
A non-transitory computer-readable storage medium, storing a plurality of programs that, when executed by a processor of an electronic device, cause the electronic device to perform a plurality of operations including:
- obtaining a plurality of target rows to be cleared at a target time from a data table of a row-oriented database, wherein the plurality of target rows are historical data indicative of a plurality of historical versions of a user account's data in the data table of the row-oriented database accumulated before the target time;
- storing target attribute values recorded in the plurality of target rows in target pages of a column-oriented database, including:
- storing the target attribute values recorded in each one of different target columns of the plurality of target rows in a dump transition page associated with the particular target column in an internal memory of the electronic device, different target columns having different associated dump transition pages in the internal memory of the electronic device, wherein the dump transition page associated with the particular target column is used for dumping the target attribute values recorded in the particular target column to a respective one of the target pages of the column-oriented database located at an external storage device associated with the electronic device;
- and
- when the dump transition page is filled with the target attribute values recorded in the particular target column, migrating the target attribute values recorded in the dump transition page in the internal memory of the electronic device to the respective one of the target pages of the column-oriented database located at the external storage device associated with the electronic device;
- clearing the plurality of target rows from the data table of the row-oriented database after the target time arrives;
- receiving query information used for performing a data query on the data table;
- sequentially querying the target pages of the column-oriented database and the data table of the row-oriented database by using the query information, to obtain a query result corresponding to the query information;
- and
- returning the query result.
Dependencies are inferred from the claim text.