CN116244326A - Data processing method and device, electronic equipment and computer readable storage medium - Google Patents

Data processing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN116244326A
CN116244326A CN202310173619.1A CN202310173619A CN116244326A CN 116244326 A CN116244326 A CN 116244326A CN 202310173619 A CN202310173619 A CN 202310173619A CN 116244326 A CN116244326 A CN 116244326A
Authority
CN
China
Prior art keywords
processed
physical table
record physical
record
structured query
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310173619.1A
Other languages
Chinese (zh)
Inventor
陈诚
李启飞
王仕凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Taimei Digital Technology Co ltd
Original Assignee
Shanghai Taimei Digital Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Taimei Digital Technology Co ltd filed Critical Shanghai Taimei Digital Technology Co ltd
Priority to CN202310173619.1A priority Critical patent/CN116244326A/en
Publication of CN116244326A publication Critical patent/CN116244326A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24558Binary matching operations
    • G06F16/2456Join operations
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H10/00ICT specially adapted for the handling or processing of patient-related medical or healthcare data
    • G16H10/20ICT specially adapted for the handling or processing of patient-related medical or healthcare data for electronic clinical trials or questionnaires
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Epidemiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Primary Health Care (AREA)
  • Public Health (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a data processing method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of databases. The method comprises the following steps: receiving a structured query statement for a to-be-processed logical table, wherein the to-be-processed logical table is generated based on a to-be-processed physical table group stored in a database, and the to-be-processed physical table group comprises a to-be-processed single-record physical table and a to-be-processed multi-record physical table; determining a preset executable associated statement corresponding to the to-be-processed logic table, wherein the preset executable associated statement is a structured query statement generated based on an associated relation between the to-be-processed single-record physical table and the to-be-processed multi-record physical table; replacing sentences representing the logic table to be processed in the structured query sentence with preset executable associated sentences to obtain an executable structured query sentence; and running the executable structured query statement to obtain a data processing result of the structured query statement. Compared with the traditional technology, the method can reduce the complexity of subsequent operation and improve the system performance.

Description

Data processing method and device, electronic equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a data processing method and apparatus, an electronic device, and a computer readable storage medium.
Background
In a clinical trial data collection system (Electronic Data Capture System, EDC), a user-created form typically contains single-record data and multiple-record data, and the user typically wishes to combine the associated single-record data and multiple-record data into a single table for data analysis when performing subsequent data analysis.
To meet the requirements of subsequent data analysis, the conventional technology generally stores single record data and multiple record data in one physical table of a database. However, if the single record data and the multiple record data are stored in one physical table, modification of the multiple lines of data may be involved if modification of the single record data is desired, thereby increasing complexity of subsequent operations and further reducing system operation performance.
Disclosure of Invention
In view of this, the embodiments of the present application provide a data processing method and apparatus, an electronic device, and a computer readable storage medium, so as to solve the technical problems of increasing operation complexity and reducing operation performance caused by subsequent modification of a single record when the single record data and multiple record data are stored in one physical table.
The first aspect of the present application provides a data processing method, including: receiving a structured query statement for a to-be-processed logical table, wherein the to-be-processed logical table is generated based on a to-be-processed physical table group stored in a database, and the to-be-processed physical table group comprises a to-be-processed single-record physical table and a to-be-processed multi-record physical table; determining a preset executable associated statement corresponding to the to-be-processed logic table, wherein the preset executable associated statement is a structured query statement generated based on an associated relation between the to-be-processed single-record physical table and the to-be-processed multi-record physical table; replacing sentences representing the logic table to be processed in the structured query sentence with preset executable associated sentences to obtain an executable structured query sentence; and running the executable structured query statement to obtain a data processing result of the structured query statement.
In one embodiment, running the executable structured query statement to obtain the data processing result of the logic table to be processed includes: analyzing the executable structured query statement to obtain and determine the association relationship between the single record physical table to be processed and the multi-record physical table to be processed; and based on the association relation, performing complete connection operation on the single record physical table to be processed and the multi-record physical table to be processed, and obtaining a data processing result.
In one embodiment, determining a preset executable associated statement corresponding to the logic table to be processed includes: determining a group of physical tables to be processed for generating a logical table to be processed; and determining the preset executable associated statement corresponding to the physical table group to be processed as the preset executable associated statement corresponding to the logic table to be processed.
In one embodiment, before receiving the structured query statement for the pending logical table, further comprising: determining an association field between a single record physical table to be processed and a multi-record physical table to be processed; based on the association field, determining an association relationship between the single-record physical table to be processed and the multi-record physical table to be processed; based on the association relation, the table names of the to-be-processed single-record physical table and the table names of the to-be-processed multi-record physical table generate a preset executable association statement corresponding to the to-be-processed physical table group.
In one embodiment, the association field includes an identification key in the single record physical table to be processed and the multiple record physical table to be processed.
In one embodiment, before receiving the structured query statement for the pending logical table, further comprising: acquiring all field names of a to-be-processed single record physical table; acquiring all field names of a multi-record physical table to be processed; and combining all field names corresponding to the to-be-processed single-record physical table and all field names of the to-be-processed multi-record physical table to obtain the to-be-processed logic table.
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 the field names corresponding to the single-record physical table to be processed and all the field names corresponding to the multi-record physical table to be processed comprise the same field names, removing the same field names in all the field names corresponding to the single-record physical table, and reserving the same field names in all the field names corresponding to the multi-record physical table.
The second aspect of the present application provides a data processing apparatus, a receiving module configured to receive a structured query statement for a to-be-processed logical table, the to-be-processed logical table being generated based on a to-be-processed physical table group stored in a database, the to-be-processed physical table group including a to-be-processed single-record physical table and a to-be-processed multi-record physical table; the determining module is configured to determine a preset executable associated statement corresponding to the to-be-processed logic table, wherein the preset executable associated statement is a structured query statement generated based on an associated relation between the to-be-processed single-record physical table and the to-be-processed multi-record physical table; the replacing module is configured to replace sentences representing the logic table to be processed in the structured query sentences with preset executable associated sentences to obtain executable structured query sentences; and the operation module is configured to operate the executable structured query statement to obtain a data processing result of the structured query statement.
A third aspect of the present application provides an electronic device, comprising: a processor; and a memory having stored therein computer program instructions which, when executed by the processor, perform the data processing method provided in the first aspect above.
A fourth aspect of the present application provides a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, perform the data processing method provided in the first aspect.
According to the data processing method provided by the embodiment of the application, on the premise that the to-be-processed logic table is generated based on the to-be-processed physical table group (comprising the to-be-processed single-record physical table and the to-be-processed multi-record physical table) stored in the database, the purpose of combining the to-be-processed single-record physical table logic into the to-be-processed multi-record physical table on the basis of storing the to-be-processed single-record physical table and the to-be-processed multi-record physical table is achieved by replacing the statement representing the to-be-processed logic table in the structured query statement with a preset executable associated statement. Because the single record physical table logic is only combined into the multi-record physical table to be processed when the data is processed, the physical layer is still stored in two tables when being stored, compared with the direct combination storage in the prior art, the method has the advantages that multiple rows of data are not required to be changed when the single record data is changed, and therefore the purposes of reducing the complexity of subsequent operation and improving the operation performance of the system are achieved.
Drawings
The foregoing and other objects, features and advantages of the present application will become more apparent from the following more particular description of embodiments of the present application, as illustrated in the accompanying drawings. The accompanying drawings are included to provide a further understanding of embodiments of the application and are incorporated in and constitute a part of this specification, illustrate the application and not constitute a limitation to the application.
Fig. 1 is a system architecture diagram of a data processing method according to an embodiment of the present application.
Fig. 2 is a flow chart of a data processing method according to an embodiment of the present application.
Fig. 3 is a schematic flow chart of determining a to-be-processed logical table corresponding to a to-be-processed physical table group according to an embodiment of the present application.
Fig. 4 is a flowchart illustrating a process of determining a preset executable associated statement corresponding to a to-be-processed physical table group according to an embodiment of the present application.
Fig. 5 is a schematic structural diagram of a data processing apparatus according to an embodiment of the disclosure.
FIG. 6 is a schematic diagram illustrating a data processing apparatus according to another embodiment of the present disclosure
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The single record data means that each item corresponds to only one data, and the multi-record data means that each item corresponds to only a plurality of data, for example, a personal resume form (refer to form 1 below), in which names, sexes, ages, phone numbers, etc. belong to the single record data, and educational experiences belong to the multi-record data.
Form 1
Figure BDA0004101383290000041
The data in form 1 in the EDC system needs to be stored in a database in the form of a table for subsequent data analysis. Wherein a TABLE (TABLE) is an object in a database used to store data. In performing subsequent data analysis, a user typically desires to combine associated single record data and multiple record data into a single table for data analysis, for ease of viewing and analysis.
It is common in the art to store single record data and multiple record data in one physical table of a database. However, if the single record data and the multiple record data are stored in one physical table, modification of the multiple lines of data may be involved if modification of the single record data is desired, thereby increasing complexity of subsequent operations and further reducing system operation performance.
For example, for form 2, name, gender, age and phone number are in the single record data, and date of examination, serum proteins, hemoglobin and white blood cell count are in the multiple record data.
Form 2
Name: Zhang San gender: man's body
Age: 28 number of mobile phone: 186****8888
date of inspection Serum proteins Hemoglobin (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
The conventional art directly stores single record data and multi-record data in the form of table1 below.
Table1 (Table 1)
Figure BDA0004101383290000051
For table1, if the names in table1 are modified, many lines need to be modified, the complexity of the subsequent operations is high, and the system operation performance is seriously degraded.
In order to solve the above-mentioned problems, an embodiment of the present disclosure provides a data processing method, which combines a to-be-processed logical table with a method of replacing a statement characterizing a to-be-processed logical table in a structured query statement with a preset executable associated statement on the premise that the to-be-processed logical table is generated based on a to-be-processed physical table group (including a to-be-processed single-record physical table and a to-be-processed multi-record physical table) stored in a database, so as to achieve the purpose of combining the to-be-processed single-record physical table logic into the to-be-processed multi-record physical table on the basis of storing the to-be-processed single-record physical table and the to-be-processed multi-record physical table, thereby facilitating subsequent data analysis. Because the single record physical table logic is only combined into the multi-record physical table to be processed when the data is processed, the physical layer is still stored in two tables when being stored, compared with the direct combination storage in the prior art, the method has the advantages that multiple rows of data are not required to be changed when the single record data is changed, and therefore the purposes of reducing the complexity of subsequent operation and improving the operation performance of the system are achieved.
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The system architecture of the data processing method is illustrated in conjunction with fig. 1.
As shown in fig. 1, a data processing method provided in an embodiment of the present disclosure relates to a database system 110 and a user terminal 120.
In the practical application process, the data storage process and the data query process can be divided. In the data storage process, the database system 110 receives a form acquired by the EDC system, stores single record data and multi-record data as a single record physical table to be processed and a multi-record physical table to be processed respectively in a digital physical layer, forms a group of physical tables to be processed based on the single record physical table to be processed and the multi-record physical table to be processed, generates a logic table to be processed and a preset executable associated statement corresponding to the group of physical tables to be processed based on the single record physical table to be processed and the multi-record physical table to be processed, and displays the logic table to be processed for a user to use. For databases, all forms including single record data and multi-record data are stored in the manner described above.
In the data query process, a user inputs a structured query sentence for a to-be-processed logic table at the user terminal 120, and the database system 110 receives the structured query sentence for the to-be-processed logic table and determines a preset executable associated sentence corresponding to the to-be-processed logic table. And replacing the statement representing the to-be-processed logic table in the structured query statement with a preset executable associated statement to obtain an executable structured query statement, and running the executable structured query statement to obtain a data processing result of the structured query statement.
Illustratively, the database system may be a relational database, including, but not limited to, mySQL database, oracle database, and the like.
Illustratively, the database system 110 may be a distributed database, that is, a database having a plurality of servers (i.e., corresponding to a plurality of servers). Each server may have a complete copy of the data or a partial copy of the data and have its own local database, and multiple servers located at different sites are connected to each other via a network to form a complete, global, logically centralized, physically distributed, large database.
In an alternative example, the EDC system may also be integrally provided to the user terminal 120.
By way of example, the user terminal 120 may include a smart phone, desktop computer, tablet computer, notebook computer, or the like type of physical device.
In the embodiment of the application, because the single-record physical table logic is only combined into the multi-record physical table to be processed during data processing, the physical layer is still two table memories during storage, compared with the direct combination storage in the traditional technology, the multi-row data is not required to be changed during single-record data change, thereby achieving the purposes of reducing the complexity of subsequent operation and improving the operation performance of the system
Fig. 2 is a flow chart of a data processing method according to an embodiment of the present application. As shown in fig. 2, the data processing method includes the following steps.
Step S210, a structured query statement for a logical table to be processed is received.
The logical table to be processed is generated based on a physical table group to be processed stored in the database, the physical table group to be processed including a single-record physical table to be processed and a multi-record physical table to be processed.
In particular, the structured query language (Structured Query Language, SQL) is a database programming language. The database includes a physical layer describing how data is stored, and a logical layer describing what data the database has, and the relationships between the data.
The physical table is a table in which a physical layer exists in reality, and all data is stored in the form of the physical table. The physical table is a storage entity data table, also called physical fact table. The logical table is a table which is watched and used by a user, and the logical table does not exist in the real physical layer, so that the data processing structured query statement based on the logical table cannot be directly executed in the physical layer and needs to be converted.
The to-be-processed single record physical table is a physical table formed by storing single record data on a physical layer. The multi-record physical table to be processed is a physical table formed by storing multi-record data on a physical layer. The single record physical table to be processed and the multi-record physical table to be processed form a physical table group to be processed. The single record physical table to be processed and the multi-record physical table to be processed are subjected to logic mapping to form a logic table to be processed in a logic layer.
For example, the single record data in the above table 1 is stored as a to-be-processed single record physical table2, see table2 below, and the multi-record data in the above table 1 is stored as a to-be-processed multi-record physical table3, see table3 below.
Table2 (Table 2)
Figure BDA0004101383290000071
Figure BDA0004101383290000081
Table3 (Table 3)
Date of inspection Serum proteins Hemoglobin (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
The logic table to be processed generated based on the single record physical table to be processed table2 and the multi-record physical table to be processed table3 is described in the following table 4.
Table4 (Table 4)
Name of name Sex (sex) Sex (sex) Mobile phone number Date of inspection Serum proteins Hemoglobin (hemoglobin) White blood cell count
Although the physical layer truly exists a single record physical table to be processed and a multi-record physical table to be processed, the user sees the logic table to be processed, so when the user has data processing requirements, a structured query statement aiming at the logic table to be processed is input. That is, a user terminal connected to the database system receives a structured query statement for the logical table to be processed.
For example, if the received SQL for the pending logical table is select from table4, the SQL for the pending logical table indicates that all fields in the pending logical table4 are queried.
Step S220, determining a preset executable associated statement corresponding to the logic table to be processed.
Illustratively, the preset executable association statement is a structured query statement generated based on an association relationship between the single-record physical table to be processed and the multi-record physical table to be processed.
The preset executable associated statement corresponding to the to-be-processed logic table refers to a structured query statement which can be executed in advance at a physical layer, is generated based on an associated relation between the to-be-processed single-record physical table and the to-be-processed multi-record physical table, and can perform query processing on the to-be-processed single-record physical table and the to-be-processed multi-record physical table corresponding to the to-be-processed logic table when being executed.
In an example, determining a preset executable associated statement corresponding to the pending logical table may be performed as: determining a to-be-processed physical table group for generating the to-be-processed logical table, and determining a preset executable associated statement corresponding to the to-be-processed physical table group as a preset executable associated statement corresponding to the to-be-processed logical table.
Specifically, since the to-be-processed logical table is generated based on the to-be-processed physical table group stored in the database, that is, the to-be-processed logical table is generated based on the to-be-processed single-record physical table and the to-be-processed multi-record physical table, there is a mapping relationship between the to-be-processed logical table and the to-be-processed single-record physical table and the to-be-processed multi-record physical table. When the structured query statement of the to-be-processed logic table is received, the to-be-processed single-record physical table and the to-be-processed multi-record physical table of the to-be-processed logic table can be determined. And because the preset executable associated statement is generated based on the association relation between the single record physical table to be processed and the multi-record physical table to be processed, another mapping relation exists between the logic table to be processed and the single record physical table to be processed and the multi-record physical table to be processed, and then the preset executable associated statement can be acquired according to the single record physical table to be processed and the multi-record physical table to be processed, so that the preset executable associated statement corresponding to the logic table to be processed can be determined.
For example, the table4 is generated based on the table2 and 3, and if the preset executable associated statement corresponding to the table2 and the table3 is the table2full join table3 (that is, the preset executable associated statement corresponding to the group of the table2full join table3), the preset executable associated statement corresponding to the table4 is determined to be the table2full join table3.
Step S230, the statement representing the logic table to be processed in the structured query statement is replaced by a preset executable associated statement, so that an executable structured query statement is obtained.
Specifically, since the SQL for the to-be-processed logical table cannot be directly executed at the physical layer, and the data to be actually processed is stored in the to-be-processed physical table group, the to-be-processed logical table needs to be converted, and the statement characterizing the to-be-processed logical table is replaced by the preset executable associated statement, that is, converted into the preset executable associated statement corresponding to the to-be-processed logical table which can be executed by the physical layer.
For example, for SQL in the pending logical table, select from table4, replacing table4 with table2full join table3, then the executable structured query statement is select table2full join table3.
Step S240, running the executable structured query statement to obtain a data processing result of the structured query statement.
And operating the executable structured query statement to perform query processing on the single-record physical table to be processed and the multi-record physical table to be processed on the physical layer, thereby obtaining a query result corresponding to the executable structured query statement. The query result corresponding to the executable structured query statement is the data processing result of the structured query statement.
Illustratively, the above-mentioned executing the executable structured query statement, resulting in the data processing result of the structured query statement, may be performed as: analyzing the executable structured query statement to obtain an association relation between the single record physical table to be processed and the multi-record physical table to be processed, and performing complete connection operation on the single record physical table to be processed and the multi-record physical table to be processed based on the association relation to obtain a data processing result.
The complete connection operation refers to that according to the association relation, the data of the single record physical table to be processed and the data of the multi-record physical table to be processed are integrated and displayed.
For example, table 2full join table3 is parsed to obtain the relationship between table 2 and table3 as a complete connection, so that the data in the queried table 2 and table3 are fully connected, thereby obtaining the data processing result of the structured query statement, that is, table 1 (table 1).
In the embodiment of the application, on the premise that the to-be-processed logic table is generated based on the to-be-processed physical table group (including the to-be-processed single-record physical table and the to-be-processed multi-record physical table) stored in the database, the purpose of combining the to-be-processed single-record physical table logic into the to-be-processed multi-record physical table on the basis of storing the to-be-processed single-record physical table and the to-be-processed multi-record physical table is achieved by replacing the statement representing the to-be-processed logic table in the structured query statement with a preset executable associated statement. Because the single record physical table logic is only combined into the multi-record physical table to be processed when the data is processed, the physical layer is still stored in two tables when being stored, compared with the direct combination storage in the prior art, the method has the advantages that multiple rows of data are not required to be changed when the single record data is changed, and therefore the purposes of reducing the complexity of subsequent operation and improving the operation performance of the system are achieved.
Considering that the pending logical table corresponding to the pending physical table group needs to be determined before the structured query statement for the pending logical table, how to determine the pending logical table corresponding to the pending physical table group is described in detail below with reference to fig. 3.
Fig. 3 is a schematic flow chart of determining a to-be-processed logical table corresponding to a to-be-processed physical table group according to an embodiment of the present application. As shown in fig. 3, determining the to-be-processed logical table corresponding to the to-be-processed physical table group includes the following steps.
Step S310, all field names of the to-be-processed single record physical table are obtained.
For example, for the to-be-processed single record physical table2, all field names, sexes, ages and mobile phone numbers are obtained.
Step S320, all field names of the multi-record physical table to be processed are obtained.
For example, for the to-be-processed physical table3, all field names were acquired, and date, serum protein, hemoglobin, and leukocyte counts were checked.
And step S330, combining 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 logic table to be processed.
Specifically, for all field names corresponding to the single-record physical table to be processed and each field name in all field names of the multi-record physical table to be processed, each field name is used as each column data in each row in the logic table to be processed, so that the logic table to be processed is obtained.
Because the logic table itself reflects the relationship, the mapping relationship between the to-be-processed logic table and the to-be-processed single-record physical table and the to-be-processed multi-record physical table is established at the same time based on the to-be-processed single-record physical table and the to-be-processed multi-record physical table.
In an example, 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 in all field names corresponding to the single-record physical table, and reserving the same field names in all field names corresponding to the multi-record physical table. That is, if the same field names do not exist in all the field names corresponding to the single-record physical table to be processed and all the field names corresponding to the multi-record physical table to be processed, all the field names corresponding to the single-record physical table to be processed and all the field names corresponding to the multi-record physical table to be processed are directly combined.
For example, all field names of the to-be-processed single-record physical table are name, gender, age and mobile phone number, all field names of the to-be-processed multi-record physical table are inspection date, serum protein, hemoglobin and leukocyte number, each field name is placed in each column data in each row, and therefore all field names corresponding to the to-be-processed single-record physical table and all field names of the to-be-processed multi-record physical table are combined to obtain a to-be-processed logic table, and the specific form of the to-be-processed logic table is shown in the table 4.
In this embodiment of the present application, the purpose of determining the to-be-processed logical table corresponding to the to-be-processed physical table group is achieved by the above manner, and in addition, because the logical table is a reaction relationship, when determining the to-be-processed logical table based on the to-be-processed single-record physical table and the to-be-processed multi-record physical table, a mapping relationship between the to-be-processed logical table and the to-be-processed single-record physical table and the to-be-processed multi-record physical table is also established.
Considering that the preset executable associated statement corresponding to the pending physical table group needs to be determined before the structured query statement for the pending logical table, how to determine the preset executable associated statement corresponding to the pending physical table group is described in detail below with reference to fig. 4.
Fig. 4 is a flowchart illustrating a process of determining a preset executable associated statement corresponding to a to-be-processed physical table group according to an embodiment of the present application. As shown in fig. 4, determining the preset executable associated statement corresponding to the pending physical table group includes the following steps.
In step S410, an association field between the single record physical table to be processed and the multi-record physical table to be processed is determined.
Illustratively, the associated fields are identification keys in the to-be-processed single record physical table and the to-be-processed multi-record physical table.
The identification key is (Identity Document, ID) and is also a unique key for the data corresponding to each field in the single record physical table to be processed and a unique key for the data corresponding to the multi-record physical table to be processed.
Step S420, based on the association field, determining the association relationship between the single record physical table to be processed and the multi-record physical table to be processed.
That is, it is necessary to determine the association relationship between the single-record physical table to be processed and the multi-record physical table to be processed based on the identification key of the single-record physical table to be processed and the identification key of the multi-record physical table to be processed.
Step S430, based on the association relationship, the table names of the to-be-processed single-record physical table and the table names of the to-be-processed multi-record physical table, and the preset executable association statement corresponding to the to-be-processed physical table group is generated.
For example, the table name of the single record physical table to be processed is table2, the table name of the multi-record physical table to be processed is table3, and the association relationship is all connection relationships, that is, the relationship of full join, so that the preset executable association statement corresponding to table2 and table3 is table 2full join table3.
Because the preset executable associated statement is generated based on the association relation between the single record physical table to be processed and the multi-record physical table to be processed, the corresponding relation between the physical table group to be processed and the preset executable associated statement is established at the same time of forming the preset executable associated statement corresponding to the physical table group to be processed.
In the embodiment of the application, the purpose of determining the preset executable associated statement corresponding to the to-be-processed physical table group is achieved through the mode, so that the purpose of determining the preset executable associated statement corresponding to the to-be-processed logical table based on the corresponding relation between the to-be-processed physical table group and the to-be-processed logical table is achieved, and further the purpose of replacing the statement representing the to-be-processed logical table in the structured query statement with the preset executable associated statement to execute the executable structured query statement is achieved.
Method embodiments of the present disclosure are described above in detail in connection with fig. 2-4, and apparatus embodiments of the present disclosure are described below in detail in connection with fig. 5-6. Furthermore, it should be understood that the description of the method embodiments corresponds to the description of the device embodiments, and that parts not described in detail can therefore be seen in the previous method embodiments.
Fig. 5 is a schematic structural diagram of a data processing apparatus according to an embodiment of the disclosure. As shown in fig. 5, the data processing apparatus 500 provided in the embodiment of the present disclosure includes a receiving module 510, a determining module 520, a replacing module 530, and an operating module 540.
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 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. The determining module 520 is configured to determine a preset executable association statement corresponding to the to-be-processed logical table, where the preset executable association statement is a structured query statement generated based on an association relationship between the to-be-processed single-record physical table and the to-be-processed multi-record physical table. The replacing module 530 is configured to replace a statement characterizing the to-be-processed logic table in the structured query statement with a preset executable associated statement, so as to obtain an executable structured query statement. The execution module 540 is configured to execute the executable structured query statement to obtain a data processing result of the structured query statement.
In one embodiment, the run module 540 is further configured to parse the executable structured query statement to obtain a determination of an association between the single record physical table to be processed and the multi-record physical table to be processed. And based on the association relation, performing complete connection operation on the single record physical table to be processed and the multi-record physical table to be processed, and obtaining a data processing result.
In one embodiment, the determination module 520 is further configured to determine a group of pending physical tables that generates a pending logical table. And determining the preset executable associated statement corresponding to the physical table group to be processed as the preset executable associated statement corresponding to the logic table to be processed.
Fig. 6 is a schematic structural diagram of a processing module according to another embodiment of the disclosure. The embodiment shown in fig. 6 is extended from the embodiment shown in fig. 5, and differences between the embodiment shown in fig. 6 and the embodiment shown in fig. 6 are described in detail, so that details of the differences will not be repeated.
In this embodiment, the data processing apparatus 500 further includes a preset executable association statement determination module 610
The executable association statement determination module 610 is configured to determine an association field between a single record physical table to be processed and a multi-record physical table to be processed. And determining the association relation between the single-record physical table to be processed and the multi-record physical table to be processed based on the association field. Based on the association relation, the table names of the to-be-processed single-record physical table and the table names of the to-be-processed multi-record physical table generate a preset executable association statement corresponding to the to-be-processed physical table group.
In one embodiment, the association field includes an identification key in the single record physical table to be processed and the multiple record physical table to be processed.
In one embodiment, the data processing apparatus 500 further includes a pending logic table determination module 620. The pending logical table determination module 620 is configured to obtain all field names of the pending single record physical table. And acquiring all field names of the multi-record physical table to be processed. And combining all field names corresponding to the to-be-processed single-record physical table and all field names of the to-be-processed multi-record physical table to obtain the to-be-processed logic table.
In one embodiment, the pending logic table determining module 620 is further configured to remove the same field names in all field names corresponding to the single record physical table and reserve the same field names in all field names corresponding to the multi-record physical table if the same field names are included in all field names corresponding to the single record physical table and all field names corresponding to the multi-record physical table.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. The electronic device 700 shown in fig. 7 includes a memory 701, a processor 702, a communication interface 703, and a bus 704. The memory 701, the processor 702, and the communication interface 703 are connected to each other by a bus 704.
The Memory 701 may be a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a random access Memory (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 perform the respective steps of the data processing method of the embodiment of the present disclosure.
The processor 702 may employ a general-purpose central processing unit (Central Processing Unit, CPU), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), graphics processor (Graphics Processing Unit, GPU) or one or more integrated circuits for executing associated programs to perform the functions required by the units in the database testing apparatus of the embodiments of the present disclosure.
The processor 702 may also be an integrated circuit chip with signal processing capabilities. In implementation, various steps of the data processing methods of the present disclosure may be accomplished by instructions in the form of integrated logic circuits or software in hardware in the processor 702. The processor 702 may also be a general purpose processor, a digital signal processor (Digital Signal Processing, DSP), an Application Specific Integrated Circuit (ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps and logic blocks of the disclosure in the embodiments of the disclosure may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present disclosure may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 701, and the processor 702 reads information in the memory 701, and in combination with hardware thereof, performs functions required to be performed by units included in the database test apparatus of the embodiment of the present disclosure, or performs a data processing method of the embodiment of the method of the present disclosure.
The communication interface 703 enables communication between the apparatus 700 and other devices or communication networks using a transceiver device such as, but not limited to, a transceiver. For example, a request for a announcement or announcement data may be received through the communication interface 703.
A bus 704 may include a path that communicates information between various components of the electronic device 700 (e.g., memory 701, processor 702, communication interface 703).
It should be noted that while the electronic device 700 shown in fig. 7 shows only a memory, a processor, and a communication interface, those skilled in the art will appreciate that in a particular implementation, the electronic device 700 also includes other components necessary to achieve proper operation. Also, those skilled in the art will appreciate that the electronic device 700 may also include hardware components that perform other additional functions, as desired. Furthermore, those skilled in the art will appreciate that the electronic device 700 may also include only the components necessary to implement the embodiments of the present disclosure, and not necessarily all of the components shown in FIG. 7.
In addition to the methods, apparatus and devices described above, embodiments of the present disclosure may also be a computer program product comprising computer program instructions which, when executed by a processor, cause the processor to perform the steps of the data processing methods provided by the various embodiments of the present disclosure.
The computer program product may write program code for performing the operations of embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C++ or the like and conventional step programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device, partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium, having stored thereon computer program instructions, which when executed by a processor, cause the processor to perform the steps of the data processing method provided by the various embodiments of the present disclosure.
The computer readable storage medium may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium would include the following: an electrical connection having one or more wires, a portable disk, a hard disk, random Access Memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present disclosure may be integrated in one similar region division unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present disclosure may be embodied in essence or a part contributing to the prior art or a part of the technical solution, or in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in the embodiments of the present disclosure. And the aforementioned storage medium includes: various media capable of storing program codes, such as a U disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
The foregoing is merely specific embodiments of the disclosure, but the protection scope of the disclosure is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the disclosure, and it is intended to cover the scope of the disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.
The block diagrams of the devices referred to in this application are exemplary only and are not intended to require or imply that the connections, arrangements, configurations must be made in the manner shown in the block diagrams. The modules and units of the apparatus may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are words of openness and mean "including but not limited to," and are used interchangeably therewith. The terms "or" and "as used herein refer to and are used interchangeably with the term" and/or "unless the context clearly indicates otherwise. The term "such as" as used herein refers to, and is used interchangeably with, the phrase "such as, but not limited to.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the present application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the application to the form disclosed herein. Although a number of example aspects and embodiments have been discussed above, a person of ordinary skill in the art will recognize certain variations, modifications, alterations, additions, and subcombinations thereof.

Claims (10)

1. A method of data processing, comprising:
receiving a structured query statement for a to-be-processed logical table, the to-be-processed logical table being generated based on a to-be-processed physical table group stored in a database, the to-be-processed physical table group comprising a to-be-processed single-record physical table and a to-be-processed multi-record physical table;
determining a preset executable associated statement corresponding to the to-be-processed logic table, wherein the preset executable associated statement is a structured query statement generated based on an associated relation between the to-be-processed single-record physical table and the to-be-processed multi-record physical table;
replacing the statement representing the logic table to be processed in the structured query statement with the preset executable associated statement to obtain an executable structured query statement;
and operating the executable structured query statement to obtain a data processing result of the structured query statement.
2. The data processing method according to claim 1, wherein the executing the executable structured query statement to obtain the data processing result of the to-be-processed logic table includes:
analyzing the executable structured query statement to obtain and determine the association relationship between the single-record physical table to be processed and the multi-record physical table to be processed;
and based on the association relation, performing complete connection operation on the single-record physical table to be processed and the multi-record physical table to be processed to obtain the data processing result.
3. The method for processing data according to claim 1 or 2, wherein the determining a preset executable association statement corresponding to the to-be-processed logic table includes:
determining a group of physical tables to be processed for generating the logical table to be processed;
and determining the preset executable associated statement corresponding to the to-be-processed physical table group as the preset executable associated statement corresponding to the to-be-processed logic table.
4. The data processing method according to claim 1 or 2, further comprising, prior to said receiving a structured query statement for a logical table to be processed:
determining an association field between the single record physical table to be processed and the multi-record physical table to be processed;
Based on the association field, determining an association relationship between the single-record physical table to be processed and the multi-record physical table to be processed;
based on the association relation, the table names of the to-be-processed single-record physical table and the table names of the to-be-processed multi-record physical table generate a preset executable association statement corresponding to the to-be-processed physical table group.
5. The data processing method of claim 4, wherein the association field includes identification keys in the single record physical table to be processed and the multiple record physical table to be processed.
6. The data processing method according to claim 1 or 2, further comprising, prior to said receiving a structured query statement for a logical table to be processed:
acquiring all field names of the to-be-processed single record physical table;
acquiring all field names of the to-be-processed multi-record physical table;
and combining 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 logic table to be processed.
7. The method of claim 6, wherein the 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 comprises:
And if all the field names corresponding to the single-record physical table to be processed and all the field names corresponding to the multi-record physical table to be processed comprise the same field names, removing the same field names in all the field names corresponding to the single-record physical table, and reserving the same field names in all the field names corresponding to the multi-record physical table.
8. A data processing apparatus, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is configured to receive a structured query statement aiming at a logic table to be processed, the logic table to be processed is generated based on a physical table group to be processed stored in a database, and the physical table group to be processed comprises a single record physical table to be processed and a multi-record physical table to be processed;
the determining module is configured to determine a preset executable associated statement corresponding to the to-be-processed logic table, wherein the preset executable associated statement is a structured query statement generated based on an associated relation between the to-be-processed single-record physical table and the to-be-processed multi-record physical table;
the replacing module is configured to replace the statement representing the to-be-processed logic table in the structured query statement with the preset executable associated statement to obtain an executable structured query statement;
And the operation module is configured to operate the executable structured query statement to obtain a data processing result of the structured query statement.
9. An electronic device, comprising:
a processor; and
a memory having stored therein computer program instructions which, when executed by the processor, perform the data processing method of any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon computer program instructions which, when executed by a processor, perform the data processing method of any of claims 1 to 7.
CN202310173619.1A 2023-02-27 2023-02-27 Data processing method and device, electronic equipment and computer readable storage medium Pending CN116244326A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310173619.1A CN116244326A (en) 2023-02-27 2023-02-27 Data processing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310173619.1A CN116244326A (en) 2023-02-27 2023-02-27 Data processing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN116244326A true CN116244326A (en) 2023-06-09

Family

ID=86623763

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310173619.1A Pending CN116244326A (en) 2023-02-27 2023-02-27 Data processing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN116244326A (en)

Similar Documents

Publication Publication Date Title
CN110633292B (en) Query method, device, medium, equipment and system for heterogeneous database
US20210081950A1 (en) Method and apparatus for identifying identity information
US10360405B2 (en) Anonymization apparatus, and program
CN110688544A (en) Method, device and storage medium for querying database
CN106933859B (en) Medical data migration method and device
CN109947804B (en) Data set query optimization method and device, server and storage medium
Gentili et al. The case for preregistering all region of interest (ROI) analyses in neuroimaging research
CN109471893B (en) Network data query method, equipment and computer readable storage medium
CN114490642A (en) Patient master index generation method, apparatus and medium
US20210042363A1 (en) Search pattern suggestions for large datasets
CN111145846A (en) Clinical trial patient recruitment method and device, electronic device and storage medium
US20230153455A1 (en) Query-based database redaction
CN116244326A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN113961569B (en) Medical data ETL task synchronization method and device
US9201936B2 (en) Rapid provisioning of information for business analytics
CN114064657A (en) Multi-table integration method, device, equipment and storage medium
CN114724725A (en) Data processing method and device, electronic equipment and storage medium
JP6646699B2 (en) Search device and search method
CN112331355A (en) Generation method and device of disease category evaluation table, electronic equipment and storage medium
CN109408368B (en) Test auxiliary information output method, storage medium and server
CN114510605A (en) Data storage method and device, electronic equipment and storage medium
CN116414858A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN111159214A (en) API access method and device, electronic equipment and storage medium
US20230214394A1 (en) Data search method and apparatus, electronic device and storage medium
US20150081380A1 (en) Complement self service business intelligence with cleansed and enriched customer data

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination