Data matching method, system and device, medium and program product

Through the data matching method of the adaptive selection matching algorithm, the problem of time-consuming and high usage threshold in the large data scenarios in the prior art is solved, and fast matching and efficient resource utilization are achieved.

CN119415970APending Publication Date: 2025-02-11SHANGHAI GARLIC SPROUT INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411601254.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-11
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

The existing open source tendency score matching method consumes time, consumes a lot of computing resources, and has a high threshold for use, so users need to manually modify scripts and import data.

Method used

Provide a data matching method, by obtaining the data to be matched, calculating the propensity score based on the preset model, and adaptively selecting the matching algorithm to achieve fast matching, reducing resource consumption and usage thresholds.

Benefits of technology

It achieves rapid matching of millions of data, has low resource consumption, high execution efficiency, lowers the threshold for use, and saves labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415970A_ABST
    Figure CN119415970A_ABST
Patent Text Reader

Abstract

The invention provides a data matching method, system and device, a medium and a program product, and the matching method comprises the steps: obtaining to-be-matched data; the to-be-matched data comprises a plurality of initial experimental group data and a plurality of initial control group data; performing tendency score calculation on the to-be-matched data based on a preset model to obtain a first tendency score and a second tendency score; in response to the condition that the second tendency scores corresponding to the plurality of pieces of initial control group data meet a preset matching condition, performing data matching on the to-be-matched data by adopting a first matching algorithm; and if not, performing data matching on the to-be-matched data by adopting a second matching algorithm to obtain a target experimental group data set and a target control group data set which are matched under each target tendency score. Through the data matching method provided by the invention, rapid matching of millions of data levels can be realized, the resource consumption is low, and the execution efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing, and in particular to a data matching method, system, device, medium and program product. Background Art

[0002] In the Internet industry, AB experiments are the most commonly used method for evaluating business results. However, in some scenarios, such as evaluating the conversion effect brought by an intervention and users can choose whether to accept the intervention, because user behavior is uncontrollable, the users who accept the intervention in the experimental group are biased, so the a priori assumption of the AB experiment (all experimental samples satisfy independent and identical distribution) cannot be met, and thus the standard statistical significance test cannot be directly used for the diversion samples. In this case, the propensity score matching method can be used to find the two most similar groups of users from the experimental group (users accepted the intervention) and the control group (users did not accept the intervention) based on the characteristics that have a greater impact on whether the user accepts the intervention and the evaluation indicators. Then, these two groups of users can be used for significance tests to obtain reliable evaluation results.

[0003] However, when the existing open source propensity score matching methods are actually applied to large data volume scenarios, they encounter the following problems:

[0004] (1) Most open-source propensity score matching methods first use the logistic regression model of the sklearn library to calculate the propensity score, and then use the K-Nearest Neighbors matching model to find the sample with the closest propensity score. This method takes tens of minutes or even hours to complete when the sample size of the experimental group or control group exceeds one million, and consumes a lot of computing resources. It is prone to failure and error when cluster resources are insufficient.

[0005] (2) Each time propensity score matching is used in different business scenarios, the script needs to be manually modified, data imported, and then manually run. Each user is required to fully understand the script code, which raises the threshold for using this method and also causes a lot of manpower waste. Summary of the invention

[0006] The technical problem to be solved by the present disclosure is to overcome the defects in the prior art and to provide a data matching method, system, device, medium and program product.

[0007] The present invention solves the above technical problems through the following technical solutions:

[0008] According to a first aspect of the present disclosure, a data matching method is provided, the data matching method comprising:

[0009] Acquire data to be matched; the data to be matched includes a plurality of initial experimental group data and a plurality of initial control group data;

[0010] Calculate the propensity score of the data to be matched based on a preset model to obtain a first propensity score for each of the initial experimental group data and a second propensity score for each of the initial control group data;

[0011] Under different target propensity scores, in response to the second propensity scores corresponding to a number of the initial control group data satisfying a preset matching condition, a first matching algorithm is used to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that match each of the target propensity scores;

[0012] If not, a second matching algorithm is used to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores;

[0013] Wherein, the target experimental group data set includes at least one of the initial experimental group data; the target control group data set includes at least one of the initial control group data;

[0014] The amount of data calculated during the matching process of the first matching algorithm is smaller than the amount of data calculated during the matching process of the second matching algorithm.

[0015] Preferably, in response to the second propensity scores corresponding to a number of the initial control group data satisfying a preset matching condition, the first matching algorithm is used to perform data matching on the data to be matched to obtain a target experimental group data set and a target control group data set that match each of the target propensity scores; if not, the second matching algorithm is used to perform data matching on the data to be matched to obtain a target experimental group data set and a target control group data set that match each of the target propensity scores, the step specifically includes:

[0016] Obtaining the total amount of data of the initial control group data and the initial experimental group data;

[0017] Obtaining a first quantity ratio; wherein the first quantity ratio is the ratio of the target propensity score to the total amount of data;

