Data processing method and device, equipment, storage medium and program product

By parsing variable declaration statements to determine table types and creating table variables, the inefficiency and high maintenance costs of traditional databases in temporary data storage scenarios are solved, enabling flexible data processing and cost reduction.

CN121255802APending Publication Date: 2026-01-02CETC JINCANG (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511301720.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-11
Publication Date
2026-01-02

AI Technical Summary

Technical Problem

Traditional database design patterns are inefficient and costly to maintain when faced with complex and ever-changing data storage and management needs, making it difficult to meet the flexible needs of business development. In particular, in temporary data storage scenarios, constraints are complex, index creation is limited, and sequence support is insufficient.

Method used

The variable declaration statement is parsed to obtain the type identifier, determine whether it is a table type, and if so, a table variable is created. When an operation statement is received, data processing operations are performed. Table type features are integrated to avoid redefining the table structure and table variables are used to flexibly process data.

Benefits of technology

It improves database efficiency, reduces maintenance costs, ensures data accuracy and consistency, breaks through the index limitations of traditional temporary tables, and enhances query efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121255802A_ABST
    Figure CN121255802A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data processing method and device, equipment, a storage medium and a program product, and is applied to the technical field of databases. The method comprises the steps that under the condition that a variable declaration statement is received, the variable declaration statement is analyzed, and a type identifier of a type quoted by a target variable of declaration is obtained; and determining whether the type referenced by the target variable is a table type or not according to the type identifier. If yes, the target variable is created, and the target variable is a table variable. And under the condition that a target operation statement including the target variable is received, executing a data processing operation corresponding to the target variable on a target temporary table corresponding to the target variable. The method provided by the invention can improve the working efficiency of the database and reduce the maintenance cost of the database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database technology, and in particular to a data processing method, apparatus, device, storage medium, and program product. Background Technology

[0002] As database technology continues to evolve, and with the continuous expansion of enterprise businesses and the increasing diversification of application scenarios, databases face increasingly complex data storage and management needs. Traditional database design patterns are gradually revealing limitations in addressing these complex and ever-changing scenarios, making it difficult to efficiently and flexibly meet the demands of business development. In conventional database use, data storage typically requires pre-defining fixed table structures to store specific data types. Each new data storage requirement often necessitates creating a new table and defining corresponding fields, constraints, indexes, and other attributes. However, this approach currently suffers from low efficiency and high database maintenance costs.

[0003] Therefore, improving database efficiency and reducing database maintenance costs are urgent issues that need to be addressed. Summary of the Invention

[0004] The data processing methods, apparatus, devices, storage media, and program products provided in this application are intended to improve database efficiency and reduce database maintenance costs.

[0005] In a first aspect, embodiments of this application provide a data processing method, the method comprising:

[0006] Upon receiving a variable declaration statement, the variable declaration statement is parsed to obtain the type identifier of the type referenced by the declared target variable;

[0007] Determine whether the type referenced by the target variable is a table type based on the type identifier;

[0008] If so, then create the target variable, which is a table variable;

[0009] Upon receiving a target operation statement that includes the target variable, perform the data processing operation corresponding to the target variable on the target temporary table corresponding to the target variable.

[0010] Optionally, determining whether the type referenced by the target variable is a table type based on the type identifier includes:

[0011] Based on the dependency system table, determine the target object that has a dependency relationship with the type identifier;

[0012] If the target object includes a table, then the type is determined to be a table type.

[0013] Optionally, before determining the target object that has a dependency relationship with the type identifier based on the dependency system table, the method further includes:

[0014] Determine whether the type identifier exists based on the type system table;

[0015] If it exists, determine whether the type referenced by the target variable is a table type based on the type identifier;

[0016] If it does not exist, an error message will be output, which indicates that the type referenced by the target variable is abnormal.

[0017] Optionally, the method further includes:

[0018] The received target creation statement is parsed to identify the type of target creation statement.

[0019] If the type is identified as a table type, an initial table type is created, and a target internal table is created based on the table definition information in the target creation statement;

[0020] The initial table type is associated with the target internal table to generate the table type.

[0021] Optionally, the step of associating the initial table type with the target internal table to generate the table type includes:

[0022] Obtain the structural information of the target's internal table;

[0023] Establish the dependency relationship between the target internal table and the initial table type;

[0024] The structural information and the dependencies are stored in the system table to associate the initial table type with the target internal table, thereby generating the table type.

[0025] Optional, also includes:

[0026] Upon receiving a delete statement, the identifier of the type to be deleted is extracted from the delete statement;

[0027] Determine whether the type to be deleted is a table type based on the identifier of the type to be deleted;

[0028] If so, then delete the type to be deleted and the internal table corresponding to the type to be deleted.

[0029] Secondly, embodiments of this application provide a data processing apparatus, including:

[0030] The first processing module is used to parse the variable declaration statement upon receiving it, and obtain the type identifier of the type referenced by the declared target variable;

[0031] The second processing module is used to determine whether the type referenced by the target variable is a table type based on the type identifier;

[0032] The first control module is used to create the target variable if the condition is met; the target variable is a table variable.

[0033] The second control module is used to perform data processing operations corresponding to the target variable on the target temporary table corresponding to the target variable when it receives a target operation statement that includes the target variable.

[0034] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0035] The memory stores computer-executed instructions;

