Data storage method and device, data query method and device, equipment, medium and product

By placing and partitioning business data tables, and using query optimization configuration in data queries, the problem of excessive consumption of data storage and query resources in the existing technology is solved, and query efficiency and flexibility are improved.

CN119669218APending Publication Date: 2025-03-21PEOPLE'S INSURANCE COMPANY OF CHINA
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411554221.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The prior art causes excessive consumption of database resources during data storage and querying, and inefficient query efficiency and inflexibility.

Method used

By obtaining the business data and attribute information of multiple business objects, generating business data tables, and performing table and partitioning according to preset division rules, and storing them in the target database. During the query process, based on the query conditions entered by the user and the query optimization configuration of the target database, query optimization is performed using the table key, table results and partition results.

Benefits of technology

It reduces the data volume and database resource consumption of business data tables, improves the flexibility of data management, and improves the efficiency and flexibility of data queries through query optimization configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119669218A_ABST
    Figure CN119669218A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a data storage method and device, a data query method and device, equipment, a medium and a product. The data storage method comprises the steps that service data of multiple service objects and attribute information of the multiple service objects are obtained; based on the business data and the attribute information of each business object, generating a business data table containing the business data of the plurality of business objects and the attribute information of the plurality of business objects; according to a preset division rule, performing table division and partition processing on the service data table to obtain a plurality of service data sub-tables and partition results of the plurality of service data sub-tables; and storing the business data in a target database based on the plurality of business data sub-tables and the partitioning result of the plurality of business data sub-tables. Through the embodiment of the invention, the flexibility of data management is improved, the resource consumption during query is reduced, and the data query efficiency and the flexibility of the query process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a data storage method, a data query method, a device, a equipment, a medium and a product. Background Art

[0002] With the growth of business volume, business data shows an explosive growth trend. Therefore, the data storage and query process should also be continuously optimized. In the prior art, when storing data, the business data of the business object is stored in the database by associating an attribute information of the business object with the business list table of the business object. This causes the database to store a large number of business list tables, which consumes a lot of database resources. When querying, the business list table of the business object is obtained by querying the attribute information of the business object. This data query method is not only inefficient, but also very inflexible.

[0003] Therefore, there is an urgent need for a data storage and query method that can save database resources while improving the efficiency and flexibility of data query. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a data storage method, a data query method, an apparatus, a device, a medium and a product to solve the problem of low data query efficiency in related technologies.

[0005] In order to solve the above technical problems, the embodiments of the present application are implemented as follows: In a first aspect, an embodiment of the present application provides a data storage method, including: Acquire business data of multiple business objects and attribute information of the multiple business objects; Based on the business data and attribute information of each of the business objects, generating a business data table including the business data of the plurality of business objects and the attribute information of the plurality of business objects; According to the preset division rule, the business data table is divided into tables and partitioned to obtain a plurality of business data sub-tables and the partition results of the plurality of business data sub-tables; Based on the multiple business data sub-tables and the partitioning results of the multiple business data sub-tables, the business data is stored in a target database.

[0006] In a second aspect, an embodiment of the present application provides a data query method, including: Obtaining a data query request sent by a user, and determining a query condition input by the user; Generate a query result based on the query condition and the query optimization configuration of the target database; the query result includes business data of at least one business object; The query optimization configuration of the target database includes one or more of the following: a shard table replacement query based on a shard table key, a filtering condition based on a shard table result, and a filtering condition based on a partition result; The sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing a sub-table processing on a business data table containing business data of a plurality of business objects and attribute information of a plurality of business objects based on a preset splitting rule; the sub-table result includes a plurality of the business data sub-tables; the partition result is obtained by performing a partition processing on the business data sub-table based on a preset partitioning rule; The query result is returned to the user.

[0007] In a third aspect, an embodiment of the present application provides a data storage device, including: An acquisition module, used to acquire business data of multiple business objects and attribute information of the multiple business objects; A generating module, configured to generate a business data table including the business data of a plurality of the business objects and the attribute information of the plurality of business objects based on the business data and the attribute information of each of the business objects; A partitioning module, used to perform table and partition processing on the business data table according to a preset partitioning rule, to obtain a plurality of business data sub-tables and partition results of the plurality of business data sub-tables; The storage module is used to store the business data in a target database based on the multiple business data sub-tables and the partitioning results of the multiple business data sub-tables.

[0008] In a fourth aspect, an embodiment of the present application provides a data query device, including: A determination module, used to obtain a data query request sent by a user and determine a query condition input by the user; A generating module, configured to generate a query result based on the query condition and the query optimization configuration of the target database; the query result includes business data of at least one business object; The query optimization configuration of the target database includes one or more of the following: a shard table replacement query based on a shard table key, a filtering condition based on a shard table result, and a filtering condition based on a partition result; The sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing a sub-table processing on a business data table containing business data of a plurality of business objects and attribute information of a plurality of business objects based on a preset splitting rule; the sub-table result includes a plurality of the business data sub-tables; the partition result is obtained by performing a partition processing on the business data sub-table based on a preset partitioning rule; The returning module is used to return the query result to the user.

[0009] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method described in the first aspect or the second aspect above are implemented.

[0010] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect or the second aspect above are implemented.

[0011] In the seventh aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer executes the steps of the method described in the first or second aspect above.

