CN107436918B - Database implementation method, device and equipment - Google Patents

Database implementation method, device and equipment Download PDF

Info

Publication number
CN107436918B
CN107436918B CN201710465882.2A CN201710465882A CN107436918B CN 107436918 B CN107436918 B CN 107436918B CN 201710465882 A CN201710465882 A CN 201710465882A CN 107436918 B CN107436918 B CN 107436918B
Authority
CN
China
Prior art keywords
column
merged
value
original
values
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710465882.2A
Other languages
Chinese (zh)
Other versions
CN107436918A (en
Inventor
何嘉文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201710465882.2A priority Critical patent/CN107436918B/en
Publication of CN107436918A publication Critical patent/CN107436918A/en
Application granted granted Critical
Publication of CN107436918B publication Critical patent/CN107436918B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • 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

Abstract

The application provides a database implementation method, a database implementation device and database implementation equipment. The method comprises the following steps: determining original columns to be combined; for each record of the data table, merging the column values of the original columns to be merged according to a merging rule to obtain a merged column value; and correspondingly inserting a merged column value into the merged column of the data table. When the database is deployed, the column values of original columns to be merged can be merged according to the merging rules for each record of the data table to obtain merged column values, the merged column values are correspondingly inserted into the merged columns of the data table, the number of columns of the data table is reduced, the number of columns of a system main table is reduced, time consumed for reading and writing key information when the database is accessed for the first time is reduced, the first-time access rate is improved, and meanwhile, the occupation of a memory can be reduced.

Description

Database implementation method, device and equipment
Technical Field
The present application relates to the field of database technologies, and in particular, to a method, an apparatus, and a device for implementing a database.
Background
A database is a repository that organizes, stores, and manages data according to a data structure. When a database is accessed for the first time, some key information of the database is usually read into a memory, and a series of initialization operations are performed to realize subsequent normal access. How to increase the first access rate of the database and reduce the memory occupation is a problem to be solved urgently.
Disclosure of Invention
In view of this, the present application provides a database implementation method, apparatus and device.
Specifically, the method is realized through the following technical scheme:
a database implementation method, comprising:
determining original columns to be combined;
for each record of the data table, merging the column values of the original columns to be merged according to a merging rule to obtain a merged column value;
and correspondingly inserting a merged column value into the merged column of the data table.
A database implementation method, comprising:
reading column values from a data table of a database;
judging whether the read column value is a combined column value obtained by combining a plurality of original column values;
and if the read column value is the merged column value, reversely analyzing according to the merging rule to obtain the target column value.
A database-implemented apparatus, comprising:
a column determination unit that determines an original column to be merged;
a column value merging unit, configured to merge, according to a merge rule, column values of the original columns to be merged for each record of the data table, to obtain a merged column value;
and a column value insertion unit for correspondingly inserting the merged column value into the merged column of the data table.
A database-implemented apparatus, comprising:
a column value reading unit which reads column values from a data table of the database;
a merging judgment unit which judges whether the read column value is a merged column value obtained by merging a plurality of original column values;
and the column value analysis unit is used for reversely analyzing the read column value to obtain a target column value according to a merging rule if the read column value is a merged column value.
A database-implemented device, comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory corresponding to database-implemented control logic, the processor is caused to:
determining original columns to be combined;
for each record of the data table, merging the column values of the original columns to be merged according to a merging rule to obtain a merged column value;
and correspondingly inserting a merged column value into the merged column of the data table.
A database-implemented device, comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory corresponding to database-implemented control logic, the processor is caused to:
reading column values from a data table of a database;
judging whether the read column value is a combined column value obtained by combining a plurality of original column values;
and if the read column value is the merged column value, reversely analyzing according to the merging rule to obtain the target column value.
As can be seen from the above description, when the database is deployed, according to each record of the data table, the column values of the original columns to be merged may be merged according to the merging rule to obtain merged column values, and the merged column values are correspondingly inserted into the merged columns of the data table, so that the number of columns of the data table is reduced, the number of columns of the system main table is further reduced, time consumed for reading and writing the key information when the database is accessed for the first time is reduced, the rate of the first access is improved, and meanwhile, the occupation of the memory is reduced.
Drawings
Fig. 1 is a flowchart illustrating a database implementation method according to an exemplary embodiment of the present application.
Fig. 2 is a flow chart diagram illustrating another database implementation method according to an exemplary embodiment of the present application.
Fig. 3 is a schematic structural diagram of a database implementation apparatus according to an exemplary embodiment of the present application.
Fig. 4 is a block diagram illustrating a database implementation apparatus according to an exemplary embodiment of the present application.
Fig. 5 is a schematic structural diagram of another apparatus for implementing a database according to an exemplary embodiment of the present application.
Fig. 6 is a block diagram of another database implementation apparatus according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In the related art, taking the SQLite database as an example, when the SQLite database is accessed for the first time, the create statement stored in the system master table SQLite _ master is subjected to word segmentation, analysis and other operations, so as to generate a resident memory structure. The memory structure is used for storing some summary information of the SQLite database, such as: a manifest, an index name, a trigger name, etc. The more the number of columns of the data table in the SQLite database is, the more the columns of the SQLite _ master are, the more the read-write operation for accessing the SQLite database for the first time is, so that the low rate of the access for the first time is caused, and a large amount of memory is occupied.
In order to solve the above problems, the present application provides a database implementation scheme, which reduces the number of columns in the main table of the system by merging columns in the database data table, thereby improving the first access rate of the database and saving the memory space.
Fig. 1 is a flowchart illustrating a database implementation method according to an exemplary embodiment of the present application.
Referring to fig. 1, the database implementation method may be applied to an electronic device for organizing a database, which is deployed by an organizer of the database, and includes the following steps:
step 101, determining an original column to be merged.
In this embodiment, the original column represents a column that the database organizer plans to deploy when organizing the data table, such as: a column for storing a URL (Uniform Resource Locator), and the like.
In this embodiment, the original column with the smaller number of queries may be determined as the original column to be merged for the subsequent query operation. In an actual implementation, an original column with an access frequency less than a threshold may be determined as the original column to be merged, wherein the access frequency may be set by a developer.
For example, assuming that a database is used to store relevant data of an APP (Application), a data table of the database has an original column for storing a URL of a frequently-used button icon in the APP user interface, and the original column is usually only queried when a user starts up for the first time after downloading the APP, the original column may be determined as the original column to be merged.
Of course, those skilled in the art can also determine the original columns to be merged in other ways, such as: the original columns to be merged and the like are empirically specified, and this application does not specifically limit this.
And 102, merging the column values of the original columns to be merged according to a merging rule aiming at each record of the data table to obtain a merged column value.
In this embodiment, the merge rule may be set by a developer according to a specific type of a column value (the column value represents a value of a certain column in the record). In one example, if the column values of the original columns to be merged are all character strings, the original column values may be directly merged.
Recording Original column 1 to be merged Original column 2 to be merged Original column to be merged 3
25 Hdfh 46 Dfh98
TABLE 1
For example, assuming that a data table is determined to have 3 original columns to be merged, the column values of the 3 original columns to be merged of the 25 th record of the data table are shown in table 1, and after merging the 3 original column values, the merged column value "Hdfh, 46, Dfh 98" can be obtained.
In another example, if the column values of the original columns to be merged are not all character strings, the original column values to be merged may be first spliced together, and then the splicing result is serialized to convert the splicing result into a binary value, where the binary data is the merged column value obtained after the merging process. The serialization process can be freely implemented, and the application is not particularly limited to this.
In this embodiment, to facilitate the access device to identify the merged column value, a merged flag bit may be added to the merged column value, for example: this may be accomplished by adding a special character before or after the merged column value, etc.
And 103, correspondingly inserting a merged column value into the merged column of the data table.
Based on the foregoing step 102, after merging the column values of the original columns, merged column value correspondences may be inserted into the merged columns. The merged columns are independent of the columns in the data table that the database organizer plans to deploy when organizing the data table.
With reference to the embodiment shown in fig. 1, taking the SQLite database as an example, when a database organizer deploys the database, for each record of the data table, original column values that are not accessed or accessed less frequently, such as URLs and picture information, may be merged, and the merged column values obtained after merging are stored in a pre-specified merged column, so that the number of columns of the data table is reduced, and further the number of columns of the SQLite _ master is reduced. When the SQLite database is accessed for the first time, compared with the SQLite database before combination, the read-write operation is reduced, the access rate is improved, and meanwhile, the occupation of a memory can be reduced.
As can be seen from the above description, when the database is deployed, according to each record of the data table, the column values of the original columns to be merged may be merged according to the merging rule to obtain merged column values, and the merged column values are correspondingly inserted into the merged columns of the data table, so that the number of columns of the data table is reduced, the number of columns of the system main table is further reduced, time consumed for reading and writing the key information when the database is accessed for the first time is reduced, the rate of the first access is improved, and meanwhile, the occupation of the memory is reduced.
Based on the merging scheme shown in fig. 1, the present application further provides a database implementation method for database query. The database implementation method can be applied to access equipment, and the access equipment can be an intelligent terminal, a tablet computer, a PC (personal computer) and the like. Referring to fig. 2, the database implementation method includes the following steps:
at step 201, a column value is read from a data table of a database.
In this embodiment, the accessing of the database by the access device may include: read access and write access, wherein the write access may include: insert, modify, etc. For convenience of description, the read data may be referred to as column values (a column value indicates a value of a certain record in a certain column).
Step 202, determining whether the read column value is a merged column value obtained by merging a plurality of original column values.
Based on the foregoing step 201, after the column value is read, it may be determined whether the column value carries a merge flag bit, and if not, it may be determined that the read column value is not a merge column value, and the processing may be performed according to an implementation manner in the related art. If the read column value carries the merge flag, it can be said that the column value is a merged column value, and step 203 is executed.
In step 203, if the read column value is a merged column value, a target column value is obtained by reverse analysis according to a merging rule.
Based on the determination result in the foregoing step 202, after it is determined that the read column value is the merged column value, the merged column value may be analyzed to obtain the original column value before merging, and then the target column value accessed this time is found in the original column value.
Taking the merging rule as an example of serialization processing, in this step, for a merged column value, deserialization processing may be performed first to restore the serialized merged column value into a plurality of original column values, and then a target column value accessed this time is found in the plurality of original column values.
After the target column value is found, if the target column value is read access, the target column value can be filled into a field corresponding to the Object; and if the write access is performed, performing write operation on the target column value according to the write access, after the write operation is performed, merging a new target column value and a non-target column value in the merged column value according to a merging rule to obtain a new merged column value, and replacing the merged column value stored in the data table with the new merged column value.
For example, still taking the original column values shown in table 1 as an example, for the record, when the database organizing party organizes the database, the original column values of the original columns 1, 2, and 3 to be merged are serialized to obtain a merged column value 1. In this embodiment, the access device reads the merged column value 1 based on the write access, and then performs deserialization on the merged column value, and may restore the merged column value 1 to the original column value shown in table 1. Assuming that the write access needs to modify the original column value 2 to "48", the access device may modify the original column value 2 from "46" to "48", and then the access device may continue to concatenate the column value "Hdfh" of the original column 1, the new column value "48" of the original column 2, and the column value "Dfh 98" of the original column 3, and then perform serialization processing, and assuming that the merged column value 2 is obtained after the serialization processing, the access device updates the merged column value 1 in the data table with the merged column value 2, thereby implementing the write access to the merged column value.
In this embodiment, based on the database after the column value combination, the access device of the present application may still perform read access and write access.
Corresponding to the foregoing embodiment of the database implementation method shown in fig. 1, the present application also provides an embodiment of a database implementation apparatus.
The embodiment of the database implementation device can be applied to electronic equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is formed by reading, by a processor of the electronic device where the device is located, a corresponding computer program instruction in the nonvolatile memory into the memory for operation. From a hardware aspect, as shown in fig. 3, a hardware structure diagram of an electronic device in which the database implementation apparatus of the present application is located is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 3, the electronic device in which the apparatus is located in the embodiment may also include other hardware according to an actual function of the electronic device, which is not described again.
Fig. 4 is a block diagram illustrating a database implementation apparatus according to an exemplary embodiment of the present application.
Referring to fig. 4, the database implementation apparatus 300 can be applied to the electronic device shown in fig. 3, and includes: a column determination unit 301, a column value combining unit 302, and a column value inserting unit 303.
Wherein, the column determining unit 301 determines an original column to be merged;
a column value merging unit 302, configured to merge, according to a merge rule, column values of the original columns to be merged for each record of the data table, to obtain a merged column value;
column value inserting section 303 inserts a merged column value into the merged column of the data table.
Optionally, the column determining unit 301 determines an original column with an access frequency smaller than a threshold as an original column to be merged.
Optionally, the column value merging unit 302 is configured to perform serialization processing on the column value of the original column to be merged for each record in the data table, and determine a binary value obtained after the serialization processing as the merged column value.
Optionally, the column value merging unit 302 further adds a merging flag bit to the merged column value for identification by the access device.
Corresponding to the foregoing embodiment of the database implementation method shown in fig. 2, the present application also provides an embodiment of a database implementation apparatus.
The embodiment of the database implementation device can be applied to the access equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the access device where the software implementation is located as a logical means. From a hardware aspect, as shown in fig. 5, a hardware structure diagram of an access device where an apparatus for implementing a database is located in the present application is shown, where in addition to the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 5, the access device where the apparatus is located in the embodiment may also include other hardware according to an actual function of the access device, which is not described again.
Fig. 6 is a block diagram illustrating a database implementation apparatus according to an exemplary embodiment of the present application.
Referring to fig. 6, the database implementation apparatus 500 may be applied in the access device shown in fig. 5, and includes: a column value reading unit 501, a merge determination unit 502, a column value analysis unit 503, and a column value writing unit 504.
The column value reading unit 501 reads a column value from a data table of a database;
a merge judgment unit 502 that judges whether the read column value is a merged column value in which a plurality of original column values are merged;
the column value analyzing unit 503 performs reverse analysis according to the merge rule to obtain the target column value if the read column value is the merged column value.
Optionally, the merging judgment unit 502 includes: judging whether the read column values carry merging flag bits or not; and when the read column values carry the merging flag bit, determining the read column values as the merged column values obtained by merging the plurality of original column values.
Optionally, the merge rule includes: for each record of the data table, carrying out serialization processing on column values of a plurality of original columns to be merged;
the column value analysis unit 503 performs deserialization on the parallel values to obtain target column values.
Optionally, the access frequency of the original columns to be merged is less than a threshold.
Optionally, the column value reading unit reads a column value from a data table of a database based on write access;
a column value writing unit 504 that performs a write operation on the target column value according to the write access; after the write operation is finished, combining the new target column value and the non-target column value in the combined column value according to the combination rule to obtain a new combined column value; replacing the merged column value stored by the data table with the new merged column value.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
Corresponding to the foregoing embodiment of the database implementation method shown in fig. 1, the present application further provides a database implementation device, where the database implementation device includes: a processor and a memory for storing machine executable instructions. Wherein the processor and the memory are typically interconnected by means of an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, the processor is caused to:
determining original columns to be combined;
for each record of the data table, merging the column values of the original columns to be merged according to a merging rule to obtain a merged column value;
and correspondingly inserting a merged column value into the merged column of the data table.
Optionally, in determining the original columns to be merged, the processor is caused to:
and determining the original column with the access frequency smaller than the threshold value as the original column to be merged.
Optionally, when merging, according to a merging rule, column values of the original columns to be merged for each record of the data table, the processor is caused to:
and for each record of the data table, performing serialization processing on the column value of the original column to be merged, and determining a binary value obtained after the serialization processing as the merged column value.
Optionally, the processor is further caused to:
and adding a merging flag bit in the merging column value for the identification of the access device.
Corresponding to the foregoing embodiment of the database implementation method shown in fig. 1, the present application further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the following steps:
determining original columns to be combined;
for each record of the data table, merging the column values of the original columns to be merged according to a merging rule to obtain a merged column value;
and correspondingly inserting a merged column value into the merged column of the data table.
Optionally, the determining the original columns to be merged includes:
and determining the original column with the access frequency smaller than the threshold value as the original column to be merged.
Optionally, the merging, according to a merging rule, the column value of the original column to be merged for each record of the data table includes:
and for each record of the data table, performing serialization processing on the column value of the original column to be merged, and determining a binary value obtained after the serialization processing as the merged column value.
Optionally, the method further includes:
and adding a merging flag bit in the merging column value for the identification of the access device.
Corresponding to the foregoing embodiment of the database implementation method shown in fig. 2, the present application further provides a database implementation device, where the database implementation device includes: a processor and a memory for storing machine executable instructions. Wherein the processor and the memory are typically interconnected by means of an internal bus. In other possible implementations, the device may also include an external interface to enable communication with other devices or components.
In this embodiment, the processor is caused to:
reading column values from a data table of a database;
judging whether the read column value is a combined column value obtained by combining a plurality of original column values;
and if the read column value is the merged column value, reversely analyzing according to the merging rule to obtain the target column value.
Optionally, when determining whether the read column value is a merged column value obtained by merging a plurality of original column values, the processor is caused to:
judging whether the read column values carry merging flag bits or not;
and if the read column values carry the merging flag bit, determining the read column values as the merged column values obtained by merging the plurality of original column values.
Optionally, the merge rule includes: for each record of the data table, carrying out serialization processing on column values of a plurality of original columns to be merged;
upon reverse parsing a target column value according to a merge rule, the processor is caused to:
and performing deserialization processing on the merged column values to obtain target column values.
Optionally, the access frequency of the original columns to be merged is less than a threshold.
Optionally, upon reading a column value from a data table of the database, the processor is caused to:
reading column values from a data table of the database based on the write access;
the processor is further caused to: performing write operation on the target column value according to the write access;
after the write operation is finished, combining the new target column value and the non-target column value in the combined column value according to the combination rule to obtain a new combined column value;
replacing the merged column value stored by the data table with the new merged column value.
Corresponding to the embodiment of the database implementation method shown in the foregoing 2, the present application further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the following steps:
reading column values from a data table of a database;
judging whether the read column value is a combined column value obtained by combining a plurality of original column values;
and if the read column value is the merged column value, reversely analyzing according to the merging rule to obtain the target column value.
Optionally, the determining whether the read column value is a merged column value obtained by merging a plurality of original column values includes:
judging whether the read column values carry merging flag bits or not;
and if the read column values carry the merging flag bit, determining the read column values as the merged column values obtained by merging the plurality of original column values.
Optionally, the merge rule includes: for each record of the data table, carrying out serialization processing on column values of a plurality of original columns to be merged;
the obtaining of the target column value through reverse analysis according to the merging rule comprises the following steps:
and performing deserialization processing on the merged column values to obtain target column values.
Optionally, the access frequency of the original columns to be merged is less than a threshold.
Optionally, the reading a column value from a data table of the database includes:
reading column values from a data table of the database based on the write access;
the method further comprises the following steps:
performing write operation on the target column value according to the write access;
after the write operation is finished, combining the new target column value and the non-target column value in the combined column value according to the combination rule to obtain a new combined column value;
replacing the merged column value stored by the data table with the new merged column value.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (12)

1. A database implementation method, comprising:
determining original columns to be combined;
for each record of the data table, merging the column values of the original columns to be merged according to a merging rule to obtain a merged column value;
correspondingly inserting a merged column value into the combined row and parallel of the data table, wherein the combined row and parallel and merged column value are used for generating a resident memory structure when a database is accessed for the first time;
the determining of the original columns to be merged comprises:
determining the original column with the access frequency smaller than the threshold value as an original column to be merged;
and adding a merging flag bit in the merging column value for the identification of the access device.
2. The method according to claim 1, wherein the merging, according to a merging rule, the column values of the original columns to be merged for each record of the data table includes:
and for each record of the data table, performing serialization processing on the column value of the original column to be merged, and determining a binary value obtained after the serialization processing as the merged column value.
3. A database implementation method, comprising:
reading a column value from a data table of a database when the database is accessed for the first time;
judging whether the read column value is a combined column value obtained by combining a plurality of original column values, wherein the combined column value is obtained by combining the original column values with access frequencies smaller than a threshold value;
if the read column values are merged column values, reversely analyzing according to a merging rule to obtain a plurality of original column values corresponding to the merged column values, and determining a target column value from the plurality of original column values;
the determining whether the read column value is a merged column value obtained by merging a plurality of original column values includes:
judging whether the read column values carry merging flag bits or not;
and if the read column values carry the merging flag bit, determining the read column values as the merged column values obtained by merging the plurality of original column values.
4. The method of claim 3, wherein the first and second light sources are selected from the group consisting of,
the merge rule includes: for each record of the data table, carrying out serialization processing on column values of a plurality of original columns to be merged;
the reversely analyzing according to the merging rule to obtain a plurality of original column values corresponding to the merged column value, and determining a target column value from the plurality of original column values includes:
and performing deserialization processing on the merged column values to obtain a plurality of original column values, and determining a target column value from the plurality of original column values.
5. The method of claim 3, the reading a column value from a data table of a database comprising:
reading column values from a data table of the database based on the write access;
the method further comprises the following steps:
performing write operation on the target column value according to the write access;
after the write operation is finished, combining the new target column value and the non-target column value in the combined column value according to the combination rule to obtain a new combined column value;
replacing the merged column value stored by the data table with the new merged column value.
6. A database-implemented apparatus, comprising:
a column determination unit that determines an original column to be merged;
a column value merging unit, configured to merge, according to a merge rule, column values of the original columns to be merged for each record of the data table, to obtain a merged column value;
a column value insertion unit, which is used for correspondingly inserting a merged column value in the combined row and parallel of the data table, wherein the combined row and the merged column value are used for generating a resident memory structure when the database is accessed for the first time;
the column determining unit is used for determining the original column with the access frequency smaller than the threshold value as the original column to be merged; and the column value merging unit is also used for adding a merging flag bit in the merged column value for the identification of the access equipment.
7. The apparatus of claim 6, wherein the first and second electrodes are disposed on opposite sides of the substrate,
and the column value merging unit is used for serializing the column values of the original columns to be merged aiming at each record of the data table, and determining the binary values obtained after the serialization processing as the merged column values.
8. A database-implemented apparatus, comprising:
the column value reading unit is used for reading column values from a data table of the database when the database is accessed for the first time;
the merging judgment unit is used for judging whether the read column values are merged column values obtained by merging a plurality of original column values, wherein the merged column values are obtained by merging original column values with access frequencies smaller than a threshold value;
a column value analyzing unit, which obtains a plurality of original column values corresponding to the merged column value through reverse analysis according to a merging rule if the read column value is the merged column value, and determines a target column value from the plurality of original column values;
the merging judgment unit includes: judging whether the read column values carry merging flag bits or not; and when the read column values carry the merging flag bit, determining the read column values as the merged column values obtained by merging the plurality of original column values.
9. The apparatus of claim 8, wherein the first and second electrodes are disposed on opposite sides of the substrate,
the merge rule includes: for each record of the data table, carrying out serialization processing on column values of a plurality of original columns to be merged;
and the column value analysis unit is used for performing deserialization processing on the parallel values to obtain a plurality of original column values, and determining a target column value from the plurality of original column values.
10. The apparatus of claim 8, wherein the first and second electrodes are disposed on opposite sides of the substrate,
the column value reading unit reads column values from a data table of a database based on write access;
the device further comprises:
a column value writing unit that performs a write operation on the target column value according to the write access; after the write operation is finished, combining the new target column value and the non-target column value in the combined column value according to the combination rule to obtain a new combined column value; replacing the merged column value stored by the data table with the new merged column value.
11. A database-implemented device, comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory corresponding to database-implemented control logic, the processor is caused to:
determining original columns to be combined;
for each record of the data table, merging the column values of the original columns to be merged according to a merging rule to obtain a merged column value;
correspondingly inserting a merged column value into the combined row and parallel of the data table, wherein the combined row and parallel and merged column value are used for generating a resident memory structure when a database is accessed for the first time;
the determining of the original columns to be merged comprises:
determining the original column with the access frequency smaller than the threshold value as an original column to be merged;
and adding a merging flag bit in the merging column value for the identification of the access device.
12. A database-implemented device, comprising:
a processor;
a memory for storing machine executable instructions;
wherein, by reading and executing machine-executable instructions stored by the memory corresponding to database-implemented control logic, the processor is caused to:
reading a column value from a data table of a database when the database is accessed for the first time;
judging whether the read column value is a combined column value obtained by combining a plurality of original column values, wherein the combined column value is obtained by combining the original column values with access frequencies smaller than a threshold value;
if the read column values are merged column values, reversely analyzing according to a merging rule to obtain a plurality of original column values corresponding to the merged column values, and determining a target column value from the plurality of original column values;
the determining whether the read column value is a merged column value obtained by merging a plurality of original column values includes:
judging whether the read column values carry merging flag bits or not;
and if the read column values carry the merging flag bit, determining the read column values as the merged column values obtained by merging the plurality of original column values.
CN201710465882.2A 2017-06-19 2017-06-19 Database implementation method, device and equipment Active CN107436918B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710465882.2A CN107436918B (en) 2017-06-19 2017-06-19 Database implementation method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710465882.2A CN107436918B (en) 2017-06-19 2017-06-19 Database implementation method, device and equipment

Publications (2)

Publication Number Publication Date
CN107436918A CN107436918A (en) 2017-12-05
CN107436918B true CN107436918B (en) 2020-08-11

Family

ID=60459020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710465882.2A Active CN107436918B (en) 2017-06-19 2017-06-19 Database implementation method, device and equipment

Country Status (1)

Country Link
CN (1) CN107436918B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11841857B2 (en) 2022-02-22 2023-12-12 International Business Machines Corporation Query efficiency using merged columns

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102243624A (en) * 2010-11-02 2011-11-16 泗阳天琴软件科技有限公司 Several new functions of spreadsheet
CN102937931A (en) * 2012-09-25 2013-02-20 北京奇虎科技有限公司 Method and system of log data transmission
CN103646096A (en) * 2013-12-18 2014-03-19 用友软件股份有限公司 Method and device for generating sub-queries through user configuration
US8943058B1 (en) * 2009-12-14 2015-01-27 Teradata Us, Inc. Calculating aggregates of multiple combinations of a given set of columns

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8943058B1 (en) * 2009-12-14 2015-01-27 Teradata Us, Inc. Calculating aggregates of multiple combinations of a given set of columns
CN102243624A (en) * 2010-11-02 2011-11-16 泗阳天琴软件科技有限公司 Several new functions of spreadsheet
CN102937931A (en) * 2012-09-25 2013-02-20 北京奇虎科技有限公司 Method and system of log data transmission
CN103646096A (en) * 2013-12-18 2014-03-19 用友软件股份有限公司 Method and device for generating sub-queries through user configuration

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
"MySQL的合并两列,并添加到一个新列";融智技术学院;《http://blog.sina.com.cn/s/blog_768552710101jfpw.html》;20140212;第1页 *
"Oracle将一列分成多列";siege;《https://blog.csdn.net/u010999240/article/details/45652547/ 》;20150511;第1页Oracle将一列分成多列 *
"pandas dataframe 合并两列";匿名;《http://wenda.chinahadoop.cn/question/5669》;20170423;第1-2页 *
"如何拆分python中的DataFrame列";IT屋;《http://www.it1352.com/605470.html》;20170326;第1-3页 *
"将数据库中的两列合并成一列来显示";risotto;《https://www.xuebuyuan.com/256494.html》;20121020;第1-2页 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11841857B2 (en) 2022-02-22 2023-12-12 International Business Machines Corporation Query efficiency using merged columns

Also Published As

Publication number Publication date
CN107436918A (en) 2017-12-05

Similar Documents

Publication Publication Date Title
CN111241389A (en) Sensitive word filtering method and device based on matrix, electronic equipment and storage medium
US20230205755A1 (en) Methods and systems for improved search for data loss prevention
CN112181902A (en) Database storage method and device and electronic equipment
CN112347512A (en) Image processing method, device, equipment and storage medium
CN104714957A (en) List structure changing method and device
CN114780537A (en) Flow table storage and message forwarding method, device, computing equipment and medium
CN107391535A (en) The method and device of document is searched in document application
CN111241040B (en) Information acquisition method and device, electronic equipment and computer storage medium
CN112466378A (en) Solid state disk operation error correction method and device and related components
CN110059088B (en) Data attribute identification method, device and equipment in block chain type account book
US8726101B2 (en) Apparatus and method for tracing memory access information
US9164978B2 (en) Identifying objects within a multidimensional array
CN109416621A (en) Restore the free space in non-volatile memories using the computer memory system of shared object is supported
CN107436918B (en) Database implementation method, device and equipment
CN105117168A (en) Information processing method and electronic equipment
CN108241705A (en) A kind of data insertion method and device
CN111124883A (en) Test case library introduction method, system and equipment based on tree form
US9286349B2 (en) Dynamic search system
CN112036133B (en) File storage method and device, electronic equipment and storage medium
CN110990799A (en) Data processing method, device and system for anti-crawler and storage medium
KR102300444B1 (en) Document editing device to check whether the font applied to the document is a supported font and operating method thereof
CN107885861A (en) A kind of image indexing system and method
CN109783024B (en) Data storage processing method and device
CN106775586A (en) Data reordering method and device
CN107608947A (en) Html file processing method and processing device, electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Patentee before: Alibaba Group Holding Ltd.

TR01 Transfer of patent right