[0018] In response to the first quantity proportion exceeding a first threshold, using the first matching algorithm to perform data matching on the to-be-matched data to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores;

[0019] In response to the first quantity proportion not exceeding the first threshold, the second matching algorithm is used to perform data matching on the data to be matched to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores.

[0020] Preferably, the first matching algorithm is a binary matching algorithm;

[0021] The second matching algorithm is a nearest neighbor matching algorithm.

[0022] Preferably, after the step of acquiring the data to be matched and before the step of calculating the propensity score of the data to be matched based on a preset model, the data matching method further includes:

[0023] Obtaining a number of characteristic data corresponding to any of the data to be matched, and the proportion of the number of null values ​​of different characteristic data in the initial experimental group data or the initial control group data;

[0024] In response to the proportion of the number of null values ​​exceeding a second threshold, deleting and recording the feature data corresponding to the proportion of the number of null values;

[0025] In response to the proportion of the number of null values ​​not exceeding the second threshold, acquiring a data type corresponding to the feature data;

[0026] In response to the data type being a non-numeric type, encoding the to-be-matched data corresponding to the non-numeric type according to a preset encoding rule;

[0027] In response to the data type being a numerical type, further acquiring a data value of the characteristic data;

[0028] In response to the characteristic data being a null value, the characteristic data is filled with a first preset value.

[0029] Preferably, after obtaining the target experimental group data set and the target control group data set that match each target propensity score, the data matching method further includes:

[0030] Performing a balance check on the target experimental group data set and the target control group data set based on a preset check rule;

[0031] In response to the target experimental group data set and the target control group data set passing the balance check, outputting the target experimental group data set and the target control group data set;

[0032] In response to the target experimental group data set and the target control group data set failing the balance check, the step of obtaining data matching for the data to be matched using a preset matching algorithm is re-executed, and the target experimental group data set and the target control group data set that failed the balance check are recorded.

[0033] Preferably, the step of calculating the propensity score of the to-be-matched data based on a preset model specifically includes:

[0034] Calculating the propensity score of the data to be matched according to a logistic regression model;

[0035] and / or,

[0036] Before the step of calculating the propensity score of the to-be-matched data based on the preset model, the data matching method further includes:

[0037] Obtain a first quantity and a second quantity; wherein the first quantity is the data volume of the first set of experimental data; and the second quantity is the data volume of the second set of experimental data;

[0038] In response to the first number being greater than the second number, the first group of experimental data is the initial experimental group data, and the second group of experimental data is the initial control group data;

[0039] In response to the first number being smaller than the second number, the second group of experimental data is the initial experimental group data, and the first group of experimental data is the initial control group data.

[0040] According to a second aspect of the present disclosure, a data matching system is provided, the matching system comprising:

[0041] A data acquisition module is used to acquire data to be matched; the data to be matched includes a plurality of initial experimental group data and a plurality of initial control group data;

[0042] A score calculation module, used to calculate the propensity score of the to-be-matched data based on a preset model, and obtain a first propensity score for each of the initial experimental group data and a second propensity score for each of the initial control group data;

[0043] A data matching module is used for, under different target propensity scores, in response to the second propensity scores corresponding to a number of the initial control group data satisfying a preset matching condition, using a first matching algorithm to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that match under each of the target propensity scores; if not, using a second matching algorithm to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that match under each of the target propensity scores;

[0044] Wherein, the target experimental group data set includes at least one of the initial experimental group data; the target control group data set includes at least one of the initial control group data;

[0045] The amount of data calculated during the matching process of the first matching algorithm is smaller than the amount of data calculated during the matching process of the second matching algorithm.

[0046] Preferably, the data matching module is used to obtain the total amount of data of the initial control group data and the initial experimental group data and a first quantity ratio; wherein the first quantity ratio is the ratio of the target propensity score in the total amount of data;

[0047] In response to the first quantity proportion exceeding a first threshold, using the first matching algorithm to perform data matching on the to-be-matched data to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores;

[0048] In response to the first quantity proportion not exceeding the first threshold, the second matching algorithm is used to perform data matching on the data to be matched to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores.

[0049] Preferably, the first matching algorithm is a binary matching algorithm;

[0050] The second matching algorithm is a nearest neighbor matching algorithm.

[0051] Preferably, the matching system further comprises a feature processing module, which is used to obtain a number of feature data corresponding to any of the data to be matched, and the proportion of the number of null values ​​of different feature data in the initial experimental group data or the initial control group data, after obtaining the data to be matched and before calculating the propensity score of the data to be matched based on a preset model;

[0052] In response to the proportion of the number of null values ​​exceeding a second threshold, deleting and recording the feature data corresponding to the proportion of the number of null values;

[0053] In response to the proportion of the number of null values ​​not exceeding the second threshold, acquiring a data type corresponding to the feature data;

[0054] In response to the data type being a non-numeric type, encoding the to-be-matched data corresponding to the non-numeric type according to a preset encoding rule;

[0055] In response to the data type being a numerical type, further acquiring a data value of the characteristic data;

[0056] In response to the characteristic data being a null value, the characteristic data is filled with a first preset value.

[0057] Preferably, the matching system further comprises a data verification module, wherein the data verification module is used to perform a balance verification on the target experimental group data set and the target control group data set based on a preset verification rule after obtaining the target experimental group data set and the target control group data set that match each target propensity score;

[0058] In response to the target experimental group data set and the target control group data set passing the balance check, outputting the target experimental group data set and the target control group data set;

[0059] In response to the target experimental group data set and the target control group data set failing the balance check, the step of obtaining data matching for the data to be matched using a preset matching algorithm is re-executed, and the target experimental group data set and the target control group data set that failed the balance check are recorded.

[0060] Preferably, the score calculation module is used to calculate the propensity score of the to-be-matched data according to a logistic regression model;

[0061] and / or,

[0062] Preferably, the data acquisition module is further used to acquire a first quantity and a second quantity; wherein the first quantity is the data volume of the first set of experimental data; and the second quantity is the data volume of the second set of experimental data;

[0063] In response to the first number being greater than the second number, the first group of experimental data is the initial experimental group data, and the second group of experimental data is the initial control group data;

[0064] In response to the first number being smaller than the second number, the second group of experimental data is the initial experimental group data, and the first group of experimental data is the initial control group data.

[0065] According to a third aspect of the present disclosure, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, wherein the processor implements the data matching method described in the first aspect of the present disclosure when executing the computer program.

[0066] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the data matching method described in the first aspect of the present disclosure is implemented.

[0067] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the data matching method described in the first aspect of the present disclosure is implemented.

[0068] On the basis of being in accordance with the common sense in the art, the above-mentioned preferred conditions can be arbitrarily combined to obtain the preferred embodiments of the present disclosure.

[0069] The positive and progressive effects of this disclosure are:

[0070] In the data matching method provided by the present disclosure, two groups of samples (experimental group and control group) and their characteristic values ​​are input, and the propensity scores of the input samples are calculated. According to the propensity score distribution of the two groups of samples, the matching method is adaptively selected to finally obtain the two most similar groups of sub-samples in the experimental group and the control group. The data matching method provided by the present disclosure can realize fast matching of millions of data with low resource consumption and high execution efficiency. Moreover, the method supports end-to-end, and the user only needs to import the original experimental group and control group samples and their characteristics to output the matched similar sub-samples and the matched characteristic distribution test results, which lowers the usage threshold and saves labor costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 Schematic diagram of the process of the data matching method in Embodiment 1 of the present disclosure;

[0072] Figure 2 This is a flowchart of the implementation principle of fast data matching in Embodiment 1 of the present disclosure;

[0073] Figure 3 This is a schematic diagram of the structure of the data input in Embodiment 1 of the present disclosure;

[0074] Figure 4 This is a schematic diagram of the structure of data output in Embodiment 1 of the present disclosure;

[0075] Figure 5 It is a structural diagram of a data matching system in Embodiment 2 of the present disclosure;

[0076] Figure 6It is a schematic diagram of the structure of the electronic device in Embodiment 3 of the present disclosure. DETAILED DESCRIPTION

[0077] The present disclosure is further described below by way of examples, but the present disclosure is not limited to the scope of the examples.

[0078] Prefixes such as "first" and "second" are used in the embodiments of the present disclosure only to distinguish different description objects, and have no limiting effect on the position, order, priority, quantity or content of the described objects. The use of prefixes such as ordinal numbers to distinguish description objects in the embodiments of the present disclosure does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the claims or embodiments, and no unnecessary limitation should be constituted due to the use of such prefixes. In addition, in the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.

[0079] In the embodiments of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0080] Internet business scenarios often process data volumes of hundreds of thousands, millions, or even billions. Given limited cluster resources, a lot of improvements need to be made to traditional algorithms in order to apply propensity score matching methods at the engineering level and lower the threshold for use by data analysts.

[0081] In view of this, the present disclosure provides a data matching method, system, device, medium and program product to achieve fast matching of millions of data levels.

[0082] Example 1

[0083] Figure 1 A flowchart of a data matching method provided in Embodiment 1 of the present disclosure;

[0084] like Figure 1 As shown, the data matching method includes:

[0085] S11: Obtaining data to be matched; the data to be matched includes a number of initial experimental group data and a number of initial control group data;

[0086] S12: Calculate the propensity score of the to-be-matched data based on the preset model, and obtain a first propensity score for each initial experimental group data and a second propensity score for each initial control group data;

[0087] S13: Under different target propensity scores, in response to the second propensity scores corresponding to a number of initial control group data satisfying the preset matching conditions, a first matching algorithm is used to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that match under each target propensity score; if not, a second matching algorithm is used to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that match under each target propensity score.

[0088] Wherein, the target experimental group data set includes at least one of the initial experimental group data; the target control group data set includes at least one of the initial control group data;