[0036] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0037] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0038] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0039] The data processing method, apparatus, device, storage medium, and program product provided in this application embodiment parses the type identifier of the type referenced by the target variable when a variable declaration statement is received, determines whether it is a table type based on the type identifier, and if so, creates a table variable. When an operation statement containing the target variable is received, the corresponding data processing operation is performed on the target temporary table corresponding to the table variable, so as to integrate the table type characteristics into the variable. This avoids repeatedly defining the table structure for different business scenarios, and at the same time, it uses the target temporary table corresponding to the table variable to flexibly process data without the need to create and clean up fixed tables specifically for temporary data, thereby improving database efficiency and reducing database maintenance costs. Attached Figure Description

[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0041] Figure 1 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0042] Figure 2 A flowchart illustrating another data processing method provided in an embodiment of this application;

[0043] Figure 3 A flowchart illustrating another data processing method provided in an embodiment of this application;

[0044] Figure 4 A flowchart illustrating another data processing method provided in an embodiment of this application;

[0045] Figure 5 A flowchart illustrating another data processing method provided in an embodiment of this application;

[0046] Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;

[0047] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0048] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0049] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0050] In the field of database applications, with the continuous expansion of enterprise businesses and the increasing diversification of application scenarios, database systems face increasingly complex data processing and management needs. Among these, there exists a category of data processing scenarios with unique requirements. For example, in real-time transaction risk control systems in the financial industry, a large amount of intermediate transaction state data needs to be temporarily stored. This data is only valid within the current risk control assessment process and loses its value after the assessment ends. Another example is during promotional activities on e-commerce platforms, where massive amounts of temporary grouping information for user orders need to be processed in real time for targeted promotional content delivery; this information is no longer needed after the activity ends. Yet another example is in large-scale data simulation experiments in the scientific research field, where numerous intermediate state data are generated during the experiment, serving only the current experimental step and can be discarded after the experiment is completed.

[0051] Currently, the common approach to storing temporary data in the aforementioned scenarios is to create temporary tables. Database administrators (DBAs) need to design and create the temporary table structure based on the specific business scenario, defining the required fields to store the data. For example, in a financial risk control scenario, a temporary table containing fields such as transaction amount and risk score is created to insert intermediate transaction status data for subsequent risk control analysis; in an e-commerce platform promotion scenario, a temporary table containing fields such as user ID and group type is created to store temporary grouping information for user orders.

[0052] However, existing implementations of temporary tables have many problems.

[0053] Regarding constraint definitions, to ensure data accuracy and consistency, business operations often require setting constraints on stored data. For example, temporary tables in financial risk control need to ensure that risk scores are within a reasonable range, while temporary tables in e-commerce platforms need to ensure that user IDs are unique. However, different database systems have significant differences in the syntax and rules for defining constraints for temporary tables, making the operation complex and error-prone, resulting in incomplete or inaccurate constraint definitions and affecting data quality.

