Data processing method and device, electronic device, and computer-readable storage medium
By replacing the preset executable relational statements with structured query statements in the clinical trial data acquisition system, separate table storage for single-record data and multi-record data is achieved, solving the problem of high complexity in modifying single-record data and improving system performance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI TAIMEI DIGITAL TECH CO LTD
- Filing Date
- 2023-02-27
- Publication Date
- 2026-06-16
AI Technical Summary
In clinical trial data acquisition systems, when single-record data and multi-record data are stored in a single physical table, subsequent single-record data modification operations become highly complex, reducing system performance.
By receiving structured query statements, the system determines the preset executable relational statements for the logical tables to be processed and replaces them with the preset executable relational statements. This enables the separate storage of single-record physical tables and multi-record physical tables to be processed, and the single-record physical tables are logically merged into multi-record physical tables only during data processing.
This reduces the operational complexity of changing single record data and improves system performance.
Smart Images

Figure CN116244326B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of database technology, specifically to a data processing method and apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] In the Electronic Data Capture System (EDC) of clinical trials, the forms created by users usually contain single-record data and multi-record data. When conducting subsequent data analysis, users usually want to merge related single-record data and multi-record data into a single table for data analysis.
[0003] To meet the needs of subsequent data analysis, traditional techniques typically store single-record and multi-record data in a single physical table within a database. However, storing single-record and multi-record data in the same physical table means that subsequent operations such as modifying a single record will involve modifying multiple rows of data, increasing the complexity of subsequent operations and consequently reducing system performance. Summary of the Invention
[0004] In view of this, embodiments of this application provide a data processing method and apparatus, electronic device, and computer-readable storage medium to solve the technical problem of increased operational complexity and reduced operational performance caused by subsequent single-record modifications when single-record data and multiple-record data are stored in a physical table.
[0005] The first aspect of this application provides a data processing method, comprising: receiving a structured query statement for a logical table to be processed, the logical table to be processed being generated based on a group of physical tables to be processed stored in a database, the group of physical tables to be processed including a single-record physical table to be processed and a multi-record physical table to be processed; determining a preset executable relational statement corresponding to the logical table to be processed, the preset executable relational statement being a structured query statement generated based on the relational relationship between the single-record physical table to be processed and the multi-record physical table to be processed; replacing the statement representing the logical table to be processed in the structured query statement with the preset executable relational statement to obtain an executable structured query statement; and running the executable structured query statement to obtain the data processing result of the structured query statement.
[0006] In one embodiment, running an executable structured query statement to obtain the data processing result of the logical table to be processed includes: parsing the executable structured query statement to obtain the relationship between the physical table to be processed (single record) and the physical table to be processed (multiple record); and performing a full join operation on the physical table to be processed (single record) and the physical table to be processed (multiple record) based on the relationship to obtain the data processing result.
[0007] In one embodiment, determining the preset executable association statement corresponding to the logic table to be processed includes: determining the physical table group to be processed that generates the logic table to be processed; and determining the preset executable association statement corresponding to the physical table group to be processed as the preset executable association statement corresponding to the logic table to be processed.
[0008] In one embodiment, before receiving a structured query statement for a logical table to be processed, the method further includes: determining the association fields between a single-record physical table to be processed and a multi-record physical table to be processed; determining the association relationship between the single-record physical table to be processed and the multi-record physical table to be processed based on the association fields; and generating a preset executable association statement corresponding to the group of physical tables to be processed based on the association relationship, the table name of the single-record physical table to be processed, and the table name of the multi-record physical table to be processed.
[0009] In one embodiment, the associated field includes an identity key in the physical table of the single record to be processed and the physical table of the multiple records to be processed.
[0010] In one embodiment, before receiving the structured query statement for the logical table to be processed, the method further includes: obtaining all field names of the single-record physical table to be processed; obtaining all field names of the multi-record physical table to be processed; and merging all field names of the single-record physical table to be processed and all field names of the multi-record physical table to be processed to obtain the logical table to be processed.
[0011] In one embodiment, merging all field names corresponding to the single-record physical table to be processed and all field names corresponding to the multi-record physical table to be processed includes: if all field names corresponding to the single-record physical table to be processed and all field names corresponding to the multi-record physical table to be processed include the same field names, removing the same field names from all field names corresponding to the single-record physical table and retaining the same field names from all field names corresponding to the multi-record physical table.
[0012] A second aspect of this application provides a data processing apparatus, comprising: a receiving module configured to receive a structured query statement for a logical table to be processed, the logical table to be processed being generated based on a group of physical tables to be processed stored in a database, the group of physical tables to be processed including a single-record physical table to be processed and a multi-record physical table to be processed; a determining module configured to determine a preset executable relational statement corresponding to the logical table to be processed, the preset executable relational statement being a structured query statement generated based on the relational relationship between the single-record physical table to be processed and the multi-record physical table to be processed; a replacing module configured to replace the statement representing the logical table to be processed in the structured query statement with the preset executable relational statement to obtain an executable structured query statement; and a running module configured to run the executable structured query statement to obtain the data processing result of the structured query statement.
[0013] A third aspect of this application provides an electronic device, including: a processor; and a memory storing computer program instructions, wherein when the computer program instructions are executed by the processor, the processor performs the data processing method provided in the first aspect.
[0014] The fourth aspect of this application provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, cause the processor to perform the data processing method provided in the first aspect.
[0015] According to the data processing method provided in this application, based on the premise that the logical table to be processed is generated from a group of physical tables to be processed (including a single-record physical table and a multi-record physical table) stored in the database, the method replaces the statements representing the logical table to be processed in the structured query statement with preset executable relational statements. This achieves the goal of logically merging the single-record physical table to be processed into the multi-record physical table, facilitating subsequent data analysis, while maintaining separate storage for the single-record and multi-record physical tables. Since the single-record physical table is only logically merged into the multi-record physical table during data processing, the physical layer still stores two tables. Compared to the direct merging in traditional technologies, changes to single-record data do not require modifying multiple rows of data, thereby reducing the complexity of subsequent operations and improving system performance. Attached Figure Description
[0016] The above and other objects, features, and advantages of this application will become more apparent from the more detailed description of the embodiments of this application in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of this application and form part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation thereof.
[0017] Figure 1 The diagram shown is a system architecture diagram of a data processing method provided in an embodiment of this application.
[0018] Figure 2 The diagram shown is a flowchart of a data processing method provided in an embodiment of this application.
[0019] Figure 3 The diagram shown is a flowchart illustrating the process of determining the logical table to be processed corresponding to the physical table group to be processed, according to an embodiment of this application.
[0020] Figure 4 The diagram shown is a flowchart illustrating the process of determining the preset executable associated statement corresponding to the physical table group to be processed, according to an embodiment of this application.
[0021] Figure 5The diagram shown is a structural schematic of a data processing apparatus provided in an embodiment of this disclosure.
[0022] Figure 6 The diagram shown is a structural schematic of a data processing apparatus provided in another embodiment of this disclosure.
[0023] Figure 7 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0025] Single-record data refers to data where each item corresponds to only one record, while multi-record data refers to data where each item corresponds to multiple records. For example, in a resume form (see Form 1 below), the name, gender, age, and phone number in the form are single-record data, while educational background is multi-record data.
[0026] Form 1
[0027]
[0028] The data in Form 1 of the EDC system needs to be stored in the database as a table for subsequent data analysis. A table is an object in the database used to store data. When performing subsequent data analysis, users typically want to merge related single-record and multi-record data into a single table for easier observation and analysis.
[0029] Traditional technologies typically store single-record and multi-record data in a single physical table within a database. However, storing single-record and multi-record data in the same physical table means that subsequent operations, such as modifying a single record, will involve modifying multiple rows of data, increasing the complexity of subsequent operations and ultimately reducing system performance.
[0030] For example, in Form 2, name, gender, age, and mobile phone number are single-record data, while examination date, serum protein, hemoglobin, and white blood cell count are multi-record data.
[0031] Form 2
[0032] Name: Zhang San gender: male age: 28 Phone number: 186****8888 Inspection date serum protein hemoglobin White blood cell count 2022-01-01 34 / 100ml 18 / 100ml 125900 2022-02-01 38 / 100ml 21 / 100ml 132490 2022-03-01 31 / 100ml 25 / 100ml 124567 2022-04-01 40 / 100ml 23 / 100ml 140045
[0033] In traditional technologies, single-record data and multi-record data are stored directly in the form shown in Table 1 below.
[0034] Table 1
[0035]
[0036] If we modify the names in Table 1, we need to modify many rows, which increases the complexity of subsequent operations and severely reduces the performance of the system.
[0037] To address the aforementioned issues, this disclosure provides a data processing method. Based on the premise that the logical table to be processed is generated from a group of physical tables (including single-record and multi-record physical tables) stored in a database, the method replaces the statements representing the logical table in the structured query with preset executable relational statements. This achieves the logical merging of the single-record physical table into the multi-record physical table, facilitating subsequent data analysis, while maintaining separate storage for the single-record and multi-record physical tables. Since the single-record physical table is only logically merged into the multi-record physical table during data processing, the physical layer still stores two tables. Compared to the direct merging in traditional techniques, changes to single-record data do not require modifying multiple rows of data, thereby reducing the complexity of subsequent operations and improving system performance.
[0038] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0039] The following is combined with Figure 1 An example is given to illustrate the system architecture of the data processing method.
[0040] like Figure 1 As shown, the data processing method provided in this embodiment involves a database system 110 and a user terminal 120.
[0041] In practical applications, this process can be divided into data storage and data query. During data storage, the database system 110 receives forms collected by the EDC system and stores single-record and multi-record data respectively as a single-record physical table and a multi-record physical table at the physical layer. These tables form a group of physical tables to be processed. Based on these tables, a corresponding logical table and preset executable relational statements are generated for the group of physical tables to be processed, and the logical table is displayed for user access. For the database, all forms, including single-record and multi-record data, are stored using this method.
[0042] During the data query process, the user inputs a structured query statement for the logical table to be processed on the user terminal 120. The database system 110 receives the structured query statement for the logical table to be processed and determines the preset executable relational statement corresponding to the logical table to be processed. The statement representing the logical table to be processed in the structured query statement is replaced with the preset executable relational statement to obtain an executable structured query statement. The executable structured query statement is then run to obtain the data processing result of the structured query statement.
[0043] For example, the database system can be a relational database, including, but not limited to, MySQL databases, Oracle databases, etc.
[0044] For example, database system 110 can be a distributed database, that is, the database has multiple servers (i.e., multiple server ends). Each server may have a complete copy of the data or a partial copy of the data, and has its own local database. Multiple servers located in different locations are interconnected through a network to form a complete, globally logically centralized, physically distributed large database.
[0045] In an optional example, the EDC system can also be integrated into the user terminal 120.
[0046] For example, user terminal 120 may include physical devices such as smartphones, desktop computers, tablets, and laptops.
[0047] In this embodiment, since the single-record physical table is logically merged into the multi-record physical table to be processed only during data processing, the physical layer still stores two tables. Compared to the direct merging and storage in traditional technologies, when a single record's data changes, there is no need to modify multiple rows of data. This achieves the goal of reducing the complexity of subsequent operations and improving system performance.
[0048] Figure 2The diagram shown is a schematic flowchart of a data processing method provided in an embodiment of this application. Figure 2 As shown, the data processing method includes the following steps.
[0049] Step S210: Receive a structured query statement for the logical table to be processed.
[0050] The logical table to be processed is generated based on the physical table group to be processed stored in the database. The physical table group to be processed includes the physical table to be processed single record and the physical table to be processed multiple record.
[0051] Specifically, Structured Query Language (SQL) is a database programming language. A database consists of a physical layer and a logical layer. The physical layer describes how data is stored, while the logical layer describes what data is in the database and the relationships between that data.
[0052] Physical tables are the actual tables that exist at the physical layer, and all data is stored in the format of physical tables. Physical tables store entity data and are also called physical fact tables. Logical tables are tables for users to view and use; logical tables do not exist in the actual physical layer. Therefore, structured query statements based on logical tables cannot be directly executed at the physical layer and require conversion.
[0053] The physical table for a single record to be processed is a physical table formed by storing single-record data at the physical layer. The physical table for multiple records to be processed is a physical table formed by storing multiple-record data at the physical layer. The physical tables for single records and multiple records to be processed form a group of physical tables to be processed. The physical tables for single records and multiple records to be processed are logically mapped to form a logical table to be processed at the logical layer.
[0054] For example, the single record data in Form 1 above is stored in the physical table table 2 of the single record to be processed, as detailed in Table 2 below. The multi-record data in Form 1 above is stored in the physical table table 3 of the multi-record to be processed, as detailed in Table 3 below.
[0055] Table 2
[0056]
[0057]
[0058] Table 3
[0059] Inspection date serum protein hemoglobin White blood cell count 2022-01-01 34 / 100ml 18 / 100ml 125900 2022-02-01 38 / 100ml 21 / 100ml 132490 2022-03-01 31 / 100ml 25 / 100ml 124567 2022-04-01 40 / 100ml 23 / 100ml 140045
[0060] The logical tables to be processed, generated based on the physical tables for single records (table2) and multiple records (table3), are detailed in Table 4 below.
[0061] Table 4
[0062] Name gender gender Phone number Inspection date serum protein hemoglobin White blood cell count
[0063] Although the physical layer actually contains single-record and multi-record physical tables for processing, users see logical tables for processing. Therefore, when users have data processing needs, they input structured query statements targeting these logical tables. In other words, the user terminal connected to the database system receives structured query statements targeting these logical tables.
[0064] For example, if the received SQL for the logical table to be processed is "select * from table4", the SQL for the logical table to be processed indicates that all fields in the logical table table4 to be processed are queried.
[0065] Step S220: Determine the preset executable related statement corresponding to the logical table to be processed.
[0066] For example, the default executable relational statement is a structured query statement generated based on the relational relationship between the physical table of a single record to be processed and the physical table of multiple records to be processed.
[0067] The pre-defined executable relational statement corresponding to the pending logical table refers to a pre-defined structured query statement that can be executed at the physical layer, generated based on the relational relationship between the pending single-record physical table and the pending multi-record physical table, and which can be used to query the pending single-record physical table and the pending multi-record physical table corresponding to the pending logical table at runtime.
[0068] In one example, determining the preset executable association statement corresponding to the logical table to be processed can be executed as follows: determine the group of physical tables to be processed that generates the logical table to be processed, and determine the preset executable association statement corresponding to the physical table group to be processed as the preset executable association statement corresponding to the logical table to be processed.
[0069] Specifically, since the logical table to be processed is generated based on the group of physical tables to be processed stored in the database—that is, generated based on the single-record physical table and the multi-record physical table—there is a mapping relationship between the logical table to be processed and the single-record and multi-record physical tables. When a structured query statement for the logical table to be processed is received, the single-record and multi-record physical tables that generated the logical table can be identified. Furthermore, since the preset executable join statement is generated based on the join relationship between the single-record and multi-record physical tables, another mapping relationship exists between the logical table to be processed and the single-record and multi-record physical tables. Therefore, based on the single-record and multi-record physical tables, the preset executable join statement can be obtained, and thus the preset executable join statement corresponding to the logical table to be processed can be determined.
[0070] For example, the logical table table4 to be processed is generated based on the physical table table2 to be processed (single record) and the physical table table3 to be processed (multiple records). Assuming that the default executable join statement corresponding to table2 and table3 is table 2fulljoin table3 (that is, the default executable join statement corresponding to the physical table group to be processed is table2full join table3), then the default executable join statement corresponding to table4 is determined to be table2full jointable3.
[0071] Step S230: Replace the statement representing the logical table to be processed in the structured query statement with a preset executable relational statement to obtain an executable structured query statement.
[0072] Specifically, since the SQL statements targeting the logical tables to be processed cannot be executed directly at the physical layer, and the actual data to be processed is stored in the group of physical tables to be processed, it is necessary to transform the logical tables to be processed and replace the statements representing the logical tables to be processed with preset executable relational statements. That is, to transform them into preset executable relational statements corresponding to the logical tables to be processed that can be executed at the physical layer.
[0073] For example, if the SQL statement for the logical table to be processed is `select * from table4`, and `table4` is replaced with `table2full join table3`, then the executable structured query statement will be `select * table2full jointable3`.
[0074] Step S240: Run the executable structured query statement to obtain the data processing results of the structured query statement.
[0075] Running an executable structured query statement allows for query processing on both single-record and multi-record physical tables at the physical layer, yielding the query results. These results represent the data processing outcome of the structured query statement.
[0076] For example, the aforementioned execution of an executable structured query statement to obtain the data processing result of the structured query statement can be performed as follows: parsing the executable structured query statement to obtain the relationship between the physical table of the single record to be processed and the physical table of the multiple records to be processed; based on the relationship, performing a full join operation on the physical table of the single record to be processed and the physical table of the multiple records to be processed to obtain the data processing result.
[0077] A full join operation refers to integrating and displaying data from both the single-record physical table and the multi-record physical table to be processed, based on the relationships between them.
[0078] For example, parsing `select * table 2 full join table3` reveals that the relationship between table 2 and table 3 is a full join. Therefore, a full join operation is performed on the data in table 2 and table 3 to obtain the data processing result of the structured query statement, which is the above-mentioned table 1.
[0079] In this embodiment, based on the premise that the logical table to be processed is generated from a group of physical tables to be processed stored in the database (including a single-record physical table and a multi-record physical table), the statement representing the logical table to be processed in the structured query statement is replaced with a preset executable relational statement. This achieves the goal of logically merging the single-record physical table to be processed into the multi-record physical table, while maintaining separate storage for the single-record and multi-record physical tables. This facilitates subsequent data analysis. Since the single-record physical table is logically merged into the multi-record physical table only during data processing, the physical layer still stores two tables. Compared to the direct merging storage in traditional technologies, changes to single-record data do not require modifying multiple rows of data, thereby reducing the complexity of subsequent operations and improving system performance.
[0080] Considering that before performing structured queries on the logical tables to be processed, it is necessary to determine the logical tables corresponding to the physical table groups to be processed, the following will combine... Figure 3 Provide a detailed explanation of how to determine the logical tables corresponding to the physical table groups to be processed.
[0081] Figure 3The diagram shown is a flowchart illustrating the process of determining the logical table to be processed corresponding to a physical table group according to an embodiment of this application. Figure 3 As shown, determining the logical table to be processed corresponding to the physical table group to be processed includes the following steps.
[0082] Step S310: Obtain all field names of the physical table of the single record to be processed.
[0083] For example, for the physical table table2 containing a single record to be processed, retrieve all field names: name, gender, age, and mobile phone number.
[0084] Step S320: Obtain all field names of the physical table containing the multiple records to be processed.
[0085] For example, for the physical table table3 with multiple records to be processed, retrieve all field names and check the date, serum protein, hemoglobin, and white blood cell count.
[0086] Step S330: Merge all field names corresponding to the single-record physical table to be processed and all field names of the multi-record physical table to be processed to obtain the logical table to be processed.
[0087] Specifically, for each field name in the physical table of a single record to be processed and each field name in the physical table of multiple records to be processed, each field name is used as the data of each column in each row of the logical table to be processed, thus obtaining the logical table to be processed.
[0088] Since logical tables themselves reflect relationships, a mapping relationship is established between the physical tables of single records and multiple records to be processed, as well as between the logical tables to be processed and the physical tables of single records and multiple records to be processed.
[0089] In one example, if all field names in the single-record physical table to be processed and all field names in the multi-record physical table to be processed contain the same field names, the identical field names in the single-record physical table are removed, while the identical field names in the multi-record physical table are retained. In other words, if no identical field names exist in either the single-record physical table or the multi-record physical table to be processed, then the fields in both tables are directly merged.
[0090] For example, the fields in the physical table of a single record to be processed are named name, gender, age, and mobile phone number, while the fields in the physical table of multiple records to be processed are named examination date, serum protein, hemoglobin, and white blood cell count. Each field name is placed in each column of data in each row, thereby merging all field names corresponding to the physical table of the single record to be processed and all field names corresponding to the physical table of the multiple records to be processed to obtain the logical table to be processed. The specific form of the logical table to be processed is shown in Table 4 above.
[0091] In this embodiment of the application, the purpose of determining the logical table to be processed corresponding to the physical table group to be processed is achieved by the above method. In addition, since the logical table itself is a reaction relationship, the mapping relationship between the logical table to be processed and the physical table to be processed (single record physical table and multiple record physical table) is also established when determining the logical table to be processed based on the physical table to be processed (single record physical table and multiple record physical table).
[0092] Considering that before performing structured queries on the logical tables to be processed, it is also necessary to determine the preset executable join statements corresponding to the physical table groups to be processed, the following is combined with... Figure 4 This section details how to determine the preset executable join statements corresponding to the physical table group to be processed.
[0093] Figure 4 The diagram shown is a flowchart illustrating the process of determining a preset executable relational statement corresponding to a physical table group to be processed, according to an embodiment of this application. Figure 4 As shown, determining the preset executable relational statement corresponding to the physical table group to be processed includes the following steps.
[0094] Step S410: Determine the association fields between the physical table of the single record to be processed and the physical table of the multiple records to be processed.
[0095] For example, the associated field is the identity key in the physical table of the single record to be processed and the physical table of the multiple records to be processed.
[0096] The identity key is the Identity Document (ID), which is also the unique key used for each field in the single-record physical table to be processed, and the unique key used for the data in the multi-record physical table to be processed.
[0097] Step S420: Based on the association field, determine the association relationship between the physical table of the single record to be processed and the physical table of the multiple records to be processed.
[0098] In other words, it is necessary to determine the association between the physical table to be processed and the physical table to be processed based on the identity key of the physical table to be processed for single records and the physical table to be processed for multiple records.
[0099] Step S430: Based on the association relationship, the table name of the physical table to be processed (single record) and the table name of the physical table to be processed (multiple records) are used to generate a preset executable association statement corresponding to the physical table group to be processed.
[0100] For example, the table name of the physical table to be processed (single record) is table2, and the table name of the physical table to be processed (multiple records) is table3. The relationship is a full join. Therefore, the default executable join statement for table2 and table3 is table 2full join table3.
[0101] Since the preset executable relational statements are generated based on the relational relationship between the physical table to be processed (single record) and the physical table to be processed (multiple records), the corresponding relationship between the physical table group to be processed and the preset executable relational statements is established at the same time as the preset executable relational statements are generated.
[0102] In this embodiment of the application, the above method is used to achieve the purpose of determining the preset executable related statement corresponding to the physical table group to be processed, thereby achieving the purpose of determining the preset executable related statement corresponding to the logical table to be processed based on the correspondence between the physical table group to be processed and the logical table to be processed, and then replacing the statement representing the logical table to be processed in the structured query statement with the preset executable related statement to execute the executable structured query statement.
[0103] The above text combined Figures 2 to 4 The present disclosure describes in detail the method embodiments, which are then combined with the following. Figures 5 to 6 The present disclosure provides a detailed description of the apparatus embodiments. Furthermore, it should be understood that the descriptions of the method embodiments correspond to the descriptions of the apparatus embodiments; therefore, any parts not described in detail can be found in the foregoing method embodiments.
[0104] Figure 5 The diagram shown is a structural schematic of a data processing apparatus provided in an embodiment of this disclosure. Figure 5 As shown, the data processing apparatus 500 provided in this embodiment includes a receiving module 510, a determining module 520, a replacing module 530, and a running module 540.
[0105] Specifically, the receiving module 510 is configured to receive a structured query statement for a logical table to be processed. The logical table to be processed is generated based on a group of physical tables to be processed stored in the database. The group of physical tables to be processed includes a single-record physical table to be processed and a multi-record physical table to be processed. The determining module 520 is configured to determine a preset executable relational statement corresponding to the logical table to be processed. The preset executable relational statement is a structured query statement generated based on the relational relationship between the single-record physical table to be processed and the multi-record physical table to be processed. The replacing module 530 is configured to replace the statement representing the logical table to be processed in the structured query statement with the preset executable relational statement to obtain an executable structured query statement. The running module 540 is configured to run the executable structured query statement to obtain the data processing result of the structured query statement.
[0106] In one embodiment, the execution module 540 is further configured to parse an executable structured query statement to obtain the association relationship between the single-record physical table to be processed and the multi-record physical table to be processed. Based on the association relationship, a full join operation is performed on the single-record physical table to be processed and the multi-record physical table to be processed to obtain the data processing result.
[0107] In one embodiment, the determining module 520 is further configured to determine the group of physical tables to be processed from which the logical table to be processed is generated. The preset executable relational statement corresponding to the group of physical tables to be processed is determined as the preset executable relational statement corresponding to the logical table to be processed.
[0108] Figure 6 The diagram shown is a structural schematic of a processing module provided in another embodiment of this disclosure. Figure 5 Extending from the illustrated embodiment Figure 6 The illustrated embodiment will be described in detail below. Figure 6 The illustrated embodiments and Figure 6 The differences between the embodiments shown are not repeated here, and the similarities are not repeated here.
[0109] In this embodiment, the data processing device 500 further includes a preset executable associated statement determination module 610.
[0110] The executable association statement determination module 610 is configured to determine the association fields between the single-record physical table to be processed and the multi-record physical table to be processed. Based on the association fields, the association relationship between the single-record physical table to be processed and the multi-record physical table to be processed is determined. Based on the association relationship, the table name of the single-record physical table to be processed and the table name of the multi-record physical table to be processed are used to generate a preset executable association statement corresponding to the group of physical tables to be processed.
[0111] In one embodiment, the associated field includes an identity key in the physical table of the single record to be processed and the physical table of the multiple records to be processed.
[0112] In one embodiment, the data processing apparatus 500 further includes a logic table determination module 620. The logic table determination module 620 is configured to: obtain all field names of a single-record physical table to be processed; obtain all field names of a multi-record physical table to be processed; and merge all field names corresponding to the single-record physical table and the multi-record physical table to obtain the logic table to be processed.
[0113] In one embodiment, the logic table determination module 620 is further configured to remove the same field names from all field names in the single-record physical table and retain the same field names in all field names in the multi-record physical table if all field names in the single-record physical table and all field names in the multi-record physical table contain the same field names.
[0114] Figure 7 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this disclosure. Figure 7 The illustrated electronic device 700 includes a memory 701, a processor 702, a communication interface 703, and a bus 704. The memory 701, processor 702, and communication interface 703 are interconnected via the bus 704.
[0115] The memory 701 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 701 may store a program, and when the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used to execute the various steps of the data processing method of the embodiments of this disclosure.
[0116] The processor 702 may be a general-purpose central processing unit (CPU), microprocessor, application-specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, used to execute relevant programs to achieve the functions required by the units in the database testing apparatus of this disclosure embodiment.
[0117] The processor 702 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the data processing method of this disclosure can be completed by the integrated logic circuits in the hardware of the processor 702 or by instructions in software form. The processor 702 described above can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this disclosure can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory 701. The processor 702 reads the information in the memory 701 and, in conjunction with its hardware, performs the functions required by the units included in the database testing apparatus of this disclosure, or executes the data processing method of the method embodiment of this disclosure.
[0118] The communication interface 703 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the device 700 and other devices or communication networks. For example, the communication interface 703 can receive promotional requests or promotional data.
[0119] Bus 704 may include a pathway for transmitting information between various components of electronic device 700 (e.g., memory 701, processor 702, communication interface 703).
[0120] It should be noted that, although Figure 7 The illustrated electronic device 700 only shows the memory, processor, and communication interface. However, those skilled in the art should understand that in specific implementations, the electronic device 700 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that the electronic device 700 may also include hardware devices for implementing other additional functions. Moreover, those skilled in the art should understand that the electronic device 700 may only include the devices necessary for implementing the embodiments of this disclosure, and may not necessarily include... Figure 7 All the devices shown.
[0121] In addition to the methods, apparatus, and devices described above, embodiments of this disclosure may also be computer program products, including computer program instructions that, when executed by a processor, cause the processor to perform the various steps of the data processing methods provided in the various embodiments of this disclosure.
[0122] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this disclosure. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0123] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform various steps of the data processing methods provided in the various embodiments of this disclosure.
[0124] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0125] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0126] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0127] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and 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 through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0128] 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.
[0129] In addition, the functional units in the various embodiments of this disclosure can be integrated into a similar region segmentation unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0130] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion 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 described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0131] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
[0132] The device block diagrams involved in this application are merely illustrative examples and are not intended to require or imply that connections, arrangements, or configurations must be made in the manner shown in the block diagrams. As those skilled in the art will recognize, modules and units of the device can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0133] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0134] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A data processing method, characterized in that, include: Receive a structured query statement for a logical table to be processed, the logical table to be processed is generated based on a group of physical tables to be processed stored in the database, the group of physical tables to be processed includes a single-record physical table to be processed and a multi-record physical table to be processed; Determine the preset executable association statement corresponding to the logical table to be processed. The preset executable association statement is a structured query statement generated based on the association relationship between the single-record physical table to be processed and the multi-record physical table to be processed. Replace the statement representing the logical table to be processed in the structured query statement with the preset executable association statement to obtain an executable structured query statement; Run the executable structured query statement to obtain the data processing result of the structured query statement; The process of running the executable structured query statement to obtain the data processing result of the structured query statement includes: Parse the executable structured query statement to obtain the association relationship between the physical table of the single record to be processed and the physical table of the multiple records to be processed; Based on the aforementioned relationship, a full join operation is performed on the physical table of the single record to be processed and the physical table of the multiple records to be processed to obtain the data processing result. The step of determining the preset executable associated statement corresponding to the logic table to be processed includes: Determine the group of physical tables to be processed that will generate the logical tables to be processed; The preset executable association statement corresponding to the physical table group to be processed is determined as the preset executable association statement corresponding to the logical table to be processed.
2. The data processing method according to claim 1, characterized in that, Before receiving the structured query statement for the logical table to be processed, the method further includes: Determine the association fields between the physical table of the single record to be processed and the physical table of the multiple records to be processed; Based on the associated fields, the association relationship between the physical table of the single record to be processed and the physical table of the multiple records to be processed is determined; Based on the aforementioned association, the table name of the single-record physical table to be processed and the table name of the multi-record physical table to be processed are used to generate a preset executable association statement corresponding to the group of physical tables to be processed.
3. The data processing method according to claim 2, characterized in that, The associated fields include the identity key in the physical table of the single record to be processed and the physical table of the multiple records to be processed.
4. The data processing method according to claim 1, characterized in that, Before receiving the structured query statement for the logical table to be processed, the method further includes: Obtain all field names from the physical table of the single record to be processed; Obtain all field names of the physical table containing the multiple records to be processed; The field names corresponding to the single-record physical table to be processed and the field names corresponding to the multi-record physical table to be processed are merged to obtain the logical table to be processed.
5. The data processing method according to claim 4, characterized in that, The merging of all field names corresponding to the single-record physical table to be processed and all field names corresponding to the multi-record physical table to be processed includes: If all field names corresponding to the single-record physical table to be processed and all field names corresponding to the multi-record physical table to be processed contain the same field names, remove the same field names from all field names corresponding to the single-record physical table and retain the same field names from all field names corresponding to the multi-record physical table.
6. A data processing apparatus, characterized in that, include: The receiving module is configured to receive structured query statements for a logical table to be processed, the logical table to be processed being generated based on a group of physical tables to be processed stored in the database, the group of physical tables to be processed including a single-record physical table to be processed and a multi-record physical table to be processed. The determination module is configured to determine the preset executable association statement corresponding to the logical table to be processed. The preset executable association statement is a structured query statement generated based on the association relationship between the single-record physical table to be processed and the multi-record physical table to be processed. The replacement module is configured to replace the statement representing the logical table to be processed in the structured query statement with the preset executable association statement to obtain an executable structured query statement; The running module is configured to run the executable structured query statement and obtain the data processing result of the structured query statement; The process of running the executable structured query statement to obtain the data processing result of the structured query statement includes: Parse the executable structured query statement to obtain the association relationship between the physical table of the single record to be processed and the physical table of the multiple records to be processed; Based on the aforementioned relationship, a full join operation is performed on the physical table of the single record to be processed and the physical table of the multiple records to be processed to obtain the data processing result. The step of determining the preset executable associated statement corresponding to the logic table to be processed includes: Determine the group of physical tables to be processed that will generate the logical tables to be processed; The preset executable association statement corresponding to the physical table group to be processed is determined as the preset executable association statement corresponding to the logical table to be processed.
7. An electronic device, characterized in that, include: processor; and A memory storing computer program instructions, which, when executed by the processor, enable the processor to perform the data processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, enable the processor to perform the data processing method according to any one of claims 1 to 5.