Data processing method and device, electronic equipment, data query method and device and electronic equipment
By creating auxiliary tables for the source table to be adjusted in the database and storing the attribute fields of object type data, the problem of frequent serialization and deserialization operations is solved, and efficient storage and operation of object type data is achieved.
Patent Information
- Application Number
- CN202411842000.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-11
AI Technical Summary
When processing object type data in a database, the prior art requires frequent serialization and deserialization operations, resulting in high operation costs and low efficiency in querying and updating object attribute values.
By creating an auxiliary table for the source table to be adjusted and storing the attribute fields of the object type data in the auxiliary table separately, frequent serialization and deserialization operations are avoided, and a pointer to the attribute fields in the auxiliary table stored in the source table to be adjusted is stored, and the target source table is obtained.
It realizes separate storage of object type data attribute fields, optimizes the storage method of object type data, reduces operation costs, and improves query and update efficiency.
Smart Images

Figure CN119807197A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a data processing method, device and electronic device, and a data query method, device and electronic device. Background Art
[0002] When inserting object-type data into a database table or querying object-type data from a table, there is a conversion from a structured memory structure to a streaming storage format. Currently, object-type data stored in a table requires complete packing and unpacking operations during query and update.
[0003] If the database needs to query a specific attribute value in an object column, it must first obtain the complete object memory instance, and then access the member attribute value from the object memory instance. It cannot locate and access data as quickly as other conventional types (such as numeric types, string types, etc.); at the same time, if the user needs to modify a specific member inside the object, the existing method requires first taking out the object type data, unpacking it to obtain the object instance, then accessing and modifying the object attribute value, and finally performing a packing operation on the object instance, and inserting the packed data into the table again. The above operations have invisibly increased the operating cost of object type data. Summary of the invention
[0004] The present invention provides a data processing method, device and electronic device as well as a data query method, device and electronic device, which complete the storage of object type data by creating an auxiliary table for a source table.
[0005] According to one aspect of the present invention, there is provided a data processing method, comprising:
[0006] Acquire a source table to be adjusted that includes a target column, wherein the target column includes a column storing object type data in a database;
[0007] Determine a column to be adjusted in the source table to be adjusted, where the column to be adjusted is a column to be adjusted in the target column;
[0008] Creating an auxiliary table corresponding to the column to be adjusted, wherein the auxiliary table stores attribute fields of object type data stored in the column to be adjusted;
[0009] A pointer pointing to the row storing the attribute field in the auxiliary table is stored in the column to be adjusted to obtain a target source table.
[0010] According to another aspect of the present invention, there is provided a data query method, comprising:
[0011] Get the query statement;
[0012] Parsing the query statement to obtain a parsing result, wherein the parsing result indicates whether the query statement contains associated columns in the target source table except for the columns to be adjusted, and whether the query statement is a complete content of the query object type data;
[0013] According to the parsing result, the data required by the query statement is queried from the target source table and the corresponding auxiliary table.
[0014] According to another aspect of the present invention, there is provided a data processing device, comprising:
[0015] A first acquisition module is used to acquire a source table to be adjusted that includes a target column, where the target column includes a column storing object type data in a database;
[0016] A determination module, used for determining a column to be adjusted in the source table to be adjusted, wherein the column to be adjusted is a column to be adjusted in the target column;
[0017] A creation module, used for creating an auxiliary table corresponding to the column to be adjusted, wherein the auxiliary table stores attribute fields of object type data stored in the column to be adjusted;
[0018] The storage module is used to store a pointer pointing to the row storing the attribute field in the auxiliary table into the column to be adjusted to obtain a target source table.
[0019] According to another aspect of the present invention, there is provided a data query device, comprising:
[0020] The second acquisition module is used to acquire the query statement;
[0021] A parsing module, used to parse the query statement to obtain a parsing result, wherein the parsing result indicates whether the query statement contains associated columns in the target source table except the columns to be adjusted, and whether the query statement is a complete content of the query object type data;
[0022] A query module is used to query the data required by the query statement from the target source table and the corresponding auxiliary table according to the parsing result.
[0023] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0024] at least one processor; and
[0025] a memory communicatively connected to the at least one processor; wherein,
[0026] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data processing method described in any embodiment of the present invention.
[0027] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0028] at least one processor; and
[0029] a memory communicatively connected to the at least one processor; wherein,
[0030] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data query method described in any embodiment of the present invention.
[0031] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, wherein the computer instructions are used to enable a processor to implement the data processing method described in any embodiment of the present invention when executed, and wherein the computer instructions are used to enable a processor to implement the data query method described in any embodiment of the present invention when executed.
[0032] According to another aspect of the present invention, a computer program product is provided, which includes a computer program, and when the computer program is executed by a processor, it implements the data processing method described in any embodiment of the present invention, and when the computer program is executed by a processor, it implements the data query method described in any embodiment of the present invention.
[0033] The technical solution of the embodiment of the present invention first obtains the source table to be adjusted containing the target column, and determines the column to be adjusted in the source table to be adjusted, then creates an auxiliary table corresponding to the column to be adjusted, the auxiliary table stores the attribute field of the object type data stored in the column to be adjusted, and finally stores the pointer pointing to the row storing the attribute field in the auxiliary table in the column to be adjusted to obtain the target source table. By creating an auxiliary table for the source table to be adjusted and storing the attribute field of the object type data separately in the auxiliary table, frequent serialization and deserialization operations on the object type data are avoided, and the pointer pointing to the attribute field in the object type data stored in the auxiliary table is stored in the source table to be adjusted, and the target source table is obtained, and the separate storage of the attribute field of the object type data is realized, and the storage method of the object type data is optimized.
[0034] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 is a flow chart of a data processing method provided according to Embodiment 1 of the present invention;
[0037] Figure 2 is a flowchart of a validity information indication method provided according to Embodiment 2 of the present invention;
[0038] Figure 3 is a flow chart of a data query method provided according to Embodiment 3 of the present invention;
[0039] Figure 4 is a flowchart of a method for querying data required by a query statement provided in accordance with a fourth embodiment of the present invention;
[0040] Figure 5 is a structural schematic diagram of a data processing device provided according to Embodiment 5 of the present invention;
[0041] Figure 6 is a structural schematic diagram of a data query device provided according to Embodiment 6 of the present invention;
[0042] Figure 7 is a block diagram of an electronic device for implementing a data processing method provided according to a seventh embodiment of the present invention;
[0043] Figure 8 It is a block diagram of an electronic device for implementing a data query method provided according to a seventh embodiment of the present invention. DETAILED DESCRIPTION
[0044] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0045] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0046] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0047] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0048] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0049] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0050] Embodiment 1
[0051] Figure 1 A flowchart of a data processing method is provided for the first embodiment of the present invention. This embodiment is applicable to the case where an auxiliary table is created for a source table and object type data is stored in the auxiliary table. The method can be executed by a data processing device, which can be implemented in the form of hardware and / or software. The data processing device can be configured in an electronic device that implements the data processing method. Figure 1 As shown, the method includes:
[0052] S110: Acquire a source table to be adjusted that includes a target column, where the target column includes a column storing object type data in a database.
[0053] In this embodiment, the target column can be understood as a sequence of object type data stored in the database. The source table to be adjusted can be understood as a table in the database that stores data and needs to change the storage method. The storage method of the source table to be adjusted can be different from the conventional method, in which a pointer to a table composed of data in the target column is stored, while the conventional method only stores the data in each storage unit of the table. Object type data is a data type that abstractly describes the real world. It is generally defined as a binary large object type in the database and is stored in a streaming manner. The object encapsulates the attributes of the data, and the methods and / or behaviors for operating the data.
[0054] Specifically, a column storing object type data in a database is determined as a target column, and a source table to be adjusted containing the target column is obtained. The source table to be adjusted may have multiple rows and columns of storage units to store data, and the target column in the source table to be adjusted may contain multiple columns, each of which may store one type of object data.
[0055] For example, assuming that there is a "book" object in the database, and currently a "book management" table needs to be created, the "book management" table is the source table to be adjusted. The source table to be adjusted needs to contain two columns, "publishing house" and "book information", where the "book information" column can specify the information contained in the "book" object in the database, and the "book information" column is the target column. The source table to be adjusted can store the data of "publishing house" and "book information" of multiple books. The acquisition, storage and use of the data in the embodiment are in compliance with the provisions of relevant laws and regulations.
[0056] S120: Determine a column to be adjusted in the source table to be adjusted, where the column to be adjusted is a column to be adjusted in the target column.
[0057] In this embodiment, the column to be adjusted can be understood as a sequence in the target column whose storage mode can be adjusted.
[0058] Specifically, in the target column, there is a sequence whose storage mode can be adjusted, which can be used as the column to be adjusted. The column to be adjusted can include multiple attribute fields, and the information in the column to be adjusted can be stored as a separate table. Through the storage format of the target column, it can be determined whether the target column is used as the column to be adjusted.
[0059] For example, suppose there is a "book" object in the database, which contains three attributes: "book title", "category", and "language". The source table to be adjusted needs to contain two columns: "publisher" and "book information", where the "book information" column can be specified to store the information contained in the "book" object in the database, and the "book information" column is the target column, and the information contained in the "book" object in the database needs to be used frequently. The "book information" column can be used as the column to be adjusted, and the columns of the column to be adjusted include the three attribute fields of "book title", "category", and "language", and the rows of the column to be adjusted include the attribute values representing the three attribute fields of each book.
[0060] S130: Create an auxiliary table corresponding to the column to be adjusted, wherein the auxiliary table stores attribute fields of the object type data stored in the column to be adjusted.
[0061] In this embodiment, the auxiliary table can be understood as a table in a database and data management system used to support the source table. The main function of the auxiliary table is to store the attribute information of the object type data in the source table to help data management or improve query efficiency. The attribute field can be understood as a data item used to describe data characteristics, and is used to store specific types of data, such as book titles, categories, and / or languages.
[0062] Specifically, multiple attribute fields of the column to be adjusted are stored in an auxiliary table, each column of the auxiliary table can store the attribute value contained in an attribute field of an object type data, and each row of the auxiliary table can store the attribute value corresponding to each attribute field of each target.
[0063] Exemplarily, the column to be adjusted includes three attribute fields, namely, "Book Title", "Category", and "Language", and the above three attribute fields and their corresponding attribute values are stored in the auxiliary table. As shown in Table 1, the attribute values of a book with the title "Book A", the category "Fiction", and the language "Chinese" are stored therein. In addition, the auxiliary table includes packaging information for object type data and the validity of the packaging information, which are also added to the auxiliary table as two separate columns.
[0064] Table 1 "Book Information" auxiliary table
[0065] Title category language Packaging information Packaging information validity Book A novel Chinese (a string of binary data) efficient
[0066] S140: Store a pointer to the row storing the attribute field in the auxiliary table in the column to be adjusted to obtain a target source table.
[0067] In this embodiment, the target source table can be understood as being obtained by adjusting the storage mode of the source table to be adjusted. The target source table contains a pointer to the storage attribute field in the auxiliary table, and the target source table can be queried by statements in the database.
[0068] Specifically, a pointer is stored in the column to be adjusted of the source table to be adjusted, and the pointer points to the row in the auxiliary table storing the attribute value corresponding to the attribute field, and then the target source table is obtained. That is, the target source table stores a pointer to the attribute value corresponding to the attribute field stored in the auxiliary table and the attribute field and attribute value of the unadjusted column.
[0069] Exemplarily, only a pointer is inserted into the column to be adjusted in the source table to be adjusted, and the pointer points to the row data of the corresponding row in the auxiliary table, and the attribute field of the book is stored in the row data, and the target source table can be obtained. For example, it is necessary to insert a row of data (publishing house, book 01) in the source table to be adjusted in "Book Management", as shown in Table 2, where the attribute value of book 01 is (Book A, novel, Chinese) in the auxiliary table of "Book Information".
[0070] Table 2 "Book Management" target source table
[0071] publishing house Book Information Publisher A (pointer to the first row of data in the auxiliary table)
[0072] The technical solution of the embodiment of the present invention first obtains the source table to be adjusted containing the target column, and determines the column to be adjusted in the source table to be adjusted, then creates an auxiliary table corresponding to the column to be adjusted, the auxiliary table stores the attribute field of the object type data stored in the column to be adjusted, and finally stores the pointer pointing to the row storing the attribute field in the auxiliary table in the column to be adjusted to obtain the target source table. By creating an auxiliary table for the source table to be adjusted and storing the attribute field of the object type data separately in the auxiliary table, frequent serialization and deserialization operations on the object type data are avoided, and the pointer pointing to the attribute field in the object type data stored in the auxiliary table is stored in the source table to be adjusted, and the target source table is obtained, and the separate storage of the attribute field of the object type data is realized, and the storage method of the object type data is optimized.
[0073] Based on the above embodiment, a variant embodiment of the above embodiment is proposed. It should be noted that in order to make the description concise, only the differences from the above embodiment are described in the variant embodiment.
[0074] In one embodiment, determining the to-be-adjusted column in the to-be-adjusted source table includes:
[0075] Determine storage format information of the target column in the source table to be adjusted;
[0076] The target column corresponding to the storage format information indicating the storage format to be adjusted is determined as the column to be adjusted.
[0077] In this embodiment, the storage format information can be understood as a series of rules and standards used to describe how data is stored and / or encoded. The storage format information can be divided into a conventional method and a storage format to be adjusted. The conventional method is to directly store the attribute fields of the data, while the storage format to be adjusted is to store the attribute fields of the data in an auxiliary table and store a pointer to the attribute fields in the auxiliary table in the source table.
[0078] Specifically, the storage format information of each target column in the source table to be adjusted is obtained, and the target column containing multiple attribute fields with high update frequency and / or query frequency can be determined, and its storage format information is determined as the storage format to be adjusted. The target column whose storage format information is the storage format to be adjusted can be used as the column to be adjusted.
[0079] For example, the source table to be adjusted needs to contain two columns, "Publisher" and "Book Information", where the "Book Information" column can be specified to store the information contained in the "Book" object in the database and use it as the target column. The "Book" object contains three attribute fields, "Book Title", "Category", and "Language", and these three attribute fields are updated and / or queried by the database more frequently. Therefore, the target column of "Book Information" can be used as the column to be adjusted.
[0080] In one embodiment, the target column corresponding to the storage format information indicating the storage format to be adjusted includes a target column having an update frequency greater than an update threshold and / or a target column having a query frequency greater than a query threshold.
[0081] In this embodiment, the update frequency can be understood as the period at which data in the database is updated. The shorter the update period, the higher the frequency at which data is updated. The update threshold can be a threshold set for determining the storage format information, which can characterize the update frequency of data. The query frequency can be understood as the number of times data in the database is queried within a period of time. The more times the query is performed, the higher the query frequency of the data. The query threshold can be a threshold set for determining the storage format information, which can characterize the query frequency of data.
[0082] For example, when there are many object type data in the source table to be adjusted, there may be too many auxiliary tables, so users can be supported to specify storage format information. That is, by setting the update threshold and query threshold, the target column corresponding to the object type data is determined as the column to be adjusted. For object type data that needs to be frequently queried and / or updated, its target column can be used as the column to be adjusted and stored in the form of an auxiliary table to facilitate fast query and / or update operations; for other object type data that does not need to be frequently queried and / or updated, it is still stored in a conventional way, thereby reducing the number of auxiliary tables and saving storage space.
[0083] In one embodiment, after storing the pointer pointing to the row storing the attribute field in the auxiliary table in the to-be-adjusted column, the method further includes:
[0084] In the case where data in the to-be-adjusted column is to be updated, determining a pointer in the to-be-adjusted column;
[0085] Acquire the attribute field stored in the auxiliary table according to the pointer;
[0086] Update the attribute field.
[0087] Specifically, when the data in the column to be adjusted is first inserted into the auxiliary table, the pointer of each row of the auxiliary table is determined. The attribute field stored in the auxiliary table can be obtained according to the pointer. When the data in the column to be adjusted needs to be updated, the attribute field stored in the auxiliary table is found through the pointer, and the attribute value corresponding to the attribute field in the auxiliary table is updated.
[0088] Exemplarily, since the update of object type data may cause the invalidation of object packaging information, a column can be added to the auxiliary table to record the validity of the current object packaging information. It is set to valid when the object type data is initially inserted, and is set to invalid after any attribute value of the object type data is updated. Assuming that the "language" in the "book information" in the column to be adjusted needs to be updated to English, the "book information" auxiliary table corresponding to the pointer is obtained through the pointer in the column to be adjusted. Update the "language" of book 01 pointed to by the pointer in the auxiliary table to English.
[0089] Embodiment 2
[0090] Figure 2 This is a flow chart of a validity information indication method provided in the second embodiment of the present invention. Based on the above embodiment, when the auxiliary table also stores the packaging information of the object type data stored in the column to be adjusted and the validity information of the packaging information, it also includes a validity information indication method accordingly. Figure 2 As shown, the method includes:
[0091] S210: When the data in the to-be-adjusted column is to be updated, if some attributes of the object type data in the auxiliary table are updated, the validity information is updated to indicate invalid validity information.
[0092] In this embodiment, the packaging information can be understood as information formed by packaging the attribute fields inserted for the first time in the auxiliary table, and stored in a separate column in the auxiliary table. The validity information of the packaging information can be understood as information indicating whether the packaging information is valid. If some attribute fields in the auxiliary table have not been updated, the validity information indicates that the packaging information is valid; if some attribute fields in the auxiliary table have been updated, the validity information indicates that the packaging information is invalid; if all attribute fields in the auxiliary table have been updated, the validity information indicates that the packaging information is valid.
[0093] Specifically, when the data in the column to be adjusted is to be updated, if some attribute fields of the object type data in the auxiliary table are updated, but the attribute fields stored in the packaging information are not updated, then the packaging information cannot indicate the information of the object type data at this time, and the validity information in the auxiliary table needs to be updated to invalid.
[0094] Exemplarily, when updating the data in the column to be adjusted, directly update the data in the auxiliary table corresponding to the column to be adjusted. The specific method is: according to the pointer saved in the column to be adjusted, find the corresponding attribute field in the auxiliary table and update it, and change the validity of the packaged information to invalid. For example, when it is necessary to update the "language" in the "book information" in the column to be adjusted to English, obtain the "book information" auxiliary table corresponding to the pointer through the pointer in the column to be adjusted. Update the "language" of book 01 pointed to by the pointer in the auxiliary table to English, and update the "validity of packaged information" to invalid.
[0095] S220. When the data in the to-be-adjusted column is to be updated, if all the attributes of the object type data in the auxiliary table are updated, the corresponding packaging information is updated, and the validity information is set to indicate valid validity information.
[0096] Specifically, when the data in the column to be adjusted is to be updated, if all the attribute fields of the object type data in the auxiliary table are updated, the packaging information needs to be updated as well. At this time, the packaging information still indicates the information of the object type data after the update, and the validity information in the auxiliary table is valid.
[0097] For example, if the entire object type data is updated directly, for example, book 01 is updated to book 02, all the attribute information corresponding to book 01 is updated in the auxiliary table. The specific method is: according to the pointer stored in the column to be adjusted, find the corresponding attribute field in the auxiliary table, and update all attribute fields and packaging information, and the validity information of the packaging information is valid.
[0098] The technical solution of the embodiment of the present invention proposes a validity information indication method when the auxiliary table also stores the packing information of the object type data stored in the column to be adjusted and the validity information of the packing information. When the data in the column to be adjusted is to be updated, if some attributes of the object type data in the auxiliary table are updated, the validity information is updated to indicate invalid validity information; when the data in the column to be adjusted is to be updated, if all attributes of the object type data in the auxiliary table are updated, the corresponding packing information is updated, and the validity information is set to indicate valid validity information. The validity information of the packing information is determined by the update of the data in the column to be adjusted, the indication method of the validity information is refined, and the update of the information in the auxiliary table is completed.
[0099] Embodiment 3
[0100] Figure 3 A flowchart of a data query method is provided for the third embodiment of the present invention. This embodiment is applicable to the case where the required data is queried in the target source table according to the query statement, and the target source table can be constructed and updated by the data processing method provided by the embodiment of the present invention. The data query method can be executed by a data query device, which can be implemented in the form of hardware and / or software, and the data query device can be configured in an electronic device that implements the data query method. Figure 3 As shown, the method includes:
[0101] S310: Obtain a query statement.
[0102] In this embodiment, the query statement can be understood as a statement for querying the attribute values in the object type data in the database, and the query statement can be a structured statement for operating the data stored in the database.
[0103] Specifically, in a database management system, when a certain attribute in a table needs to be queried, a query statement needs to be generated, which includes the table to be queried and the attribute fields of the object type data.
[0104] S320: Parse the query statement to obtain a parsing result, wherein the parsing result indicates whether the query statement contains associated columns in the target source table except for the columns to be adjusted, and whether the query statement is a complete content of the query object type data.
[0105] In this embodiment, the parsing result can be understood as being used to indicate the columns in the query statement, and can also indicate the content of the object type data queried by the query statement. The associated column can be understood as a column in the target source table other than the column to be adjusted, and the attribute value of the data is directly stored in the associated column.
[0106] Specifically, according to the parsing result of the query statement, it is determined whether the query statement contains associated columns, that is, other columns in the target source table except the column to be adjusted, and whether the auxiliary table can be directly queried. The parsing result can also be used to determine whether the query statement queries the complete content of the object type data, that is, whether the query statement contains the attribute fields of the auxiliary table.
[0107] S330: Query the data required by the query statement from the target source table and the corresponding auxiliary table according to the parsing result.
[0108] Specifically, first determine whether to query the complete content of the object type data according to the query statement. If so, determine whether the query statement contains associated columns. If so, query the target source table according to the associated columns. If not, query directly to obtain the data required by the query statement. If not, determine whether the query statement contains associated columns. If so, query the target source table according to the attribute fields and associated columns of the object type data in the query statement. If not, query directly to obtain the data required by the query statement based on the attribute fields of the object type data in the query statement.
[0109] The technical solution of the embodiment of the present invention first obtains a query statement, then parses the query statement to obtain a parsing result, the parsing result indicates whether the query statement contains associated columns in the target source table except for the columns to be adjusted, and whether the query statement is the complete content of the query object type data, and finally queries the data required by the query statement from the target source table and the corresponding auxiliary table according to the parsing result. The required data is queried in the target source table through the query statement, and the object type data in the target source table is queried according to the pointer, etc., which improves the query efficiency and reduces the frequency of operations on the object type data.
[0110] Embodiment 4
[0111] Figure 4 This is a flowchart of a method for querying data required by a query statement provided in Embodiment 4 of the present invention. This embodiment is developed with respect to the method for determining data required by a query statement in the above embodiments. Figure 4 As shown, the method includes:
[0112] S410. When the parsing result indicates that the query statement is a statement for querying the values of some attributes in the object type data, and the query statement contains the associated column, determine the pointer stored in the column to be adjusted corresponding to the associated column in the target source table, and query the row of the corresponding storage attribute field in the corresponding auxiliary table according to the pointer to obtain the value of the attribute queried by the query statement in the row.
[0113] Specifically, when the parsing result of the query statement indicates that the query statement is a query of partial attribute values in the object type data, and the query statement contains associated columns, it is necessary to first find the column to be adjusted corresponding to the associated column in the target source table, find the corresponding auxiliary table according to the pointer stored therein, and query the attribute values of the corresponding rows of the storage attribute fields in the auxiliary table according to the parsing result of the query statement to obtain the data required by the query statement.
[0114] For example, assume that the query statement is: SELECT "Book Information.Book Title" FROM "Book Management" WHERE "Publisher" = "Publisher A". The parsing result of this statement indicates that the query statement queries the partial attribute value "Book Title" in the object type data, and the query statement contains the associated column "Publisher". You need to first find the columns to be adjusted corresponding to all associated columns with "Publisher" being "Publisher A" in the target source table "Book Management", find the row storing the corresponding attribute field in the auxiliary table according to the pointer in the column "Book Information" to be adjusted, and then obtain the attribute value of the "Book Title" column of the corresponding attribute field in the auxiliary table.
[0115] S420. When the parsing result indicates that the query statement is a statement for querying values of some attributes in object type data, and the query statement does not contain the associated column, query the values of the attributes queried by the query statement in all rows storing attribute fields in the auxiliary table associated with the target source table.
[0116] Specifically, when the parsing result of the query statement indicates that the query statement is a query of partial attribute values in the object type data, and the query statement does not contain associated columns, the auxiliary table associated with the target source table is directly queried, and the attribute values of all rows of the storage attribute fields in the auxiliary table are queried according to the parsing result of the query statement to obtain the data required by the query statement.
[0117] For example, assume that the query statement is: SELECT "book information.book title" FROM "book management". The parsing result of this statement indicates that the query statement queries the partial attribute value "book title" in the object type data, and the query statement does not contain the associated column. At this time, you can directly query the auxiliary table corresponding to the target source table "book information" to obtain the "book title" column attribute value of the corresponding attribute field in the auxiliary table.
[0118] S430. When the parsing result indicates that the query statement is a statement for querying the value of the complete content in the object type data, and the query statement contains the associated column, determine the pointer stored in the column to be adjusted corresponding to the associated column in the target source table, and query the row of the corresponding storage attribute field in the corresponding auxiliary table according to the pointer, obtain the packing information in the row and the validity information of the packing information, unpack the attribute field in the row according to the packing information and the validity information, obtain the object instance, and obtain the complete content of the object type data corresponding to the object instance.
[0119] Specifically, when the parsing result of the query statement indicates that the query statement is the value of the complete content in the query object type data, and the query statement contains associated columns. It is necessary to first find the column to be adjusted corresponding to the associated column in the target source table, and find the corresponding auxiliary table according to the pointer stored therein. According to the corresponding row storing the attribute field in the auxiliary table, the packing information and the validity information of the packing information, the attribute field in the row is unpacked to obtain the object instance. When unpacking the attribute field, if the validity information of the packing information indicates valid, the attribute field is directly unpacked according to the packing information to obtain the object instance; if the validity information of the packing information indicates invalid, the conventional method of constructing the object instance is used to construct the corresponding object instance according to the attribute value recorded in the auxiliary table.
[0120] For example, assume that the query statement is: SELECT "Book Information" FROM "Book Management" WHERE "Publisher" = "Publisher A". The parsing result of this statement indicates that the query statement queries the complete content in the object type data, and the query statement contains the associated column "Publisher". It is necessary to first find the columns to be adjusted corresponding to all associated columns with "Publisher" as "Publisher A" in the target source table "Book Management", and find the corresponding auxiliary table according to the pointer in the "Book Information" column of the column to be adjusted. According to the corresponding rows of the storage attribute fields in the auxiliary table, as well as the packaging information and validity information of the packaging information, the attribute fields in the rows are unpacked to obtain the object instance.
[0121] S440. When the parsing result indicates that the query statement is a statement for querying the value of the complete content in the object type data, and the query statement does not contain the associated column, query the packing information and the validity information of the packing information in the rows storing all attribute fields in the auxiliary table associated with the target source table, unpack the attribute fields in the corresponding rows according to the packing information and the validity information to obtain the object instance, so as to obtain the complete content of the object type data corresponding to the object instance.
[0122] Specifically, when the parsing result of the query statement indicates that the query statement is the value of the complete content in the query object type data, and the query statement does not contain associated columns. Directly query the auxiliary table associated with the target source table, obtain the packaging information and validity information of the packaging information in all rows storing attribute fields in the auxiliary table, and unpack the attribute fields accordingly to obtain the object instance. The unpacking method is consistent with the unpacking method described in S430.
[0123] For example, assume that the query statement is: SELECT "book information" FROM "book management". The parsing result of this statement indicates that the query statement queries the complete content in the object type data, and the query statement does not contain the associated column. At this time, you can directly query all the storage attribute fields in the auxiliary table corresponding to "book information" in the target source table, obtain the packaging information and the validity information of the packaging information, and unpack it to obtain the object instance.
[0124] The technical solution of the embodiment of the present invention queries the data required by the query statement according to the parsing result of the query statement. The query statement determines whether to query the complete content of the object type data and whether the query statement contains associated columns, and obtains the data required by the query statement. Finally, the data is unpacked to obtain the object instance, completing the operation of the query statement, and refining the method of obtaining the data required by the query statement.
[0125] Embodiment 5
[0126] Figure 5 This is a schematic diagram of the structure of a data processing device provided in Embodiment 5 of the present invention. Figure 5 As shown, the device comprises:
[0127] A first acquisition module 510 is used to acquire a source table to be adjusted that includes a target column, where the target column includes a column storing object type data in a database;
[0128] A determination module 520 is used to determine a column to be adjusted in the source table to be adjusted, where the column to be adjusted is a column to be adjusted in the target column;
[0129] A creation module 530, configured to create an auxiliary table corresponding to the column to be adjusted, wherein the auxiliary table stores attribute fields of object type data stored in the column to be adjusted;
[0130] The storage module 540 is used to store the pointer pointing to the row storing the attribute field in the auxiliary table into the column to be adjusted to obtain the target source table.
[0131] The data processing device provided by the embodiment of the present invention first obtains the source table to be adjusted containing the target column through the first acquisition module, and determines the column to be adjusted in the source table to be adjusted through the determination module, then creates the auxiliary table corresponding to the column to be adjusted through the creation module, and the attribute field of the object type data stored in the column to be adjusted is stored in the auxiliary table, and finally the pointer pointing to the row storing the attribute field in the auxiliary table is stored in the column to be adjusted through the storage module, so as to obtain the target source table. Through the cooperation between the modules, an auxiliary table is created for the source table to be adjusted, and the attribute field of the object type data is stored separately in the auxiliary table, so as to avoid frequent serialization and deserialization operations on the object type data, and the pointer pointing to the attribute field in the object type data stored in the auxiliary table is stored in the source table to be adjusted, so as to obtain the target source table, realize the separate storage of the attribute field of the object type data, and optimize the storage method of the object type data.
[0132] In one embodiment, the determination module 520 is specifically configured to:
[0133] Determine storage format information of the target column in the source table to be adjusted;
[0134] The target column corresponding to the storage format information indicating the storage format to be adjusted is determined as the column to be adjusted.
[0135] In one embodiment, the target column corresponding to the storage format information indicating the storage format to be adjusted includes a target column having an update frequency greater than an update threshold and / or a target column having a query frequency greater than a query threshold.
[0136] In one embodiment, the data processing device further includes an updating module, which is specifically configured to:
[0137] In the case where data in the to-be-adjusted column is to be updated, determining a pointer in the to-be-adjusted column;
[0138] Acquire the attribute field stored in the auxiliary table according to the pointer;
[0139] Update the attribute field.
[0140] In one embodiment, the auxiliary table further stores packaging information of the object type data stored in the to-be-adjusted column and validity information of the packaging information. Accordingly, the data processing device further includes an indication module, which is specifically used to:
[0141] In the case where the data in the to-be-adjusted column is to be updated, if some attributes of the object type data in the auxiliary table are updated, the validity information is updated to indicate invalid validity information;
[0142] In the case where the data in the to-be-adjusted column is to be updated, if all the attributes of the object type data in the auxiliary table are updated, the corresponding packaging information is updated, and the validity information is set to indicate valid validity information.
[0143] The data processing device provided in the embodiment of the present invention can execute the data processing method provided in any embodiment of the present invention, completes the processing of data through the mutual cooperation and collaboration between the modules, and has the functional modules and beneficial effects corresponding to the execution method.
[0144] Embodiment 6
[0145] Figure 6 This is a schematic diagram of the structure of a data query device provided by Embodiment 6 of the present invention. Figure 6 As shown, the device comprises:
[0146] The second acquisition module 610 is used to acquire a query statement;
[0147] A parsing module 620 is used to parse the query statement to obtain a parsing result, wherein the parsing result indicates whether the query statement contains associated columns in the target source table except the columns to be adjusted, and whether the query statement is a complete content of the query object type data;
[0148] The query module 630 is used to query the data required by the query statement from the target source table and the corresponding auxiliary table according to the parsing result.
[0149] The data query device provided by the embodiment of the present invention first obtains the query statement through the second acquisition module, and then parses the query statement through the parsing module to obtain the parsing result, the parsing result indicates whether the query statement contains the associated columns in the target source table except the columns to be adjusted, and whether the query statement is the complete content of the query object type data, and finally the query module queries the data required by the query statement from the target source table and the corresponding auxiliary table according to the parsing result. Through the cooperation between the modules, the query statement queries the required data in the target source table, and performs operations such as querying the object type data in the target source table according to the pointer, thereby improving the query efficiency and reducing the frequency of operations on the object type data.
[0150] In one embodiment, the query module 630 is specifically configured to:
[0151] When the parsing result indicates that the query statement is a statement for querying values of some attributes in object type data, and the query statement contains the associated column, determine a pointer stored in a column to be adjusted corresponding to the associated column in the target source table, and query a row of a corresponding storage attribute field in the corresponding auxiliary table according to the pointer to obtain a value of the attribute queried by the query statement in the row;
[0152] When the parsing result indicates that the query statement is a statement for querying values of some attributes in object type data, and the query statement does not contain the associated column, querying the values of the attributes queried by the query statement in all rows storing attribute fields in the auxiliary table associated with the target source table;
[0153] In the case where the parsing result indicates that the query statement is a statement for querying the value of the complete content in the object type data, and the query statement contains the associated column, determining the pointer stored in the column to be adjusted corresponding to the associated column in the target source table, and querying the row storing the corresponding attribute field in the corresponding auxiliary table according to the pointer, obtaining the packing information in the row and the validity information of the packing information, unpacking the attribute field in the row according to the packing information and the validity information to obtain the object instance, so as to obtain the complete content of the object type data corresponding to the object instance;
[0154] When the parsing result indicates that the query statement is a statement for querying the value of the complete content in the object type data, and the query statement does not contain the associated column, query the packing information and the validity information of the packing information in the rows storing all attribute fields in the auxiliary table associated with the target source table, unpack the attribute fields in the corresponding rows according to the packing information and the validity information, and obtain the object instance to obtain the complete content of the object type data corresponding to the object instance.
[0155] The data query device provided in the embodiment of the present invention can execute the data query method provided in any embodiment of the present invention, completes the query of data through the mutual cooperation and collaboration between the modules, and has the functional modules and beneficial effects corresponding to the execution method.
[0156] Embodiment 7
[0157] According to an embodiment of the present invention, the present invention also provides an electronic device, a computer-readable storage medium and a computer program product.
[0158] Figure 7It is a block diagram of an electronic device for implementing a data processing method provided according to Embodiment 7 of the present invention, and the electronic device can implement the data processing method described in the embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0159] like Figure 7 As shown, the electronic device 710 includes at least one processor 711, and a memory connected to the at least one processor 711 in communication, such as a read-only memory (ROM) 712, a random access memory (RAM) 713, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 711 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 712 or the computer program loaded from the storage unit 718 to the random access memory (RAM) 713. In the RAM 713, various programs and data required for the operation of the electronic device 710 can also be stored. The processor 711, the ROM 712, and the RAM 713 are connected to each other via a bus 714. An input / output (I / O) interface 715 is also connected to the bus 714.
[0160] A number of components in the electronic device are connected to the I / O interface 715, including: an input unit 716, such as a keyboard, a mouse, etc.; an output unit 717, such as various types of displays, speakers, etc.; a storage unit 718, such as a disk, an optical disk, etc.; and a communication unit 719, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 719 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0161] The processor 711 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 711 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 711 performs the various methods and processes described above, such as a data processing method.
[0162] In some embodiments, the data processing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 718. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 710 via the ROM 712 and / or the communication unit 719. When the computer program is loaded into the RAM 713 and executed by the processor 711, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the processor 711 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).
[0163] Figure 8 It is a block diagram of an electronic device for implementing a data query method provided according to Embodiment 7 of the present invention, and the electronic device can implement the data query method described in the embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0164] like Figure 8 As shown, the electronic device 810 includes at least one processor 811, and a memory connected to the at least one processor 811 in communication, such as a read-only memory (ROM) 812, a random access memory (RAM) 813, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 811 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 812 or the computer program loaded from the storage unit 818 to the random access memory (RAM) 813. In the RAM 813, various programs and data required for the operation of the electronic device 810 can also be stored. The processor 811, the ROM 812, and the RAM 813 are connected to each other via a bus 814. An input / output (I / O) interface 815 is also connected to the bus 814.
[0165] A number of components in the electronic device are connected to the I / O interface 815, including: an input unit 816, such as a keyboard, a mouse, etc.; an output unit 817, such as various types of displays, speakers, etc.; a storage unit 818, such as a disk, an optical disk, etc.; and a communication unit 819, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 819 allows the electronic device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0166] The processor 811 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 811 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 811 executes the various methods and processes described above, such as a data query method.
[0167] In some embodiments, the data query method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 818. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 810 via the ROM 812 and / or the communication unit 819. When the computer program is loaded into the RAM 813 and executed by the processor 811, one or more steps of the data query method described above may be performed. Alternatively, in other embodiments, the processor 811 may be configured to perform the data query method in any other appropriate manner (e.g., by means of firmware).
[0168] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0169] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0170] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0171] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0172] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0173] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0174] In some embodiments, the computer program product includes a computer program, and when the computer program is executed by a processor, it implements the data processing method and the data query method provided by the embodiments of the present invention.
[0175] The technical solution of the embodiment of the present invention is through a data processing method, device and electronic device as well as a data query method, device and electronic device. First, a source table to be adjusted containing a target column is obtained, and the column to be adjusted in the source table to be adjusted is determined, then an auxiliary table corresponding to the column to be adjusted is created, and the attribute field of the object type data stored in the column to be adjusted is stored in the auxiliary table, and finally a pointer pointing to the row storing the attribute field in the auxiliary table is stored in the column to be adjusted to obtain the target source table. The present invention avoids frequent serialization and deserialization operations on the object type data by creating an auxiliary table for the source table to be adjusted and storing the attribute field of the object type data separately in the auxiliary table, and stores the pointer pointing to the attribute field in the object type data stored in the auxiliary table in the source table to be adjusted, thereby obtaining the target source table, realizing the separate storage of the attribute field of the object type data, and optimizing the storage method of the object type data.
[0176] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0177] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data processing method, characterized in that: include: Acquire a source table to be adjusted that includes a target column, wherein the target column includes a column storing object type data in a database; Determine a column to be adjusted in the source table to be adjusted, where the column to be adjusted is a column to be adjusted in the target column; Creating an auxiliary table corresponding to the column to be adjusted, wherein the auxiliary table stores attribute fields of object type data stored in the column to be adjusted; A pointer pointing to the row storing the attribute field in the auxiliary table is stored in the column to be adjusted to obtain a target source table.
2. The method according to claim 1, characterized in that The determining the to-be-adjusted column in the to-be-adjusted source table includes: Determine storage format information of the target column in the source table to be adjusted; The target column corresponding to the storage format information indicating the storage format to be adjusted is determined as the column to be adjusted.
3. The method according to claim 1 or 2, characterized in that: The target column corresponding to the storage format information indicating the storage format to be adjusted includes a target column having an update frequency greater than an update threshold and / or a target column having a query frequency greater than a query threshold.
4. The method according to claim 1, characterized in that After storing the pointer pointing to the row storing the attribute field in the auxiliary table into the column to be adjusted, the method further includes: In the case where data in the to-be-adjusted column is to be updated, determining a pointer in the to-be-adjusted column; Acquire the attribute field stored in the auxiliary table according to the pointer; Update the attribute field.
5. The method according to claim 1, characterized in that: The auxiliary table also stores packaging information of the object type data stored in the to-be-adjusted column and validity information of the packaging information. Accordingly, the method further includes: In the case where the data in the to-be-adjusted column is to be updated, if some attributes of the object type data in the auxiliary table are updated, the validity information is updated to indicate invalid validity information; In the case where the data in the to-be-adjusted column is to be updated, if all the attributes of the object type data in the auxiliary table are updated, the corresponding packaging information is updated, and the validity information is set to indicate valid validity information.
6. A data query method, characterized in that: include: Get the query statement; Parsing the query statement to obtain a parsing result, wherein the parsing result indicates whether the query statement contains associated columns in the target source table except for the columns to be adjusted, and whether the query statement is a complete content of the query object type data; According to the parsing result, the data required by the query statement is queried from the target source table and the corresponding auxiliary table.
7. The method according to claim 6, characterized in that The querying the data required by the query statement from the target source table and the corresponding auxiliary table according to the parsing result includes: When the parsing result indicates that the query statement is a statement for querying values of some attributes in object type data, and the query statement contains the associated column, determine a pointer stored in a column to be adjusted corresponding to the associated column in the target source table, and query a row of a corresponding storage attribute field in the corresponding auxiliary table according to the pointer to obtain a value of the attribute queried by the query statement in the row; When the parsing result indicates that the query statement is a statement for querying values of some attributes in object type data, and the query statement does not contain the associated column, querying the values of the attributes queried by the query statement in all rows storing attribute fields in the auxiliary table associated with the target source table; In the case where the parsing result indicates that the query statement is a statement for querying the value of the complete content in the object type data, and the query statement contains the associated column, determining the pointer stored in the column to be adjusted corresponding to the associated column in the target source table, and querying the row storing the corresponding attribute field in the corresponding auxiliary table according to the pointer, obtaining the packing information in the row and the validity information of the packing information, unpacking the attribute field in the row according to the packing information and the validity information to obtain the object instance, so as to obtain the complete content of the object type data corresponding to the object instance; When the parsing result indicates that the query statement is a statement for querying the value of the complete content in the object type data, and the query statement does not contain the associated column, query the packing information and the validity information of the packing information in the rows storing all attribute fields in the auxiliary table associated with the target source table, unpack the attribute fields in the corresponding rows according to the packing information and the validity information, and obtain the object instance to obtain the complete content of the object type data corresponding to the object instance.
8. A data processing device, characterized in that: include: A first acquisition module is used to acquire a source table to be adjusted that includes a target column, where the target column includes a column storing object type data in a database; A determination module, used for determining a column to be adjusted in the source table to be adjusted, wherein the column to be adjusted is a column to be adjusted in the target column; A creation module, used for creating an auxiliary table corresponding to the column to be adjusted, wherein the auxiliary table stores attribute fields of object type data stored in the column to be adjusted; The storage module is used to store a pointer pointing to the row storing the attribute field in the auxiliary table into the column to be adjusted to obtain a target source table.
9. A data query device, characterized in that: include: The second acquisition module is used to acquire the query statement; A parsing module, used to parse the query statement to obtain a parsing result, wherein the parsing result indicates whether the query statement contains associated columns in the target source table except the columns to be adjusted, and whether the query statement is a complete content of the query object type data; A query module is used to query the data required by the query statement from the target source table and the corresponding auxiliary table according to the parsing result.
10. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the data processing method according to any one of claims 1 to 5.
11. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data query method according to any one of claims 6 to 7.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data processing method described in any one of claims 1-5 when executed, and the computer instructions are used to enable a processor to implement the data query method described in any one of claims 6-7 when executed.
13. A computer program product, characterized in that The computer program product comprises a computer program, which implements the data processing method according to any one of claims 1 to 5 when executed by a processor, and which implements the data query method according to any one of claims 6 to 7 when executed by a processor.