[0089] The amount of data calculated during the matching process of the first matching algorithm is smaller than the amount of data calculated during the matching process of the second matching algorithm.

[0090] The data matching method provided by the present invention can realize rapid matching of millions of data with low resource consumption and high execution efficiency; and the method supports end-to-end, and users only need to import the original experimental group and control group samples and their characteristics to output the matched similar sub-samples and the matched feature distribution test results, which lowers the usage threshold and saves labor costs.

[0091] In this embodiment, in response to the second propensity scores corresponding to a number of the initial control group data satisfying the preset matching condition, the first matching algorithm is used to perform data matching on the data to be matched to obtain a target experimental group data set and a target control group data set that match each of the target propensity scores; if not, the second matching algorithm is used to perform data matching on the data to be matched to obtain a target experimental group data set and a target control group data set that match each of the target propensity scores, specifically including:

[0092] Obtain the total amount of the initial control group data and the initial experimental group data; obtain a first quantity ratio; wherein the first quantity ratio is the ratio of the target propensity score to the total amount of data;

[0093] In response to the first quantity proportion exceeding the first threshold, a first matching algorithm is used to perform data matching on the to-be-matched data to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores;

[0094] In response to the first quantity proportion not exceeding the first threshold, a second matching algorithm is used to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores.

[0095] Among them, the first matching algorithm is a bipartite matching algorithm; the second matching algorithm is a nearest neighbor matching algorithm.

[0096] In one implementation, when the number of initial control group data corresponding to the target propensity score exceeds the first threshold in the initial control group, the nearest neighbor matching algorithm is used to match the data, and the k nearest users are found for all users in the experimental group at one time, and then the condition is used to determine whether to accept the current nearest user as the matching result. If the matching ratio of the control group is less than expected, the matched index is deleted from the index library, and the previous steps are repeated. In order to efficiently process large amounts of data, the nearest neighbor matching algorithm is selected. At this time, the speed and accuracy are balanced, the index parameters are adaptively adjusted, and the matching ratio between the two groups of data is improved through repeated matching, thereby improving the speed of data matching.

[0097] In another embodiment, when the number of initial control group data corresponding to the target propensity score does not exceed the first threshold in the initial control group, a binary matching algorithm is used to match the data. The binary method is used to find the control group user with the closest propensity score for each experimental group user, and then the current control group user is determined based on whether the distance is less than 0.1 times the standard deviation. This method traverses all the control group data and improves the accuracy of data matching.

[0098] In this embodiment, before calculating the propensity score of the to-be-matched data based on the preset model, the matching method further includes:

[0099] Obtain a first quantity and a second quantity; wherein the first quantity is the data volume of the first set of experimental data; and the second quantity is the data volume of the second set of experimental data;

[0100] In response to the first number being greater than the second number, the first set of experimental data is the initial experimental group data, and the second set of experimental data is the initial control group data;

[0101] In response to the first number being smaller than the second number, the second set of experimental data is the initial experimental group data, and the first set of experimental data is the initial control group data.

[0102] In this embodiment, the amount of control group data is smaller than the amount of experimental group data, and thus when performing data matching, the side with less data can be traversed, further improving the speed of data matching.

[0103] In this embodiment, after obtaining the data to be matched, before calculating the propensity score of the data to be matched based on the preset model, the matching method further includes:

[0104] Obtaining a number of feature data corresponding to any data to be matched, as well as the proportion of null values ​​of different feature data in the initial experimental group data or the initial control group data;

[0105] In response to the proportion of the number of null values ​​exceeding a second threshold, deleting and recording the feature data corresponding to the proportion of the number of null values;

[0106] In response to the proportion of the number of null values ​​not exceeding the second threshold, obtaining the data type of the corresponding feature data;

[0107] In response to the data type being a non-numeric type, encoding the to-be-matched data corresponding to the non-numeric type according to a preset encoding rule;

[0108] In response to the data type being a numerical type, further acquiring a data value of the characteristic data;

[0109] In response to the characteristic data being a null value, the characteristic data is filled with a first preset value.

[0110] In one implementation, the data to be matched input in this embodiment includes several feature data. In this embodiment, all feature data will be checked for null values. Features whose null value ratio exceeds a certain threshold (default 0.8) will be directly deleted, and the deleted feature names will be recorded to ensure data integrity.

[0111] For the retained feature data, further determine whether the corresponding data type is a numeric type. If not, encode it. The encoding rule is to count the number of times each enumeration value appears. If the number of occurrences exceeds a certain threshold (the default is 0), replace the enumeration value with the index value (starting from 1). If a null value appears, all null values ​​will be replaced with 0. If the corresponding data type is a numeric type, it is only necessary to determine whether it is a null value. If it is a null value, fill the null value with 0 and complete the feature processing of the data, providing a basis for the calculation of the propensity score.

[0112] In this embodiment, the step of calculating the propensity score of the matching data based on the preset model specifically includes:

[0113] Propensity scores were calculated for the matched data based on the logistic regression model.

[0114] In one embodiment, the corresponding feature group is used as the dependent variable, the feature data after feature processing is used as the independent variable, the dependent variable and the independent variable are standardized, and a logistic regression is performed through a logistic regression model. At the same time, the probability value output by the logistic regression is used as the result of the propensity score and added to the data set.

[0115] In this embodiment, after obtaining a plurality of matched target experimental group data sets and target control group data sets, the matching method further includes:

[0116] Perform a balance check on the target experimental group data set and the target control group data set based on preset verification rules;

[0117] In response to the target experimental group data set and the target control group data set passing the balance check, outputting the target experimental group data set and the target control group data set;

[0118] In response to the target experimental group data set and the target control group data set failing the balance check, the step of obtaining data matching for the matching data using a preset matching algorithm is re-executed, and the target experimental group data set and the target control group data set failing the balance check are recorded.

[0119] In this embodiment, before the actual matching, the applicable matching method will be adaptively determined based on the data volume and the distribution of the propensity score of the data to be matched. After each matching, the output matching result will be verified.

[0120] The specific verification method is to determine the feature distribution of all features before and after matching, and calculate the cohenD value of each feature (an indicator used to measure the effect size). Only when all cohenD values ​​are less than 0.2 can the verification be passed.

[0121] The specific matching and verification steps are as follows:

[0122] Determine whether the propensity score of the data set accounts for a certain value greater than 0.8 and the amount of control group data is less than 1 million (if yes, continue; otherwise, proceed to the next judgment).

[0123] Perform binary exact matching, then verify the matching result and output it regardless of whether it passes the verification.

[0124] Determine whether the propensity score of the data set accounts for less than 0.8 in all values ​​(if yes, continue, otherwise output the result that the matching fails because the data distribution is too concentrated and the data volume is too large);

[0125] Perform FAISS vector nearest neighbor matching, then verify the matching result to determine whether it passes the verification (if yes, output the matching result, otherwise continue);

[0126] The proportion of expected matches in the control group decreased by 0.1;

[0127] Determine whether the expected matching ratio of the control group is equal to 0.2 (if yes, match again with the expected ratio of 0.8 and output the result, and input the result that failed the verification; otherwise, proceed to the next judgment);

[0128] Determine whether FAISS nearest neighbor matching is terminated due to reaching 30 rounds and the amount of control group data is less than 1 million (if yes, continue; otherwise, proceed to the next judgment);

[0129] Perform binary exact matching, then verify the matching result, and output it regardless of whether it passes the verification;

[0130] Determine whether FAISS nearest neighbor matching is terminated due to reaching 30 rounds and the amount of data in the control group is greater than 1 million (if yes, output the result that the matching failed because the data distribution does not support it);

[0131] Perform the next FAISS match until it passes the verification or is terminated due to the judgment condition;

[0132] Output the final matching results and verification results.

[0133] The verified data will be stored in the working directory, and users can directly obtain the matching task results from the directory, thereby achieving rapid matching of millions of data with low resource consumption and high execution efficiency. This method supports end-to-end support, and users only need to import the original experimental group and control group samples and their features to output the matched similar sub-samples and the matched feature distribution test results, which lowers the usage threshold and saves labor costs.

[0134] The implementation principle of the data matching method disclosed in the present invention is specifically described below with reference to examples:

[0135] like Figure 2 As shown, S21: input the original experimental group and control group sample data and their characteristic data in the format of a csv file.

[0136] The specific file formats are as follows: Figure 3 As shown, the characteristic fields of the sample data include sample id, whether it is in the experimental group, feature 1, feature 2, feature 3, etc., and the corresponding data are filled in according to the corresponding pure data.

[0137] After importing or uploading the user to be matched on the profiling platform and selecting the user features to be focused on, a csv file containing all the data will be automatically generated in the working directory. The script will specify the input and output file names, and then import the csv data file from the working directory. Initialize the PSM class (propensity score calculation class), and pass in the is_exp field that distinguishes the experimental group and the control group, the except_features field that does not participate in the calculation of the propensity score (that is, the non-feature field other than is_exp), and the output file name output_file_name.

[0138] When the PSM class is initialized, it will detect the magnitude of the data in the experimental group (is_exp==1) and the control group (is_exp==0). Because the default is to use the experimental group to find a matching control group, based on the performance of the current matching algorithm, it is hoped that the control group data is smaller than the experimental group. Therefore, if the control group data volume is greater than 1.5 million and the experimental group data volume is less than 1.5 million, the two groups of data are swapped (is_exp values ​​are swapped). After all subsequent processes are completed and before the result data is output, 0 and 1 will be automatically swapped back and then output to avoid ambiguity.

[0139] S22: The feature processing module will filter the features and automatically perform corresponding numerical encoding and null value filling according to the data type of the features.

[0140] S23: Propensity scores were calculated using logistic regression based on the treated characteristics and the label of whether or not the patient received the intervention.