[0012] It can be seen from the technical solution provided by the above embodiments of the present application that, in the data storage process, the embodiments of the present application obtain business data of multiple business objects and attribute information of multiple business objects; based on the business data and attribute information of each business object, and a business unique identifier matching each business object, a business data table containing business data of multiple business objects and attribute information of multiple business objects is generated; according to preset division rules, the business data table is split and partitioned to obtain multiple business data sub-tables and partition results of multiple business data sub-tables; based on the multiple business data sub-tables and the partition results of multiple business data sub-tables, the business data is stored in the target database. In the data query process, the data query request sent by the user is obtained, and the query condition input by the user is determined; based on the query condition and the query optimization configuration of the target database, the query result is generated; the query result includes the business data of at least one business object; the query optimization configuration of the target database includes one or more of the following: a sub-table replacement query based on a sub-table key, a filtering condition based on a sub-table result, and a filtering condition based on a partition result; the sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing sub-table processing on a business data table containing business data of multiple business objects and attribute information of multiple business objects based on a preset splitting rule; the sub-table result includes multiple business data sub-tables; the partition result is obtained by performing partition processing on the business data sub-table based on a preset partitioning rule; and the query result is returned to the user. It can be seen that through the embodiment of the present application, by sub-tableing and partitioning the business data table, the data volume of the business data table and the resource consumption of the database are reduced, and the flexibility of data management is improved. By performing query optimization configuration on the target database, data query is made more efficient, resource consumption during query is reduced, and data query efficiency and the flexibility of the query process are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] 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 some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0014] Figure 1 A schematic diagram of a data storage method provided in an embodiment of the present application; Figure 2 A schematic diagram of the storage format of the business data sub-table provided in the embodiment of the present application; Figure 3 A schematic diagram of the configuration function page of the ClickHouse database provided in the embodiment of the present application; Figure 4A flowchart of a data query method provided in an embodiment of the present application; Figure 5 A schematic diagram of a query result display page provided in an embodiment of the present application; Figure 6 A process diagram of a data storage method provided in an embodiment of the present application; Figure 7 A process diagram of a data query method provided in an embodiment of the present application; Figure 8 A schematic diagram of the module composition of a data storage device provided in an embodiment of the present application; Fig. 9 A schematic diagram of the module composition of a data query device provided in an embodiment of the present application; Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0015] The embodiments of the present application provide a data storage method, a data query method, an apparatus, a device, a medium and a product.

[0016] In order to enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this application.

[0017] The data storage method and data query method provided in the embodiments of the present application can be applied to the storage and query scenarios of massive data. In a specific application scenario, the massive data includes the policy table data of multiple insured persons and the attribute information table of the insured persons in the system database of insurance company A, wherein the attribute information table of the insured persons may include the address information and identity information of the insured persons, etc. Exemplarily, the policy table in the system database of insurance company A has approximately 1.5 billion data items (policies for the past five years), and the insured address table has approximately 1.8 billion data items. The policy table is associated with the insured's address table and stored in the system database. When querying, the insured's policy data is queried through the insured's address. This method of data storage and query not only consumes database resources, but also takes time to query and is inefficient.

[0018] The following describes in detail the data storage method and data query method provided in the embodiments of the present application in combination with the above-mentioned specific application scenarios.

[0019] Figure 1The present invention provides a flow chart of a data storage method provided in an embodiment of the present invention. The method can be executed by a server, wherein the server can be an independent server, a server cluster composed of multiple servers, or a cloud server for cloud computing processing. Figure 1 As shown, the data storage method may specifically include the following steps: S102: Acquire business data of multiple business objects and attribute information of multiple business objects.

[0020] In the embodiment of the present application, the business object is the insured, and the business data of the business object is the policy data of the insured, which may include basic policy information, policyholder information, insured information, insurance payment information, and claim records, etc. The attribute information of the business object may include the name, contact information, ID number, and address of the insured, etc.

[0021] S104: Based on the business data and attribute information of each business object, a business data table including the business data of multiple business objects and the attribute information of multiple business objects is generated.

[0022] In an embodiment of the present application, after obtaining business data of multiple business objects and attribute information of multiple business objects, a business data table containing business data of multiple business objects and attribute information of multiple business objects is generated according to the business data of each business object and the attribute information of each business object.

[0023] In one embodiment, based on the business data and attribute information of each business object, a business data table including business data of multiple business objects and attribute information of multiple business objects is generated, including: Based on the business unique identifier that matches the business object, an array table containing attribute information of multiple business objects is generated; wherein the attribute information of multiple business objects that match the same business unique identifier is stored in the array table in the form of an array; Based on preset association conditions, the array table is transferred to the business list table to obtain a business data table containing business data of multiple business objects and attribute information of multiple business objects; the business list table contains the business data of multiple business objects.

[0024] In the embodiment of the present application, first, based on each business unique identifier that matches each business object, the attribute information of multiple business objects that match the same business unique identifier is stored in an array table in the form of an array, thereby obtaining an array table containing the attribute information of multiple business objects. Then, each business unique identifier is used as the association information between the array table and the business list table, and based on the association information, the attribute information of multiple business objects in the array table is transferred to the business list table containing the business data of multiple business objects, thereby obtaining a business data table containing the business data of multiple business objects and the attribute information of multiple business objects.

[0025] In one implementation, the business object is the insured, the business data is the policy data, the business list table is the policy table containing the policy data, and the attribute information of the business object includes the name and address of the insured. The business unique identifier can be the insurance policy number matching the insured, and there can be multiple insureds matching the same insurance policy number.

[0026] According to the policy number, an array table containing the name and address information of multiple insured persons is generated, and the names and addresses of multiple insured persons with the same policy number are stored in the array table in the form of an array. Then, the policy number is used as the association information between the array table and the policy table, and the name and address information of the insured person in the array table is transferred to the policy table containing the policy data, and finally a business data table containing the policy data of multiple insured persons and the name and address information of multiple insured persons is obtained.

[0027] Exemplarily, Table 1 is an exemplary table of the insurance policy table. As shown in Table 1, the insurance policy table contains multiple insurance policy data, and the insurance policy data specifically includes the policy number, the insurance application number, the insured person and the claim record, etc. Among them, the insurance policy number is PABC202500001, and its corresponding insurance application number is TABC202500001. The insured person is Zhao Yi, and the claim record is 2023.5.10, fracture reduction surgery, and the compensation amount is 20,000 yuan. The insurance policy number is PABC202500002, and its corresponding insurance application number is TABC202500002. The insured person is Zhao Er, and the claim record is 2023.7.10, cancer treatment, and the compensation amount is 30,000 yuan.

[0028] Table 1

[0029] Table 2 is the name and address information table of the insured. As shown in Table 2, Zhang San and Li Si have the same insurance policy number TABC202500001, where Zhang San's address is "XXX, Chaoyang District, Beijing" and Li Si's address is "XXX, Heping District, Tianjin". Wang Wu, Zhao Liu and Sun Qi have the same insurance policy number TABC202500002, where Wang Wu's address is "XXX, Hangzhou City, Zhejiang Province", Zhao Liu's address is "XXX, Wenzhou City, Zhejiang Province", and Sun Qi's address is "XXX, Jiaxing City, Zhejiang Province".

[0030] Table 2

[0031] According to the insurance policy number, an array table containing the names and addresses of multiple insured persons is generated. In a specific implementation, the definition statement of the insured person array table is as follows: CREATE TABLE insured_array_table( Policy number Sring, Insured person nameArray(String), Insured person address Array (String), … ) Statement to aggregate the insured person's address array by insurance policy number: INSERT INTO insured person array table ( Insurance policy number, Name of Insured, Insured's address, … ) SELECT policy number, groupArray(insured person's name), groupArray(insured person's address), … FROM Insured Person Information Form The data structure of the insured array table after aggregation by the above statements is shown in Table 3 ([] indicates that the data stored in it is an array, and the following tables all have this meaning). In Table 3, the names and addresses of Zhang San and Li Si, who have the same insurance policy number TABC202500001, are stored in the array table in the form of an array. The names and addresses of Wang Wu, Zhao Liu, and Sun Qi, who have the same insurance policy number TABC202500002, are stored in the array table in the form of an array.

[0032] Table 3

[0033] The policy number is used as the association information between the array table and the policy table, and the name and address information of the insured in the array table is transferred to the policy table containing the policy data, so as to obtain a business data table containing the policy data of multiple insured persons and the name and address information of multiple insured persons. Among them, the data storage structure of the business data table is shown in Table 4. In Table 4, the business data table stores the policy number and the corresponding application number, as well as the number of data items corresponding to the insured name array field and the insured address information array field, and also stores the first data item of the insured name and address information for display on the front page.

[0034] Table 4

[0035] S106: According to the preset division rule, the business data table is divided and partitioned to obtain a plurality of business data sub-tables and a plurality of partition results of the business data sub-tables.

[0036] In the embodiment of the present application, first, the business data table can be partitioned according to the preset splitting rule to obtain a preset number of business data sub-tables. Then, for each business data sub-table, the business data sub-table is partitioned according to the preset partitioning rule to obtain the partitioning result of the business data sub-table.

[0037] In one implementation, insurance company A has n (n>1) branches, each of which has a large number of customers and corresponding insurance business data. In this case, the business data table can be split into n business data sub-tables according to the n branches, and each business data sub-table is a business data sub-table of a branch, containing the insurance business data of the corresponding branch. After obtaining each business data sub-table, the business data sub-table can be partitioned according to the insurance start year or insurance type, etc., to obtain the partition results of each business data sub-table.

[0038] By splitting and partitioning the business data table, not only can the amount of data in the business data table be reduced, but the business data of each branch can also be isolated from each other, so that they will not affect each other when updating or deleting data.

[0039] S108: Based on the multiple business data sub-tables and the partitioning results of the multiple business data sub-tables, the business data is stored in a target database.

[0040] After the business data table is split and partitioned, the business data is stored in a target database based on the obtained multiple business data sub-tables and the partition results of the multiple business data sub-tables.

[0041] In one implementation, the target database may be a ClickHouse database.

[0042] Figure 2 A schematic diagram of the storage form of the business data sub-table provided in the embodiment of the present application, in one implementation, such as Figure 2 As shown, there are a large number of business data sub-tables obtained after the splitting. The multiple business data sub-tables after the splitting can be distinguished from other business data tables of Insurance Company A and stored in a separate database.

[0043] In one embodiment, after storing the business data in the target database, the method further includes: Trigger the target database to execute query optimization configuration; The query optimization configuration includes one or more of the following: configuring a shard table replacement query based on a shard table key; configuring a filter condition based on a shard table result; configuring a filter condition based on a partition result; The sub-table key is used to determine the business data sub-table to which the business data belongs.

[0044] In an embodiment of the present application, after the business data is stored in the target database, the target database is triggered to perform query optimization configuration. The query optimization configuration can be to configure a shard table replacement query based on a shard table key, to configure a filtering condition based on a shard table result of a business data table, and to configure a filtering condition based on a partition result of a business data shard table.

[0045] In one implementation, a shard table replacement query based on a shard table key may determine a corresponding shard table key based on a query condition input by a user when the user performs a data query, and replace the table name with a business data shard table storing the business data of the branch company where the user is located according to the shard table key. For example, when a user of the Beijing branch company queries data, the table name will be replaced with app_nad_clause_mp11000000 (representing the business data shard table of the Beijing branch company).

