Data relationship identification method and device, storage medium and electronic device

By generating a relationship mapping table between policyholder and insured identifiers, and utilizing the PCM algorithm and recursive methods, the problems of misjudgment and low efficiency in family insurance policy identification are solved, achieving efficient and accurate family insurance policy identification.

CN112232970BActive Publication Date: 2025-11-07MICRO INSURANCE AGENCY LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010921982.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-04
Publication Date
2025-11-07
Estimated Expiration
2040-09-04

AI Technical Summary

Technical Problem

Existing technologies suffer from misjudgment and low efficiency when identifying family insurance policies, especially when dealing with large amounts of data, making it difficult to effectively identify insurance policy data for the same family.

Method used

By generating a mapping table between policyholder identifiers and insured identifiers, and generating a starting family identifier based on the mapping table, the PCM algorithm and recursive method are used to accurately identify policy data of the same family.

Benefits of technology

It improves recognition efficiency and accuracy, is compatible with mainstream data query tools such as Hive, and avoids data omissions and misjudgments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112232970B_ABST
    Figure CN112232970B_ABST
Patent Text Reader

Abstract

The application discloses a data relationship identification method and device, a storage medium and an electronic device, and belongs to the big data field. The method comprises the following steps: obtaining insurance policy data, wherein the insurance policy data comprises a plurality of insurance policy records, each insurance policy record comprises an insured person identifier, an insured person identifier and an insurance time; generating a relationship mapping table of the insured person identifier and the insured person identifier according to the insurance policy data; generating a starting family identifier according to the relationship mapping table; querying the relationship mapping table according to the starting family identifier, and outputting a target mapping table, wherein the target mapping table comprises a family identifier, an insured person identifier or an insured person identifier. The application solves the technical problem of low efficiency of related art family insurance policy identification, has strong adaptation capability, can be applied to mainstream data query tools such as hive, and has high identification efficiency and high identification accuracy, thereby avoiding data omission and misjudgment.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of big data, and in particular to a data relationship identification method and device, a storage medium, and an electronic device. BACKGROUND

[0002] In the related art family insurance policy, the policyholder and the insured are considered to be the same family. The policyholder may also be the insured. All policies in the family are called family insurance policies. The policyholder is a person who enters into an insurance contract with an insurer and is obligated to pay premiums according to the insurance contract. The insured is also known as the policyholder. The insured is an important person in the insurance contract. The insured is a legal person or a natural person who is protected by the insurance contract and has the right to claim insurance benefits. The policy data including the family insurance policy is a very large amount of data. How to identify which policy data belongs to the same family insurance policy in the massive data is a technical problem to be solved.

[0003] In the related art, all policies under the policyholder are directly used as family insurance policies when identifying family insurance policies. The steps are as follows: removing duplicate values for all policyholders and insured persons. Grouping all policyholders. The policy of the aggregation result is the family insurance policy of the policyholder. Alternatively, all policies are traversed row by row. The steps are as follows: read the first data. The policyholder and the insured are judged to be the same family, and a family id is assigned. Read the second data. Judge whether the policyholder and the insured of the policy exist in the existing family. If so, join the family. If not, create a new family id. Repeat the above steps until all data is traversed.

[0004] The first scheme in the related art has the following disadvantages in practice: there is a missing situation. If A is insured by B and C is insured by B, then according to the algorithm, A and B will belong to the same family, and C will belong to another family, but in fact A, B, and C belong to the same family. There is a misjudgment situation. If A is insured by B and B is insured by C, then according to the algorithm, A and B will belong to the same family, and B and C will belong to another family. B exists in two families at the same time, which is a misjudgment. The second scheme in the related art has the following disadvantages in practice: low efficiency. This method can be used when the data volume is small, but when the data volume is large (tens of millions), the time consumption of this method is huge, and it cannot be used in practical applications. This method cannot adapt to query tools. This method uses a row-by-row recursive method, which cannot achieve this function for big data query tools (Hive).

[0005] In view of the above problems in the related art, no effective solution has been found so far. SUMMARY

[0006] To solve the above technical problems or at least partially solve the above technical problems, the application provides a data relationship identification method and device, a storage medium and an electronic device.

[0007] According to an aspect of an embodiment of the application, a data relationship identification method is provided, comprising: obtaining insurance policy data, wherein the insurance policy data comprises a plurality of insurance policy records, each insurance policy record comprising: an insured person identifier, an insured person identifier, and an insurance time; generating a relationship mapping table of the insured person identifier and the insured person identifier according to the insurance policy data; generating a starting family identifier according to the relationship mapping table; querying the relationship mapping table according to the starting family identifier, and outputting a target mapping table, wherein the target mapping table comprises: a family identifier, an insured person identifier, or an insured person identifier.

[0008] According to another aspect of an embodiment of the application, a data relationship identification device is also provided, comprising: an obtaining module for obtaining insurance policy data, wherein the insurance policy data comprises a plurality of insurance policy records, each insurance policy record comprising: an insured person identifier, an insured person identifier, and an insurance time; a first generating module for generating a relationship mapping table of the insured person identifier and the insured person identifier according to the insurance policy data; a second generating module for generating a starting family identifier according to the relationship mapping table; and an output module for querying the relationship mapping table according to the starting family identifier, and outputting a target mapping table, wherein the target mapping table comprises: a family identifier, an insured person identifier, or an insured person identifier.

[0009] Further, the second generating module comprises: an obtaining unit for obtaining a first earliest insurance time of an insurance policy record in the relationship mapping table with the insured person identifier as the primary key, and obtaining a second earliest insurance time of an insurance policy record with the insured person identifier as the primary key; a comparison unit for comparing the first earliest insurance time and the second earliest insurance time; a determination unit for determining the insured person identifier as the starting family identifier if the first earliest insurance time is greater than the second earliest insurance time; determining the insured person identifier as the starting family identifier if the second earliest insurance time is greater than the first earliest insurance time; and generating the starting family identifier according to the insured person identifier and the insured person identifier if the first earliest insurance time is equal to the second earliest insurance time.

[0010] Further, the determining unit comprises a comparing sub-unit, configured to compare the first string and the second string in characters from the first character to the last character, wherein the first string is the insured person identifier, the second string is the insured person identifier, and the first string has the same length as the second string; and a determining sub-unit, configured to determine the first string as the starting family identifier if the first string is greater than the second string, and determine the second string as the starting family identifier if the second string is greater than the first string.

[0011] Further, the first generating module comprises a generating unit, configured to retrieve, from the policy data, a policy record with the earliest insurance time by taking the insured person identifier and the insured person identifier as a first primary key, to generate a first mapping table; retrieve, from the policy data, an insured person identifier by taking the insured person identifier as a primary key, to generate a second mapping table; retrieve, from the policy data, an insured person identifier by taking the insured person identifier as a primary key, to generate a third mapping table; a splicing unit, configured to splice the second mapping table and the third mapping table to obtain a fourth mapping table; and a determining unit, configured to determine the first mapping table and the fourth mapping table as the relationship mapping table.

[0012] Further, the output module comprises a first generating unit, configured to add the starting family identifier in the relationship mapping table to generate a starting iteration table, wherein the starting iteration table comprises a primary key, an association key, and a first family key corresponding to the starting family identifier, and the primary key and the association key correspond to the insured person identifier and the insured person identifier respectively, or the primary key and the association key correspond to the insured person identifier and the insured person identifier respectively; a second generating unit, configured to find a specified association key of the primary key and a specified primary key of the association key in the starting iteration table, and generate a second iteration table according to the specified association key, the specified primary key, and the first family key, wherein the second iteration table comprises a primary key, an association key, and a second family key; and a matching unit, configured to set a mapping relationship between each primary key and its second family key as a mapping object after deduplicating the primary key in the second iteration table, and recursively match the mapping object using the relationship mapping table until the family key of the primary key and the family key of the association key are consistent, and output the target mapping table.

[0013] Further, the second generating unit comprises: a first comparing sub-unit, configured to compare the specified association key and the specified primary key to obtain a first maximum value, wherein the maximum value is the specified association key or the specified primary key; a second comparing sub-unit, configured to compare the first maximum value with the one-time family key to obtain a second maximum value, the second maximum value being one of the specified association key, the specified primary key and the one-time family key; and a replacing sub-unit, configured to determine the second maximum value as the two-time family key, and replace the one-time family key in the starting iteration table with the two-time family key to obtain the two-time iteration table.

[0014] Further, the matching unit comprises: a matching sub-unit, configured to match an Nth mapping object using the relation mapping table in N recursion periods to obtain a family identification of a primary key and a family identification of an association key, wherein N is greater than or equal to 1; and a processing sub-unit, configured to compare the family identification of the primary key and the family identification of the association key, and replace a family key in the Nth mapping object with a maximum value, and continue to match an N+1th mapping object using the relation mapping table to obtain a family identification of a primary key and a family identification of an association key, until the family key of the primary key and the family key of the association key in the current recursion period are consistent, and output the target mapping table.

[0015] According to another aspect of the embodiments of the present application, a storage medium is also provided, which comprises a stored program. The program performs the steps described above when running.

[0016] According to another aspect of the embodiments of the present application, an electronic device is also provided, which comprises a processor, a communication interface, a memory and a communication bus. The processor, the communication interface and the memory complete mutual communication through the communication bus. The memory is used to store a computer program, and the processor is used to execute the steps in the above method by running the program stored in the memory.

[0017] According to an aspect of the present application, a computer program product or a computer program is provided, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device execute the steps in any of the embodiments of the above data relation identification method.

[0018] Compared with the prior art, the above technical solution provided by the embodiments of the present application has the following advantages:

[0019] In the embodiment of the present application, by generating the relationship mapping table of the insured person identifier and the insured person identifier, and generating the starting family identifier based on the relationship mapping table, the policy data of the same family can be accurately identified without line-by-line recursion on all policy data, thereby solving the technical problem of low efficiency of identifying family policies in the related art, and being suitable for mainstream data query tools such as hive, having high identification efficiency and high identification accuracy, avoiding data omission and misjudgment. BRIEF DESCRIPTION OF DRAWINGS

[0020] The accompanying drawings incorporated in and forming a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the application.

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative labor.

[0022] Figure 1 is a flowchart of a data relationship identification method according to an embodiment of the present application;

[0023] Figure 2 is an implementation flowchart of an embodiment of the present application;

[0024] Figure 3 is a structural block diagram of a data relationship identification device according to an embodiment of the present application;

[0025] Figure 4 is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. The illustrative embodiments of the present application and their descriptions serve to explain the present application, and do not constitute an improper limitation on the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0027] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another similar entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0028] This embodiment provides a method for identifying data relationships. Figure 1 This is a flowchart of a data relationship identification method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:

[0029] Step S102: Obtain policy data, which includes multiple policy records. Each policy record includes: policyholder identifier, insured identifier, and application time.

[0030] In this embodiment, the policyholder identifier is character data generated based on the policyholder information (such as name, ID number, account number, etc.), and the insured identifier is character data generated based on the insured information (such as name, ID number, account number, etc.). In some examples, the policy record also includes a policy number, which is used to uniquely identify the policy record.

[0031] Step S104: Generate a mapping table of the relationship between the policyholder identifier and the insured identifier based on the policy data;

[0032] The relationship mapping table in this embodiment is used to represent the relationship between the policyholder and the insured. It can be generated by using the policyholder as the primary key and the insured as the associated key, or by using the insured as the primary key and the policyholder as the associated key.

[0033] Step S106: Generate the starting family identifier based on the relationship mapping table;

[0034] Optionally, in this embodiment, the family identifier is used to identify all members in a family policy on a family-by-family basis. As the iteration cycle changes, the family identifier will also change until all policyholder identifiers and insured identifiers in a family correspond to the same family identifier.

[0035] Step S108, querying the relationship mapping table according to the starting family identifier, and outputting a target mapping table, wherein the target mapping table includes a family identifier, an insured identifier or an insured identifier.

[0036] In the target mapping table, the insured identifiers or the insured identifiers corresponding to the family members in the same family correspond to the same family identifier, and when searching in the target mapping table, the family identifier can be used as the primary key to search for all family members.

[0037] Through the above steps, the policy data is obtained, then the relationship mapping table of the insured identifier and the insured identifier is generated according to the policy data, the starting family identifier is generated according to the relationship mapping table, and finally the target mapping table including the family identifier and the insured identifier or the insured identifier field is output by querying the relationship mapping table according to the starting family identifier. Through the generation of the relationship mapping table of the insured identifier and the insured identifier, and the generation of the starting family identifier based on the relationship mapping table, the policy data of the same family can be accurately identified without recursive line-by-line of all policy data, thereby solving the technical problem of low efficiency of identifying family policies in related technologies, and having strong adaptation capability, which can be applied in mainstream data query tools such as hive, and has high identification efficiency and high identification accuracy, avoiding data omission and misjudgment.

[0038] In the embodiment, the policy data including the insured-insured relationship table is input, and the primary key-family key final mapping table is output. In an example, the fields of the policy record include: policy number (primary key, unique value), insured encrypted id: md5 value (which can be encrypted based on the insured ID card + name + ciphertext), insured encrypted id: md5 value (which can be encrypted based on the insured ID card + name + ciphertext), and insurance date. The fields of the target mapping table include: insured or insured encrypted id (primary key, unique value), and family id.

[0039] The primary key of the embodiment is one or more fields (in the embodiment, it refers to the insured identifier, the insured identifier, and the family identifier) in the table, and its value is used to uniquely identify a record in the table. When searching or searching for a record in the table, the primary key can be used to uniquely match.

[0040] In an embodiment of the embodiment, generating the relationship mapping table of the insured identifier and the insured identifier according to the policy data includes: searching for the earliest insurance time policy record in the policy data with the insured identifier and the insured identifier as the first primary key, generating a first mapping table; searching for the insured identifier in the policy data with the insured identifier, generating a second mapping table, searching for the insured identifier in the policy data with the insured identifier, generating a third mapping table; splicing the second mapping table and the third mapping table to obtain a fourth mapping table; and determining the first mapping table and the fourth mapping table as the relationship mapping table.

[0041] In actual scenarios, due to the passage of time, the original family relationship may be dissolved, such as divorce, death, and the like, and therefore, by using the earliest time to retrieve, an accurate relationship mapping table can be generated. Of course, the policy data can also be retrieved with the policyholder identifier and the insured identifier as the first primary key to obtain the policy record with the latest policy time, to generate the first mapping table, and the policy record in the original policy can also be deduplicated so that the policy record of the same policyholder and the same insured is only retained in one, to reduce the redundancy of data and reduce the processing amount of data.

[0042] In this embodiment, by retrieving the policy data including the policyholder-insured relationship table, the record satisfying the simultaneous presence of the policyholder id and the insured id is determined as the hit record, the records are sorted according to time, the record with the earliest purchase date is retained, and the table is generated as shown in Table 1. Table 1 includes the following fields: policyholder id, insured id, and purchase date.

[0043] In this embodiment, six policy records are taken as an example for illustration, and the order of the fields of the policy number, the policyholder, the insured, and the policy time is 1AB1, 2BD2, 3DA3, 4DA4, 5EF2, and 6FE3, respectively.

[0044] Table 1

[0045] Insurer Insured Date of insurance A B 1 B D 2 D A 3 E F 2 F E 3

[0046] Since the policyholder and the insured relationship is completely symmetrical, the policyholder can be used as the primary key and the insured can be used as the associated key to form a new table (the second mapping table). The insured can be used as the primary key and the policyholder can be used as the associated key to form a new table (the third mapping table), and then the new tables are connected. The new table is shown in Table 2. Table 2 includes the following fields: primary key (key_id) and associated key (relation_id).

[0047] Table 2

[0048] Primary key Foreign key A B B D D A E F F E B A D B A D

[0049] Based on each primary key in Table 2, the first purchase date (or the latest purchase date, which is taken as an example here) of the primary key is determined through the association of Table 1. The first purchase date of each primary key in Table 2 is obtained, as shown in Table 3. Table 3 includes the following fields: primary key and earliest entry date.