[0141] S24: According to the data volume and the distribution of the propensity score calculated by logistic regression, a more suitable matching method is adaptively selected from the two alternative matching methods to find the control group sample with the closest propensity score for the experimental group sample.

[0142] S25: Perform a balance test on the two groups of sub-samples obtained after matching. Specifically, the inter-group difference of the distribution of each feature is calculated to see whether it is small enough. If all feature differences are less than a fixed threshold, the match is considered to have passed the balance test. If the balance test fails, the match will return to step 3 to continue matching until the test is passed or the fuse condition is triggered.

[0143] S26: Integrate the result of feature processing in step 2, the two groups of similar sub-samples obtained by matching in step 4, and the result of balance test in step 5 and output them in the format of a csv file.

[0144] Among them, in S22, the input data to be matched includes several feature data; in this embodiment, the input features will be automatically processed, including determining the proportion of feature null values, and automatically deleting feature data with too high a null value proportion, identifying the data type of the retained features, and numerically encoding the non-numeric feature data, and determining the null value of the numeric feature data, and filling the null value feature data with 0.

[0145] In S23, all processed feature values ​​are automatically standardized according to the logistic regression model, and logistic regression is performed with whether or not the intervention is received as the positive and negative sample labels, and the probability value calculated by the logistic regression is used as the propensity score.

[0146] In S24, there are two alternative matching methods, namely FAISS nearest neighbor matching and dichotomy exact matching. By automatically calculating the distribution concentration of the propensity score, combined with the size of the data and the characteristics of the two matching methods, the most suitable matching method is selected to achieve a balance between efficiency and accuracy.

[0147] In S25, the feature distribution differences between all matched samples are automatically calculated, and the preset threshold is used to determine whether the balance test is passed. If it fails, the preset matching ratio will be reduced, and S24 will be replayed to rematch until the test is passed or the preset fuse condition is triggered.

[0148] In S26, the similar sub-samples obtained after matching and their balance test results (feature names that passed and failed the test), the feature names deleted in the previous step, and the proportion of the final control group that was matched are output together for further analysis by the user. The output results are as follows: Figure 4 shown.

[0149] The data matching method provided in the present disclosure regards the propensity score calculated by logistic regression as a one-dimensional vector, and innovatively uses the library FAISS (Facebook AI Similarity Search) for efficient similarity search to replace the traditional KNN (K-Nearest Neighbors) as a method for finding the control group sample with the closest propensity score for each sample in the experimental group.

[0150] Based on the excellent performance of the FAISS library in vector distance calculation and finding the nearest vector, the matching method proposed in the present disclosure can be improved on the basis of traditional single matching to a cyclic matching based on whether the preset expected matching ratio and balance test are passed. In a single cycle, it will also determine whether the propensity score distance of the closest sample found by FAISS is less than the preset threshold to further improve the matching quality. The FAISS nearest neighbor matching method also ensures adaptability during the development process. It will automatically initialize the FAISS query engine according to the sample size of the experimental group and the control group, and automatically adjust the parameters to achieve a balanced query efficiency and accuracy.

[0151] The present disclosure, based on the end-to-end highly integrated automation to lower the threshold for user use, allows users to change the default values ​​preset by the script hyperparameters or the calculated adaptive values ​​by passing values ​​to meet personalized user needs. Secondly, the present invention preferably presets error messages, explanations, and recommended solutions for various situations caused by different data structures passed in by users during script operation. At the same time, the execution log will also output the information of each adaptive adjustment judgment of the model, so that users can clearly know the operation of the model.

[0152] Example 2

[0153] Corresponding to the aforementioned data matching method embodiment, the present disclosure also provides an embodiment of a data matching system.

[0154] Figure 5 This is a module diagram of a data matching system provided in Embodiment 2 of the present disclosure, the system comprising:

[0155] The data acquisition module 100 is used to acquire the data to be matched; the data to be matched includes a number of initial experimental group data and a number of initial control group data;

[0156] A score calculation module 200 is used to calculate the propensity score of the to-be-matched data based on a preset model, and obtain a first propensity score for each initial experimental group data and a second propensity score for each initial control group data;

[0157] The data matching module 300 is used for, under different target propensity scores, in response to the second propensity scores corresponding to a plurality of initial control group data satisfying a preset matching condition, using a first matching algorithm to perform data matching on the to-be-matched data to obtain a target experimental group data set and a target control group data set that match under each target propensity score; if not, using a second matching algorithm to perform data matching on the to-be-matched data to obtain a target experimental group data set and a target control group data set that match under each target propensity score;

[0158] The target experimental group data set includes at least one initial experimental group data; the target control group data set includes at least one initial control group data;

[0159] The amount of data calculated during the matching process of the first matching algorithm is smaller than the amount of data calculated during the matching process of the second matching algorithm.

[0160] In this embodiment, the data matching module 300 is used to obtain a first quantitative proportion of the total amount of data of the initial control group data and the initial experimental group data; wherein the first quantitative proportion is the proportion of the target propensity score in the total amount of data;