[0046] In one implementation, to configure filtering conditions based on sub-table results, it is necessary to determine which field or fields are used to filter the sub-table query results. These fields are usually selected based on business needs. For example, when a user queries data, if the query condition includes a branch field, a _table pseudo column can be added for query filtering. For example, if the query condition is "branch in Beijing, Tianjin", then after adding the _table pseudo column, the query is replaced with "_table in (app_nad_clause_mp11000000, app_nad_clause_mp12000000)", where "app_nad_clause_mp12000000" represents the Tianjin branch business data table. By adding the _table pseudo column, the business data sub-tables of the Beijing branch and the business data sub-tables of the Tianjin branch can be queried.

[0047] In one implementation, to configure filtering conditions based on partition results, it is necessary to determine which field or fields are used to filter partition query results. When a user queries data, if the partition field is used in the query condition, a partition field filtering condition will be added. For example, suppose the business data is partitioned by year, and the partition field is "year". When the query condition includes "year=2024", the query condition _partition.value.1 = '2024' will be added. By adding the _partition pseudo column, the business data of the Beijing branch in 2024 and the business data of the Tianjin branch in 2024 can be queried. If there are multiple partition fields, the serial number _partition.value.X increases in sequence.

[0048] A pseudo column is a column that does not exist physically but is constructed when querying. It is dynamically generated when querying and does not actually store data in the table. By using pseudo columns, you can quickly locate data, limit query results, and perform paging queries.

[0049] Figure 3 A schematic diagram of a configuration function page of a ClickHouse database provided in an embodiment of the present application, in one implementation, as Figure 3 As shown in the figure, the list management function page of the ClickHouse database provides a query optimization configuration function for the partition list of the table. In the optimization configuration function, name and replace the query table, _table pseudo column, and _partition pseudo column to perform query optimization configuration.

[0050] In one embodiment, you can also define a merge query table and use the Merge engine of the ClickHouse database to create a target business data table for users of the head office or users with query permissions for multiple branches. The target business data table contains business data of multiple business data sub-tables and is created as follows: Create Table app_nad_clause ( Policy number String, Insurance policy number String, Insured person address array, Insured person address information String, … ) ENGINE = MERGE('nad', '^app_nad_clause_mp') It can be seen from the technical solution provided by the above embodiments of the present application that in the data storage process, the embodiments of the present application obtain the business data of multiple business objects and the attribute information of multiple business objects; based on the business data and attribute information of each business object, and the business unique identifier matching each business object, generate a business data table containing the business data of multiple business objects and the attribute information of multiple business objects; according to the preset partitioning rules, the business data table is divided and partitioned to obtain the partition results of multiple business data sub-tables and multiple business data sub-tables; based on the partition results of multiple business data sub-tables and multiple business data sub-tables, the business data is stored in the target database. By dividing and partitioning the business data table, the data volume of the business data table and the resource consumption of the database are reduced, and the flexibility of data management is improved. By performing query optimization configuration on the target database, data query is made more efficient, the resource consumption during query is reduced, and the data query efficiency and the flexibility of the query process are improved.

[0051] Figure 4 The present invention provides a flow chart of a data query method provided in an embodiment of the present invention. The method can be executed by a server, wherein the server can be an independent server, a server cluster composed of multiple servers, or a cloud server for cloud computing processing. Figure 4 As shown, the method may specifically include the following steps: S402: Obtaining a data query request sent by a user and determining a query condition input by the user; In the embodiment of the present application, a data query request sent by a user is obtained, and the user may be a business person A of the Beijing branch of insurance company A. The query conditions entered by the user on the client are, for example, query conditions such as branch, starting year of insurance, or insurance type. Among them, branch is a sub-table query condition, starting year of insurance or insurance type is a partition query condition, and the query condition entered by the user may also include, for example, the address information of business object A.

[0052] S404: Generate a query result based on the query condition and the query optimization configuration of the target database; the query result includes business data of at least one business object; The query optimization configuration of the target database includes one or more of the following: shard table replacement query based on shard table key, filtering condition based on shard table result, and filtering condition based on partition result; Among them, the sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by sub-table processing of a business data table containing business data of multiple business objects and attribute information of multiple business objects based on a preset splitting rule; the sub-table result includes multiple business data sub-tables; the partition result is obtained by partitioning the business data sub-table based on the preset partitioning rule.

[0053] In an embodiment of the present application, a query result is generated based on the query condition input by the user and the query optimization configuration of the target database, and the query result includes business data of at least one business object matching the query condition input by the user.

[0054] In one embodiment, based on the query conditions and the query optimization configuration of the target database, the query results are generated, including: Based on the query conditions and the query optimization configuration of the target database, determine the sharding key and partition key that match the query conditions; the partition key is used to determine the partition to which the business data belongs in the business data sharding table; Based on the shard key and the partition key, determine the business data shard that matches the shard key and the partition that matches the partition key; A query result is generated based on the business data shard table matching the shard table key and the partition matching the partition key, and at least one business attribute of the business object input by the user.

[0055] In one implementation, the query conditions input by the user are, for example, branch: Beijing Branch, policy start year: 2024, address: XXX, Chaoyang District, Beijing. Based on the above query conditions input by the user, the sub-table key is determined to be "Beijing Branch" and the partition key is "policy start year". Based on the sub-table key being "Beijing Branch", the business data sub-table that matches the sub-table key is determined to be the Beijing Branch business data sub-table; based on the partition key being "policy start year", the partition that matches the sub-table key is determined to be the policy start year partition. Based on the address information of business object A input by the user, generate the policy data of business object A.

[0056] In an example, suppose that the branch where business person A works is the Beijing branch, and business person A wants to query the insurance policy data of the Beijing branch in 2024. When querying data, the target database replaces the query based on the shard table replacement query based on the shard table key in the query optimization configuration. When querying, the table name in the query statement is replaced with "app_nad_clause_mp11000000", which represents the business data shard table of the Beijing branch, and adds a filter condition based on the shard table result in the branch field. For example, if the query condition is "branch in Beijing", the query condition is replaced with "_table in (app_nad_clause_mp11000000)", and the business data shard table of the Beijing branch is obtained by query. Add a filter condition based on the partition result in the partition field. For example, if the query condition contains "year = 2024", the query condition _partition.value.1 = '2024' is added to obtain the business data of the Beijing branch in 2024. Assuming that the query condition entered by business person A also includes "address = XXX, Chaoyang District, Beijing", the query condition _partition.value.2 = 'XXX, Chaoyang District, Beijing' will be added. Based on the above query conditions and query optimization configuration, the policy data of business object A of Beijing Branch, with policy starting from 2024 and address of XXX, Chaoyang District, Beijing, can be queried.

[0057] In one embodiment, before generating the query result, the method further includes: Get the comparison operator in the data query request sent by the user; According to the preset conversion rules, the comparison operator is converted into a target query condition that matches the target database; Utilize the target query conditions to generate query results that match the data query request.

[0058] In the embodiment of the present application, a data filtering condition in the data query request sent by the user is also obtained, and the data filtering condition is, for example, a comparison operator, etc. When performing a data query, the comparison operator in the data query request sent by the user can be converted into a target query condition matching the target database according to a preset conversion rule; then, the query result is generated using the target query condition.

[0059] In one implementation, the target database is a ClickHouse database, and the preset conversion rules are shown in Table 5. According to the correspondence between the comparison operators and the ClickHouse query conditions shown in Table 5, the comparison operators in the data query request sent by the user are converted into ClickHouse query conditions.

[0060] Table 5

[0061] In one embodiment, when querying data, the user's data query authority can also be determined based on the data query request sent by the user; when it is determined that the user's data query authority is allowed to query data in multiple business data sub-tables, the target business data table is returned to the user; the target business data table is obtained by merging multiple business data sub-tables in advance using a data table generation tool.

[0062] The method of creating the target business data table can refer to the relevant steps of the above-mentioned data storage method, and this application will not go into details here.

[0063] S406: Return the query result to the user.

[0064] After obtaining the query results, the query results are returned to the user.

[0065] Figure 5 A schematic diagram of a query result display page provided in an embodiment of the present application, in one implementation, as Figure 5 As shown in the following figure, in the query results, array type fields such as the insured's address only display the first row of data and the total number of data items by default. For example, Figure 5 In the first row of data, the insured's address is displayed as "Lichuan City", and the "19" displayed in the insured's address data box is the total number of insured's address data matching the policy number PEBX0000001. When the user clicks the data number display button in the upper right corner, all insured's addresses can be displayed.

[0066] You can also display each insured person's address data as a row of data by clicking the array field display mode switch button on the page (not shown in the figure).

[0067] Consistent with the above-mentioned insured person address query result display method, the insured person's name, target address, policy terms, insurance plan and other data can be queried and displayed in this way.

[0068] It can be seen from the technical solution provided by the above embodiments of the present application that in the data query process, the embodiments of the present application obtain the data query request sent by the user and determine the query conditions input by the user; based on the query conditions and the query optimization configuration of the target database, generate the query results; the query results include the business data of at least one business object; the query optimization configuration of the target database includes one or more of the following: sub-table replacement query based on the sub-table key, filtering conditions based on the sub-table result, and filtering conditions based on the partition result; the sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing sub-table processing on the business data table containing the business data of multiple business objects and the attribute information of multiple business objects based on the preset splitting rules; the sub-table result includes multiple business data sub-tables; the partition result is obtained by partitioning the business data sub-table based on the preset partitioning rules; and the query result is returned to the user. It can be seen that through the embodiments of the present application, according to the query conditions input by the user and the query optimization configuration of the target database, the query results to be queried by the user are determined, making the data query more efficient, reducing the resource consumption during the query, and improving the data query efficiency and the flexibility of the query process.

[0069] Figure 6 A process diagram of a data storage method provided in an embodiment of the present application. In an exemplary embodiment, Figure 6 As shown, the data storage method specifically includes the following steps: Step 601: Prepare business data; the list data includes policy data of multiple insured persons; Step 602: Create an array table and a business data table; create an array table based on the insurance policy number, using the name and address of the insured as array fields, and transfer the array table to the target list table to obtain a business data table; Step 603: Split the business data table; split the business data table into multiple business data sub-tables according to the splitting rule, and partition each business data sub-table to obtain a partitioning result.

[0070] Step 604: define a merge query table; use the Merge engine of the ClickHouse database to create a target business data table provided to the head office user or the user with query permissions for multiple branches. The target business data table contains business data of multiple business data sub-tables.

[0071] Step 605: configure query optimization in the target database; configure a shard table replacement query based on a shard table key; configure a filtering condition based on a shard table result; configure a filtering condition based on a partition result; Step 606: Business data storage: Based on the above table and partition results and query optimization configuration, the business data is stored in the ClickHouse database.

[0072] Figure 7 A process diagram of a data query method provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the data query method specifically includes the following steps: Step 701: The user sends a data query request; the data query request includes query conditions input by the user; Step 702: Perform a query based on the query conditions and query optimization configuration; Step 703: Convert query conditions; convert the comparison operator in the data query request sent by the user into a ClickHouse query condition; Step 704: Return the query result to the user.

[0073] Corresponding to the data storage method provided in the above embodiment, based on the same technical concept, the embodiment of the present application also provides a data storage device, Figure 8 A schematic diagram of the module composition of a data storage device provided in an embodiment of the present application, wherein the data storage device is used to execute Figure 1 Describes the data storage method, such as Figure 8 As shown, the data storage device comprises: An acquisition module 801 is used to acquire business data of multiple business objects and attribute information of the multiple business objects; A generating module 802, configured to generate a business data table including the business data of a plurality of the business objects and the attribute information of the plurality of business objects based on the business data and the attribute information of each of the business objects; A partitioning module 803 is used to perform table and partition processing on the business data table according to a preset partitioning rule to obtain a plurality of business data sub-tables and partition results of the plurality of business data sub-tables; The storage module 804 is used to store the business data in a target database based on the multiple business data sub-tables and the partitioning results of the multiple business data sub-tables.

