Method, apparatus, terminal and storage medium for determining a target set
By receiving the data source and determining the combined columns and separators, the privacy set interpolation of multiple columns of data is directly performed, which solves the cumbersome problems in the existing technology and realizes efficient multi-column data combination interpolation operation.
Patent Information
- Application Number
- CN202210626216.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2042-06-02
AI Technical Summary
In the prior art, the steps for interrogating the privacy sets of multiple columns of data combinations are cumbersome, resulting in low efficiency.
By receiving the first data source and the second data source, the first combined column and the second combined column are determined respectively, and the separator is analyzed and determined using a negotiation interactive method, and the index number set corresponding to the first and second combined columns is determined based on the combined column and the separator, and the privacy set interleaving is performed directly to avoid manual conversion to single-column data.
The privacy set interception automation, integration and flexibility of multi-column data combinations are realized, which improves operational efficiency and reduces user manual data cleaning steps.
Smart Images

Figure CN115048367B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data security technology, and in particular to a method, device, terminal and storage medium for determining a target set. Background Art
[0002] Private Set Intersection (PSI) allows two parties to intersect their data without revealing any additional information. PSI is often used to identify shared samples before joint computations between multiple vendors, without revealing any shared samples.
[0003] At present, the intersection of privacy sets of multi-column data combinations (i.e., column combinations) is generally performed indirectly, that is, users need to first clean the data of different column combinations, then convert the cleaned different column combinations into different single-column data, and then input the different single-column data into the system for PSI operations.
[0004] However, the above method is cumbersome in steps to perform privacy set intersection on multiple columns of data, resulting in low efficiency. Summary of the Invention
[0005] The main purpose of this application is to provide a method, device, terminal and storage medium for determining a target set to solve the problem of low efficiency existing in related technologies.
[0006] To achieve the above objectives, in a first aspect, the present application provides a method for determining a target set, comprising:
[0007] receiving a first data source and a second data source;
[0008] Determine a first combined column and a second combined column based on the first data source and the second data source respectively, wherein the combined column is formed by combining multiple columns of data;
[0009] Analyze the first combination column and the second combination column in a negotiation interaction manner to determine the separator;
[0010] Based on the first combination column, the second combination column and the separator, a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column are determined to obtain a target set through the first index number set and the second index number set.
[0011] In a possible implementation, determining the first combination column and the second combination column based on the first data source and the second data source respectively includes:
[0012] Generate a first data table and a second data table based on the first data source and the second data source respectively;
[0013] Selecting a preset number of columns of data from the first data table and the second data table respectively to obtain a preset number of first columns of data and a preset number of second columns of data;
[0014] A preset number of first column data and a preset number of second column data are combined to obtain a first combined column and a second combined column.
[0015] In a possible implementation, the first data source is sent by a first client, and the second data source is sent by a second client;
[0016] The first and second combination columns are analyzed in a negotiation interaction manner to determine the separator, including:
[0017] When the first client is the negotiation initiator, determining a separator based on the first combination column and the second combination column;
[0018] In the case where the second client is the negotiation initiator, a delimiter is determined based on the first combination column and the second combination column.
[0019] In a possible implementation, when the first client is the negotiation initiator, determining the delimiter based on the first combination column and the second combination column includes:
[0020] Determine a first character difference set and a second character difference set based on the first combination column and the second combination column respectively;
[0021] If either the first character difference set or the second character difference set is empty, obtain the current timestamp, and determine the delimiter based on the current timestamp, wherein the delimiter is obtained by sequentially performing string conversion, hash operation, and string truncation on the current timestamp;
[0022] If both the first character difference set and the second character difference set are not empty, select any character from the first character difference set as the target character;
[0023] If the target character exists in the second character difference set, the target character is used as a separator.
[0024] In a possible implementation, the method further includes:
[0025] If the target character does not exist in the second character difference set, the second client is used as the negotiation initiator, and any character from the second character difference set is selected as the target character;
[0026] If the target character exists in the first character difference set, the target character is used as a separator;
[0027] If the target character does not exist in the first character difference set, the step of selecting any character from the first character difference set as the target character is repeated.
[0028] In a possible implementation, when the second client is the negotiation initiator, determining the delimiter based on the first combination column and the second combination column includes:
[0029] If either the first character difference set or the second character difference set is empty, obtain the current timestamp, and determine the delimiter based on the current timestamp, wherein the delimiter is obtained by sequentially performing string conversion, hash operation, and string truncation on the current timestamp;
[0030] If both the first character difference set and the second character difference set are not empty, select any character from the second character difference set as the target character;
[0031] If the target character exists in the first character difference set, the target character is used as a separator.
[0032] In a possible implementation, the method further includes:
[0033] If the target character does not exist in the first character difference set, the first client is used as the negotiation initiator, and any character from the first character difference set is selected as the target character;
[0034] If the target character exists in the second character difference set, the target character is used as a separator;
[0035] If the target character does not exist in the second character difference set, the step of selecting any character from the second character difference set as the target character is repeated.
[0036] In a possible implementation, determining the first character difference set and the second character difference set based on the first combination column and the second combination column respectively includes:
[0037] Counting all characters in the first combination column to form a first character set, and performing a subtraction between the preset character set and the first character set to obtain a first character difference set;
[0038] All characters in the second combination column are counted to form a second character set, and a difference is made between the preset character set and the second character set to obtain a second character difference set.
[0039] In a possible implementation, determining a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column based on the first combination column, the second combination column, and the separator includes:
[0040] Preprocess the first combination column, the second combination column, and the separator to obtain first combination data corresponding to the first combination column and a third index number set corresponding to the first combination data, and second combination data corresponding to the second combination column and a fourth index number set corresponding to the second combination data;
[0041] An intersection operation is performed on the first combination data and the second combination data, and combined with the third index number set and the fourth index number set to obtain a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column.
[0042] In a second aspect, an embodiment of the present invention provides a device for determining a target set, including:
[0043] A data receiving module, configured to receive a first data source and a second data source;
[0044] a combination column determining module, configured to determine a first combination column and a second combination column based on the first data source and the second data source, respectively, wherein the combination column is formed by combining multiple columns of data;
[0045] A delimiter determination module is used to analyze the first combination column and the second combination column in a negotiation interaction manner to determine a delimiter;
[0046] The target set determination module is used to determine the first index number set corresponding to the first combination column and the second index number set corresponding to the second combination column based on the first combination column, the second combination column and the separator, so as to obtain the target set through the first index number set and the second index number set.
[0047] In a third aspect, an embodiment of the present invention provides a terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of any of the above methods for determining a target set are implemented.
[0048] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the steps of any of the above target set determination methods.
[0049] The embodiment of the present invention provides a method, device, terminal and storage medium for determining a target set, including: receiving a first data source and a second data source, determining a first combination column and a second combination column based on the first data source and the second data source respectively, then analyzing the first combination column and the second combination column in a negotiated interactive manner to determine a separator, and then determining a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column based on the first combination column, the second combination column and the separator, so as to obtain a target set through the first index number set and the second index number set. The present invention flexibly selects multiple columns of data for combination to obtain a combination column (i.e., a first combination column and a second combination column) corresponding to the multiple columns of data, without manually converting the multiple columns of data in the combination column into a single column of data, directly intersecting the privacy set of the first combination column and the second combination column to obtain the first index number set corresponding to the first combination column and the second index number set corresponding to the second combination column, and then directly querying the corresponding data through the index number to obtain the target set. The user can flexibly select and freely combine column data to form a combination column according to needs, thereby realizing the automation, integration and flexibility of the intersection of multiple columns of data, and does not require the user to manually clean the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The drawings that constitute part of this application are used to provide a further understanding of this application and make other features, objects and advantages of this application more apparent. The illustrative embodiment drawings of this application and their descriptions are used to explain this application and do not constitute an improper limitation of this application. In the drawings:
[0051] Figure 1 This is a flowchart of a method for determining a target set provided by one embodiment of the present invention;
[0052] Figure 2 is a flowchart of a method for determining a target set provided by another embodiment of the present invention;
[0053] Figure 3 is a schematic diagram of a data table formed by storing source data provided by an embodiment of the present invention;
[0054] Figure 4 1 is a schematic diagram of the operation of selecting and numbering column data provided by an embodiment of the present invention;
[0055] Figure 5 This is a flowchart of an implementation method for delimiter negotiation provided by an embodiment of the present invention;
[0056] Figure 6 This is a flowchart of an implementation of delimiter negotiation implemented by a first client (A) as a negotiation initiator, provided by an embodiment of the present invention;
[0057] Figure 7This is a flowchart of an implementation of delimiter negotiation implemented by a second client (B) as a negotiation initiator, provided by an embodiment of the present invention;
[0058] Figure 8 is a schematic diagram of a data table formed by intersection preprocessing provided by an embodiment of the present invention;
[0059] Figure 9 is a schematic diagram of a PSI operation result provided by an embodiment of the present invention;
[0060] Figure 10 1 is a schematic structural diagram of a device for determining a target set provided by an embodiment of the present invention;
[0061] Figure 11 is a schematic diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0062] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0063] The terms "first," "second," "third," "fourth," and so forth (if any) in the description and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequential sequence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the present invention described herein can be practiced in sequences other than those illustrated or described herein.
[0064] It should be understood that in various embodiments of the present invention, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0065] It should be understood that in the present invention, "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.
[0066] It should be understood that in the present invention, "multiple" refers to two or more. "And / or" is only a description of the association relationship of associated objects, indicating that three relationships can exist. For example, and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "Contains A, B and C", "Contains A, B, C" means that A, B, and C are all included, "Contains A, B or C" means that one of A, B, and C is included, and "Contains A, B and / or C" means that any one, any two, or any three of A, B, and C are included.
[0067] It should be understood that, in the present invention, "B corresponding to A," "B corresponding to A," "A corresponds to B," or "B corresponds to A" means that B is associated with A and B can be determined based on A. Determining B based on A does not mean determining B based solely on A; B can also be determined based on A and / or other information. A and B match when the similarity between A and B is greater than or equal to a preset threshold.
[0068] Depending on the context, "if" as used herein may be interpreted as "when" or "when" or "in response to determining" or "in response to detecting."
[0069] The following specific embodiments are used to describe the technical solution of the present invention in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0070] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below with reference to the accompanying drawings.
[0071] In one embodiment, Figure 1 As shown, a method for determining a target set is provided, comprising the following steps:
[0072] Step S101: Receive a first data source and a second data source.
[0073] Combine Figure 2 This application uses two data sources for intersecting private sets: a first data source sent by client A and a second data source sent by client B. After receiving the first and second data sources, the data must be imported into the first and second data sources to generate a first data table and a second data table, respectively. The imported data sources can be in the form of CSV files, MySQL, Hive, and so on.
[0074] Step S102: Determine a first combination column and a second combination column based on the first data source and the second data source respectively.
[0075] Among them, the combination column is formed by combining multiple columns of data. The present application generates a first data table and a second data table based on the first data source and the second data source, respectively, wherein the first data table and the second data table both include multiple columns of data. Taking the first data table including N columns of data as an example, the determination of the first combination column is described. Specifically, 3 columns of data are selected in the first data table, namely column 1, column 4 and column 10, and then the selected columns are numbered and combined in the order of the numbers to form a first combination column: column 1, column 4 and column 10. The way the second data source forms the second combination column is similar to that of the first data source and is no longer specifically limited here.
[0076] Step S103: Analyze the first combination column and the second combination column in a negotiation interaction manner to determine a separator.
[0077] The negotiation interaction mode refers to that the first client and the second client determine the delimiter through negotiation. That is, the obtained delimiter needs to be jointly determined by the first client and the second client and recognized by both parties.
[0078] Step S104: Based on the first combination column, the second combination column and the separator, determine a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column, so as to obtain a target set through the first index number set and the second index number set.
[0079] An embodiment of the present invention provides a method for determining a target set, comprising: receiving a first data source and a second data source, determining a first combination column and a second combination column based on the first data source and the second data source respectively, and then analyzing the first combination column and the second combination column in a negotiated interactive manner to determine a separator, and then determining a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column based on the first combination column, the second combination column and the separator, so as to obtain a target set through the first index number set and the second index number set. The present invention flexibly selects multiple columns of data for combination to obtain a combination column (i.e., a first combination column and a second combination column) corresponding to the multiple columns of data, without manually converting the multiple columns of data in the combination column into a single column of data, and directly performs a privacy set intersection on the first combination column and the second combination column to obtain a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column, and then directly queries the corresponding data through the index number to obtain the target set. Users can flexibly select and freely combine column data to form a combination column according to their needs, and conveniently and efficiently implement the privacy set intersection operation of different combination columns.
[0080] In one embodiment, step S102 includes:
[0081] Step S201: Generate a first data table and a second data table based on a first data source and a second data source respectively.
[0082] After the data source is imported, the data table corresponding to the data source will be automatically generated, that is, the first data table corresponding to the first data source and the second data table corresponding to the second data source will be generated. In other words, the imported data source is Figure 3 The data is stored in the form of a table. Specifically, the first row contains the index number index and the column names corresponding to the data source column-1, column-2...column-N. Each of the remaining rows consists of a unique index number value and a data value. The index is automatically generated and ordered.
[0083] Step S202: selecting a preset number of columns of data from the first data table and the second data table respectively to obtain a preset number of first columns of data and a preset number of second columns of data;
[0084] Step S203: Combining a preset number of first column data and a preset number of second column data respectively to obtain a first combined column and a second combined column.
[0085] The first column of data and the second column of data are intended to correspond to the first data table and the second data table respectively, rather than specifically referring to a column of data in the data table.
[0086] Combine Figure 4 This section explains how to select and number column data. ColumnA and columnB are used to distinguish the data tables to which the column data belongs. Specifically, columnA represents the column corresponding to the first data table, and columnB represents the column corresponding to the second data table. Specifically, columnA-2, columnA-50, and columnA-52 are selected from the first data table and numbered 1, 3, and 2, respectively. From the second data table, columnB-1, columnB-3, and columnB-82 are selected and numbered 2, 1, and 3, respectively. The resulting first combination of columns is columnA-2, columnA-52, and columnA-50, and the second combination is columnB-3, columnB-1, and columnB-82.
[0087] After determining the first and second combination columns, a delimiter needs to be determined based on the negotiation interaction method. Since the intersection effect in this application is related to the delimiter determined through negotiation interaction, that is, the comparison is mainly performed by combining the values of each column in the first and second combination columns (separated by a delimiter) into a string, if a delimiter appears in the data values of each column, it will affect the accuracy of the PSI intersection result.
[0088] Combine Figure 4As shown, columnA-2, columnA-52, and columnA-50 of Party A need to be matched one by one with the corresponding values of columnB-3, columnB-1, and columnB-82 of Party B. Assume that there is a record with values of "a," "b," and "c" for columnA-2, columnA-52, and columnA-50 of Party A, respectively; and there is a record with values of "a," "b," and "c" for columnB-3, columnB-1, and columnB-82 of Party B, respectively. These two records obviously do not match, and the intersection of the PSI column combination will definitely not hit. However, if "," is selected as the delimiter, according to the comparison method of this application, the records of Party A and Party B will be converted into the string "a,,b,c", and will hit when the intersection is found. In order to avoid this error, this application adds the delimiter negotiation step to ensure that the delimiter selected by Party A and Party B will not appear in the data values of both parties.
[0089] In one embodiment, combining Figure 5-Figure 7 Since the first data source is sent by the first client and the second data source is sent by the second client, based on the different sending entities of the data sources, this application uses different entities as negotiation initiators to illustrate the specific process of implementing S103.
[0090] When the first client is the negotiation initiator, determining the delimiter based on the first combination column and the second combination column includes:
[0091] (1) Determine a first character difference set and a second character difference set based on the first combination column and the second combination column, respectively.
[0092] Specifically, all characters in the first combination column are counted to form a first character set, and the preset character set is subtracted from the first character set to obtain a first character difference set, and all characters in the second combination column are counted to form a second character set, and the preset character set is subtracted from the second character set to obtain a second character difference set.
[0093] A represents the first client and B represents the second client. Party A and Party B each scan the data values of the columns that need to be PSI combined, that is, Party A scans the data values in the first combination column and Party B scans the data values in the second combination column, and counts all the characters appearing in the data values of each party respectively to form the first character set A_CharSet and the second character set B_CharSet.
[0094] Assume that the character set composed of the ASCII code table is ASC, and respectively calculate the difference between ASC and the set A_CharSet and the set B_CharSet to obtain the first character difference set A_EXCEPT and the second character difference set B_EXCEPT.
[0095] (2) If either the first character difference set or the second character difference set is empty, obtain the current timestamp, and determine the delimiter based on the current timestamp.
[0096] The delimiter is obtained by sequentially performing string conversion, hash operation, and string truncation on the current timestamp. The following describes the steps for determining the delimiter using a specific embodiment.
[0097] like Figure 6 As shown, when Party A is the initiator of the negotiation and Party B is the participant, if at least one of the first character difference set A_EXCEPT and the second character difference set B_EXCEPT is an empty set, Party A obtains the current timestamp and converts it into a string form Str(GetCurrentTimeMillis()), then performs a hash operation (including but not limited to MD5, SHA1, SHA256, etc.) on the string to form a Hash(Str(GetCurrentTimeMillis())) string. Finally, the first 16 bytes of the hash result are intercepted to form a string, that is: Str(Byte (0,15 )[Hash(Str(GetCurrentTimeMillis()))]) as the final negotiated delimiter, and sends the delimiter to Party B, and Party A's process ends. Party B receives the Str(Byte (0,15) [Hash(Str(GetCurrentTimeMillis()))]) is used as the delimiter for the final negotiation, and the process of Party B ends.
[0098] (3) If both the first character difference set and the second character difference set are not empty, any character is selected from the first character difference set as the target character. If the target character exists in the second character difference set, the target character is used as a separator.
[0099] Combine Figure 6 When Party A is the negotiation initiator and Party B is the participant, and both the first character difference set A_EXCEPT and the second character difference set B_EXCEPT are not empty, then any character a is selected from the set A_EXCEPT and sent to Party B.
[0100] After receiving character a from Party A, Party B determines whether a is in the second character difference set B_EXCEPT. If so, Party B confirms a as the final negotiated delimiter and sends feedback to Party A confirming that a can be used as a delimiter. This concludes Party B's process. Party A then confirms a as the final negotiated delimiter, and the process ends.
[0101] (4) If the target character does not exist in the second character difference set, feedback is sent to Party A indicating that the target character cannot be used as a delimiter. Party A removes the target character from the first difference set and executes the process for Party B as the negotiation initiator. For details, see the process for the second client as the negotiation initiator below. If B fails to reach an agreement on the negotiation, A and B take turns as the negotiation initiators until a delimiter is found.
[0102] If a is not in the second character difference set B_EXCEPT, Party B and Party A take turns as the negotiation initiator to determine the delimiter. Among them, when Party A is the negotiation initiator, Party B and Party A take turns as the negotiation initiator. The specific steps are as follows: First, Party A acts as the negotiation initiator of the negotiation process. The specific process is as follows: Figure 6 As shown; If the negotiation process is not completed, then Party B will act as the initiator of the negotiation process and negotiate again. The specific process is as follows Figure 7 As shown. If the negotiation process has not yet ended, A continues to serve as the negotiation initiator... and so on, A and B take turns as the negotiation initiator until the negotiation process ends. Of course, when B is the negotiation initiator, the situation is similar to the above and will not be further described here.
[0103] Combine Figure 5-Figure 7 If Party A is the negotiation initiator, it selects any character a from A_EXCEPT and sends it to Party B. If a is not in the second character difference set B_EXCEPT, Party B is the negotiation initiator. If both the first character difference set A_EXCEPT and the second character difference set B_EXCEPT are not empty, it selects any character b from the set B_EXCEPT and sends it to Party A.
[0104] After receiving character b from Party B, Party A determines whether b is in the first character difference set A_EXCEPT. If so, Party A confirms b as the final negotiated delimiter and sends feedback to Party B confirming that b can be used as a delimiter. This concludes Party A's process. Party B then confirms b as the final negotiated delimiter, and the process ends.
[0105] If b is not in the first character difference set A_EXCEPT, Party A is designated as the negotiation initiator. If either the first character difference set A_EXCEPT or the second character difference set B_EXCEPT is empty, the current timestamp is obtained and the delimiter is determined based on the current timestamp. If both the first character difference set A_EXCEPT and the second character difference set B_EXCEPT are not empty, a character c is randomly selected from the set A_EXCEPT and sent to Party B. Party A and Party B take turns as the negotiation initiator until the delimiter is determined.
[0106] In addition, when party A is the negotiation initiator, if the target character a does not exist in the second character difference set, the target character a is removed from the first character difference set, and then other characters are determined to be in the second character difference set until the separator is determined.
[0107] When the second client is the negotiation initiator, determining the delimiter based on the first combination column and the second combination column includes:
[0108] (1) If either the first character difference set or the second character difference set is empty, obtain the current timestamp and determine a delimiter based on the current timestamp. The delimiter is obtained by sequentially performing string conversion, hash operation, and string truncation on the current timestamp.
[0109] (2) If both the first character difference set and the second character difference set are not empty, any character is selected from the second character difference set as the target character. If the target character exists in the first character difference set, the target character is used as a separator.
[0110] (3) If the target character does not exist in the first character difference set, select any character from the first character difference set as the target character; if the target character exists in the second character difference set, use the target character as a separator; if the target character does not exist in the second character difference set, repeat the step of selecting any character from the second character difference set as the target character.
[0111] The principles of steps (1)-(3) in this embodiment are the same as those of steps (2)-(4) in determining the delimiter when the first client is the negotiation initiator, and are not repeated here.
[0112] In one embodiment, step S104 includes:
[0113] Step S301: pre-process the first combination column, the second combination column and the separator to obtain the first combination data corresponding to the first combination column and the third index number set corresponding to the first combination data, as well as the second combination data corresponding to the second combination column and the fourth index number set corresponding to the second combination data.
[0114] Specifically, suppose that columnA-2, columnA-52, and columnA-50 in the first composite column have a record with values "a," "b," and "c," respectively, and columnB-3, columnB-1, and columnB-82 in the second composite column have a record with values "a," ",b," and "c," respectively. Using "!" as a delimiter, the composite data formed by the first composite column is "a,!b!c," and the composite data formed by the second composite column is "a!,b!c." When all records in the first and second composite columns are separated by delimiters, the first and second composite data are formed.
[0115] Since the first and second combination columns are from Figure 3 Selected from Figure 3 The index numbers corresponding to each value in the first combination column and the second combination column are found, which are the third index number set and the fourth index number set respectively.
[0116] The step of preprocessing the first combination column and the second combination column includes: establishing a first empty table corresponding to the first combination column and a second empty table corresponding to the second combination column, and then based on the header fields in the first empty table and the second empty table, inserting the combined data formed in the first combination column and the second combination column and the corresponding index number into the first empty table and the second empty table respectively, to obtain a third data table and a fourth data table.
[0117] Specifically, two temporary empty data tables are established, namely the first empty table and the second empty table. There are two header fields, representing the index number set and the spliced column combination data value (ie, combined data), which are represented by index-set and column-group respectively.
[0118] Traverse the first and second data tables row by row, and combine the column combination and column number selected by the user to extract the data values one by one, add separators in the middle, and splice them into the combined data value-group. Together with the index number index, insert it into the empty table. The completed data table is as follows Figure 8 shown.
[0119] When inserting data, to avoid duplicating the same data combination, first check whether the value-group to be inserted exists in the corresponding data value of the column-group in the data table. If not, simply insert the index and value-group. If so, find the corresponding record in the data table and add the index to the index-set of the corresponding row.
[0120] Step S302: performing an intersection operation on the first combination data and the second combination data, and combining the third index number set and the fourth index number set to obtain a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column.
[0121] The intersection operation refers to the intersection of private sets.
[0122] After the above intersection preprocessing is completed, the Private Set Intersection (PSI) operation can be performed to determine the index number set, such as Figure 9 The specific steps are as follows:
[0123] (1) After the intersection preprocessing, party A and party B respectively generate a third data table TB-A and a fourth data table TB-B.
[0124] (2) Perform a privacy set intersection operation on the column-group column data of data tables TB-A and TB-B. Common solutions in the current field can be used, such as: oblivious transmission, hashing, public key encryption, obfuscated circuits, homomorphic encryption, etc. (including but not limited to these), and record all combined data values value-group that are hit by the intersection. For example: Figure 9 As shown, the combined data values of the 1st and 3rd rows of party A are hit by PSI, and the combined data values of the 2nd and 3rd rows of party B are hit by PSI.
[0125] (3) Based on the intersection hit combination data value value-group, combined with data tables TB-A and TB-B, locate the corresponding record row and find all corresponding index-sets. Summarize all the intersection hit index-set values of party A and party B respectively to form the index set IndexSet obtained by the intersection of their respective combinations PSI (A) and IndexSet PSI (B). For example: Figure 9 As shown, the IndexSet obtained by the intersection of Party A PSI (A) is {0,3,4}, and the IndexSet obtained by the intersection of the B combination PSI (B) is {2,4,5,6,7}.
[0126] Afterwards, by traversing the collection IndexSet separately PSI (A) and IndexSet PSI The index value in (B) is used as the index number to compare the data table generated after importing the source data (such as Figure 3), you can obtain the source data row information corresponding to the PSI column-by-column intersection result. The PSI intersection result is equivalent to: "the data value of columnA-2 is equal to the data value of columnB-3", "the data value of columnA-52 is equal to the data value of columnB-1", and "the data value of columnA-50 is equal to the data value of columnB-82".
[0127] The above results can be downloaded, that is, after the PSI operation is completed, the user can view the statistical information of the intersection results of multiple columns, and can also download the data table (such as Figure 3 Download the record rows that are hit by the intersection (as shown) in order to analyze the results.
[0128] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0129] The following are device embodiments of the present invention. For details not fully described therein, reference may be made to the corresponding method embodiments described above.
[0130] Figure 10 A schematic diagram of the structure of a target set determination device provided by an embodiment of the present invention is shown. For ease of explanation, only the parts related to the embodiment of the present invention are shown. The target set determination device includes a data receiving module 1001, a combination column determination module 1002, a delimiter determination module 1003, and an intersection set determination module 1004. The details are as follows:
[0131] A data receiving module 1001 is configured to receive a first data source and a second data source;
[0132] A combination column determining module 1002 is configured to determine a first combination column and a second combination column based on the first data source and the second data source, respectively, wherein the combination column is formed by combining multiple columns of data;
[0133] A delimiter determination module 1003 is configured to analyze the first and second combination columns in a negotiation interaction manner to determine a delimiter;
[0134] The target set determination module 1004 is configured to determine a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column based on the first combination column, the second combination column and the separator, so as to obtain a target set through the first index number set and the second index number set.
[0135] In a possible implementation, the combination column determining module 1002 includes:
[0136] a table generation submodule, configured to generate a first data table and a second data table based on the first data source and the second data source respectively;
[0137] a column data selection submodule, configured to select a preset number of column data from the first data table and the second data table respectively, to obtain a preset number of first column data and a preset number of second column data;
[0138] The column data combining submodule is used to respectively combine a preset number of first column data and a preset number of second column data to obtain a first combined column and a second combined column.
[0139] In a possible implementation, the first data source is sent by a first client, and the second data source is sent by a second client;
[0140] The delimiter determination module 1003 includes:
[0141] A first negotiation submodule, configured to determine a delimiter based on the first combination column and the second combination column when the first client is the negotiation initiator;
[0142] The second negotiation submodule is configured to determine a delimiter based on the first combination column and the second combination column when the second client is the negotiation initiator.
[0143] In a possible implementation, the first negotiation submodule includes:
[0144] A first character difference set determining unit, configured to determine a first character difference set and a second character difference set based on the first combination column and the second combination column respectively;
[0145] a first judgment unit configured to obtain a current timestamp if either the first character difference set or the second character difference set is empty, and determine a delimiter based on the current timestamp, wherein the delimiter is obtained by sequentially performing string conversion, hash operation, and string truncation on the current timestamp;
[0146] a second judgment unit, configured to select any character from the first character difference set as a target character if both the first character difference set and the second character difference set are not empty;
[0147] The third judgment unit is configured to use the target character as a separator if the target character exists in the second character difference set.
[0148] In a possible implementation, the method further includes:
[0149] a fourth judgment unit, configured to select any character from the second character difference set as the target character if the target character does not exist in the second character difference set;
[0150] a fifth judgment unit, configured to use the target character as a separator if the target character exists in the first character difference set;
[0151] The sixth judgment unit is configured to repeatedly execute the step of selecting any character from the first character difference set as the target character if the target character does not exist in the first character difference set.
[0152] In a possible implementation, the second negotiation submodule includes:
[0153] a seventh determining unit, configured to obtain a current timestamp if either the first character difference set or the second character difference set is empty, and determine a delimiter based on the current timestamp, wherein the delimiter is obtained by sequentially performing string conversion, hash operation, and string truncation on the current timestamp;
[0154] an eighth judgment unit, configured to select any character from the second character difference set as a target character if both the first character difference set and the second character difference set are not empty;
[0155] The ninth judgment unit is configured to use the target character as a separator if the target character exists in the first character difference set.
[0156] In a possible implementation, the method further includes:
[0157] a tenth judging unit, configured to select any character from the first character difference set as the target character if the target character does not exist in the first character difference set;
[0158] an eleventh judging unit, configured to use the target character as a separator if the target character exists in the second character difference set;
[0159] The twelfth judging unit is configured to repeatedly execute the step of selecting any character from the second character difference set as the target character if the target character does not exist in the second character difference set.
[0160] In a possible implementation, the first character difference set determining unit or the second character difference set determining unit includes:
[0161] a first counting subunit, configured to count all characters in the first combination column to form a first character set, and to perform a subtraction between the preset character set and the first character set to obtain a first character difference set;
[0162] The second counting subunit is configured to count all characters in the second combination column to form a second character set, and perform a subtraction between the preset character set and the second character set to obtain a second character difference set.
[0163] In one possible implementation, the target set determination module 1004 includes:
[0164] a preprocessing submodule, configured to preprocess the first combination column, the second combination column, and the separator to obtain first combination data corresponding to the first combination column and a third index number set corresponding to the first combination data, and second combination data corresponding to the second combination column and a fourth index number set corresponding to the second combination data;
[0165] The PSI operation submodule is used to perform an intersection operation on the first combination data and the second combination data, and combine the third index number set and the fourth index number set to obtain a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column.
[0166] Figure 11 Schematic diagram of a terminal provided by an embodiment of the present invention. Figure 11 As shown, the terminal 11 of this embodiment includes: a processor 110, a memory 111, and a computer program 112 stored in the memory 111 and executable on the processor 110. When the processor 110 executes the computer program 112, the steps in the above-mentioned determination method of each target set are implemented, for example Figure 1 Alternatively, when the processor 110 executes the computer program 112, the functions of the modules / units in the above-mentioned embodiments of the apparatus for determining each target set are realized, for example Figure 10 Functionality of modules / units 1001 to 1004 is shown.
[0167] The present invention also provides a readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the target set determination method provided by the various embodiments described above.
[0168] Among them, the readable storage medium can be a computer storage medium or a communication medium. Communication media include any medium that facilitates the transmission of computer programs from one place to another. Computer storage media can be any available medium that can be accessed by a general-purpose or special-purpose computer. For example, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be an integral part of the processor. The processor and the readable storage medium can be located in an application-specific integrated circuit (ASIC). In addition, the ASIC can be located in a user device. Of course, the processor and the readable storage medium can also exist in a communication device as discrete components. The readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0169] The present invention also provides a program product, comprising execution instructions stored in a readable storage medium. At least one processor of a device can read the execution instructions from the readable storage medium, and the at least one processor executes the execution instructions to cause the device to implement the target set determination method provided in the various embodiments described above.
[0170] In the embodiments of the above-mentioned devices, it should be understood that the processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the present invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0171] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.
Claims
1. A method for determining a target set, characterized in that: include: receiving a first data source and a second data source; Determine a first combined column and a second combined column based on the first data source and the second data source respectively, wherein the combined column is formed by combining multiple columns of data; Analyzing the first combination column and the second combination column in a negotiation interaction manner to determine a separator; Based on the first combination column, the second combination column, and the delimiter, determining a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column, so as to obtain a target set through the first index number set and the second index number set; The first data source is sent by a first client, and the second data source is sent by a second client; The analyzing the first combination column and the second combination column in a negotiation interaction manner to determine a separator includes: In a case where the first client is a negotiation initiator, determining the delimiter based on the first combination column and the second combination column; In a case where the second client is the negotiation initiator, determining the delimiter based on the first combination column and the second combination column; The determining the delimiter based on the first combination column and the second combination column when the first client is the negotiation initiator includes: Determine a first character difference set and a second character difference set based on the first combination column and the second combination column respectively; If either the first character difference set or the second character difference set is empty, obtaining a current timestamp, and determining the delimiter based on the current timestamp, wherein the delimiter is obtained by sequentially performing string conversion, hash operation, and string truncation on the current timestamp; If both the first character difference set and the second character difference set are not empty, selecting any character from the first character difference set as the target character; If the target character exists in the second character difference set, use the target character as the separator; The determining the first character difference set and the second character difference set based on the first combination column and the second combination column respectively includes: Counting all characters in the first combination column to form a first character set, and performing a subtraction between a preset character set and the first character set to obtain a first character difference set; All characters in the second combination column are counted to form a second character set, and the preset character set is subtracted from the second character set to obtain a second character difference set.
2. The method for determining a target set according to claim 1, wherein: The determining the first combination column and the second combination column based on the first data source and the second data source respectively includes: generating a first data table and a second data table based on the first data source and the second data source respectively; Selecting a preset number of columns of data from the first data table and the second data table respectively to obtain a preset number of first columns of data and a preset number of second columns of data; The preset number of first column data and the preset number of second column data are respectively combined to obtain the first combined column and the second combined column.
3. The method for determining a target set according to claim 1, wherein: Also includes: If the target character does not exist in the second character difference set, taking the second client as the negotiation initiator, and selecting any character from the second character difference set as the target character; If the target character exists in the first character difference set, use the target character as the separator; If the target character does not exist in the first character difference set, the step of selecting any character from the first character difference set as the target character is repeated.
4. The method for determining a target set according to claim 1, wherein: The step of determining the delimiter based on the first combination column and the second combination column when the second client is the negotiation initiator includes: If either the first character difference set or the second character difference set is empty, obtaining a current timestamp, and determining the delimiter based on the current timestamp, wherein the delimiter is obtained by sequentially performing string conversion, hash operation, and string truncation on the current timestamp; If both the first character difference set and the second character difference set are not empty, selecting any character from the second character difference set as the target character; If the target character exists in the first character difference set, the target character is used as the separator.
5. The method for determining a target set according to claim 4, wherein: Also includes: If the target character does not exist in the first character difference set, taking the first client as the negotiation initiator, and selecting any character from the first character difference set as the target character; If the target character exists in the second character difference set, use the target character as the separator; If the target character does not exist in the second character difference set, the step of selecting any character from the second character difference set as the target character is repeated.
6. The method for determining a target set according to claim 1, wherein: The determining, based on the first combination column, the second combination column, and the separator, a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column includes: Preprocessing the first combination column, the second combination column, and the delimiter to obtain first combination data corresponding to the first combination column and a third index number set corresponding to the first combination data, and second combination data corresponding to the second combination column and a fourth index number set corresponding to the second combination data; An intersection operation is performed on the first combination data and the second combination data, and combined with the third index number set and the fourth index number set to obtain a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column.
7. A device for determining a target set, characterized in that: include: A data receiving module, configured to receive a first data source and a second data source; a combination column determining module, configured to determine a first combination column and a second combination column based on the first data source and the second data source, respectively, wherein the combination column is formed by combining multiple columns of data; a delimiter determination module, configured to analyze the first combination column and the second combination column in a negotiation interaction manner to determine a delimiter; a target set determining module, configured to determine, based on the first combination column, the second combination column, and the delimiter, a first index number set corresponding to the first combination column and a second index number set corresponding to the second combination column, so as to obtain a target set using the first index number set and the second index number set; The first data source is sent by a first client, and the second data source is sent by a second client; The analyzing the first combination column and the second combination column in a negotiation interaction manner to determine a separator includes: In a case where the first client is a negotiation initiator, determining the delimiter based on the first combination column and the second combination column; In a case where the second client is the negotiation initiator, determining the delimiter based on the first combination column and the second combination column; The determining the delimiter based on the first combination column and the second combination column when the first client is the negotiation initiator includes: Determine a first character difference set and a second character difference set based on the first combination column and the second combination column respectively; If either the first character difference set or the second character difference set is empty, obtaining a current timestamp, and determining the delimiter based on the current timestamp, wherein the delimiter is obtained by sequentially performing string conversion, hash operation, and string truncation on the current timestamp; If both the first character difference set and the second character difference set are not empty, selecting any character from the first character difference set as the target character; If the target character exists in the second character difference set, use the target character as the separator; The determining the first character difference set and the second character difference set based on the first combination column and the second combination column respectively includes: Counting all characters in the first combination column to form a first character set, and performing a subtraction between a preset character set and the first character set to obtain a first character difference set; All characters in the second combination column are counted to form a second character set, and the preset character set is subtracted from the second character set to obtain a second character difference set.
8. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the processor implements the steps of the target set determination method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for determining a target set according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Facilitating entity resolution, keying, and search match without transmitting personally identifiable information in the clear
CA3084360A1
Digital television receiver and method for processing a digital television signal
CN101141582A