[0054] In terms of index creation, indexes are necessary to improve data query efficiency. However, some database systems impose strict restrictions on the creation of indexes for temporary tables, such as allowing only a limited number of indexes to be created for specific types of temporary tables. At the same time, creating indexes may affect the performance of temporary table creation and use. When processing large-scale temporary data, the creation time of temporary tables may be prolonged due to excessive system resource consumption, thereby reducing the efficiency of business process execution.

[0055] Regarding sequence support, some business scenarios require generating unique sequence numbers for stored data to ensure uniqueness and traceability, such as recording intermediate state data in scientific research experiments. However, existing temporary table implementations do not provide perfect sequence support, and many database systems do not offer convenient temporary table sequence generation mechanisms. Using sequences requires complex configuration and operations, increasing development difficulty and cost.

[0056] In summary, existing database table definition and management methods suffer from low efficiency, high maintenance costs, and difficulty in meeting temporary data storage needs when dealing with business expansion and diversified application scenarios.

[0057] In view of this, this application provides a data processing method that, upon receiving a variable declaration statement, parses it to obtain the type identifier of the type referenced by the declared target variable. Based on this type identifier, it determines whether the type referenced by the target variable is a table type. If it is determined to be a table type, a target variable is created as a table variable. Furthermore, upon receiving a target operation statement containing the target variable, data processing operations related to the target variable are performed on the target temporary table corresponding to the target variable. Compared to existing technologies where temporary tables are prone to errors due to differences in database systems in constraint definition, have limited index creation affecting performance, and suffer from insufficient sequence support increasing maintenance costs, this method avoids errors caused by database differences through unified constraint definitions for table types, ensuring data accuracy and consistency. It also allows for flexible index creation using the correspondence between table variables and target temporary tables, breaking through the limitations of traditional temporary table indexes and improving query efficiency; and it can integrate sequence definitions into table types, thereby improving database efficiency and reducing database maintenance costs.

[0058] The data processing method provided in this application can be executed by an electronic device with data processing capabilities, such as a database server, a distributed computing node, or a data processing instance in a cloud computing platform. This electronic device is equipped with a database management system or related data processing programs. Through steps such as parsing variable declaration statements to obtain type identifiers, determining whether it is a table type, creating table variables, and executing target operation statements, it achieves data processing operations on the target temporary table. Alternatively, the data processing method can be executed by a database processing system, such as an enterprise-level database management system, a real-time data processing system, or a big data analysis platform. This system integrates functions such as table type definition, variable declaration, and operation execution to efficiently process temporary data. The database can be a Structured Query Language (SQL) database, an Oracle database, a Kingbase database, etc. This application does not limit the type of database used.

[0059] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below through specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0060] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of this application. Figure 1 As shown, the method includes:

[0061] S101. Upon receiving a variable declaration statement, parse the variable declaration statement to obtain the type identifier of the type referenced by the declared target variable.

[0062] The variable declaration statement is used to declare variables and specify their reference type. This statement can be entered by the database user. For example, the variable declaration statement can be "DECLARE @tv AS table_type", where "@tv" is the target variable to be declared, and "table_type" is the type referenced by the target variable.

[0063] The types mentioned above can include, for example, basic data types (such as character and numeric types), composite types (such as structure types and array types), and table types. A type identifier is a string (such as the type name "table_type") used in the database system to uniquely identify a type, distinguishing different types. The type identifier can be generated by the database system when the type is created, or it can be pre-configured in the database system.

[0064] In this step, lexical analysis can be performed on the variable declaration statement, breaking it down into multiple lexical units, such as "DECLARE", "@tv", "AS", and "table_type". Then, syntax analysis is used to determine the role of each lexical unit and identify the type identifier "table_type" of the type referenced by the target variable.

[0065] S102. Determine whether the type referenced by the target variable is a table type based on the type identifier.