[0050] Table 3

[0051] Primary key Time A 1 B 1 D 2 E 2 F 2

[0052] In one embodiment of this embodiment, generating the starting family identifier according to the relationship mapping table includes:

[0053] S11, obtaining a first earliest insurance time of a policy record with the policyholder identifier as a primary key in a relationship mapping table, and obtaining a second earliest insurance time of the policy record with the insured identifier as a primary key;

[0054] S12, comparing the first earliest insurance time and the second earliest insurance time;

[0055] S13, if the first earliest insurance time is greater than the second earliest insurance time, determining the policyholder identifier as a starting family identifier; if the second earliest insurance time is greater than the first earliest insurance time, determining the insured identifier as the starting family identifier; if the first earliest insurance time is equal to the second earliest insurance time, generating the starting family identifier according to the policyholder identifier and the insured identifier.

[0056] Optionally, the generating the starting family identifier according to the policyholder identifier and the insured identifier comprises: comparing sizes of a first string and a second string from a first character to a last character, wherein the policyholder identifier is the first string, the insured identifier is the second string, and lengths of the first string and the second string are the same; if the first string is greater than the second string, determining the first string as the starting family identifier; if the second string is greater than the first string, determining the second string as the starting family identifier.

[0057] In the embodiment, the first string is a key (policyholder encrypted id) generated after MD5 encryption based on policyholder identity information (such as an ID number + name + ciphertext), and the second string is a key (insured encrypted id) generated after MD5 encryption based on insured identity information (such as an ID number + name + ciphertext). Since the same encryption algorithm is used, lengths of the generated keys are the same.

[0058] Based on Table 2 and Table 3, the PCM (people compare method) algorithm is used to calculate the primary key and the associated key, and the larger one is defined as the starting family identifier, which is the primary key and the associated key in Table 4 as a family key (family_id1). It is explained here that comparing two people A and B, A and B here refer to the primary key and the associated key. The comparison rule is as follows: 1. If the first_time (the earliest insurance time) of A is greater than the first_time of B, A is greater than B, and the key of A is determined as the starting family identifier, and the starting family identifier is used as the family key in the subsequent iteration process. If the first_time of the two is consistent, compare the key, if the key of A is greater than the key of B, A is greater than B. In this embodiment, the first_time format is timestamp data, which is a number (such as 20200101), and can be compared in size. The key is the policyholder identifier or the insured identifier encrypted by MD5, which does not repeat, and the repetition means the same person; when comparing the key, it is not necessary to decrypt, but to compare directly through the encrypted string. Since the MD5 encrypted string only has numbers, uppercase English letters, and lowercase English letters, the comparison process includes the following: first, compare the first character, numbers are greater than uppercase English letters, and uppercase English letters are greater than lowercase English letters; if they are numbers, compare 9>8>7……>0; if they are uppercase English letters, compare A>B>C……>; and if they are lowercase English letters, the same, if the first character is the same, compare the second character, and so on. The PCM algorithm used in the subsequent scheme is similar.

[0059] In this embodiment, the starting iteration table (the first iteration table) includes the starting family identifier, as shown in Table 4, the fields of Table 4 include: 1. The primary key (key_id); 2. The associated key (relation_id); 3. The family key (family_id1) corresponding to the starting family identifier.

[0060] Table 4

[0061] Primary key Foreign key Primary key A B A B D B D A A E F E F E E B A A D B B A D A

[0062] In one embodiment of the embodiment, the target mapping table is output according to the starting family identifier querying the relationship mapping table, including: adding the starting family identifier in the relationship mapping table to generate a starting iteration table, wherein the starting iteration table includes: a primary key, an association key, and a first family key corresponding to the starting family identifier, or the primary key and the association key correspond to the insured identifier and the insured identifier, or the primary key and the association key correspond to the insured identifier and the insured identifier; finding the specified association key of the primary key and the specified primary key of the association key in the starting iteration table, generating a second iteration table according to the specified association key, the specified primary key, and the first family key, wherein the second iteration table includes: a primary key, an association key, and a second family key; setting the mapping relationship between each primary key and its second family key as a mapping object after deduplicating the primary key in the second iteration table; and recursively matching the mapping object using the relationship mapping table until the family key of the primary key and the family key of the association key are consistent, and outputting the target mapping table.

[0063] Optionally, the search condition can be set by time. When the association key of the primary key includes multiple, the earliest and the latest insurance time can be selected as the specified association key. Similarly, the earliest and the latest primary key can be selected as the specified primary key of the association key.

[0064] In the above embodiment, based on Table 4, the earliest purchase date association key (family_id2_key) in Table 4 is found by the primary key, and at the same time, the earliest purchase date primary key (family_id2_relation) in Table 4 is found by the association key, and then the PCM algorithm is used for the three ids (family_id1, family_id2_key, family_id2_relation), and the larger one is defined as the second family key (family_id2) of the primary key and the association key.

[0065] The specific process includes: based on Table 4, the primary key is grouped to find the association key of the earliest purchase date under the same primary key, which is defined as family_id2_key, and the association key is grouped to find the primary key of the earliest purchase date under the same association key, which is defined as family_id2_relation. Then, family_id1_key and family_id2_key are compared using the PCM algorithm, and the larger one is defined as winner1; winner1 is compared with family_id2_relation using the PCM method, and the larger one is defined as family_id2.

