Customer data query method and device, electronic device, and storage medium
By generating a general column feature configuration table, a customer feature tag summary table and a duplicate data list, users are self-service query, solving the problem of cumbersome implementation process of the big data platform, improving query efficiency and convenience, and being suitable for relationship databases Concurrency characteristics.
Patent Information
- Application Number
- CN202110919429.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-11
- Publication Date
- 2024-12-10
- Estimated Expiration
- 2041-08-11
AI Technical Summary
The existing technology implements customer data query based on a big data platform. The development process is cumbersome and slow, so it cannot be put into use quickly.
By reading the feature tags in the pre-generated general column feature configuration table, generating the feature tags of the foreground page, generating background query statements in response to user selection operations, and judging the query partition. If it is determined, query in the customer feature tag summary table. If you confirm, query each partition table, and remove duplicate data summary based on the duplicate data detail table, and finally feedback the result to the user.
It realizes user-service and fast dynamic query, avoids relying on big data platforms, improves query efficiency and convenience, and is suitable for the high concurrency characteristics of relational databases.
Smart Images

Figure CN113641703B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of data query, and in particular to a method and device for querying customer data, an electronic device, and a storage medium. Background Art
[0002] Users from different business departments usually search for customer data based on different business purposes, so the query conditions are often uncertain. Users may sometimes not know how to query the data they need. Therefore, it is very important to enable users to query the required data quickly and independently.
[0003] A major existing method is to import customer feature tags and detailed lists into the big data platform, then manually collect and configure the customer feature tags, and connect to the big data platform database to provide dynamic queries that combine different conditions.
[0004] However, since the existing query method needs to rely on a big data platform, the cost of the big data platform is relatively high, and as a newer technology platform, it has high requirements for technical personnel, the entire development process is relatively cumbersome and the efficiency is relatively slow, and it cannot be put into use quickly. Summary of the invention
[0005] Based on the above-mentioned deficiencies of the prior art, the present application provides a customer data query method and device, electronic device, and storage medium to solve the problem that the prior art is based on a big data platform, the development process is relatively cumbersome and the efficiency is relatively low.
[0006] In order to achieve the above objectives, this application provides the following technical solutions:
[0007] The first aspect of the present application provides a method for querying customer data, comprising:
[0008] Read the feature tags in the pre-generated general column feature configuration table to generate feature tags for the front-end page;
[0009] In response to the user's selection operation, a backend query statement is generated using each target feature tag selected by the user in the feature tag of the frontend page;
[0010] Determine whether the query partition has been determined for this query;
[0011] If it is determined that the query has determined the partition to be queried, the background query statement is executed for the pre-generated customer feature tag summary table, so as to perform data query and summary according to the target feature tag from the partition table corresponding to the partition to be queried in the customer feature tag summary table, and obtain the final query result;
[0012] If it is determined that the query partition is not determined in this query, the background query statement is executed on each partition table in the customer feature tag summary table to obtain a first query result queried according to the target feature tag;
[0013] Based on a pre-generated duplicate data detail table, duplicate data in the first query result is removed and summarized to obtain a final query result; wherein the duplicate data detail table stores data with the same customer ID but belonging to different partitions;
[0014] The final query result is fed back to the user.
[0015] Optionally, in the above method, the method for generating the customer feature label summary table includes:
[0016] An initial customer feature label summary table is established on an Oracle database; wherein the customer feature label summary table at least includes a partition column, a summary value column, and a plurality of common columns; the customer feature label summary table is composed of a plurality of partition tables divided according to the data stored in the partition column;
[0017] Importing the pre-calculated summary data into the initial user feature tag summary table to obtain the final customer feature tag summary table; wherein the summary data is pre-calculated according to the dimension of the specified feature tag combination.
[0018] Optionally, in the above method, the method for generating the duplicate data list includes:
[0019] Creating an initial customer feature label detail table and the duplicate data detail table; wherein the customer feature label detail table is provided with the same plurality of common columns as the customer feature label summary table, and contains the original data ID and the customer ID; the duplicate data detail table has the same format as the customer feature label detail table;
[0020] Importing the original customer feature label details and customer detail data into the customer feature label detail table;
[0021] The data with the same customer ID but belonging to different partitions in the customer feature label detail table are imported into the duplicate data detail table.
[0022] Optionally, in the above method, the method for generating the general column feature configuration table includes:
[0023] By executing the database script, the feature tag sequence and name in the original detail list recorded in the original library and the imported detail list recorded in the imported library are collected, the configuration content is generated and stored in the created general column feature configuration table, and the final general column feature configuration table is obtained.
[0024] Optionally, in the above method, based on the pre-generated duplicate data list, removing duplicate data from the first query result and aggregating the data to obtain a final query result includes:
[0025] According to the same query condition as the background query statement, the second query result is searched from the duplicate data detail table;
[0026] After the first query result is positive and the second query result is negative, they are summed up in the asynchronously returned results to obtain a final query result.
[0027] A second aspect of the present application provides a device for querying customer data, comprising:
[0028] A reading unit, used to read the feature tags in the pre-generated general column feature configuration table and generate feature tags for the front-end page;
[0029] A first generating unit, configured to generate a backend query statement in response to a user's selection operation by using each target feature tag selected by the user in the feature tags of the frontend page;
[0030] A judgment unit, used to judge whether the query partition has been determined for this query;
[0031] The first query unit is used for executing the background query statement for the pre-generated customer feature tag summary table if it is determined that the query has determined the partition to be queried, so as to perform data query and summary according to the target feature tag from the partition table corresponding to the partition to be queried in the customer feature tag summary table, and obtain the final query result;
[0032] The second query unit is used to execute the background query statement on each partition table in the customer feature tag summary table to obtain a first query result queried according to the target feature tag if it is determined that the query has not determined the queried partition;
[0033] A removal unit, configured to remove duplicate data from the first query result based on a pre-generated duplicate data detail table and summarize the data to obtain a final query result; wherein the duplicate data detail table stores data with the same customer ID but belonging to different partitions;
[0034] A feedback unit is used to feed back the final query result to the user.
[0035] Optionally, in the above device, it also includes:
[0036] The first creation unit is used to establish an initial customer feature label summary table on an Oracle database; wherein the customer feature label summary table at least includes a partition column, a summary value column and a plurality of common columns; the customer feature label summary table is composed of a plurality of partition tables divided according to the data stored in the partition column;
[0037] The first importing unit is used to import the pre-calculated summary data into the initial user feature label summary table to obtain the final customer feature label summary table; wherein the summary data is pre-calculated according to the dimension of the specified feature label combination.
[0038] Optionally, in the above device, it also includes:
[0039] A first creation unit, used to create an initial customer feature label detail table and the duplicate data detail table; wherein the customer feature label detail table is provided with the same plurality of common columns as the customer feature label summary table, and contains the original data ID and the customer ID; the duplicate data detail table has the same format as the customer feature label detail table;
[0040] A second importing unit, used for importing the original customer feature label details and customer detail data into the customer feature label detail table;
[0041] The third importing unit is used to import the data with the same customer ID but belonging to different partitions in the customer feature label detailed table into the repeated data detailed table.
[0042] Optionally, in the above device, it also includes:
[0043] The fourth generation unit is used to collect the feature tag sequence and name in the original detail list recorded in the original library and the imported detail list recorded in the imported library by executing the database script, generate the configuration content and store it in the created general column feature configuration table to obtain the final general column feature configuration table.
[0044] Optionally, in the above device, the rejection unit includes:
[0045] A third query unit, used for querying the second query result from the duplicate data detail table according to the same query condition as the background query statement;
[0046] The summarizing unit is used to positively calculate the first query result and negatively calculate the second query result, and then summarize and sum them in the asynchronously returned results to obtain a final query result.
[0047] A third aspect of the present application provides an electronic device, including:
[0048] Memory and processor;
[0049] Wherein, the memory is used to store programs;
[0050] The processor is used to execute the program. When the program is executed, it is specifically used to implement the customer data query method as described in any one of the above.
[0051] A fourth aspect of the present application provides a computer storage medium for storing a computer program, wherein when the computer program is executed, it is used to implement a method for querying customer data as described in any one of the above.
[0052] The embodiment of the present application provides a method for querying customer data, which reads the feature tags in a pre-generated general column feature configuration table, generates feature tags on a front-end page, and provides them to users for selection, so that users can select feature tags to query data according to their needs. By responding to the user's selection operation, a background query statement is generated using each target feature tag selected by the user in the feature tag of the front-end page. It is determined whether the query has determined the partition for the query. If it is determined that the query has determined the partition for the query, the background query statement is executed for the pre-generated customer feature tag summary table to query and summarize data according to the target feature tag from the partition table corresponding to the partition determined to be queried in the customer feature tag summary table, and obtain the final query result. If it is determined that the query partition has not been determined in this query, the background query statement is executed on each partition table in the customer feature label summary table to obtain the first query result queried according to the target feature label, and based on the pre-generated duplicate data detail table, the duplicate data in the first query result is eliminated and summarized to obtain the final query result, thereby splitting a large amount of data query into multiple small query transactions to meet the characteristics of relational databases that can be highly concurrent but not suitable for large amount of data queries, and then realizing large amount of data queries on relational databases, and finally feeding back the final query results to the user, so that through the three created tables, user dynamic queries can be conveniently and quickly realized without relying on the big data platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0054] Figure 1A flowchart of a method for generating a customer feature label summary table provided in an embodiment of the present application;
[0055] Figure 2 A flowchart of a method for generating a duplicate data list provided in another embodiment of the present application;
[0056] Figure 3 A flowchart of a method for querying customer data provided by another embodiment of the present application;
[0057] Figure 4 A flowchart of a method for removing duplicate data provided in an embodiment of the present application;
[0058] Figure 5 A schematic diagram of the structure of a device for querying customer data provided in an embodiment of the present application;
[0059] Figure 6 A schematic diagram of the structure of a rejection unit provided in another embodiment of the present application;
[0060] Figure 7 A schematic diagram of the structure of an electronic device provided in another embodiment of the present application. DETAILED DESCRIPTION
[0061] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0062] In this application, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0063] The present application provides a method for querying customer data to solve the problem that the existing technology is based on a big data platform and the development process is relatively cumbersome and the efficiency is relatively low.
[0064] First of all, it should be explained that the customer data processing method provided by this application is based on the commonly used JAVA and Oracle database technologies, as well as the created general column feature configuration table, customer feature label summary table and duplicate data detail table, which can realize user self-service and fast dynamic query.
[0065] Therefore, for the customer data query method provided in the embodiment of the present application, it is first necessary to generate a general column feature configuration table, a customer feature label summary table, and a duplicate data detail table.
[0066] Optionally, the present application embodiment provides a method for generating a customer feature label summary table, such as Figure 1 As shown, the following steps are included:
[0067] S101. Create an initial customer feature label summary table on the Oracle database.
[0068] The customer feature label summary table includes at least a partition column, a summary value column and a plurality of common columns.
[0069] The customer feature label summary table is composed of multiple partition tables divided based on the data stored in the partition column. For example, the partition can be performed based on the branch, that is, the customer feature label summary table is partitioned based on the branch, and the branch ID can be used as the partition table name to distinguish different partition tables. Then, the partition column can be the organization column, which is used to store the name of each branch organization or the name of the organization under the branch.
[0070] It should be noted that partitioning is different from table partitioning. A partition table is a table in the concept of data partitioning, that is, data is stored in partitions, rather than actually dividing a table into multiple tables.
[0071] General columns can be represented by general fields with numerical sequences added, such as index1, index2, index3, etc., and are mainly used to store customer feature data.
[0072] S102: Import the pre-calculated summary data into the initial user feature label summary table to obtain a final customer feature label summary table.
[0073] The summary data is calculated in advance according to the dimension of the specified feature label combination. Specifically, the summary data is calculated using the data in the original library according to the dimension of the specified feature label combination.
[0074] For example, gender feature labels include: male, female, VIP type feature labels include: platinum card customers, diamond card customers, gold card customers, silver card customers, ordinary customers, so there can be 10 feature label combinations: male platinum card customers, male gold card customers, etc. Then, statistical calculations are performed on multiple of these 10 feature labels. Usually, different institutions will pre-calculate the summary data according to the dimensions of the specified feature label combination.
[0075] Optionally, an embodiment of the present application provides a method for generating a duplicate data list, such as Figure 2 As shown, the following steps are included:
[0076] S201. Create an initial customer feature label list and a duplicate data list.
[0077] The customer feature label detail table is provided with the same multiple common columns as the customer feature label summary table, and includes the ID of the original record and the customer ID, that is, includes the ID of each record in the original library and each customer ID.
[0078] It should also be noted that the format of the duplicate data detail table is the same as that of the customer feature label detail table, so after creating the customer feature label detail table, you can create a duplicate data detail table in the same format.
[0079] S202, importing the original customer feature label details and customer detail data into the customer feature label detail table.
[0080] The original customer feature label details refer to the details of each customer label in the original database, such as gender, age groups, etc. The customer detail data refers to the details of the data feature data of each customer stored in the original database.
[0081] S203. Import the data with the same customer ID but belonging to different partitions in the customer feature label detail table into the duplicate data detail table.
[0082] It should be noted that indexes are established for each common column in the customer feature label summary table, the duplicate data detail table, and the customer feature label detail table to facilitate data query.
[0083] Optionally, another embodiment of the present application provides a method for generating a general column feature configuration table, comprising:
[0084] By executing the database script, the feature tag sequence and name in the original detail list recorded in the original library and the imported detail list recorded in the imported library are collected, the configuration content is generated and stored in the created general column feature configuration table, and the final general column feature configuration table is obtained.
[0085] Specifically, the method of generating configuration content can be expressed as:
[0086] "selectt1.column_name,t3.comments column_desc
[0087] from import library.user_tab_cols t1
[0088] inner join original library.user_tab_cols t2
[0089] on t1.table_name = Import library detail table name
[0090] and t2.table_name = original table name in the original database
[0091] and t1.column_id=t2.column_id
[0092] inner join user_col_comments t3
[0093] on t2.table_name=t3.table_name”
[0094] Optionally, after generating the general column feature configuration table, the following steps may be further included:
[0095] A feature tag configuration table is established, and then a pre-configured script is executed to collect data in the general column feature configuration table and stored values in the import detail table, generate corresponding configuration content, and store it in the feature tag configuration table.
[0096] By establishing a feature tag configuration table, the values under each feature tag can be fed back to the user when querying data. For example, for the feature tags: male and female, the number of males and the number of females stored in the import detail table are combined with these two tags to obtain a feature tag configuration table, so that the number of males and the number of females can be fed back to the user when querying data.
[0097] Based on the above-generated common column feature configuration table, customer feature label summary table, and duplicate data detail table, another embodiment of the present application provides a method for querying customer data, such as Figure 3 As shown, the following steps are included:
[0098] S301, reading feature tags in a pre-generated general column feature configuration table to generate feature tags for the front-end page.
[0099] S302: In response to the user's selection operation, a backend query statement is generated using each target feature tag selected by the user in the feature tag of the frontend page.
[0100] Specifically, the target feature tags freely selected by the user are generated into a background query statement according to certain rules, so that the customer summary data can be queried according to the target feature tag as the query condition. Specifically, the query condition can be converted into a where statement, and the query item can be converted into a select statement. The summary value of each feature tag detail combination in the summary column is summed up to obtain the query result.
[0101] S303: Determine whether the query partition has been determined for this query.
[0102] It should be noted that before selecting a feature tag, the user can select the data range to be queried, and the query partition will be determined accordingly. For example, before selecting a tag, the user selects a branch or an organization under a branch, and then jumps to the corresponding page of the organization to select a special tag. At this time, the partition that the user is querying will be determined to be the partition table corresponding to the branch, or the partition table corresponding to the branch corresponding to the organization, and the corresponding background query statement generated is a statement for querying the partition table.
[0103] If it is determined that the query partition has been determined for this query, step S304 is executed. If it is determined that the query partition has not been determined for this query, that is, a global query is required, step S305 is executed.
[0104] S304: Execute a background query statement for the pre-generated customer feature tag summary table.
[0105] Step S304 is executed to perform data query and summary according to the target feature tag in the partition table corresponding to the partition to be queried in the customer feature tag summary table to obtain a final query result.
[0106] That is, when it is determined that the query has determined the partition for this query, the query is applied to the customer feature label summary table. Since the customer feature label summary table has been partitioned, the Oracle database's own logic will query and summarize data according to the target feature label from the partition table corresponding to the partition for the determined query in the customer feature label summary table to obtain the final query result.
[0107] S305: Execute a background query statement on each partition table in the customer feature tag summary table to obtain a first query result queried according to the target feature tag.
[0108] Specifically, since the query scope is not limited, the corresponding first query results are queried from each partition table in the customer feature tag summary table, that is, the query is applied to each partition table.
[0109] Optionally, CompletableFuture can be used to start multiple threads for asynchronous concurrent queries, thereby improving query efficiency.
[0110] It should be noted that, since data in different partitions may be repeated, in order to avoid repeated calculation of repeated data during aggregation, resulting in inaccurate query results, step S306 is executed after executing step S305.
[0111] S306: Based on the pre-generated duplicate data list, remove duplicate data in the first query result and summarize them to obtain a final query result.
[0112] Among them, the duplicate data detail table stores data with the same customer ID but belonging to different partitions, that is, the duplicate data detail table stores duplicate data in each partition table. Therefore, the data in the duplicate data detail table can be used to eliminate the duplicate data in the first query result and summarize it to obtain the final query result.
[0113] Optionally, in another embodiment of the present application, an implementation of step S306 is as follows: Figure 4 As shown, the following steps are included:
[0114] S401. Query the second query result from the duplicate data detail table according to the same query condition as the background query statement.
[0115] That is, data query is performed on the duplicate data detail table according to the same query conditions and query items as step S305. Optionally, step S401 can also be performed concurrently with the query transaction from each partition table in step S305.
[0116] Therefore, in the embodiment of the present application, queries involving a large amount of data are broken down into queries of multiple partition tables and a query of duplicate data with a smaller amount of data, thereby reducing the computational pressure of database queries and making full use of the characteristics of the database that is highly concurrency-resistant and not suitable for large-scale data queries, thereby simulating the map-reduce operation of the big data platform at the JAVA application level.
[0117] S402: After positively selecting the first query result and negatively selecting the second query result, the results are summed up in the asynchronously returned results to obtain a final query result.
[0118] Since the first query result is positive, which is equivalent to taking a plus sign, and the second query result is negative, which is equivalent to taking a minus sign, when the two are summed, duplicate data in the first query result will be eliminated.
[0119] S307: Feedback the final query result to the user.
[0120] Optionally, the query result may also include the numerical values corresponding to the various target feature indicators obtained from the feature tag configuration table.
[0121] The embodiment of the present application provides a method for querying customer data, which reads the feature tags in a pre-generated general column feature configuration table, generates feature tags on a front-end page, and provides them to users for selection, so that users can select feature tags to query data according to their needs. By responding to the user's selection operation, a background query statement is generated using each target feature tag selected by the user in the feature tag of the front-end page. It is determined whether the query has determined the partition for the query. If it is determined that the query has determined the partition for the query, the background query statement is executed for the pre-generated customer feature tag summary table to query and summarize data according to the target feature tag from the partition table corresponding to the partition determined to be queried in the customer feature tag summary table, and obtain the final query result. If it is determined that the query partition has not been determined in this query, the background query statement is executed on each partition table in the customer feature tag summary table to obtain the first query result queried according to the target feature tag, and based on the pre-generated duplicate data detail table, the duplicate data in the first query result is eliminated and summarized to obtain the final query result, thereby splitting a large data volume query into multiple small query transactions, which is in line with the characteristics of relational databases that can be highly concurrent but not suitable for large data volume queries, and then realizing large data volume queries on relational databases, and finally feeding back the final query results to users, so that through the three created tables, user dynamic queries can be conveniently and quickly realized without relying on the big data platform.
[0122] Another embodiment of the present application provides a device for querying customer data, such as Figure 5 As shown, it includes the following units:
[0123] The reading unit 501 is used to read the feature tags in the pre-generated general column feature configuration table to generate feature tags for the foreground page.
[0124] The generating unit 502 is used to respond to the user's selection operation and generate a backend query statement using each target feature tag selected by the user in the feature tags of the frontend page.
[0125] The judgment unit 503 is used to judge whether the query partition has been determined for this query.
[0126] The first query unit 504 is used to execute a background query statement for a pre-generated customer feature tag summary table if it is determined that the query has determined the partition for the query, so as to query and summarize data according to the target feature tag from the partition table corresponding to the partition for the query in the customer feature tag summary table, and obtain the final query result.
[0127] The second query unit 505 is used to execute background query statements on each partition table in the customer feature tag summary table to obtain a first query result queried according to the target feature tag if it is determined that the query has not determined the queried partition.
[0128] The elimination unit 506 is used to eliminate duplicate data in the first query result based on the pre-generated duplicate data list and summarize the duplicate data to obtain the final query result.
[0129] The duplicate data detail table stores data with the same customer ID but belonging to different partitions.
[0130] The feedback unit 507 is used to feed back the final query result to the user.
[0131] Optionally, in the customer data query device provided in another embodiment of the present application, the following may also be included:
[0132] The first creation unit is used to create an initial customer feature label summary table on the Oracle database.
[0133] The customer feature label summary table includes at least a partition column, a summary value column and a plurality of common columns. The customer feature label summary table is composed of a plurality of partition tables divided according to the data stored in the partition column.
[0134] The first importing unit is used to import the pre-calculated summary data into the initial user feature label summary table to obtain a final customer feature label summary table.
[0135] The summary data is calculated in advance according to the dimensions of the specified feature label combination.
[0136] Optionally, in the customer data query device provided in another embodiment of the present application, the device further includes:
[0137] The first creation unit is used to create an initial customer feature label detail list and a duplicate data detail list.
[0138] The customer feature label detail table is provided with the same common columns as the customer feature label summary table, and contains the original data ID and the customer ID. The duplicate data detail table has the same format as the customer feature label detail table.
[0139] The second importing unit is used to import the original customer feature label details and customer detail data into the customer feature label detail table.
[0140] The third import unit is used to import data with the same customer ID but belonging to different partitions in the customer feature label detail table into the duplicate data detail table.
[0141] Optionally, in the customer data query device provided in another embodiment of the present application, the device further includes:
[0142] The fourth generation unit is used to collect the feature label sequence and name in the original detail list recorded in the original library and the imported detail list recorded in the imported library by executing the database script, generate the configuration content and store it in the created general column feature configuration table to obtain the final general column feature configuration table.
[0143] Optionally, in a customer data query device provided in another embodiment of the present application, a removal unit, such as Figure 6 As shown, including:
[0144] The third query unit 601 is used to query from the duplicate data detail table to the second query result according to the same query condition as the background query statement.
[0145] The summarizing unit 602 is used to sum the first query result positively and the second query result negatively, and then obtain the final query result by summing them up in the asynchronously returned result.
[0146] Another embodiment of the present application provides an electronic device, such as Figure 7 As shown, including:
[0147] Memory 701 and processor 702 .
[0148] The memory 701 is used to store programs.
[0149] The processor 702 is used to execute the program stored in the memory 701, and when the program is executed, it is specifically used to implement the customer data query method provided by any one of the above embodiments.
[0150] Another embodiment of the present application provides a computer storage medium, characterized in that it is used to store a computer program, and when the computer program is executed, it is used to implement the customer data query method provided in any of the above embodiments.
[0151] Computer storage media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0152] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0153] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for querying customer data, characterized in that: include: Read the feature tags in the pre-generated general column feature configuration table to generate feature tags for the front-end page; In response to the user's selection operation, a backend query statement is generated using each target feature tag selected by the user in the feature tag of the frontend page; Determine whether the query partition has been determined for this query; If it is determined that the query has determined the partition to be queried, the background query statement is executed for the pre-generated customer feature tag summary table, so as to query and summarize data according to the target feature tag from the partition table corresponding to the partition to be queried in the customer feature tag summary table, and obtain the final query result; If it is determined that the query partition is not determined in this query, the background query statement is executed for each partition table in the customer feature tag summary table to obtain a first query result queried according to the target feature tag; Based on a pre-generated duplicate data detail table, duplicate data in the first query result is removed and summarized to obtain a final query result; wherein the duplicate data detail table stores data with the same customer ID but belonging to different partitions; Feeding back the final query result to the user; The method for generating the customer feature label summary table comprises: establishing an initial customer feature label summary table on an Oracle database; wherein the customer feature label summary table comprises at least a partition column, a summary value column and a plurality of general columns; the customer feature label summary table is composed of a plurality of partition tables divided according to the data stored in the partition column; importing the pre-calculated summary data into the initial customer feature label summary table to obtain the final customer feature label summary table; wherein the summary data is pre-calculated according to the dimension of the specified feature label combination; The method for generating a duplicate data detail table comprises: creating an initial customer feature label detail table and the duplicate data detail table; wherein the customer feature label detail table is provided with the same plurality of common columns as the customer feature label summary table, and contains the ID of the original data and the customer ID; the duplicate data detail table has the same format as the customer feature label detail table; importing the original customer feature label details and the customer detail data into the customer feature label detail table; importing the data with the same customer ID but belonging to different partitions in the customer feature label detail table into the duplicate data detail table; The method for generating the general column feature configuration table includes: by executing a database script, collecting the feature tag sequence and name in the original detail table recorded in the original library and the imported detail table recorded in the imported library, generating configuration content and storing it in the created general column feature configuration table, and obtaining the final general column feature configuration table.
2. The method according to claim 1, characterized in that The step of removing duplicate data from the first query result based on the pre-generated duplicate data list and aggregating the data to obtain the final query result includes: Querying a second query result from the duplicate data detail table according to the same query condition as the background query statement; After positively evaluating the first query result and negatively evaluating the second query result, the results are summed up in the asynchronously returned results to obtain a final query result.
3. A customer data query device, characterized in that: include: A reading unit, used to read the feature tags in the pre-generated general column feature configuration table and generate feature tags for the front-end page; A generating unit, configured to generate a backend query statement in response to a user's selection operation by using each target feature tag selected by the user in the feature tags of the frontend page; A judgment unit, used to judge whether the query partition has been determined for this query; The first query unit is used for executing the background query statement for the pre-generated customer feature tag summary table if it is determined that the query has determined the partition to be queried, so as to query and summarize data according to the target feature tag from the partition table corresponding to the partition to be queried in the customer feature tag summary table, and obtain a final query result; The second query unit is configured to execute the background query statement for each partition table in the customer feature tag summary table to obtain a first query result queried according to the target feature tag if it is determined that the query has not determined the queried partition; A removal unit, configured to remove duplicate data from the first query result based on a pre-generated duplicate data detail table and summarize the data to obtain a final query result; wherein the duplicate data detail table stores data with the same customer ID but belonging to different partitions; A feedback unit, used for feeding back the final query result to the user; The first creation unit is used to establish an initial customer feature label summary table on an Oracle database; wherein the customer feature label summary table at least includes a partition column, a summary value column and a plurality of common columns; the customer feature label summary table is composed of a plurality of partition tables divided according to the data stored in the partition column; A first importing unit is used to import the pre-calculated summary data into the initial customer feature label summary table to obtain the final customer feature label summary table; wherein the summary data is pre-calculated according to the dimension of the specified feature label combination; The first creation unit is further used to create an initial customer feature label detail table and the duplicate data detail table; wherein the customer feature label detail table is provided with the same plurality of common columns as the customer feature label summary table, and contains the original data ID and the customer ID; the duplicate data detail table has the same format as the customer feature label detail table; A second importing unit, used to import the original customer feature label details and customer detail data into the customer feature label detail table; A third importing unit is used to import data with the same customer ID but belonging to different partitions in the customer feature label detail table into the duplicate data detail table; The fourth generation unit is used to collect the feature tag sequence and name in the original detail list recorded in the original library and the imported detail list recorded in the imported library by executing the database script, generate the configuration content and store it in the created general column feature configuration table, and obtain the final general column feature configuration table.
4. An electronic device, characterized in that: include: Memory and processor; Wherein, the memory is used to store programs; The processor is used to execute the program, and when the program is executed, it is specifically used to implement the customer data query method according to any one of claims 1 to 2.
5. A computer storage medium, characterized in that: Used to store a computer program, which, when executed, is used to implement the customer data query method as described in any one of claims 1 to 2.
Citation Information
Patent Citations
Data querying method, data querying device and data querying system
CN103927331A
Method and device for data aggregate query
CN104504154A