[0066] A table type is a special type that combines the characteristics of both tables and types. It can be used to declare variables like a type, and it also includes table constraints, indexes, and other attributes. Determining whether a type is a table type requires querying the type attribute information stored in the system based on the type identifier. The construction method of table types will be described in subsequent embodiments and will not be elaborated upon in this step.

[0067] In this step, after parsing the type identifier (such as "table_type") of the type referenced by the target variable from the variable declaration statement, the corresponding type category information can be found by accessing the system tables of the database system, such as the system tables that store the correspondence between type identifiers and type attributes, and matching the type identifier with the records in the system tables.

[0068] If the type category information indicates that the type identifier corresponds to a table type, then the type referenced by the target variable is determined to be a table type; if the type category information indicates that the type identifier corresponds to a non-table type (e.g., the type category information indicates that the type identifier corresponds to a composite type), then the type referenced by the target variable is determined to be a non-table type.

[0069] S103. If so, then create the target variable.

[0070] The target variable is a table variable. A table variable is a variable that references a table type, and its structure and attributes are consistent with the corresponding table type. It is used to store data that conforms to the table type definition.

[0071] In this step, the structure information of the table type can first be obtained from the system table based on the type identifier. This structure information may include one or more of the following: field names, data types, constraints, and index information. Then, a temporary table corresponding to the table type is created based on this structure information. The memory structure of the target variable is then constructed according to the variable declaration statement (e.g., calculating the required storage space for the target variable, allocating a corresponding amount of storage space in system memory, and associating the starting address of that storage space with the target variable). Finally, the generated temporary table is associated with the target variable, thus completing the creation of the target variable (i.e., the table variable) that references the table type.

[0072] S104. Upon receiving a target operation statement that includes the target variable, perform the data processing operation corresponding to the target variable on the target temporary table corresponding to the target variable.

[0073] The target operation statement is a data processing statement containing the target variable, such as insert, query, update, and delete operations. The target temporary table is the temporary table created based on the table type and associated with the target variable in step S103.

[0074] Upon receiving a target operation statement, the system first parses the target variable name within the statement. Based on the target variable name, it queries the variable management table for the corresponding table variable, structure information, and storage address. The corresponding target temporary table is then located using the identified table variable. Finally, based on the operations on the target variable included in the target operation statement, the corresponding operations are directly executed on the target temporary table corresponding to the target variable.

[0075] For example, assuming the target operation statement is an insert operation on the target variable, the data items in the target operation statement can be parsed and stored sequentially in the corresponding positions of the target temporary table. Optionally, it is also possible to check whether the data item to be inserted meets the field's constraints (such as NOT NULL constraints). If it does not meet the constraints, an error message is returned, which includes the constraint type and the invalid data item.

[0076] Assuming the target operation statement is a query operation on a target variable, the data records in the target temporary table can be traversed according to the query conditions in the target operation statement. During the traversal, the index information of the table variable can be used (such as quickly locating data based on the storage location of indexed fields) to improve query efficiency. The field values ​​of each record in the target temporary table are compared with the query conditions, and records that meet the conditions are filtered out, organized according to a preset format, and returned.

[0077] Assuming the target operation statement is an update operation on the target variable, we can parse the update fields, update values, and update conditions in the target operation statement, and locate the records in the target temporary table that need to be updated based on the update conditions and index information. Then, we replace the values ​​of the update fields in these records with the update values.

[0078] If the target operation statement is a deletion operation on the target variable, then the deletion conditions in the target operation statement can be parsed, and the records to be deleted in the target temporary table can be located based on the deletion conditions and index information. These records can then be removed from the storage area and the corresponding storage space can be released.

[0079] The method provided in this application provides a way to integrate table type features into variables by parsing the type identifier of the type referenced by the target variable when a variable declaration statement is received. This avoids repeatedly defining table structures for different business scenarios. At the same time, it allows for flexible data processing using the target temporary table corresponding to the table variable, without the need to create and clean up fixed tables specifically for temporary data. This improves database efficiency and reduces database maintenance costs.

[0080] The following section details how to determine whether the type referenced by the target variable is a table type based on the type identifier in step S102. Figure 2 This is a flowchart illustrating another data processing method provided in an embodiment of this application. Figure 2 As shown, the aforementioned step S102 may specifically include:

[0081] S201. Based on the dependency system table, determine the target object that has a dependency relationship with the type identifier.

[0082] The dependency system table stores the dependencies between objects in the system. Each record contains two object identifiers, representing the dependent and the dependent object, respectively. For example, if type A depends on table B, the record would be (type A identifier, table B identifier). The target object refers to the object that has a dependency relationship with the current type identifier, which may be a table, index, constraint, etc.

[0083] When determining the target object based on the type identifier, the dependency system table can be queried using the type identifier as the dependency identifier to extract all dependent identifiers. The objects corresponding to these dependent identifiers are the target objects that have a dependency relationship with that type identifier.

[0084] Optionally, an index-based query method can be used during the query process. The dependency system table uses the dependency identifier as the index key, and the relevant record can be quickly located through the index, thereby improving query efficiency.

[0085] S202. If the target object includes a table, then the type is determined to be a table type.

[0086] A table is a structured collection in a database used to store data, and it has attributes such as field definitions, constraints, and indexes.

[0087] In this step, the target objects identified in S201 can be analyzed to check whether each target object is a table. For example, it can be checked whether the identifier of each target object begins with a specific prefix for tables to determine whether the target object contains a table. Alternatively, the attributes of each target object can be checked to determine whether it is a table, etc.

[0088] If at least one target object is a table, then the target objects with which the type identifier has a dependency include tables, and thus the type corresponding to that type identifier is determined to be a table type. If none of the target objects are tables, then the target objects with which the type identifier has a dependency do not include tables, and thus the type corresponding to that type identifier is not a table type.

[0089] Figure 3 This is a flowchart illustrating another data processing method provided in an embodiment of this application. Figure 3 As shown, before determining the target object that has a dependency relationship with the type identifier based on the dependency system table, the method may further include:

[0090] S301. Determine whether a type identifier exists based on the type system table.

[0091] The type system table stores the type identifiers of all defined types in the system. Each record corresponds to a unique type identifier, ensuring the uniqueness of type identifiers in the system.

[0092] In this step, the parsed type identifier is compared one by one with the records in the type system table. The comparison uses a string matching method, starting from the first record in the table, comparing each character of the type identifier in turn. If a record with an exact match is found, it is determined that the type identifier exists; if no match is found after traversing all records, it is determined that it does not exist.

[0093] If it exists, it indicates that the type referenced by the target variable is an existing type, there is no reference error, and step S302 is executed; if it exists, it indicates that the type referenced by the target variable is not an existing type, there may be an input error in the variable declaration statement, and step S303 is executed.

[0094] S302. Determine whether the type referenced by the target variable is a table type based on the type identifier.

[0095] When a type identifier exists, the type details corresponding to that type identifier are retrieved from the type system table. For example, the type details may include a category field for the type. By checking the value of the category field, if the value represents a table type (such as "TABLE_TYPE"), then the type referenced by the target variable is determined to be a table type. If the value is not a value representing a table type (such as "COMPOSITE_TYPE"), then it is determined not to be a table type.

[0096] S303, Output an error message.

[0097] The exception message is used to indicate that the type referenced by the target variable is abnormal. The exception message is a text message used to inform the user that the type referenced by the target variable does not exist, such as "The type referenced by the target variable does not exist. Please check if the type name is correct."

[0098] When the type identifier is determined to be missing, the above-mentioned exception message can be generated and output through the database system's output interface (such as the database client interface, log files, etc.) to facilitate user troubleshooting.

[0099] Figure 4 This is a flowchart illustrating another data processing method provided in an embodiment of this application. Figure 4 As shown, the method may further include:

[0100] S401. Parse the received target creation statement and identify the type of target creation statement.

[0101] The target creation statement is used to create new types, such as "CREATE TYPE table_type AS TABLE...".

[0102] In this step, lexical analysis is performed on the target creation statement to extract lexical units such as "CREATE", "TYPE", "table_type", "AS", and "TABLE". Key type identifiers are identified through syntax analysis. If the statement contains the keyword combination "AS TABLE", the type created by the target creation statement is identified as a table type; if it contains other keyword combinations, such as "AS OBJECT", it is identified as another type (such as an object type). Simultaneously, the type name (e.g., "table_type") and table definition information (such as field definitions, constraints, indexes, etc.) are extracted and stored in the parsing results.

[0103] S402. If the type is identified as a table type, an initial table type is created, and the target internal table is created according to the table definition information in the target creation statement.

[0104] The initial table type is the basic framework of the table type, containing basic information such as type name, creation time, and owner user. The target internal table is the internal storage structure associated with the table type, used to store table characteristic information such as constraints and indexes. Table definition information is the part of the target creation statement that describes the table structure, including field names, data types, constraints, and index definitions.

[0105] In this step, after identifying the type as a table type, an initial table type corresponding to the type required by the target creation statement can be created, and the target internal table can be created based on the table definition information in the target creation statement.

[0106] When creating an initial table type, basic information about the type can be generated, such as the type name being the name specified in the target creation statement; the creation time being the current system time character sequence; and the owner being the user identifier of the user who executed the creation statement. This information is stored in the type system table to generate a temporary type identifier.