[0066] In the embodiment, the fields of Table 5 (second iteration table) include: a primary key; an association key; and a second family key (family_id2).

[0067] Table 5

[0068] Foreign key Primary key Foreign key A B A B D A D A A E F E F E E B A A D B A A D A

[0069] Based on the above embodiments of the present embodiment, the secondary iteration table is generated according to the specified association key, the specified primary key, and the primary family key, including: comparing the specified association key and the specified primary key to obtain a first maximum value, wherein the maximum value is the specified association key or the specified primary key; comparing the first maximum value with the primary family key to obtain a second maximum value, the second maximum value being one of the specified association key, the specified primary key, and the primary family key; and determining the second maximum value as the secondary family key, and replacing the primary family key in the starting iteration table with the secondary family key to obtain the secondary iteration table.

[0070] Based on the above embodiments of the present embodiment, the recursive matching of the mapping object is performed using the relationship mapping table until the family key of the primary key and the family key of the association key are consistent, and the target mapping table is output, including: in N recursive cycles, the Nth mapping object is matched using the relationship mapping table to obtain the family identification of the primary key and the family identification of the association key, wherein N is greater than or equal to 1; comparing the family identification of the primary key and the family identification of the association key, and replacing the family key in the Nth mapping object with the maximum value, and continuing to match the N+1th mapping object using the relationship mapping table to obtain the family identification of the primary key and the family identification of the association key, until the family key of the primary key and the family key of the association key in the current recursive cycle are consistent, and the target mapping table is output.

[0071] In the present embodiment, the recursive logic is first defined: the mapping relationship between each unique key_id (primary key) and family_id (family key). In the mapping object of the first recursive cycle, denoted as r0, as shown in Table 6.

[0072] Table 6

[0073] Primary key Foreign key A A B A D A E E F E

[0074] Then the relationship mapping table (Table 2) is used to match r0 to obtain the key_famlily_id (family key of the primary key) of the key_id and the relation_family_id (family key of the association key) of the relation_id. Then the two ids are compared, and if they are inconsistent, the larger one is the new family_id of the key_id and the relation_id through the PCM method. The new key_id, family_id mapping table is obtained, denoted as the mapping object of the second recursive cycle, r1, and the mapping table output by the first recursion is shown in Table 7.

[0075] Table 7

[0076] Primary key Foreign key Primary key Foreign key A B A A B D A A D A A A E F E E F E E E B A A A D B A A A D A A

[0077] The above steps are repeated by taking r1 as the mapping object of the second recursive cycle until the key_famlily_id and the relation_family_id are consistent. In this example, table 6 is defined as r0, the recursive flow is entered, table 7 is obtained, it is known that the family key of the primary key and the family key of the associated key are the same, the target mapping table-table 8 is output, and table 8 is the final mapping table of the primary key-family key. The fields of the target mapping table include: the primary key (key_id); and the family key (family_id), as shown in table 8. Optionally, the primary key in the target mapping table can be further deduplicated.

[0078] Table 8

[0079] Family key of primary keys of R0 Family key of foreign keys of R0 A A B A D A E E F E B A D A A A

[0080] Primary key The identification flowchart of the embodiment of the present application is as shown in FIG. 1, the flowchart includes: first inputting the insured-person relationship table or the policy data, then generating the attribute table of the primary key-associated key and the table of the primary key-earliest entering platform time (earliest insurance time), that is, the relationship mapping table, performing the first iteration by using the generated family key, generating the first iteration table, performing the second iteration, generating the second iteration table, and finally entering the recursive flow until the final target mapping table is output. The identification scheme of the family policy is proposed, the corresponding family can be identified for each insured person by using the data warehouse tool such as hive, and a family id is assigned, the insured person and the insured person are taken as the primary key, the PCM and the recursive method are used, and the multiple personal insurance policy data is accurately identified as the same family. Family key

[0081] The scheme of the embodiment uses the PCM method to define the relationship between the primary key and the associated key, uses the maximum in the PCM method to define the family key (family_id), uses the recursive method to avoid missing calculation and wrong judgment, can be implemented in the database tool such as hive, is high in efficiency (tens of millions of data are completed within 10 minutes), and does not have the problems of missing and wrong judgment.

[0082] Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be realized by means of software and a necessary general hardware platform, and of course can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disc), and includes a plurality of instructions for causing a terminal device (which can be a mobile phone, a computer, a server, or a network device) to execute the method described in each embodiment of the present application. ​

[0083] There is also provided in the embodiments a data relationship identifying apparatus for implementing the above embodiments and preferred embodiments, which has been described and will not be repeated. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.

[0084] Figure 2 is a structural block diagram of a data relationship identifying apparatus according to an embodiment of the present application, as shown in Figure 2 the apparatus comprises an acquisition module 30, a first generation module 32, a second generation module 34, and an output module 36, wherein

[0085] The acquisition module 30 is configured to acquire policy data, wherein the policy data comprises a plurality of policy records, and each policy record comprises an applicant identifier, a beneficiary identifier, and an application time.

[0086] The first generation module 32 is configured to generate a relationship mapping table of the applicant identifier and the beneficiary identifier according to the policy data.

[0087] The second generation module 34 is configured to generate a starting family identifier according to the relationship mapping table.

[0088] The output module 36 is configured to query the relationship mapping table according to the starting family identifier, and output a target mapping table, wherein the target mapping table comprises a family identifier, an applicant identifier, or a beneficiary identifier.