[0161] In response to the first quantity proportion exceeding the first threshold, a first matching algorithm is used to perform data matching on the to-be-matched data to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores;

[0162] In response to the first quantity proportion not exceeding the first threshold, a second matching algorithm is used to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores.

[0163] In this embodiment, the first matching algorithm is a binary matching algorithm;

[0164] The second matching algorithm is a nearest neighbor matching algorithm.

[0165] In this embodiment, the matching system further includes a feature processing module 400, which is used to obtain a number of feature data corresponding to any data to be matched, and the proportion of null values ​​of different feature data in the initial experimental group data or the initial control group data, after obtaining the data to be matched and before calculating the propensity score for the data to be matched based on a preset model;

[0166] In response to the proportion of the number of null values ​​exceeding a second threshold, deleting and recording the feature data corresponding to the proportion of the number of null values;

[0167] In response to the proportion of the number of null values ​​not exceeding the second threshold, obtaining the data type of the corresponding feature data;

[0168] In response to the data type being a non-numeric type, encoding the to-be-matched data corresponding to the non-numeric type according to a preset encoding rule;

[0169] In response to the data type being a numerical type, further acquiring a data value of the characteristic data;

[0170] In response to the characteristic data being a null value, the characteristic data is filled with a first preset value.

[0171] In this embodiment, the matching system further includes a data verification module 500, which is used to perform a balance verification on the target experimental group data set and the target control group data set based on a preset verification rule after obtaining the target experimental group data set and the target control group data set that match each target propensity score;

[0172] In response to the target experimental group data set and the target control group data set passing the balance check, outputting the target experimental group data set and the target control group data set;

[0173] In response to the target experimental group data set and the target control group data set failing the balance check, the step of obtaining data matching for the matching data using a preset matching algorithm is re-executed, and the target experimental group data set and the target control group data set failing the balance check are recorded.

[0174] In this embodiment, the score calculation module is used to calculate the propensity score of the matching data according to the logistic regression model.

[0175] In this embodiment, the data acquisition module is further used to acquire a first quantity and a second quantity; wherein the first quantity is the data volume of the first set of experimental data; and the second quantity is the data volume of the second set of experimental data;

[0176] In response to the first number being greater than the second number, the first set of experimental data is the initial experimental group data, and the second set of experimental data is the initial control group data;

[0177] In response to the first number being smaller than the second number, the second set of experimental data is the initial experimental group data, and the first set of experimental data is the initial control group data.

[0178] As for the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only illustrative, in which the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution.

[0179] In the data matching system provided by the present disclosure, two groups of samples (experimental group and control group) and their characteristic values ​​are input, and the propensity scores of the input samples are calculated. According to the propensity score distribution of the two groups of samples, the matching method is adaptively selected to finally obtain the two most similar groups of sub-samples in the experimental group and the control group. Through the data matching method provided by the present disclosure, rapid matching of millions of data can be achieved with low resource consumption and high execution efficiency. Moreover, the method supports end-to-end, and the user only needs to import the original experimental group and control group samples and their characteristics to output the matched similar sub-samples and the matched characteristic distribution test results, which lowers the usage threshold and saves labor costs.

[0180] Example 3

[0181] Figure 6 The present invention is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present disclosure. The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the method in the above embodiment is implemented when the processor executes the program. Figure 6 The electronic device 30 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0182] like Figure 6 As shown, the electronic device 30 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 30 may include, but are not limited to: at least one processor 31, at least one memory 32, and a bus 33 connecting different system components (including the memory 32 and the processor 31).

[0183] The bus 33 includes a data bus, an address bus, and a control bus.

[0184] The memory 32 may include a volatile memory, such as a random access memory (RAM) 321 and / or a cache memory 322 , and may further include a read-only memory (ROM) 323 .

[0185] The memory 32 may also include a program / utility 325 having a set (at least one) of program modules 324, such program modules 324 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.

[0186] The processor 31 executes various functional applications and data processing by running the computer programs stored in the memory 32, such as the method in the above-mentioned embodiment of the present disclosure.

[0187] The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 35. Furthermore, the model generating device 30 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 36. Figure 6 As shown, the network adapter 36 communicates with other modules of the model-generated device 30 via the bus 33. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.

[0188] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.

[0189] Example 4

[0190] The embodiment of the present disclosure also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the data matching method provided in the above embodiment 1 is implemented.

[0191] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.

[0192] Example 5

[0193] The embodiment of the present disclosure also provides a computer program product, including a computer program, which implements the data matching method provided in the above embodiment 1 when executed by a processor.

[0194] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.

[0195] Although the specific embodiments of the present disclosure are described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present disclosure, but these changes and modifications all fall within the protection scope of the present disclosure.

Claims