[0074] In a possible implementation, the generating module 802 is specifically configured to generate an array table containing attribute information of a plurality of the business objects based on a business unique identifier matching the business object; wherein the attribute information of the plurality of the business objects matching the same business unique identifier is stored in the array table in the form of an array; Based on preset association conditions, the array table is transferred to the business list table to obtain the business data table containing the business data of multiple business objects and the attribute information of multiple business objects; the business list table contains the business data of multiple business objects.

[0075] In a possible implementation, it further includes a trigger module, which is used to trigger the target database to execute query optimization configuration; The query optimization configuration includes one or more of the following: configuring a shard table replacement query based on a shard table key; configuring a filtering condition based on a shard table result; configuring a filtering condition based on a partition result; The sub-table key is used to determine the business data sub-table to which the business data belongs.

[0076] It can be seen from the technical solution provided by the above embodiments of the present application that in the data storage process, the embodiments of the present application obtain the business data of multiple business objects and the attribute information of multiple business objects; based on the business data and attribute information of each business object, generate a business data table containing the business data of multiple business objects and the attribute information of multiple business objects; according to the preset partitioning rules, the business data table is divided and partitioned to obtain the partition results of multiple business data sub-tables and multiple business data sub-tables; based on the partition results of multiple business data sub-tables and multiple business data sub-tables, the business data is stored in the target database. By dividing and partitioning the business data table, the amount of data in the business data table and the resource consumption of the database are reduced, and the flexibility of data management is improved. By performing query optimization configuration on the target database, data query is made more efficient, the resource consumption during query is reduced, and the data query efficiency and the flexibility of the query process are improved.

[0077] It should be noted that the data storage device provided in the embodiment of the present application and the data storage method provided in the embodiment of the present application are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned data storage method, and the repeated parts will not be repeated.

[0078] Corresponding to the data query method provided in the above embodiment, based on the same technical concept, the embodiment of the present application also provides a data query device, Fig. 9 A schematic diagram of the module composition of a data query device provided in an embodiment of the present application, wherein the data query device is used to execute Figure 4 Describes the data query method, such as Fig. 9 As shown, the data query device includes: The determination module 901 is used to obtain the data query request sent by the user and determine the query condition input by the user; A generating module 902, configured to generate a query result based on the query condition and the query optimization configuration of the target database; the query result includes business data of at least one business object; The query optimization configuration of the target database includes one or more of the following: a shard table replacement query based on a shard table key, a filtering condition based on a shard table result, and a filtering condition based on a partition result; The sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing a sub-table processing on a business data table containing business data of a plurality of business objects and attribute information of a plurality of business objects based on a preset splitting rule; the sub-table result includes a plurality of the business data sub-tables; the partition result is obtained by performing a partition processing on the business data sub-table based on a preset partitioning rule; The returning module 903 is used to return the query result to the user.

[0079] In a possible implementation, the generation module 902 is specifically used to determine the sub-table key and partition key matching the query condition based on the query condition and the query optimization configuration of the target database; the partition key is used to determine the partition to which the business data belongs in the business data sub-table; Based on the sub-table key and the partition key, determining the business data sub-table matching the sub-table key and the partition matching the partition key; The query result is generated based on the business data sub-table matching the sub-table key and the partition matching the partition key, and at least one business attribute of the business object input by the user.

[0080] In a possible implementation, the generating module 902 is further configured to obtain a comparison operator in the data query request sent by the user; According to a preset conversion rule, the comparison operator is converted into a target query condition matching the target database; The target query condition is used to generate a query result that matches the data query request.

[0081] It can be seen from the technical solution provided by the above embodiments of the present application that in the data query process, the embodiments of the present application obtain the data query request sent by the user and determine the query conditions input by the user; based on the query conditions and the query optimization configuration of the target database, generate the query results; the query results include the business data of at least one business object; the query optimization configuration of the target database includes one or more of the following: sub-table replacement query based on the sub-table key, filtering conditions based on the sub-table result, and filtering conditions based on the partition result; the sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing sub-table processing on the business data table containing the business data of multiple business objects and the attribute information of multiple business objects based on the preset splitting rules; the sub-table result includes multiple business data sub-tables; the partition result is obtained by partitioning the business data sub-table based on the preset partitioning rules; and the query result is returned to the user. It can be seen that through the embodiments of the present application, according to the query conditions input by the user and the query optimization configuration of the target database, the query results to be queried by the user are determined, making the data query more efficient, reducing the resource consumption during the query, and improving the data query efficiency and the flexibility of the query process.

[0082] It should be noted that the data query device provided in the embodiment of the present application and the data query method provided in the embodiment of the present application are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the aforementioned data query method, and the repeated parts will not be repeated.

[0083] Corresponding to the data storage method and data query method provided in the above embodiments, based on the same technical concept, the embodiment of the present application further provides an electronic device, which is used to execute the above data storage method and data query method. Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the electronic device may have relatively large differences due to different configurations or performances, and may include one or more processors 1001 and memory 1002, and the memory 1002 may store one or more storage applications or data. Among them, the memory 1002 may be a short-term storage or a persistent storage. The application stored in the memory 1002 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 1001 may be configured to communicate with the memory 1002 and execute a series of computer executable instructions in the memory 1002 on the electronic device. The electronic device may also include one or more power supplies 1003, one or more wired or wireless network interfaces 1004, one or more input and output interfaces 1005, and one or more keyboards 1006.