[0089] Optionally, the second generation module comprises an acquisition unit configured to acquire, in the relationship mapping table, a first earliest application time of a policy record with the applicant identifier as a primary key, and a second earliest application time of a policy record with the beneficiary identifier as a primary key; a comparison unit configured to compare the first earliest application time and the second earliest application time; and a determination unit configured to determine the applicant identifier as the starting family identifier if the first earliest application time is greater than the second earliest application time, determine the beneficiary identifier as the starting family identifier if the second earliest application time is greater than the first earliest application time, and generate the starting family identifier according to the applicant identifier and the beneficiary identifier if the first earliest application time is equal to the second earliest application time.

[0090] Further, the determining unit comprises a comparing sub-unit, configured to compare the first string and the second string from the first character, until the last character, wherein the first string is the insured person identifier, the second string is the insured person identifier, and the first string has the same length as the second string; a determining sub-unit, configured to determine the first string as the starting family identifier if the first string is greater than the second string, and determine the second string as the starting family identifier if the second string is greater than the first string.

[0091] Optionally, the first generating module comprises a generating unit, configured to retrieve, from the policy data, a policy record with the earliest insurance time, by taking the insured person identifier and the insured person identifier as a first primary key, to generate a first mapping table; retrieve, from the policy data, an insured person identifier by taking the insured person identifier as a primary key, to generate a second mapping table; retrieve, from the policy data, an insured person identifier by taking the insured person identifier as a primary key, to generate a third mapping table; a splicing unit, configured to splice the second mapping table and the third mapping table to obtain a fourth mapping table; and a determining unit, configured to determine the first mapping table and the fourth mapping table as the relationship mapping table.

[0092] Optionally, the output module comprises a first generating unit, configured to add the starting family identifier in the relationship mapping table to generate a starting iteration table, wherein the starting iteration table comprises a primary key, an association key, and a first family key corresponding to the starting family identifier, and the primary key and the association key correspond to the insured person identifier and the insured person identifier respectively, or the primary key and the association key correspond to the insured person identifier and the insured person identifier respectively; a second generating unit, configured to find a specified association key of the primary key and a specified primary key of the association key in the starting iteration table, and generate a second iteration table according to the specified association key, the specified primary key, and the first family key, wherein the second iteration table comprises a primary key, an association key, and a second family key; and a matching unit, configured to set a mapping relationship between each primary key and its second family key as a mapping object after deduplicating the primary key in the second iteration table, and recursively match the mapping object by using the relationship mapping table until the family key of the primary key and the family key of the association key are consistent, and output the target mapping table.

[0093] Optionally, the second generation unit includes: a first comparison subunit, configured to compare the specified association key and the specified primary key to obtain a first maximum value, wherein the maximum value is the specified association key or the specified primary key; a second comparison subunit, configured to compare the first maximum value with the primary family key to obtain a second maximum value, wherein the second maximum value is one of the following: the specified association key, the specified primary key, or the primary family key; and a replacement subunit, configured to determine the second maximum value as the secondary family key, and use the secondary family key to replace the primary family key in the initial iteration table to obtain the secondary iteration table.

[0094] Optionally, the matching unit includes: a matching subunit, used to match the Nth mapping object using the relation mapping table in N recursive cycles to obtain the family identifier of the primary key and the family identifier of the associated key, wherein N is greater than or equal to 1; and a processing subunit, used to compare the family identifier of the primary key and the family identifier of the associated key, and replace the family key in the Nth mapping object with the maximum value, continue to match the (N+1)th mapping object using the relation mapping table to obtain the family identifier of the primary key and the family identifier of the associated key, until the family key of the primary key and the family key of the associated key are consistent in the current recursive cycle, and output the target mapping table.

[0095] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0096] This application also provides an electronic device. Figure 3 This is a structural diagram of an electronic device according to an embodiment of the present invention, such as... Figure 3 Figure 4 Figure 4 As shown, it includes a processor 41, a communication interface 42, a memory 43, and a communication bus 44, wherein the processor 41, the communication interface 42, and the memory 43 communicate with each other through the communication bus 44.

[0097] Memory 43 is used to store computer programs;

[0098] When processor 41 executes the program stored in memory 43, it performs the following steps:

[0099] Obtaining policy data, wherein the policy data comprises a plurality of policy records, each policy record comprising: an applicant identifier, an insured person identifier, and an application time; generating a relationship mapping table of the applicant identifier and the insured person identifier according to the policy data; generating a starting family identifier according to the relationship mapping table; querying the relationship mapping table according to the starting family identifier, and outputting a target mapping table, wherein the target mapping table comprises: a family identifier, an applicant identifier, or an insured person identifier.

[0100] Further, generating a starting family identifier according to the relationship mapping table comprises: obtaining a first earliest application time of a policy record with the applicant identifier as a primary key in the relationship mapping table, and obtaining a second earliest application time of a policy record with the insured person identifier as a primary key; comparing the first earliest application time and the second earliest application time; if the first earliest application time is greater than the second earliest application time, determining the applicant identifier as the starting family identifier; if the second earliest application time is greater than the first earliest application time, determining the insured person identifier as the starting family identifier; and if the first earliest application time is equal to the second earliest application time, generating the starting family identifier according to the applicant identifier and the insured person identifier.

[0101] Further, generating the starting family identifier according to the applicant identifier and the insured person identifier comprises: comparing the size of a first string and a second string from the first character to the last character, wherein the applicant identifier is the first string, the insured person identifier is the second string, and the first string and the second string have the same length; if the first string is greater than the second string, determining the first string as the starting family identifier; if the second string is greater than the first string, determining the second string as the starting family identifier.

[0102] Further, generating a relationship mapping table of the applicant identifier and the insured person identifier according to the policy data comprises: retrieving a policy record with the earliest application time in the policy data with the applicant identifier and the insured person identifier as a first primary key, and generating a first mapping table; retrieving an insured person identifier in the policy data with the applicant identifier, generating a second mapping table, retrieving an applicant identifier in the policy data with the insured person identifier, and generating a third mapping table; splicing the second mapping table and the third mapping table to obtain a fourth mapping table; and determining the first mapping table and the fourth mapping table as the relationship mapping table.

[0103] Further, the target mapping table is outputted by querying the relationship mapping table according to the starting family identifier, including: adding the starting family identifier in the relationship mapping table to generate a starting iteration table, wherein the starting iteration table includes a primary key, an association key, and a first family key corresponding to the starting family identifier, and the primary key and the association key correspond to an insured person identifier and an insured identifier, respectively, or the primary key and the association key correspond to an insured identifier and an insured person identifier, respectively; searching for a specified association key of the primary key and a specified primary key of the association key in the starting iteration table, and generating a second iteration table according to the specified association key, the specified primary key, and the first family key, wherein the second iteration table includes a primary key, an association key, and a second family key; setting a mapping relationship between each primary key and the second family key thereof in the second iteration table as a mapping object, and recursively matching the mapping object by using the relationship mapping table until the family keys of the primary key and the association key are consistent, and outputting the target mapping table.

[0104] Further, the second iteration table is generated according to the specified association key, the specified primary key, and the first family key, including: comparing the specified association key and the specified primary key to obtain a first maximum value, wherein the maximum value is the specified association key or the specified primary key; comparing the first maximum value with the first family key to obtain a second maximum value, and the second maximum value is one of the specified association key, the specified primary key, and the first family key; and determining the second maximum value as the second family key, and replacing the first family key in the starting iteration table with the second family key to obtain the second iteration table.

[0105] Further, the target mapping table is outputted by recursively matching the mapping object by using the relationship mapping table until the family keys of the primary key and the association key are consistent, including: in N recursion cycles, the relationship mapping table is used to match an Nth mapping object to obtain a family identifier of a primary key and a family identifier of an association key, wherein N is greater than or equal to 1; the family identifier of the primary key and the family identifier of the association key are compared, and a maximum value is used to replace a family key in the Nth mapping object, and the relationship mapping table is used to continue to match an N+1th mapping object to obtain a family identifier of a primary key and a family identifier of an association key, until the family keys of the primary key and the association key in the current recursion cycle are consistent, and the target mapping table is outputted.

[0106] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.

[0107] The communication interface is used for communication between the terminal and other devices.

[0108] The memory can include a Random Access Memory (RAM) and can also include a non-volatile memory such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the processor.

[0109] The processor mentioned above can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc. It can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.

[0110] In another embodiment provided in the present application, a computer readable storage medium is also provided, and the computer readable storage medium stores instructions, when the instructions run on a computer, the computer executes the data relationship identification method in any of the above embodiments.

[0111] In another embodiment provided in the present application, a computer program product containing instructions is also provided, when the instructions run on a computer, the computer executes the data relationship identification method in any of the above embodiments.

[0112] In the embodiments described above, all or some of the steps can be implemented by hardware, software, firmware or any combination thereof. When implemented in software, all or some of the steps can be stored in or performed as one or more instructions on a computer-readable medium. The computer-readable medium can be a storage medium or a medium that includes a signal. However, the computer-readable medium does not include a signal per se. The computer-readable medium can be any available medium or a combination of multiple media that is accessible by a computer. For example, the computer-readable medium can include one or more of the following: a magnetic disk, a CD-ROM, a DVD, a Blu-ray disk, a magnetic tape, a semiconductor memory (e.g., a RAM, a ROM, etc.), a hard disk, a floppy disk, an optical disk, a magneto-optical disk, a portable computer disk drive, a RAM, a ROM, a flash memory, a portable computer-readable medium, a memory card, a disk, etc.

[0113] The specific embodiments described herein are illustrative and not intended to be limiting. Other embodiments will readily occur to those skilled in the art. Modifications may be made to such embodiments without departing from the spirit and scope of the application. Accordingly, it will be appreciated that the present application will not be limited to the embodiments shown in the drawings and described above exactly and that within the scope of the appended claims the application can be practiced otherwise than is specifically described herein.

[0114] The above description is intended to be illustrative and not restrictive. Many other embodiments will be apparent to those of skill in the art upon reviewing the above description. The scope of the application should, therefore, be determined not with reference to the above description, but instead with reference to the appended claims, along with their full scope of equivalents.

Claims

1. A method of identifying a data relationship, characterized by, The method comprises the following steps: acquiring policy data, wherein the policy data comprises a plurality of policy records, each policy record comprising an applicant identifier, a policyholder identifier, and an application time; generating a relationship mapping table of the applicant identifier and the policyholder identifier according to the policy data; generating a starting family identifier according to the relationship mapping table; querying the relationship mapping table according to the starting family identifier to output a target mapping table, wherein the target mapping table comprises a family identifier, an applicant identifier, or a policyholder identifier; wherein generating the relationship mapping table of the applicant identifier and the policyholder identifier according to the policy data comprises: retrieving, in the policy data, the policy record with the earliest application time by taking the applicant identifier and the policyholder identifier as a first primary key to generate a first mapping table; retrieving, in the policy data, the policyholder identifier by taking the applicant identifier as a primary key to generate a second mapping table, and retrieving, in the policy data, the applicant identifier by taking the policyholder identifier as a primary key to generate a third mapping table; splicing the second mapping table and the third mapping table to obtain a fourth mapping table; and determining the first mapping table and the fourth mapping table as the relationship mapping table.