1. A data matching method, characterized in that: The data matching method comprises: Acquire data to be matched; the data to be matched includes a plurality of initial experimental group data and a plurality of initial control group data; Calculate the propensity score of the data to be matched based on a preset model to obtain a first propensity score for each of the initial experimental group data and a second propensity score for each of the initial control group data; Under different target propensity scores, in response to the second propensity scores corresponding to a number of the initial control group data satisfying a preset matching condition, a first matching algorithm is used to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that match under each of the target propensity scores; If not, a second matching algorithm is used to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores; Wherein, the target experimental group data set includes at least one of the initial experimental group data; the target control group data set includes at least one of the initial control group data; The amount of data calculated during the matching process of the first matching algorithm is smaller than the amount of data calculated during the matching process of the second matching algorithm.

2. The data matching method according to claim 1, characterized in that: In response to the second propensity scores corresponding to a number of the initial control group data satisfying a preset matching condition, the first matching algorithm is used to perform data matching on the data to be matched to obtain a target experimental group data set and a target control group data set that match each of the target propensity scores; if not, the second matching algorithm is used to perform data matching on the data to be matched to obtain a target experimental group data set and a target control group data set that match each of the target propensity scores, the steps specifically include: Obtaining the total amount of data of the initial control group data and the initial experimental group data; Obtaining a first quantity ratio; wherein the first quantity ratio is the ratio of the target propensity score to the total amount of data; In response to the first quantity proportion exceeding a first threshold, using the first matching algorithm to perform data matching on the to-be-matched data to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores; In response to the first quantity proportion not exceeding the first threshold, the second matching algorithm is used to perform data matching on the data to be matched to obtain a target experimental group data set and a target control group data set that are matched under each of the target propensity scores.

3. The data matching method according to claim 2, characterized in that: The first matching algorithm is a binary matching algorithm; The second matching algorithm is a nearest neighbor matching algorithm.

4. The data matching method according to claim 1, characterized in that: After the step of acquiring the data to be matched and before the step of calculating the propensity score of the data to be matched based on a preset model, the data matching method further includes: Obtaining a number of characteristic data corresponding to any of the data to be matched, and the proportion of the number of null values ​​of different characteristic data in the initial experimental group data or the initial control group data; In response to the proportion of the number of null values ​​exceeding a second threshold, deleting and recording the feature data corresponding to the proportion of the number of null values; In response to the proportion of the number of null values ​​not exceeding the second threshold, acquiring a data type corresponding to the feature data; In response to the data type being a non-numeric type, encoding the to-be-matched data corresponding to the non-numeric type according to a preset encoding rule; In response to the data type being a numerical type, further acquiring a data value of the characteristic data; In response to the characteristic data being a null value, the characteristic data is filled with a first preset value.

5. The data matching method according to claim 1, characterized in that: After obtaining the target experimental group data set and the target control group data set that match each target propensity score, the data matching method further includes: Performing a balance check on the target experimental group data set and the target control group data set based on a preset check rule; In response to the target experimental group data set and the target control group data set passing the balance check, outputting the target experimental group data set and the target control group data set; In response to the target experimental group data set and the target control group data set failing the balance check, the step of obtaining data matching for the data to be matched using a preset matching algorithm is re-executed, and the target experimental group data set and the target control group data set that failed the balance check are recorded.

6. The data matching method according to any one of claims 1 to 5, characterized in that: The step of calculating the propensity score of the to-be-matched data based on the preset model specifically includes: Calculating the propensity score of the data to be matched according to a logistic regression model; and / or, Before the step of calculating the propensity score of the to-be-matched data based on the preset model, the data matching method further includes: Obtain a first quantity and a second quantity; wherein the first quantity is the data volume of the first set of experimental data; and the second quantity is the data volume of the second set of experimental data; In response to the first number being greater than the second number, the first group of experimental data is the initial experimental group data, and the second group of experimental data is the initial control group data; In response to the first number being smaller than the second number, the second group of experimental data is the initial experimental group data, and the first group of experimental data is the initial control group data.

7. A data matching system, characterized in that: The matching system comprises: A data acquisition module is used to acquire data to be matched; the data to be matched includes a plurality of initial experimental group data and a plurality of initial control group data; A score calculation module, used to calculate the propensity score of the to-be-matched data based on a preset model, and obtain a first propensity score corresponding to each of the initial experimental group data and a second propensity score corresponding to each of the initial control group data; A data matching module is used for, under different target propensity scores, in response to the second propensity scores corresponding to a number of the initial control group data satisfying a preset matching condition, using a first matching algorithm to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that match under each of the target propensity scores; if not, using a second matching algorithm to perform data matching on the data to be matched, so as to obtain a target experimental group data set and a target control group data set that match under each of the target propensity scores; Wherein, the target experimental group data set includes at least one of the initial experimental group data; the target control group data set includes at least one of the initial control group data; The amount of data calculated during the matching process of the first matching algorithm is smaller than the amount of data calculated during the matching process of the second matching algorithm.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, characterized in that: When the processor executes the computer program, the data matching method according to any one of claims 1 to 6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data matching method according to any one of claims 1 to 6 is implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the data matching method according to any one of claims 1 to 6 is implemented.