[0107] When creating a target internal table based on table definition information, the process begins by parsing the field definitions and assigning a storage location and data type identifier to each field. Next, constraint information records are created based on constraint definitions, with each record containing the constraint type, involved fields, and constraint expression. Then, index information records are created based on index definitions (which may include, for example, the index name, index type, involved fields, and a description of the index's storage structure). Finally, space is allocated for the target internal table in the storage area to store the field definitions, constraint information, and index information, and an identifier for the target internal table is generated.

[0108] Optionally, you can create the initial table type first, and then create the corresponding target internal table; or you can create the corresponding target internal table first, and then create the initial table type; or you can create the initial table type and the corresponding target internal table at the same time.

[0109] S403. Associate the initial table type with the target internal table to generate the table type.

[0110] Among them, associating the initial table type with the target internal table combines the information of the two to form a complete table type, so that the table type contains both the basic information of the type and the characteristic information of the table.

[0111] Specifically, this step can be achieved through the following sub-steps:

[0112] S4031. Obtain the structural information of the target's internal tables.

[0113] The structural information of the target internal table includes the number of fields, the name, data type, length, constraint association identifier (the identifier corresponding to the constraint information record), the number of indexes, the name, type, and field association identifier (the identifier corresponding to the field definition) of each index.

[0114] When retrieving structural information, the storage area of ​​the target internal table can be accessed through its identifier. Information from the field definition area can be read, the number of fields counted, and the name, data type (by querying the corresponding data type name based on the data type identifier), and length of each field can be extracted. The constraint information area can be read to obtain the association identifier for each constraint and associate it with the field. The index information area can be read to count the number of indexes and extract the name, type, and field association identifier for each index. This information is then organized into a structured character sequence.

[0115] S4032. Establish the dependency relationship between the target internal table and the initial table type.

[0116] Building dependencies involves establishing a connection between the initial table type and the target internal table, indicating that the initial table type depends on the target internal table.

[0117] Dependency records can contain, for example, a dependent identifier (a temporary type identifier for the initial table type) and a dependent identifier (an identifier for the target internal table). This record is stored in the dependency system table, along with a relationship type identifier (such as "TYPE_TABLE") to indicate a dependency between a type and a table.

[0118] S4033. Store the structural information and dependencies in the system table to establish the association between the initial table type and the target internal table, and generate the table type.

[0119] The system table contains a dedicated area for storing table type association information, with the temporary type identifier of the initial table type as the key. The structure information of the target internal table obtained in S4031 is stored in the "Structure Information" field of this area, and the identifier of the dependency record constructed in S4032 (such as the unique identifier of the record in the dependency system table) is stored in the "Dependency Identifier" field.

[0120] After storage is completed, the initial table type and the target internal table are successfully associated to form a complete table type.

[0121] Figure 5 This is a flowchart illustrating another data processing method provided in an embodiment of this application. Figure 5 As shown, the method may further include:

[0122] S501. Upon receiving a delete statement, extract the identifier of the type to be deleted from the delete statement.

[0123] The delete statement is used to delete a defined type. For example, the delete statement can be "DROP TYPE table_type". The identifier of the type to be deleted is a string that uniquely identifies the type to be deleted, such as "table_type" in "DROPTYPE table_type".

[0124] In this step, the name of the type to be deleted (such as "table_type") can be obtained by parsing the deletion statement. Then, the name of the type to be deleted can be used as the identifier of the type to be deleted, or the identifier of the type to be deleted can be determined based on the name of the type to be deleted (such as first generating the corresponding identifier based on the name of the type to be deleted, and then using the generated identifier as the identifier of the type to be deleted).

[0125] S502. Determine whether the type to be deleted is a table type based on the identifier of the type to be deleted.

[0126] The method for determining whether the type to be deleted is a table type is the same as in S102, that is, query the type system table based on the identifier of the type to be deleted to obtain the type category information. If the category is "TABLE_TYPE", then it is determined to be a table type. At the same time, query the dependency system table to check whether the target objects that have a dependency relationship with the identifier contain tables, and further verify whether the type is a table type.

[0127] S503. If so, delete the type to be deleted and the internal table corresponding to the type to be deleted.

[0128] If it is determined whether the type to be deleted is a table type, then the type needs to be deleted using the table type deletion method.

[0129] In this step, the first step is to locate the record corresponding to the type identifier in the type system table and delete that record and its related type details (such as structure description, creation information, etc.). Then, based on the identifier of the type to be deleted, the dependency system table is queried to find the identifier of the corresponding target internal table.

[0130] Locate the target internal table based on its identifier, delete all information in its storage area, including field definitions, constraints, and indexes, and release the storage area. Simultaneously, delete all dependency records related to the type to be deleted and the target internal table from the dependency system table, ensuring that no dependency information related to this table type exists in the system.

[0131] In addition, if the type to be deleted is not a table type, then the type can be deleted directly.

[0132] Figure 6 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application. Figure 6 As shown, the device may include: a first processing module 11, a second processing module 12, a first control module 13, and a second control module 14.

[0133] The first processing module 11 is used to parse the variable declaration statement upon receiving it, and obtain the type identifier of the type referenced by the declared target variable.

[0134] The second processing module 12 is used to determine whether the type referenced by the target variable is a table type based on the type identifier.

[0135] The first control module 13 is used to create a target variable if the condition is met; the target variable is a table variable.

[0136] The second control module 14 is used to perform data processing operations on the target temporary table corresponding to the target variable when it receives a target operation statement that includes the target variable.

[0137] Optionally, the second processing module 12 is specifically used to determine the target object that has a dependency relationship with the type identifier based on the dependency system table. If the target object includes a table, then the type is determined to be a table type.

[0138] Optionally, before determining the target object that has a dependency relationship with the type identifier based on the dependency system table, the second processing module 12 is also used to determine whether a type identifier exists based on the type system table. If it exists, it determines whether the type referenced by the target variable is a table type based on the type identifier. If it does not exist, it outputs an exception message to indicate that the type referenced by the target variable is abnormal.

[0139] Optionally, the first processing module 11 is further configured to parse the received target creation statement and identify the type created by the target creation statement. The first control module 13 is further configured to, if the type is identified as a table type, create an initial table type and create a target internal table based on the table definition information in the target creation statement. The initial table type and the target internal table are associated to generate the table type.

[0140] Optionally, the first control module 13 is specifically used to obtain the structural information of the target internal table. It constructs the dependency relationship between the target internal table and the initial table type. The structural information and dependency relationship are stored in a system table to establish the association between the initial table type and the target internal table, thereby generating the table type.

[0141] Optionally, the first processing module 11 is further configured to extract the identifier of the type to be deleted from the deletion statement upon receiving the deletion statement. The second processing module 12 is further configured to determine whether the type to be deleted is a table type based on the identifier of the type to be deleted. The first control module 13 is further configured to delete the type to be deleted and the internal table corresponding to the type to be deleted if the type is.

[0142] The data processing apparatus provided in this application embodiment can execute the data processing method in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again here.

[0143] Figure 7 This is a schematic diagram of an electronic device provided in an embodiment of this application. The electronic device is used to execute the aforementioned data processing method. Figure 7 As shown, the electronic device 700 may include at least one processor 701, a memory 702, and a communication interface 703.

[0144] The memory 702 is used to store programs. Specifically, the program may include program code, which includes computer operation instructions.

[0145] The memory 702 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0146] The processor 701 is used to execute computer execution instructions stored in the memory 702 to implement the method described in the foregoing method embodiments. The processor 701 may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0147] The processor 701 can communicate and interact with external devices through the communication interface 703. These external devices can be, for example, the client device mentioned earlier. In specific implementations, if the communication interface 703, memory 702, and processor 701 are implemented independently, they can be interconnected via a bus to complete communication. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc., but this does not imply that there is only one bus or one type of bus.