[0084] Specifically in this embodiment, the electronic device includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store a computer program; the processor is used to execute the program stored in the memory to implement the following method steps: Acquire business data of multiple business objects and attribute information of the multiple business objects; Based on the business data and attribute information of each of the business objects, generating a business data table including the business data of the plurality of business objects and the attribute information of the plurality of business objects; According to the preset division rule, the business data table is divided into tables and partitioned to obtain a plurality of business data sub-tables and the partition results of the plurality of business data sub-tables; Based on the multiple business data sub-tables and the partitioning results of the multiple business data sub-tables, the business data is stored in a target database.

[0085] It can be seen from the technical solution provided by the above embodiments of the present application that in the data storage process, the embodiments of the present application obtain the business data of multiple business objects and the attribute information of multiple business objects; based on the business data and attribute information of each business object, generate a business data table containing the business data of multiple business objects and the attribute information of multiple business objects; according to the preset partitioning rules, the business data table is divided and partitioned to obtain the partition results of multiple business data sub-tables and multiple business data sub-tables; based on the partition results of multiple business data sub-tables and multiple business data sub-table results, the business data is stored in the target database. By dividing and partitioning the business data table, the amount of data in the business data table and the resource consumption of the database are reduced, and the flexibility of data management is improved. By performing query optimization configuration on the target database, data query is made more efficient, the resource consumption during query is reduced, and the data query efficiency and the flexibility of the query process are improved.

[0086] In another specific embodiment, the electronic device includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store a computer program; the processor is used to execute the program stored in the memory to implement the following method steps: Obtaining a data query request sent by a user, and determining a query condition input by the user; Generate a query result based on the query condition and the query optimization configuration of the target database; the query result includes business data of at least one business object; The query optimization configuration of the target database includes one or more of the following: a shard table replacement query based on a shard table key, a filtering condition based on a shard table result, and a filtering condition based on a partition result; The sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing a sub-table processing on a business data table containing business data of a plurality of business objects and attribute information of a plurality of business objects based on a preset splitting rule; the sub-table result includes a plurality of the business data sub-tables; the partition result is obtained by performing a partition processing on the business data sub-table based on a preset partitioning rule; The query result is returned to the user.

[0087] It can be seen from the technical solution provided by the above embodiments of the present application that in the data query process, the embodiments of the present application obtain the data query request sent by the user and determine the query conditions input by the user; based on the query conditions and the query optimization configuration of the target database, generate the query results; the query results include the business data of at least one business object; the query optimization configuration of the target database includes one or more of the following: sub-table replacement query based on the sub-table key, filtering conditions based on the sub-table result, and filtering conditions based on the partition result; the sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing sub-table processing on the business data table containing the business data of multiple business objects and the attribute information of multiple business objects based on the preset splitting rules; the sub-table result includes multiple business data sub-tables; the partition result is obtained by partitioning the business data sub-table based on the preset partitioning rules; and the query result is returned to the user. It can be seen that through the embodiments of the present application, according to the query conditions input by the user and the query optimization configuration of the target database, the query results to be queried by the user are determined, making the data query more efficient, reducing the resource consumption during the query, and improving the data query efficiency and the flexibility of the query process.

[0088] The present application also provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the following method steps are implemented: Acquire business data of multiple business objects and attribute information of the multiple business objects; Based on the business data and attribute information of each of the business objects, generating a business data table including the business data of the plurality of business objects and the attribute information of the plurality of business objects; According to the preset division rule, the business data table is divided into tables and partitioned to obtain a plurality of business data sub-tables and the partition results of the plurality of business data sub-tables; Based on the multiple business data sub-tables and the partitioning results of the multiple business data sub-tables, the business data is stored in a target database.

[0089] It can be seen from the technical solution provided by the above embodiments of the present application that in the data storage process, the embodiments of the present application obtain the business data of multiple business objects and the attribute information of multiple business objects; based on the business data and attribute information of each business object, generate a business data table containing the business data of multiple business objects and the attribute information of multiple business objects; according to the preset partitioning rules, the business data table is divided and partitioned to obtain the partition results of multiple business data sub-tables and multiple business data sub-table results; based on the partition results of multiple business data sub-tables and multiple business data sub-tables, the business data is stored in the target database. By dividing and partitioning the business data table, the data volume of the business data table and the resource consumption of the database are reduced, and the flexibility of data management is improved. By performing query optimization configuration on the target database, data query is made more efficient, the resource consumption during query is reduced, and the data query efficiency and the flexibility of the query process are improved.

[0090] In another embodiment, the storage medium stores a computer program, and when the computer program is executed by a processor, the following method steps are implemented: Obtaining a data query request sent by a user and determining a query condition input by the user; Generate a query result based on the query condition and the query optimization configuration of the target database; the query result includes business data of at least one business object; The query optimization configuration of the target database includes one or more of the following: a shard table replacement query based on a shard table key, a filtering condition based on a shard table result, and a filtering condition based on a partition result; The sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing a sub-table processing on a business data table containing business data of a plurality of business objects and attribute information of a plurality of business objects based on a preset splitting rule; the sub-table result includes a plurality of the business data sub-tables; the partition result is obtained by performing a partition processing on the business data sub-table based on a preset partitioning rule; The query result is returned to the user.

