WO2020177376A1 - 数据的提取方法、装置、终端及计算机可读存储介质 - Google Patents
数据的提取方法、装置、终端及计算机可读存储介质 Download PDFInfo
- Publication number
- WO2020177376A1 WO2020177376A1 PCT/CN2019/117214 CN2019117214W WO2020177376A1 WO 2020177376 A1 WO2020177376 A1 WO 2020177376A1 CN 2019117214 W CN2019117214 W CN 2019117214W WO 2020177376 A1 WO2020177376 A1 WO 2020177376A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- tables
- query
- temporary
- basic
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/08—Insurance
Definitions
- This application relates to the field of data extraction technology, and in particular to a data extraction method, device, terminal, and computer-readable storage medium.
- insurance policies of type a, type b, type c, etc. need to be extracted or pushed after XXXX time.
- the insurance policy includes premium, insurance start period, and insurance end Period and so on.
- the insurance policy table is a large table with a data volume of over 100 million.
- the time interval is large and there are many insurance types, the query is very slow and some queries are expensive. Time is more than a few hours.
- the main purpose of this application is to provide a data extraction method, device, terminal, and computer-readable storage medium, aiming to solve the technical problem of long time-consuming data extraction from a large number of existing data tables.
- this application provides a method for extracting data, and the method for extracting data includes:
- the temporary table is used as a driving table to perform a joint query in other related tables to obtain final extracted data, where the other related tables are related tables other than the largest basic table in the multi-table related table.
- this application also provides a data extraction device, which includes:
- An obtaining module which is used to obtain key fields of business requirements
- the first query module is configured to perform a query in a preset largest basic table according to the key field to obtain query data in the largest basic table, where the largest basic table is a multi-table related table The largest table;
- a creation module the creation module is used to create a temporary table according to the temporary data
- the second query module is used to use the temporary table as a driving table to perform a joint query in other related tables to obtain the final extracted data, wherein the other related tables are the largest basic table among the multi-table related tables External association table.
- the present application also provides a terminal, including a processor, a memory, and computer-readable instructions stored on the memory that can be executed by the processor, where the computer-readable instructions are executed by the processor , To achieve the steps of the data extraction method described above.
- the present application also provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, wherein when the computer-readable instructions are executed by a processor, the method for extracting data as described above is implemented A step of.
- the present application also provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium, wherein when the computer-readable instructions are executed by a processor, the method for extracting data as described above is implemented A step of.
- the key fields of the business requirements are obtained; according to the key fields, a query is made in the preset maximum basic table to obtain temporary data, where the maximum basic table is the largest table in the multi-table related table; Create a temporary table for data; use the temporary table as a driving table to perform a joint query in other related tables to obtain the final extracted data.
- the other related tables are related tables other than the largest basic table in the multi-table related tables.
- the technical solution proposed in this application extracts data from a large number of data tables based on data reports, creates a temporary table based on the results of the query in the largest basic table in the multi-table association table, and then uses the temporary table as the driving table in the multi-table association Query in other related tables in the table to obtain the final extracted data. Since the created temporary table only includes data related to key fields, the amount of data in the temporary table is small, so that the temporary table is used as the driving table in the Joint query in other related tables can significantly improve query speed.
- FIG. 1 is a schematic diagram of the hardware structure of a terminal involved in a solution of an embodiment of the application
- FIG. 2 is a schematic flowchart of a first embodiment of a method for extracting data in this application
- FIG. 3 is a detailed schematic diagram of the process of using the temporary table as a driving table to perform joint query in other related tables in the implementation of this application to obtain the final extracted data;
- FIG. 4 is a schematic flowchart of a second embodiment of a method for extracting data in this application.
- FIG. 5 is a schematic flowchart of a third embodiment of a method for extracting data in this application.
- FIG. 6 is a detailed schematic diagram of the process of querying in the preset maximum basic table according to the key fields in an embodiment of the application to obtain temporary data;
- FIG. 7 is a schematic flowchart of a fourth embodiment of a method for extracting data in this application.
- FIG. 8 is a schematic flowchart of a fifth embodiment of a method for extracting data in this application.
- Fig. 9 is a schematic diagram of modules of the data extraction device of the application.
- the data extraction method involved in the embodiments of the present application is mainly applied to a terminal, and the terminal may be a device with display and processing functions such as a PC, a portable computer, and a mobile terminal.
- FIG. 1 is a schematic diagram of a terminal structure involved in a solution of an embodiment of this application.
- the terminal may include a processor 1001 (for example, a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
- the communication bus 1002 is used to realize the connection and communication between these components;
- the user interface 1003 may include a display (Display), an input unit such as a keyboard (Keyboard);
- the network interface 1004 may optionally include a standard wired interface, a wireless interface (Such as WI-FI interface);
- the memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory.
- the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
- FIG. 1 does not constitute a limitation on the device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange different components.
- the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and computer-readable instructions.
- the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the computer-readable instructions stored in the memory 1005 and execute the steps of the data extraction method.
- This application provides a data extraction method.
- the data extraction method includes the following steps:
- Step S100 obtaining key fields of business requirements
- users when they need to obtain data in a large number of data tables, they can perform multi-table related queries on the data tables, for example, join rows from two or more tables through a SQL join (JOIN) clause, and connect
- the basis is the common fields between these tables.
- These common fields are called associative fields, and all the data tables that are related for query are called multi-table association tables.
- the policy information may include information such as premium, insured amount, insurance start period, insurance end period, basic information of the insured, and the type of insurance information.
- the key fields that can be input to the terminal are: after 2017, type a, type b, type c, etc.
- Step S200 Query in the preset maximum basic table according to the key field to obtain temporary data, where the maximum basic table is the largest table in the multi-table association table;
- the preset maximum basic table can be queried according to the key fields entered by the user, and the queried data can be extracted as temporary data.
- the basic insurance policy table is the largest basic table in the multi-table association of the insurance policy.
- the data of insurance type a, type b, and type c are extracted as temporary data.
- the largest basic table is the basic table with the largest amount of data in the multi-table association table.
- Step S300 creating a temporary table according to the temporary data
- Step S400 using the temporary table as a driving table to perform a joint query in other related tables to obtain final extracted data, where the other related tables are related tables other than the largest basic table in the multi-table related tables.
- the largest basic table is also a related table in a multi-table related table, and other related tables refer to related tables other than the largest basic table.
- the temporary table is created, and the temporary table is used as the driving table for the entire subsequent query process.
- the joint query is performed in the other related tables in the multi-table related table to obtain the queried data and extract the queried data Get the final extracted data that users need.
- FIG. 3 is a detailed schematic diagram of the process of using the temporary table as the driving table to perform joint query in other related tables in the implementation of this application to obtain the final data extraction step.
- the steps S400 includes:
- Step S410 obtaining the associated fields between the associated tables in the multi-table association table
- association fields between the largest basic table in the multi-table association table and other association tables, and the association fields between the other association tables themselves can be obtained.
- the associated fields between the basic policy table and the identity table, between the basic policy table and the insurance type definition table, and between the identity table and the insurance type definition table can all be the policy number.
- Step S420 set an index according to the associated field
- Step S430 Use the temporary table as a driving table, and perform a joint query in other related tables according to the index to obtain the final extracted data.
- the index of the temporary table can be set according to the related field.
- the function of the index is equivalent to the catalog of books, and the required content can be quickly found according to the page number in the catalog. That is, you can quickly find the data you need to find based on the index.
- the temporary table is used as the driving table, and a joint query is performed in other related tables according to the index to obtain the final extracted data. That is, according to the index, the temporary table is associated with other associated tables to obtain the final extracted data.
- step S420 includes:
- Step S421 establishing an index of the temporary table according to the associated fields of the largest basic table and other associated tables;
- a multi-table related table there are related fields between the largest basic table and other related tables.
- multiple indexes of the temporary table can be established, each index
- the index includes an address. The address provides a pointer to the data value in the specified column of the other association table. According to the address in the index, you can find the data in the corresponding other association table, which is beneficial to Quickly query data.
- the I index on the temporary table when the I index on the temporary table is established based on the associated field between the largest basic table and the A table, the I index on the temporary table corresponds to the A table, and the data in the A table can be queried ;
- the II index on the temporary table is established based on the associated field between the largest basic table and the B table, the II index on the temporary table corresponds to the B table, and the data in the B table can be queried.
- Step S430 includes:
- Step S431 traversing and querying the data in the temporary table to obtain the address in the index
- all data in the temporary table is traversed to obtain addresses in all indexes of all the data in the temporary table.
- Step S432 query in other corresponding association tables according to the address to obtain the corresponding sub-temporary table
- the data in the corresponding related table can be found according to the queried address, and each other related table corresponds to a sub-temporary table , Put the data found in other related tables into the corresponding sub-temporary table.
- step S433 the data in the temporary table and all the sub-temporary tables are assembled together as the final extracted data.
- association tables A, B, C, D, E in the multi-table association table
- a table is the largest basic table among the five tables, A table and B table, A table and C table, A
- the data in the A table that meets the user's needs are extracted to create a temporary table X. Create multiple indexes of the temporary table X according to the associated fields existing between the A table and the B table, the A table and the C table, the A table and the D table, and the A table and the E table.
- the temporary table X and the B table are associated with an index established based on the associated field between the A table and the B table, and the data that meets the requirements in the B table is obtained and placed in the sub-temporary table X1;
- the index established by the associated field between the A table and the C table, the temporary table X and the C table are associated with the query, and the data that meets the requirements in the C table is placed in the child temporary table X2; according to the relationship between the A table and the D table
- the index established by the associated field, the temporary table X and the D table are associated with the query, and the data that meets the requirements in the D table is placed in the sub-temporary table X3; according to the index established by the associated field between the A table and the E table, the temporary The table X and the E table are associated with the query, and the data that meets the requirements in the E table is obtained and placed in the sub temporary table X4.
- an associated query can be performed on the temporary table X and the B table based on the index established by the associated field between the A table and the B table, and the data that meets the requirements in the B table can be obtained and placed in the temporary table X.
- Sub-temporary table X1 based on the index established by the associated field between the A table and the C table, perform an associated query on the temporary table X and the C table, and add the query result to the sub-temporary table X1 to form the sub-temporary table X2;
- the temporary table X and the D table are associated with the query, and the query results are added to the child temporary table X2 to form the child temporary table X3;
- the A table and E The index established by the associated field between the tables, the temporary table X and the E table are associated with the query, and the query results are added to the sub-temporary table X3 to form the sub-temporary table X4.
- FIG. 5 is a schematic flowchart of a third embodiment of a method for extracting data in this application. Based on the foregoing embodiment, step S420 further includes:
- Step S422 Sort the association tables in the multi-table association table according to the size order of the tables
- Step S423 Set an index corresponding to the larger one of the two tables according to the association field between the two adjacent association tables.
- the temporary table can be used to gradually perform association queries on other association tables in the multi-table association table in order, until all other association tables are queried to obtain the final extracted data.
- the association tables in the multi-table association table can be sorted according to the order of the table size; then the larger table of the two tables is set according to the association field between the two adjacent association tables The corresponding index.
- Step S430 also includes:
- Step S434 traversing and querying the data in the temporary table to obtain the address in the corresponding index
- the index of the temporary table may be the index corresponding to the largest basic table. After the temporary table is obtained, all data in the temporary table is traversed to obtain the addresses in the indexes of all the data in the temporary table. Among them, the index corresponding to the largest basic table is established based on the associated fields between the largest basic table and adjacent tables, and the index corresponding to the largest basic table can only query the associated tables adjacent to the largest basic table.
- Step S435 query in the associated table adjacent to the largest basic table according to the address to obtain the corresponding sub-temporary table
- the query is performed in the associated table adjacent to the largest basic table, and the data in the associated table adjacent to the largest basic table is obtained and put into the corresponding temporary sub-table.
- Step S436 using the sub-temporary table as the driving table, and performing repeated, step-by-step associative queries in other associative tables according to the corresponding indexes, until all associative tables are queried to obtain the final extracted data.
- the index corresponding to the related table finds the data in the next adjacent related table, puts it into the sub-temporary table corresponding to the next adjacent related table, and then uses the obtained sub-temporary table as the driving table for the next query , Perform an associated query on the next adjacent associated table, and repeat the associated query step by step until all associated tables are queried, and the last child temporary table is obtained, and then the temporary table and all the child temporary tables Collect the data together to get the final extracted data.
- Table query to obtain temporary table Y based on the index established between the related fields between F table and G table, perform an associated query on temporary table Y and G table, and obtain the data that meets the requirements in G table and put it into sub temporary table Y1;
- the index established by the associated field between the G table and the H table, the associated query is performed on the temporary table Y1 and the H table, and the data that meets the requirements in the H table is placed in the child temporary table Y2; according to the association between the H table and the I table
- the index established by the field is used to perform an associated query on the temporary table Y2 and the I table, and the data that meets the requirements in the I table is placed in the sub-temporary table Y3; according to the index established by the associated field between the I table and the J table, the temporary table Y3
- the key fields of the business requirements are obtained; according to the key fields, a query is made in the preset maximum basic table to obtain temporary data, where the maximum basic table is the largest table in the multi-table related table; Create a temporary table for data; use the temporary table as a driving table to perform a joint query in other related tables to obtain the final extracted data.
- the other related tables are related tables other than the largest basic table in the multi-table related tables.
- the technical solution proposed in this application extracts data from a large number of data tables based on data reports, creates a temporary table based on the results of the query in the largest basic table in the multi-table association table, and then uses the temporary table as the driving table in the multi-table association Query in other related tables in the table to obtain the final extracted data. Since the created temporary table only includes data related to key fields, the amount of data in the temporary table is small, so that the temporary table is used as the driving table in the Joint query in other related tables can significantly improve query speed.
- FIG. 6 is a detailed schematic diagram of the process of querying in the preset maximum basic table according to the key field to obtain temporary data in an embodiment of the application. Based on the above embodiment, the steps S200 includes:
- Step S210 Query in the preset largest basic table according to the key field to obtain query data in the largest basic table
- a key field may correspond to a table or multiple key fields correspond to a table. Basically all the key fields can be queried in the largest basic table, but in very special circumstances, they may also exist The key fields that cannot be queried for data in the largest basic table need to be queried in other basic tables based on the key fields that cannot be queried to extract the corresponding data. For example, if insurance type a, type b, and type c are all basic insurance types, they all exist in the basic insurance policy table. However, in an extremely special case, when insurance types a, b, and c are very rare In case of insurance, the data of this very rare insurance can be queried in other special basic tables. Therefore, after the key fields are obtained, the data that can be queried from the largest basic table of the multi-table related table can be extracted first to obtain the query data in the largest basic table.
- Step S220 Determine whether there are fields in the key fields that cannot be queried in the largest basic table
- the key field exists in the field that cannot be queried in the largest basic table, and it can be judged whether the key field exists in the largest basic table.
- Fields for example, when there is a rare insurance type c insurance type in a insurance type, b insurance type, c insurance type, the rare insurance type c insurance type cannot be found in the basic insurance policy table.
- the data queried in the basic insurance policy table is not Including the data of insurance type c can indicate that the key fields corresponding to insurance type c cannot be queried in the largest basic table.
- Step S230 If there is a field that cannot be queried in the largest basic table in the key field, query in other basic tables according to the field to obtain query data in other basic tables, where the other basic tables are other related tables Basic table in
- the queried data can be extracted As the query data in his basic table; if multiple fields need to correspond to several other basic tables to be queried, you can query in the corresponding other basic tables according to the fields, and get the corresponding to several other basic tables Query data, gather the query data together as the query data in other basic tables.
- step S240 the query data in the largest basic table and the query data in other basic tables are used as temporary data.
- the extracted query data in the largest basic table and the query data in other basic tables are collected together as temporary data.
- step S200 further includes:
- Step S250 judging whether the key fields are greater than or equal to two;
- Step S260 If the number of the key fields is greater than or equal to two, a parallel query is performed in the preset maximum basic table according to the key fields to obtain temporary data.
- the process of querying to obtain temporary data can be executed in parallel, that is, multi-threaded query in the largest basic table.
- the actual number of multi-threaded processing can be adjusted according to the actual needs of the user, as long as it does not exceed the maximum number of concurrent processing threads on the server.
- FIG. 8 is a schematic flowchart of a fifth embodiment of a method for extracting data in this application. Based on the first embodiment, after step S400, it further includes:
- Step S500 Delete the temporary table.
- the created temporary table can be deleted.
- all temporary data such as all sub-temporary tables in the terminal can be deleted.
- this application also provides a data extraction device 10, and the data extraction device 10 includes:
- An obtaining module 20 which is used to obtain key fields of business requirements
- the first query module 30, the first query module is configured to perform a query in a preset maximum basic table according to the key field to obtain temporary data, wherein the maximum basic table is the largest table in a multi-table related table;
- a creation module 40 the creation module is used to create a temporary table according to the temporary data
- the second query module 50 the second query module is used to use the temporary table as a driving table to perform a joint query in other related tables to obtain the final extracted data, where the other related tables are multi-table related tables except the largest basic Related tables outside the table.
- the second query module 50 is also used for:
- the temporary table is used as a driving table, and a joint query is performed in other related tables according to the index to obtain the final extracted data.
- the second query module 50 is also used for:
- the second query module 50 is also used for:
- the sub-temporary table is used as the driving table, and repeated step-by-step associative queries are performed in other associated tables according to the corresponding indexes, until all the associated tables are queried to obtain the final extracted data.
- first query module 30 is also used for:
- first query module 30 is also used for:
- a parallel query is performed in the preset maximum basic table according to the key fields to obtain temporary data.
- the data extraction device 10 further includes:
- the deletion module is used to delete the temporary table.
- each module in the above-mentioned data extraction device 10 corresponds to each step in the above-mentioned data extraction method embodiment, and its functions and implementation processes will not be repeated here.
- this application also provides a computer-readable storage medium.
- the computer-readable storage medium of the present application stores computer-readable instructions, where the computer-readable instructions implement the steps of the above-mentioned data extraction method when executed by the processor.
- the embodiments of the present application can be provided as methods, systems, or computer-readable instruction products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware.
- These computer-readable instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the instruction device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- These computer-readable instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, which can be executed on the computer or other programmable equipment.
- the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
- any reference signs located between parentheses should not be constructed as limitations on the claims.
- the word “comprising” does not exclude the presence of parts or steps not listed in the claims.
- the word “a” or “an” preceding a component does not exclude the presence of multiple such components.
- This application can be realized by means of hardware including several different components and by means of a suitably programmed computer. In the unit claims enumerating several devices, several of these devices may be embodied by the same hardware item.
- the use of the words first, second, and third, etc. do not indicate any order. These words can be interpreted as names.
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- General Physics & Mathematics (AREA)
- Development Economics (AREA)
- Technology Law (AREA)
- Strategic Management (AREA)
- General Business, Economics & Management (AREA)
- Marketing (AREA)
- Economics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种数据的提取方法、装置、终端及计算机可读存储介质,所述方法包括:获取业务需求的关键字段(S100);根据关键字段在预设的最大基本表中进行查询,获得临时数据,其中,最大基本表为多表关联表中的最大表(S200);根据临时数据创建临时表(S300);将临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表(S400)。
Description
本申请要求于2019年3月7日提交中国专利局、申请号为201910173127.6、发明名称为“数据的提取方法、装置、终端及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
技术领域
本申请涉及数据提取技术领域,尤其涉及一种数据的提取方法、装置、终端及计算机可读存储介质。
背景技术
时常有业务场景,需要在数据量比较大的表中提取数据,例如,需要提取或推送XXXX时间之后的a险种、b险种、c险种等的保单,保单中包含保费、保险起期、保险止期等等信息。目前,遇到对大量数据表的数据查询,通常都是多表关联查询,但是保单表是个大表,数据量过亿,当时间区间较大,险种较多时,查询非常慢,有的查询耗时几个小时以上。
因此,现有的大量数据表中的数据提取耗时较长是一种亟待解决的问题
发明内容
本申请的主要目的在于提供一种数据的提取方法、装置、终端及计算机可读存储介质,旨在解决现有的大量数据表中的数据提取耗时较长的技术问题。
为实现上述目的,本申请提供一种数据的提取方法,所述数据的提取方法包括:
获取业务需求的关键字段;
根据所述关键字段在预设的最大基本表中进行查询,得到最大基本表中的查询数据,其中,最大基本表为多表关联表中的最大表;
判断关键字段中是否存在最大基本表中查询不到的字段;
若关键字段中存在最大基本表中查询不到的字段,则根据所述字段在其他基本表中进行查询,得到其他基本表中的查询数据,其中,其他基本表为其他关联表中的基本表;
将最大基本表中的查询数据与其他基本表中的查询数据一起作为临时数据;
根据所述临时数据创建临时表;
将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表。
另外,本申请还提供一种数据的提取装置,所述数据的提取装置包括:
获取模块,所述获取模块用于获取业务需求的关键字段;
第一查询模块,所述第一查询模块用于根据所述关键字段在预设的最大基本表中进行查询,得到最大基本表中的查询数据,其中,最大基本表为多表关联表中的最大表;
判断关键字段中是否存在最大基本表中查询不到的字段;
若关键字段中存在最大基本表中查询不到的字段,则根据所述字段在其他基本表中进行查询,得到其他基本表中的查询数据,其中,其他基本表为其他关联表中的基本表;
将最大基本表中的查询数据与其他基本表中的查询数据一起作为临时数据;
创建模块,所述创建模块用于根据所述临时数据创建临时表;
第二查询模块,所述第二查询模块用于将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表。
本申请还提供一种终端,包括处理器、存储器、以及存储在所述存储器上的可被所述处理器执行的计算机可读指令,其中,所述计算机可读指令被所述处理器执行时,实现如上所述的数据的提取方法的步骤。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时,实现如上所述的数据的提取方法的步骤。
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时,实现如上所述的数据的提取方法的步骤。
本申请技术方案中,获取业务需求的关键字段;根据关键字段在预设的最大基本表中进行查询,获得临时数据,其中,最大基本表为多表关联表中的最大表;根据临时数据创建临时表;将临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表。本申请提出的技术方案基于数据报表对大量数据表中的数据进行提取,根据在多表关联表中的最大基本表中进行查询的结果创建临时表,再将临时表作为驱动表在多表关联表中的其他关联表中进行查询,获得最终的提取数据,由于创建的临时表中只包括了与关键字段相关的数据,因此,临时表的数据量小,使得通过临时表作为驱动表在其他关联表中联合查询,能够显著提高查询速度。
附图说明
图1为本申请实施例方案中涉及的终端的硬件结构示意图;
图2为本申请数据的提取方法第一实施例的流程示意图;
图3为本申请实施中将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据的步骤的流程细化示意图;
图4为本申请数据的提取方法第二实施例的流程示意图;
图5为本申请数据的提取方法第三实施例的流程示意图;
图6为本申请实施例中根据所述关键字段在预设的最大基本表中进行查询,获得临时数据的步骤的流程细化示意图;
图7为本申请数据的提取方法第四实施例的流程示意图;
图8为本申请数据的提取方法第五实施例的流程示意图;
图9为本申请数据的提取装置的模块示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的可选地实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例涉及的数据的提取方法主要应用于终端,该终端可以是PC、便携计算机、移动终端等具有显示和处理功能的设备。
参照图1,图1为本申请实施例方案中涉及的终端结构示意图。本申请实施例中,终端可以包括处理器1001(例如CPU),通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信;用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard);网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口);存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile
memory),例如磁盘存储器,存储器1005可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图1中示出的硬件结构并不构成对设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
继续参照图1,图1中作为一种计算机可读存储介质的存储器1005可以包括操作系统、网络通信模块以及计算机可读指令。
在图1中,网络通信模块主要用于连接服务器,与服务器进行数据通信;而处理器1001可以调用存储器1005中存储的计算机可读指令,并执行数据的提取方法的步骤。
基于上述终端的硬件结构,提出本申请数据的提取方法的各个实施例。
本申请提供一种数据的提取方法。
请参阅图2,在本申请第一实施例中,数据的提取方法包括以下步骤:
步骤S100,获取业务需求的关键字段;
可选地,当用户需要获取大量数据表中的数据时,可以对数据表进行多表关联查询,例如,通过SQL连接(JOIN)子句把来自两个或多个表的行连接起来,连接的基础是这些表之间的共同字段,将这些共同字段称为关联字段,将关联起来进行查询的所有的数据表称为多表关联表。
在进行多表关联查询时,可以先向终端输入需要获取的数据的关键字段。以保单查询为例,保单情况可能包括保费、保额、保险起期、保险止期、参保人基本情况、险种的情况等信息,在保单基本表中存在基本的险种、基本险种的保费、保额、保险起期、保险止期以及参保人名称等信息,而在身份表中存在参保人的详细信息,在险种定义表中存在险种的信息,在保费明细表中存在保费的明细信息等。
当用户需要提取或推送2017年之后的a险种、b险种、c险种的保单情况时,可以向终端输入的关键字段为:2017年之后、a险种、b险种、c险种等。
步骤S200,根据所述关键字段在预设的最大基本表中进行查询,获得临时数据,其中,最大基本表为多表关联表中的最大表;
可以根据用户输入的关键字段对预设的最大基本表进行查询,将查询到的数据提取出来作为临时数据。例如,保单基本表是保单多表关联中的最大基本表,当用户需要提取或推送2017年之后的a险种、b险种、c险种的保单情况时,可以从保单基本表中将对应的2017年之后的a险种、b险种、c险种的数据提取出来,作为临时数据。需要说明的是,最大基本表为多表关联表中的数据量最大的基本表。
步骤S300,根据所述临时数据创建临时表;
需要说明的是,在创建临时表时,不需要把临时表的信息归档,可以提高临时表的创建效率。
步骤S400,将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表。
需要说明的是,最大基本表也是多表关联表中的关联表,其他关联表是指除最大基本表之外的关联表。在将临时数据提取出来创建了临时表,将临时表作为后续整个查询过程的驱动表,在多表关联表中的其他关联表中进行联合查询,获得查询的数据,将查询到的数据提取出去得到用户需要的最终提取数据。
进一步地,请参照图3,图3为本申请实施中将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据的步骤的流程细化示意图,基于上述实施例,步骤S400包括:
步骤S410,获取多表关联表中的关联表之间的关联字段;
可选地,可以获取多表关联表中最大基本表与其他关联表之间的关联字段,以及其他关联表自身之间的关联字段。例如,在保单基本表与身份表之间、保单基本表与险种定义表之间以及身份表与险种定义表之间的关联字段均可以是保单号等。
步骤S420,根据所述关联字段设置索引;
步骤S430,将所述临时表作为驱动表,根据所述索引在其他关联表中进行联合查询,获得最终提取数据。
获取到多表关联表中的关联表之间的关联字段后,可以根据该关联字段设置临时表的索引,索引的作用相当于图书的目录,可以根据目录中的页码快速找到所需的内容,即可以根据索引快速找到需要查找的数据。在本实施例中,将临时表作为驱动表,根据该索引在其他关联表中进行联合查询,获得最终提取数据。即,根据索引,将临时表与其他关联表进行关联查询,获得最终提取数据。
进一步地,请参照图4,图4为本申请数据的提取方法第二实施例的流程示意图,基于上述实施例,步骤S420包括:
步骤S421,根据最大基本表与其他关联表的关联字段建立临时表的索引;
在多表关联表中,最大基本表与其他关联表两两之间分别存在有关联字段,根据最大基本表与其他关联表之间的关联字段,可以建立临时表的多个索引,每个索引对应有一个其他关联表,索引中包括有地址,地址即为提供指向其他关联表的指定列中的数据值的指针,根据索引中的地址可以查找到对应的其他关联表中的数据,有利于快速对数据进行查询,例如,当根据最大基本表与A表之间的关联字段建立临时表上的I索引时,临时表上的I索引与A表对应,能够对A表中的数据进行查询;当根据最大基本表与B表之间的关联字段建立临时表上的II索引时,临时表上的II索引与B表对应,能够对B表中的数据进行查询。
步骤S430包括:
步骤S431,对所述临时表中的数据进行遍历查询得到索引中的地址;
可选地,在获取到临时表后,对临时表中的所有数据进行遍历,获得该临时表中所有的数据的所有的索引中的地址。
步骤S432,根据所述地址在对应的其他关联表中进行查询,得到对应的子临时表;
在获取到临时表的索引中的地址后,由于一个索引可以对应一个其他关联表,因此,可以根据查询到的地址找到对应的关联表中的数据,每一个其他关联表对应有一个子临时表,将在其他关联表中查找到的数据放入对应的子临时表中。
步骤S433,将临时表和所有的子临时表中的数据集合在一起作为最终提取数据。
在将多表关联表中的所有的其他关联表查询完毕后,将临时表和所有子临时中的数据集合在一起作为最终提取数据。
例如,假设多表关联表中存在五个关联表A、B、C、D、E,其中,A表为五个表中的最大基本表,A表与B表、A表与C表、A表与D表、A表与E表之间均存在关联字段,在进行查询时,将A表中符合用户需求的数据提取出来创建临时表X。根据A表与B表、A表与C表、A表与D表、A表与E表之间存在的关联字段建立临时表X的多个索引。
在一种实施例中,根据A表与B表之间的关联字段建立的索引,对临时表X与B表进行关联查询,得到B表中符合要求的数据放入子临时表X1中;根据A表与C表之间的关联字段建立的索引,对临时表X与C表进行关联查询,得到C表中符合要求的数据放入子临时表X2中;根据A表与D表之间的关联字段建立的索引,对临时表X与D表进行关联查询,得到D表中符合要求的数据放入子临时表X3中;根据A表与E表之间的关联字段建立的索引,对临时表X与E表进行关联查询,得到E表中符合要求的数据放入子临时表X4中。最后将临时表X、子临时表X1、X2、X3以及X4的数据集合关联在一起形成表X5,表X5里面的数据就是用户所需要提取的最终提取数据。
在另一种实施例中,可以根据A表与B表之间的关联字段建立的索引,对临时表X与B表进行关联查询,得到B表中符合要求的数据放入临时表X中形成子临时表X1;根据A表与C表之间的关联字段建立的索引,对临时表X与C表进行关联查询,将查询到的结果添加至子临时表X1中,形成子临时表X2;根据A表与D表之间的关联字段建立的索引,对临时表X与D表进行关联查询,将查询到的结果添加至子临时表X2中,形成子临时表X3;根据A表与E表之间的关联字段建立的索引,对临时表X与E表进行关联查询,将查询到的结果添加至子临时表X3中,形成子临时表X4,子临时表X4里的数据就是用户所需要提取的最终提取数据。
进一步地,请参照图5,图5为本申请数据的提取方法第三实施例的流程示意图,基于上述实施例,步骤S420还包括:
步骤S422,按照表的大小顺序对多表关联表中的关联表进行排序;
步骤S423,根据相邻的两个关联表之间的关联字段设置两个表中的较大的表对应的索引。
可以利用临时表对多表关联表中的其他关联表按顺序逐步进行关联查询,直到将所有的其他关联表查询完毕后,得到最终提取数据。在可选的实施例中,可以按照表的大小顺序对多表关联表中的关联表进行排序;再根据相邻的两个关联表之间的关联字段设置两个表中的较大的表对应的索引。
步骤S430还包括:
步骤S434,对所述临时表中的数据进行遍历查询得到对应的索引中的地址;
临时表的索引可以为最大基本表对应的索引,在获取到临时表后,对临时表中的所有数据进行遍历,获得该临时表中所有的数据的索引中的地址。其中,最大基本表对应的索引是根据最大基本表与相邻的表之间的关联字段建立的,最大基本表对应的索引只能对与最大基本表相邻的关联表进行查询。
步骤S435,根据所述地址在与最大基本表相邻的关联表中进行查询,得到对应的子临时表;
根据获得的地址在在与最大基本表相邻的关联表中进行查询,获得与最大基本表相邻的关联表中的数据,放入对应的子临时表。
步骤S436,将所述子临时表作为驱动表,根据对应的索引在其他关联表中进行重复的逐步关联查询,直到将所有的关联表查询完毕,得到最终提取数据。
可选地,将子临时表作为驱动表,根据对应的索引在其他关联表中进行重复逐步关联查询,得到最终提取数据,即,将子临时表作为驱动表,根据与最大基本表相邻的关联表对应的索引查找到下一个相邻的关联表中的数据,放入与下一个相邻的关联表对应的子临时表中,再将获得的子临时表又作为下一次查询的驱动表,对再下一个相邻的关联表进行关联查询,如此进行重复逐步关联查询,直到将所有的关联表均查询完毕,得到最后一个子临时表,再将临时表与所有的子临时表中的数据集合在一起得到最终的提取数据。
例如,假设将多表关联表按表的大小进行排序后,按顺序存在F、G、H、I、J五个表,F表为五个表中的最大基本表,根据关键字段对F表进行查询得到临时表Y,根据F表与G表之间的关联字段建立的索引,对临时表Y与G表进行关联查询,得到G表中符合要求的数据放入子临时表Y1;根据G表与H表之间的关联字段建立的索引,对临时表Y1与H表进行关联查询,得到H表中符合要求的数据放入子临时表Y2;根据H表与I表之间的关联字段建立的索引,对临时表Y2与I表进行关联查询,得到I表中符合要求的数据放入子临时表Y3;根据I表与J表之间的关联字段建立的索引,对临时表Y3与J表进行关联查询,得到J表中符合要求的数据放入子临时表Y4,该临时表Y、子临时表Y1、子临时表Y2、子临时表Y3以及子临时表Y4中的数据集合在一起就是用户所需要提取的最终提取数据。
本申请技术方案中,获取业务需求的关键字段;根据关键字段在预设的最大基本表中进行查询,获得临时数据,其中,最大基本表为多表关联表中的最大表;根据临时数据创建临时表;将临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表。本申请提出的技术方案基于数据报表对大量数据表中的数据进行提取,根据在多表关联表中的最大基本表中进行查询的结果创建临时表,再将临时表作为驱动表在多表关联表中的其他关联表中进行查询,获得最终的提取数据,由于创建的临时表中只包括了与关键字段相关的数据,因此,临时表的数据量小,使得通过临时表作为驱动表在其他关联表中联合查询,能够显著提高查询速度。
进一步地,请参照图6,图6为本申请实施例中根据所述关键字段在预设的最大基本表中进行查询,获得临时数据的步骤的流程细化示意图,基于上述实施例,步骤S200包括:
步骤S210,根据所述关键字段在预设的最大基本表中进行查询,得到最大基本表中的查询数据;
需要说明的是,一个关键字段可能对应一张表或者多个关键字段对应一张表,最大基本表中基本可以查询到所有的关键字段,但是在非常特殊的情况下,也可能存在在最大基本表中查询不到数据的关键字段,需要根据该查询不到数据的关键字段在其他基本表中进行查询,提取出相应的数据。例如,若a险种、b险种以及c险种均为基本险种,则其均存在于保单基本表中,但是,在一种极其特殊的情况下,当a险种、b险种以及c险种中存在非常罕见险种时,可以在其他的特殊基本表中查询该非常罕见险种的数据。因此,可以在获取到关键字段后,先在多表关联表的最大基本表中将能够查询出的数据提取出来,得到最大基本表中的查询数据。
步骤S220,判断关键字段中是否存在最大基本表中查询不到的字段;
可选地,在最大基本表中进行查询后,再判断关键字段是否存在最大基本表中查询不到的字段,可以通过查询出的数据判断关键字段是否存在最大基本表中查询不到的字段,例如,当a险种、b险种、c险种中存在非常见险种c险种时,就无法在保单基本表中查找到该非常见险种c险种,当在保单基本表中查询出来的数据就不包括c险种的数据,可以说明c险种对应的关键字段在最大基本表中查询不到。
步骤S230,若关键字段中存在最大基本表中查询不到的字段,则根据所述字段在其他基本表中进行查询,得到其他基本表中的查询数据,其中,其他基本表为其他关联表中的基本表;
当关键字段中存在在最大基本表中查询不到的字段时,那么需要在其他基本表中进行查询,需要说明的是,其他基本表为其他关联表中的基本表。例如,当c险种为非常见险种,需要在特殊保单表中进行查询,将与该字段对应的查询数据提取出来,得到查询数据。其中,当关键字段中在最大基本表中查询不到的字段有多个时,如果多个字段均能在其他的一张其他基本表中查询数来时,可以将查询出来的数据提取出来作为他基本表中的查询数据;如果多个字段需要对应在不同的几张其他基本表中才能查询出来,可以根据字段在对应的其他基本表中进行查询,得到与几张其他基本表对应的查询数据,将查询数据集合在一起作为其他基本表中的查询数据。
步骤S240,将最大基本表中的查询数据与其他基本表中的查询数据一起作为临时数据。
当根据关键字段查询结束后,将提取出来的最大基本表中的查询数据和其他基本表中的查询数据集合在一起,作为临时数据。
进一步地,请参照图7,图7为本申请数据的提取方法第四实施例的流程示意图,基于第一实施例,步骤S200还包括:
步骤S250,判断所述关键字段是否大于或等于两个;
步骤S260,若所述关键字段的数量大于或等于两个,则根据所述关键字段在预设的最大基本表中进行并行查询,获得临时数据。
为了进一步提高数据的提取速度,可以对查询获得临时数据的过程进行并行执行,即,在最大基本表中进行多线程查询。可选地,判断用户输入的关键字段是否大于或等于两个,若用户输入的关键字段大于或等于两个,则根据关键字段在预设的最大基本表中进行并行查询;若用户输入的关键字段不大于等于两个,则根据关键字段直接在最大基本表中进行查询。此外,在关键字段较多时,进行多线程处理的实际路数可以根据用户的实际需要进行调整,只要不超过服务器最大并发处理线程数即可。
进一步地,请参照图8,图8为本申请数据的提取方法第五实施例的流程示意图,基于第一实施例,步骤S400之后,还包括:
步骤S500,对所述临时表进行删除。
可选地,为了减少占用的内存,在获取到用户需要的数据后,可以对创建的临时表进行删除。此外,在用户得到最终提取数据后,还可以将终端内存在的所有子临时表等临时数据全部进行删除。
此外,请参照图9,本申请还提供一种数据的提取装置10,所述数据的提取装置10包括:
获取模块20,所述获取模块用于获取业务需求的关键字段;
第一查询模块30,所述第一查询模块用于根据所述关键字段在预设的最大基本表中进行查询,获得临时数据,其中,最大基本表为多表关联表中的最大表;
创建模块40,所述创建模块用于根据所述临时数据创建临时表;
第二查询模块50,所述第二查询模块用于将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表。
进一步地,所述第二查询模块50还用于:
获取多表关联表中的关联表之间的关联字段;
根据所述关联字段设置索引;
将所述临时表作为驱动表,根据所述索引在其他关联表中进行联合查询,获得最终提取数据。
进一步地,所述第二查询模块50还用于:
根据最大基本表与其他关联表的关联字段建立临时表的索引;
对所述临时表中的数据进行遍历查询得到索引中的地址;
根据所述地址在对应的其他关联表中进行查询,得到对应的子临时表;
将临时表和所有的子临时表中的数据集合在一起作为最终提取数据。
进一步地,所述第二查询模块50还用于:
按照表的大小顺序对多表关联表中的关联表进行排序;
根据相邻的两个关联表之间的关联字段设置两个表中的较大的表对应的索引;
对所述临时表中的数据进行遍历查询得到对应的索引中的地址;
根据所述地址在与最大基本表相邻的关联表中进行查询,得到对应的子临时表;
将所述子临时表作为驱动表,根据对应的索引在其他关联表中进行重复的逐步关联查询,直到将所有的关联表查询完毕,得到最终提取数据。
进一步地,所述第一查询模块30还用于:
根据所述关键字段在预设的最大基本表中进行查询,得到最大基本表中的查询数据;
判断关键字段中是否存在最大基本表中查询不到的字段;
若关键字段中存在最大基本表中查询不到的字段,则根据所述字段在其他基本表中进行查询,得到其他基本表中的查询数据,其中,其他基本表为其他关联表中的基本表;
将最大基本表中的查询数据与其他基本表中的查询数据一起作为临时数据。
进一步地,所述第一查询模块30还用于:
判断所述关键字段是否大于或等于两个;
若所述关键字段的数量大于或等于两个,则根据所述关键字段在预设的最大基本表中进行并行查询,获得临时数据。
进一步地,所述数据的提取装置10还包括:
删除模块,所述删除模块用于对所述临时表进行删除。
其中,上述数据的提取装置10中各个模块与上述数据的提取方法实施例中各步骤相对应,其功能和实现过程在此处不再一一赘述。
此外,本申请还提供一种计算机可读存储介质。
本申请计算机可读存储介质上存储有计算机可读指令,其中,计算机可读指令被处理器执行时,实现如上述的数据的提取方法的步骤。
其中,计算机可读指令被执行时所实现的方法可参照本申请数据的提取方法的各个实施例,此处不再赘述。
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机可读指令产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机可读指令的流程图和/或方框图来描述的。应理解可由计算机可读指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机可读指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机可读指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机可读指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
应当注意的是,在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的部件或步骤。位于部件之前的单词“一”或“一个”不排除存在多个这样的部件。本申请可以借助于包括有若干不同部件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
尽管已描述了本申请的可选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括可选实施例以及落入本申请范围的所有变更和修改。
以上所述仅为本申请的可选实施例,并非因此限制本申请的专利范围,凡是在本申请的发明构思下,利用本申请说明书及附图内容所作的等效结构变换,或直接/间接运用在其他相关的技术领域均包括在本申请的专利保护范围内。
Claims (20)
- 一种数据的提取方法,其中,所述数据的提取方法包括:获取业务需求的关键字段;根据所述关键字段在预设的最大基本表中进行查询,得到最大基本表中的查询数据,其中,最大基本表为多表关联表中的最大表;判断关键字段中是否存在最大基本表中查询不到的字段;若关键字段中存在最大基本表中查询不到的字段,则根据所述字段在其他基本表中进行查询,得到其他基本表中的查询数据,其中,其他基本表为其他关联表中的基本表;将最大基本表中的查询数据与其他基本表中的查询数据一起作为临时数据;根据所述临时数据创建临时表;将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表。
- 如权利要求1所述的数据的提取方法,其中,所述将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据的步骤包括:获取多表关联表中的关联表之间的关联字段;根据所述关联字段设置索引;将所述临时表作为驱动表,根据所述索引在其他关联表中进行联合查询,获得最终提取数据。
- 如权利要求2所述的数据的提取方法,其中,所述根据所述关联字段设置索引的步骤包括:根据最大基本表与其他关联表的关联字段建立临时表的索引;所述将所述临时表作为驱动表,根据所述索引在其他关联表中进行联合查询,获得最终提取数据的步骤包括:对所述临时表中的数据进行遍历查询得到索引中的地址;根据所述地址在对应的其他关联表中进行查询,得到对应的子临时表;将临时表和所有的子临时表中的数据集合在一起作为最终提取数据。
- 如权利要求2所述的数据的提取方法,其中,所述根据所述关联字段设置索引的步骤还包括:按照表的大小顺序对多表关联表中的关联表进行排序;根据相邻的两个关联表之间的关联字段设置两个表中的较大的表对应的索引;所述将所述临时表作为驱动表,根据所述索引在其他关联表中进行联合查询,获得最终提取数据的步骤还包括:对所述临时表中的数据进行遍历查询得到对应的索引中的地址;根据所述地址在与最大基本表相邻的关联表中进行查询,得到对应的子临时表;将所述子临时表作为驱动表,根据对应的索引在其他关联表中进行重复的逐步关联查询,直到将所有的关联表查询完毕,得到最终提取数据。
- 如权利要求1所述的数据的提取方法,其中,所述根据所述关键字段在预设的最大基本表中进行查询,获得临时数据的步骤还包括:判断所述关键字段是否大于或等于两个;若所述关键字段的数量大于或等于两个,则根据所述关键字段在预设的最大基本表中进行并行查询,获得临时数据。
- 如权利要求1所述的数据的提取方法,其中,所述判断所述关键字段是否大于或等于两个的步骤之后,还包括:若所述关键字段的数量不大于或等于两个,则根据关键字段直接在最大基本表中进行查询。
- 如权利要求1所述的数据的提取方法,其中,所述将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据的步骤之后,还包括:对所述临时表进行删除。
- 一种数据的提取装置,其中,所述数据的提取装置包括:获取模块,所述获取模块用于获取业务需求的关键字段;第一查询模块,所述第一查询模块用于根据所述关键字段在预设的最大基本表中进行查询,得到最大基本表中的查询数据,其中,最大基本表为多表关联表中的最大表;判断关键字段中是否存在最大基本表中查询不到的字段;若关键字段中存在最大基本表中查询不到的字段,则根据所述字段在其他基本表中进行查询,得到其他基本表中的查询数据,其中,其他基本表为其他关联表中的基本表;将最大基本表中的查询数据与其他基本表中的查询数据一起作为临时数据;创建模块,所述创建模块用于根据所述临时数据创建临时表;第二查询模块,所述第二查询模块用于将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表。
- 一种终端,其中,包括处理器、存储器、以及存储在所述存储器上的可被所述处理器执行的计算机可读指令,其中,所述计算机可读指令被所述处理器执行时,执行如下步骤:获取业务需求的关键字段;根据所述关键字段在预设的最大基本表中进行查询,得到最大基本表中的查询数据,其中,最大基本表为多表关联表中的最大表;判断关键字段中是否存在最大基本表中查询不到的字段;若关键字段中存在最大基本表中查询不到的字段,则根据所述字段在其他基本表中进行查询,得到其他基本表中的查询数据,其中,其他基本表为其他关联表中的基本表;将最大基本表中的查询数据与其他基本表中的查询数据一起作为临时数据;根据所述临时数据创建临时表;将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表。
- 如权利要求9所述的终端,所述计算机可读指令被所述处理器执行时,还执行如下步骤:获取多表关联表中的关联表之间的关联字段;根据所述关联字段设置索引;将所述临时表作为驱动表,根据所述索引在其他关联表中进行联合查询,获得最终提取数据。
- 如权利要求10所述的终端,所述计算机可读指令被所述处理器执行时,还执行如下步骤:根据最大基本表与其他关联表的关联字段建立临时表的索引;对所述临时表中的数据进行遍历查询得到索引中的地址;根据所述地址在对应的其他关联表中进行查询,得到对应的子临时表;将临时表和所有的子临时表中的数据集合在一起作为最终提取数据。
- 如权利要求10所述的终端,所述计算机可读指令被所述处理器执行时,还执行如下步骤:按照表的大小顺序对多表关联表中的关联表进行排序;根据相邻的两个关联表之间的关联字段设置两个表中的较大的表对应的索引;对所述临时表中的数据进行遍历查询得到对应的索引中的地址;根据所述地址在与最大基本表相邻的关联表中进行查询,得到对应的子临时表;将所述子临时表作为驱动表,根据对应的索引在其他关联表中进行重复的逐步关联查询,直到将所有的关联表查询完毕,得到最终提取数据。
- 如权利要求9所述的终端,所述计算机可读指令被所述处理器执行时,还执行如下步骤:判断所述关键字段是否大于或等于两个;若所述关键字段的数量大于或等于两个,则根据所述关键字段在预设的最大基本表中进行并行查询,获得临时数据。
- 如权利要求9所述的终端,所述计算机可读指令被所述处理器执行时,还执行如下步骤:若所述关键字段的数量不大于或等于两个,则根据关键字段直接在最大基本表中进行查询。
- 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机可读指令,其中,所述计算机可读指令被处理器执行时,执行如下步骤:获取业务需求的关键字段;根据所述关键字段在预设的最大基本表中进行查询,得到最大基本表中的查询数据,其中,最大基本表为多表关联表中的最大表;判断关键字段中是否存在最大基本表中查询不到的字段;若关键字段中存在最大基本表中查询不到的字段,则根据所述字段在其他基本表中进行查询,得到其他基本表中的查询数据,其中,其他基本表为其他关联表中的基本表;将最大基本表中的查询数据与其他基本表中的查询数据一起作为临时数据;根据所述临时数据创建临时表;将所述临时表作为驱动表在其他关联表中进行联合查询,获得最终提取数据,其中,其他关联表为多表关联表中除最大基本表外的关联表。
- 如权利要求15所述的计算机可读存储介质,所述计算机可读指令被处理器执行时,还执行如下步骤:获取多表关联表中的关联表之间的关联字段;根据所述关联字段设置索引;将所述临时表作为驱动表,根据所述索引在其他关联表中进行联合查询,获得最终提取数据。
- 如权利要求16所述的计算机可读存储介质,所述计算机可读指令被处理器执行时,还执行如下步骤:根据最大基本表与其他关联表的关联字段建立临时表的索引;对所述临时表中的数据进行遍历查询得到索引中的地址;根据所述地址在对应的其他关联表中进行查询,得到对应的子临时表;将临时表和所有的子临时表中的数据集合在一起作为最终提取数据。
- 如权利要求16所述的计算机可读存储介质,所述计算机可读指令被处理器执行时,还执行如下步骤:按照表的大小顺序对多表关联表中的关联表进行排序;根据相邻的两个关联表之间的关联字段设置两个表中的较大的表对应的索引;对所述临时表中的数据进行遍历查询得到对应的索引中的地址;根据所述地址在与最大基本表相邻的关联表中进行查询,得到对应的子临时表;将所述子临时表作为驱动表,根据对应的索引在其他关联表中进行重复的逐步关联查询,直到将所有的关联表查询完毕,得到最终提取数据。
- 如权利要求15所述的计算机可读存储介质,所述计算机可读指令被处理器执行时,还执行如下步骤:判断所述关键字段是否大于或等于两个;若所述关键字段的数量大于或等于两个,则根据所述关键字段在预设的最大基本表中进行并行查询,获得临时数据。
- 如权利要求15所述的计算机可读存储介质,所述计算机可读指令被处理器执行时,还执行如下步骤:若所述关键字段的数量不大于或等于两个,则根据关键字段直接在最大基本表中进行查询。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910173127.6A CN110009514B (zh) | 2019-03-07 | 2019-03-07 | 数据的提取方法、装置、终端及计算机可读存储介质 |
CN201910173127.6 | 2019-03-07 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020177376A1 true WO2020177376A1 (zh) | 2020-09-10 |
Family
ID=67166557
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/117214 WO2020177376A1 (zh) | 2019-03-07 | 2019-11-11 | 数据的提取方法、装置、终端及计算机可读存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN110009514B (zh) |
WO (1) | WO2020177376A1 (zh) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110009514B (zh) * | 2019-03-07 | 2024-03-08 | 平安科技(深圳)有限公司 | 数据的提取方法、装置、终端及计算机可读存储介质 |
CN111078734B (zh) * | 2019-12-25 | 2023-08-08 | 天津南大通用数据技术股份有限公司 | 一种通过创建内部临时表索引提高start with查询性能的方法 |
CN112685444A (zh) * | 2020-12-24 | 2021-04-20 | 江苏苏宁云计算有限公司 | 数据查询方法、装置、计算机设备和存储介质 |
CN113448969B (zh) * | 2021-08-30 | 2022-02-18 | 阿里云计算有限公司 | 数据处理方法、设备及存储介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150169697A1 (en) * | 2013-12-13 | 2015-06-18 | Martin Kaufmann | Bitemporal Timeline Index |
CN107016001A (zh) * | 2016-01-28 | 2017-08-04 | 阿里巴巴集团控股有限公司 | 一种数据查询方法及装置 |
CN107368493A (zh) * | 2016-05-12 | 2017-11-21 | 百度在线网络技术(北京)有限公司 | 数据库查询方法和装置 |
US20170337232A1 (en) * | 2016-05-19 | 2017-11-23 | Fifth Dimension Holdings Ltd. | Methods of storing and querying data, and systems thereof |
CN109408535A (zh) * | 2018-09-28 | 2019-03-01 | 中国平安财产保险股份有限公司 | 大数据量匹配方法、装置、计算机设备及存储介质 |
CN110009514A (zh) * | 2019-03-07 | 2019-07-12 | 平安科技(深圳)有限公司 | 数据的提取方法、装置、终端及计算机可读存储介质 |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8650179B2 (en) * | 2005-08-18 | 2014-02-11 | International Business Machines Corporation | Generating statistics for temporary tables during query optimization |
US20080016047A1 (en) * | 2006-07-12 | 2008-01-17 | Dettinger Richard D | System and method for creating and populating dynamic, just in time, database tables |
CN106202573A (zh) * | 2016-08-19 | 2016-12-07 | 中国科学院信息工程研究所 | 一种通用的两个数据库联合查询方法 |
CN108021618B (zh) * | 2017-11-13 | 2020-10-16 | 北京天元创新科技有限公司 | 一种数据查询方法及系统 |
CN108648092B (zh) * | 2018-05-16 | 2023-07-21 | 中国平安人寿保险股份有限公司 | 保险赔付率计算方法、装置、设备及计算机可读存储介质 |
-
2019
- 2019-03-07 CN CN201910173127.6A patent/CN110009514B/zh active Active
- 2019-11-11 WO PCT/CN2019/117214 patent/WO2020177376A1/zh active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20150169697A1 (en) * | 2013-12-13 | 2015-06-18 | Martin Kaufmann | Bitemporal Timeline Index |
CN107016001A (zh) * | 2016-01-28 | 2017-08-04 | 阿里巴巴集团控股有限公司 | 一种数据查询方法及装置 |
CN107368493A (zh) * | 2016-05-12 | 2017-11-21 | 百度在线网络技术(北京)有限公司 | 数据库查询方法和装置 |
US20170337232A1 (en) * | 2016-05-19 | 2017-11-23 | Fifth Dimension Holdings Ltd. | Methods of storing and querying data, and systems thereof |
CN109408535A (zh) * | 2018-09-28 | 2019-03-01 | 中国平安财产保险股份有限公司 | 大数据量匹配方法、装置、计算机设备及存储介质 |
CN110009514A (zh) * | 2019-03-07 | 2019-07-12 | 平安科技(深圳)有限公司 | 数据的提取方法、装置、终端及计算机可读存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN110009514A (zh) | 2019-07-12 |
CN110009514B (zh) | 2024-03-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2020177376A1 (zh) | 数据的提取方法、装置、终端及计算机可读存储介质 | |
WO2020147385A1 (zh) | 数据录入方法、装置、终端及计算机可读存储介质 | |
WO2021008017A1 (zh) | 联邦学习方法、系统、终端设备及存储介质 | |
WO2020125251A1 (zh) | 基于联邦学习的模型参数训练方法、装置、设备及介质 | |
WO2020073495A1 (zh) | 基于人工智能的复审方法、装置、设备及存储介质 | |
WO2018004236A1 (ko) | 개인정보의 비식별화 방법 및 장치 | |
WO2018082484A1 (zh) | 一种电子设备的截屏方法、系统及电子设备 | |
WO2021003930A1 (zh) | 客服录音的质检方法、装置、设备及计算机可读存储介质 | |
WO2018076865A1 (zh) | 数据分享方法、装置、存储介质及电子设备 | |
WO2014044136A1 (zh) | 基于分布式数据的并发处理方法、系统和计算机存储介质 | |
WO2020082766A1 (zh) | 输入法的联想方法、装置、设备及可读存储介质 | |
WO2012155709A1 (zh) | 一种动态推送用户个人标签的方法和系统、存储介质 | |
WO2019019350A1 (zh) | 开户页面的生成方法、装置、设备及计算机可读存储介质 | |
WO2018120681A1 (zh) | 数据同步方法、装置、系统、数据处理服务器和存储介质 | |
WO2020087981A1 (zh) | 风控审核模型生成方法、装置、设备及可读存储介质 | |
WO2020253135A1 (zh) | 自动化分析方法、用户设备、存储介质及装置 | |
WO2020199599A1 (zh) | 工作队列的信息展示方法、装置、计算机设备和存储介质 | |
WO2021012481A1 (zh) | 系统性能监控方法、装置、设备及存储介质 | |
WO2020155359A1 (zh) | 家电设备的控制方法、服务器、家电设备及存储介质 | |
WO2020119115A1 (zh) | 数据审核方法、装置、设备及存储介质 | |
WO2018201774A1 (zh) | 数据审批方法、装置、设备和计算机可读存储介质 | |
WO2020062640A1 (zh) | 终端应用动态文案的语言切换方法、服务器及存储介质 | |
WO2020087704A1 (zh) | 信贷信息管理方法、装置、设备和存储介质 | |
WO2017111197A1 (ko) | 학습 분석에서 빅데이터 시각화 시스템 및 방법 | |
WO2014044130A1 (zh) | 业务巡检方法和系统、计算机存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19917923 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19917923 Country of ref document: EP Kind code of ref document: A1 |