[0148] Optionally, in a specific implementation, if the communication interface 703, memory 702, and processor 701 are integrated on a single chip, then the communication interface 703, memory 702, and processor 701 can communicate through an internal interface.

[0149] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0150] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0151] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0152] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0153] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0154] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0155] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0156] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0157] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0158] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A data processing method, characterized by, The method comprises: In the case of receiving a variable declaration statement, parsing the variable declaration statement to obtain a type identifier of a type referenced by a declared target variable; Determining whether the type referenced by the target variable is a table type according to the type identifier; If yes, creating the target variable, which is a table variable; In the case of receiving a target operation statement including the target variable, performing a data processing operation corresponding to the target variable on a target temporary table corresponding to the target variable.

2. The method of claim 1, wherein, The determination of whether the type referenced by the target variable is a table type according to the type identifier comprises: Determining a target object having a dependency relationship with the type identifier according to a dependency relationship system table; If a table is included in the target object, determining that the type is a table type.

3. The method of claim 2, wherein, Before the determination of the target object having the dependency relationship with the type identifier according to the dependency relationship system table, the method further comprises: Determining whether the type identifier exists according to a type system table; If yes, determining whether the type referenced by the target variable is a table type according to the type identifier; If no, outputting an exception prompt information for prompting that the type referenced by the target variable is abnormal.

4. The method of claim 1, wherein, The method further comprises: Parsing a received target creation statement to identify a type created by the target creation statement; If the type is identified as a table type, creating an initial table type and creating a target internal table according to table definition information in the target creation statement; Associating the initial table type with the target internal table to generate the table type.

5. The method of claim 4, wherein, The association of the initial table type with the target internal table to generate the table type comprises: Obtaining structure information of the target internal table; Building a dependency relationship between the target internal table and the initial table type; Storing the structure information and the dependency relationship into a system table to realize the association of the initial table type with the target internal table and generate the table type.

6. The method of claim 1, wherein, Further comprising: In the case of receiving a deletion statement, extracting an identifier of a to-be-deleted type from the deletion statement; Determining whether the to-be-deleted type is a table type according to the identifier of the to-be-deleted type; If yes, deleting the to-be-deleted type and an internal table corresponding to the to-be-deleted type.

7. A data processing apparatus, characterized by, The apparatus comprises: A first processing module configured to, in the case of receiving a variable declaration statement, parse the variable declaration statement to obtain a type identifier of a type referenced by a declared target variable; A second processing module configured to determine whether the type referenced by the target variable is a table type according to the type identifier; A first control module configured to, if yes, create the target variable, which is a table variable; A second control module configured to, in the case of receiving a target operation statement including the target variable, perform a data processing operation corresponding to the target variable on a target temporary table corresponding to the target variable.

8. An electronic device, comprising: Comprise: A memory and a processor; The memory stores computer execution instructions; The processor executes the computer execution instructions stored in the memory, so that the processor performs the method according to any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer-executable instructions which, when executed by a processor, implement the method of any one of claims 1-6.

10. A computer program product, characterised in that, A computer program which, when executed by a processor, implements the method of any one of claims 1-6.