[0091] It can be seen from the technical solution provided by the above embodiments of the present application that in the data query process, the embodiments of the present application obtain the data query request sent by the user and determine the query conditions input by the user; based on the query conditions and the query optimization configuration of the target database, generate the query results; the query results include the business data of at least one business object; the query optimization configuration of the target database includes one or more of the following: sub-table replacement query based on the sub-table key, filtering conditions based on the sub-table result, and filtering conditions based on the partition result; the sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing sub-table processing on the business data table containing the business data of multiple business objects and the attribute information of multiple business objects based on the preset splitting rules; the sub-table result includes multiple business data sub-tables; the partition result is obtained by partitioning the business data sub-table based on the preset partitioning rules; and the query result is returned to the user. It can be seen that through the embodiments of the present application, according to the query conditions input by the user and the query optimization configuration of the target database, the query results to be queried by the user are determined, making the data query more efficient, reducing the resource consumption during the query, and improving the data query efficiency and the flexibility of the query process.

[0092] The embodiment of the present application also provides a computer program product. When the computer program is executed by a processor, each process of the above-mentioned data storage method and data query method embodiments is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0093] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0094] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0095] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0097] In a typical configuration, an electronic device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0098] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0099] Computer readable media include 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.

[0100] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0101] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0102] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A data storage method, characterized in that: include: Acquire business data of multiple business objects and attribute information of the multiple business objects; Based on the business data and attribute information of each of the business objects, generating a business data table including the business data of the plurality of business objects and the attribute information of the plurality of business objects; According to the preset division rule, the business data table is divided into tables and partitioned to obtain a plurality of business data sub-tables and the partition results of the plurality of business data sub-tables; Based on the multiple business data sub-tables and the partitioning results of the multiple business data sub-tables, the business data is stored in a target database.

2. The method according to claim 1, characterized in that The generating, based on the business data and attribute information of each of the business objects, a business data table including the business data of the plurality of business objects and the attribute information of the plurality of business objects comprises: Based on the business unique identifier matching the business object, an array table containing attribute information of a plurality of the business objects is generated; wherein the attribute information of the plurality of the business objects matching the same business unique identifier is stored in the array table in the form of an array; Based on preset association conditions, the array table is transferred to the business list table to obtain the business data table containing the business data of multiple business objects and the attribute information of multiple business objects; the business list table contains the business data of multiple business objects.

3. The method according to claim 1, characterized in that Also includes: Triggering the target database to execute query optimization configuration; The query optimization configuration includes one or more of the following: configuring a shard table replacement query based on a shard table key; configuring a filtering condition based on a shard table result; configuring a filtering condition based on a partition result; The sub-table key is used to determine the business data sub-table to which the business data belongs.

4. A data query method, characterized in that: include: Obtaining a data query request sent by a user, and determining a query condition input by the user; Generate query results based on the query conditions and the query optimization configuration of the target database; The query result includes business data of at least one business object; The query optimization configuration of the target database includes one or more of the following: a shard table replacement query based on a shard table key, a filtering condition based on a shard table result, and a filtering condition based on a partition result; The sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing a sub-table processing on a business data table containing business data of a plurality of business objects and attribute information of a plurality of business objects based on a preset splitting rule; the sub-table result includes a plurality of the business data sub-tables; the partition result is obtained by performing a partition processing on the business data sub-table based on a preset partitioning rule; The query result is returned to the user.

5. The method according to claim 4, characterized in that The query optimization configuration based on the query condition and the target database generates a query result, including: Based on the query condition and the query optimization configuration of the target database, determine the sub-table key and partition key that match the query condition; the partition key is used to determine the partition to which the business data belongs in the business data sub-table; Based on the sub-table key and the partition key, determining the business data sub-table matching the sub-table key and the partition matching the partition key; The query result is generated based on the business data sub-table matching the sub-table key and the partition matching the partition key, and at least one business attribute of the business object input by the user.

6. The method according to claim 4, characterized in that Before generating the query result, the method further includes: Obtaining a comparison operator in the data query request sent by the user; According to a preset conversion rule, the comparison operator is converted into a target query condition matching the target database; The target query condition is used to generate a query result that matches the data query request.

7. A data storage device, characterized in that: include: An acquisition module, used to acquire business data of multiple business objects and attribute information of the multiple business objects; A generating module, configured to generate a business data table containing a plurality of the business data based on the business data and attribute information of each of the business objects and a business unique identifier matching each of the business objects; A partitioning module, used to perform table and partition processing on the business data table according to a preset partitioning rule, to obtain a plurality of business data sub-tables and partition results of the plurality of business data sub-tables; The storage module is used to store the business data in a target database based on the multiple business data sub-tables and the partitioning results of the multiple business data sub-tables.

8. A data query device, characterized in that: include: A determination module, used to obtain a data query request sent by a user and determine a query condition input by the user; A generation module, used to generate query results based on the query conditions and the query optimization configuration of the target database; The query result includes business data of at least one business object; The query optimization configuration of the target database includes one or more of the following: a shard table replacement query based on a shard table key, a filtering condition based on a shard table result, and a filtering condition based on a partition result; The sub-table key is used to determine the business data sub-table to which the business data belongs; the business data sub-table is obtained by performing a sub-table process on a business data table containing business data of a plurality of business objects and attribute information of a plurality of business objects based on a preset splitting rule; the partition result is obtained by performing a partition process on the business data sub-table based on a preset partitioning rule; The returning module is used to return the query result to the user.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other through the bus; the memory is used to store computer programs; the processor is used to execute the programs stored in the memory to implement the steps of the data storage method according to any one of claims 1 to 3 and the data query method according to any one of claims 4 to 6.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data storage method according to any one of claims 1 to 3 and the data query method according to any one of claims 4 to 6 are implemented.

Citation Information

Patent Citations

  • Insurance policy data processing method and apparatus

    CN106980636A

  • Business data storage method and device, equipment and storage medium

    CN117216056A

  • Query statement determination method and device, equipment, medium and product

    CN117520368A

  • Data processing method and device based on real-time data warehouse, equipment and medium

    CN118170765A