2. The method of claim 1, wherein, Generating the starting family identifier according to the relationship mapping table comprises: in the relationship mapping table, taking the applicant identifier as a primary key to obtain a first earliest application time of a policy record, and taking the policyholder identifier as a primary key to obtain a second earliest application time of a policy record; comparing the first earliest application time and the second earliest application time; if the first earliest application time is greater than the second earliest application time, determining the applicant identifier as the starting family identifier; if the second earliest application time is greater than the first earliest application time, determining the policyholder identifier as the starting family identifier; and if the first earliest application time is equal to the second earliest application time, generating the starting family identifier according to the applicant identifier and the policyholder identifier.

3. The method of claim 2, wherein, Generating the starting family identifier according to the applicant identifier and the policyholder identifier comprises: comparing the size of a first string and a second string from the first character to the last character, wherein the applicant identifier is the first string, the policyholder identifier is the second string, and the first string and the second string have the same length; if the first string is greater than the second string, determining the first string as the starting family identifier; if the second string is greater than the first string, determining the second string as the starting family identifier.

4. The method of claim 1, wherein, Querying the relationship mapping table according to the starting family identifier to output a target mapping table comprises: adding the starting family identifier in the relationship mapping table to generate a starting iteration table, wherein the starting iteration table comprises a primary key, an associated key, and a one-time family key corresponding to the starting family identifier, and the primary key and the associated key correspond to the applicant identifier and the policyholder identifier respectively, or the primary key and the associated key correspond to the policyholder identifier and the applicant identifier respectively. Finding a specified association key of the primary key and a specified primary key of the association key in the starting iteration representative, generating a secondary iteration representative according to the specified association key, the specified primary key and the primary home key, wherein the secondary iteration representative comprises a primary key, an association key and a secondary home key; After deduplicating the primary keys in the secondary iteration representative, setting a mapping relationship between each primary key and its secondary home key as a mapping object, recursively matching the mapping object using the relationship mapping table until the home keys of the primary keys and the home keys of the association keys are consistent, and outputting the target mapping table.

5. The method of claim 4, wherein, Generating a secondary iteration representative according to the specified association key, the specified primary key and the primary home key comprises: Comparing the specified association key and the specified primary key to obtain a first maximum value, wherein the maximum value is the specified association key or the specified primary key; Comparing the first maximum value and the primary home key to obtain a second maximum value, wherein the second maximum value is one of the specified association key, the specified primary key and the primary home key; Determining the second maximum value as the secondary home key, and replacing the primary home key in the starting iteration representative with the secondary home key to obtain the secondary iteration representative.

6. The method of claim 4, wherein, Recursively matching the mapping object using the relationship mapping table until the home keys of the primary keys and the home keys of the association keys are consistent, and outputting the target mapping table comprises: In N recursion cycles, matching an Nth mapping object using the relationship mapping table to obtain a home identity of a primary key and a home identity of an association key, wherein N is greater than or equal to 1; Comparing the home identity of the primary key and the home identity of the association key, replacing the home keys in the Nth mapping object with a maximum value, and continuing to match an N+1th mapping object using the relationship mapping table to obtain a home identity of a primary key and a home identity of an association key until the home keys of the primary keys and the home keys of the association keys in the current recursion cycle are consistent, and outputting the target mapping table.

7. An apparatus for identifying data relationships, characterized by Comprise: An acquisition module is used to acquire policy data, wherein the policy data comprises a plurality of policy records, and each policy record comprises an applicant identifier, a beneficiary identifier and an application time; A first generation module is used to generate a relationship mapping table of the applicant identifier and the beneficiary identifier according to the policy data; A second generation module is used to generate a starting home identity according to the relationship mapping table; An output module is used to query the relationship mapping table according to the starting home identity, and output a target mapping table, wherein the target mapping table comprises a home identity, an applicant identifier or a beneficiary identifier. The first generation module comprises: a generation unit configured to retrieve, in the policy data, a policy record with the earliest insurance time as a first primary key of the policyholder identifier and the insured identifier, and generate a first mapping table; retrieve, in the policy data, an insured identifier as the policyholder identifier, and generate a second mapping table; retrieve, in the policy data, a policyholder identifier as the insured identifier, and generate a third mapping table; a splicing unit configured to splice the second mapping table and the third mapping table to obtain a fourth mapping table; and a determination unit configured to determine the first mapping table and the fourth mapping table as the relationship mapping table.

8. A storage medium, characterized by The storage medium comprises a stored program, wherein the program performs the method steps of any one of claims 1 to 6 when executed.

9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein, The processor, the communication interface, and the memory complete mutual communication through a communication bus; wherein: The memory is used to store a computer program; The processor is used to execute the method steps of any one of claims 1 to 6 by running the program stored in the memory. 10.A computer program product, comprising computer instructions stored in a computer readable storage medium, wherein a processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to enable the computer device to perform the method steps of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data processing method and apparatus of family customer insurance demand

    CN107507093A