Method, system and device for determining difference between data sets and storage medium

By using hash functions and XOR operations under truncated geometric distribution conditions in big data analysis, the problem of balancing memory usage and accuracy of analysis results in big data set difference analysis is solved, and efficient data set difference analysis is achieved.

CN118656371AInactive Publication Date: 2024-09-17XI AN JIAOTONG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410811082.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-09-17
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In big data analysis, it is difficult for existing technologies to balance memory efficiency and accuracy of analysis results when processing large-scale data sets, resulting in a contradiction between memory usage and analysis results.

Method used

The hash function under the condition of truncated geometric distribution is used to map the data of the data set into the probability distribution, and the synopsis compressed data is generated through the XOR operation. Finally, the frequency of the Boolean distribution in the synopsis difference data is used to solve the expectation function to determine the relationship between the data sets. difference value.

Benefits of technology

While ensuring the accuracy of analysis results, it effectively reduces memory usage, improves the speed and efficiency of data set difference analysis, and solves the problem of incompatibility between memory usage and accuracy of analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118656371A
    Figure CN118656371A
Patent Text Reader

Abstract

The invention discloses a method, a system and a device for determining difference between data sets, electronic equipment and a computer readable storage medium, which are applied to a data server side, and are characterized in that data in the data sets can be recorded according to probability distribution corresponding to a hash function by utilizing the property of a truncated geometric distribution condition, so that the difference between the data sets can be determined. Therefore, the probability data of the data sets is determined by using the preset hash function, the integrity of the data sets is maintained, the requirement of a data storage space is effectively reduced, the probability compressed data is generated, and then the probability difference data between the target data sets is quickly obtained by performing XOR operation on the probability compressed data of the target data sets; and finally, determining a difference value between the data sets by solving an expectation function. The accuracy of the analysis result is guaranteed, meanwhile, memory occupation is effectively reduced, and the problem that in the data set difference analysis process of big data, memory occupation and the accuracy of the analysis result cannot be considered at the same time is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of big data technology, and specifically relates to a method, system, device, electronic device and computer-readable storage medium for determining differences between data sets. Background Art

[0002] In the fields of big data analysis, network security, distributed computing, etc., it is often necessary to perform differential analysis on data sets in order to identify data changes, synchronize information, detect anomalies, etc.

[0003] Currently, common techniques for dealing with dataset differences include using Bloom filters or counting sketches to compress datasets and estimating differences through set operations. These methods reduce storage and computing resource requirements by mapping data elements into a smaller space.

[0004] However, when storage space is limited, existing technologies face the contradiction between memory efficiency and accuracy when processing large-scale data sets, and cannot strike a balance between estimation accuracy and processing speed. Summary of the invention

[0005] The present application aims to provide a method, system, device, electronic device and computer-readable storage medium for determining differences between data sets, at least to solve the problem that memory usage and analysis result accuracy cannot be taken into account in the process of big data data set difference analysis.

[0006] In a first aspect, an embodiment of the present application discloses a method for determining differences between data sets, which is applied to a data service end, comprising:

[0007] Acquire multiple data sets to be compared, and determine the summary data of each of the data sets by a preset hash function, so that the data in each of the data sets is recorded in the corresponding summary data according to the probability distribution corresponding to the hash function; the hash function satisfies a preset truncated geometric distribution condition; the summary data includes multiple data bits, the data bits in the summary data correspond to the data in the data sets one by one, and each of the data bits is used to record the existence of the corresponding data in the corresponding data set according to the Boolean distribution;

[0008] Performing an exclusive OR operation on each bit in each of the summary data and the first value of the Boolean distribution, respectively, to obtain summary compressed data of each of the data sets;

[0009] In response to the selection of two target data sets, performing an XOR operation on two target outline compressed data corresponding to the two target data sets respectively to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets is recorded in the outline difference data according to the probability distribution;

[0010] Determine the frequency of occurrence of the second value of the Boolean distribution in the outline difference data, and use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solve the expected function, and use the solved value as the difference value between the target data sets, so that the difference value is positively correlated with the amount of data in the difference set of the two target data sets.

[0011] In a second aspect, an embodiment of the present application further discloses a system for determining differences between data sets, which is applied to a data service end, and the system includes:

[0012] A preprocessing subsystem, used to obtain multiple data sets to be compared, and determine the summary data of each of the data sets through a preset hash function, so that the data in each of the data sets is recorded in the corresponding summary data according to the probability distribution corresponding to the hash function; the hash function satisfies a preset truncated geometric distribution condition; the summary data contains multiple data bits, the data bits in the summary data correspond to the data in the data sets one by one, and each of the data bits is used to record the existence of the corresponding data in the corresponding data set according to the Boolean distribution;

[0013] An updating subsystem, used for performing an exclusive OR operation on each bit in each of the summary data and the first value of the Boolean distribution, so as to obtain the summary compressed data of each of the data sets;

[0014] A computing subsystem is used for, in response to the selection of two target data sets, performing an XOR operation on two target outline compressed data corresponding to each of the two target data sets to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets are recorded in the outline difference data according to the probability distribution; the computing subsystem is also used for determining the frequency of occurrence of the second value of the Boolean distribution in the outline difference data, and using the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solving the expected function, and using the solved value as the difference value between the target data sets, so that the difference value is positively correlated with the amount of data in the difference set of the two target data sets.

[0015] In a third aspect, an embodiment of the present application further discloses a device for determining differences between data sets, which is applied to a data service end, and the device includes:

[0016] A preprocessing module, used to take multiple data sets to be compared, and determine the summary data of each of the data sets through a preset hash function, so that the data in each of the data sets is recorded in the corresponding summary data according to the probability distribution corresponding to the hash function; the hash function satisfies a preset truncated geometric distribution condition; the summary data contains multiple data bits, the data bits in the summary data correspond to the data in the data sets one by one, and each of the data bits is used to record the existence of the corresponding data in the corresponding data set according to the Boolean distribution;

[0017] An updating compression module is used to perform an XOR operation on each bit in each of the summary data and the first value of the Boolean distribution to obtain the summary compressed data of each of the data sets;

[0018] a difference obtaining module, configured to, in response to the selection of two target data sets, perform an XOR operation on two target outline compressed data corresponding to the two target data sets respectively, so as to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets is recorded in the outline difference data according to the probability distribution;

[0019] An analysis module is used to determine the frequency of occurrence of the second value of the Boolean distribution in the outline difference data, and use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solve the expected function, and use the solved value as the difference value between the target data sets, so that the difference value is positively correlated with the amount of data in the difference set of the two target data sets.

[0020] In a fourth aspect, an embodiment of the present application further discloses an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.

[0021] In a fifth aspect, an embodiment of the present application further discloses a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0022] In summary, in the embodiment of the present application, the truncated geometric distribution condition is used so that the data in the data set can be recorded according to the probability distribution corresponding to the hash function, so that the outline data of the data set is determined by using a preset hash function, while maintaining the integrity of the data set, the demand for data storage space is effectively reduced; the outline compressed data is then generated by the XOR operation, which further reduces the data storage demand; then the outline compressed data of the target data set is XORed to quickly obtain the outline difference data between the target data sets; finally, the frequency initial value of the second numerical value of the Boolean distribution in the outline difference data is used to solve the expected function of the truncated geometric distribution to determine the difference value between the data sets, making it simpler than direct data comparison, which also improves the analysis speed. Therefore, the method based on the embodiment of the present application effectively reduces memory usage while ensuring the accuracy of the analysis results, and solves the problem that memory usage and analysis result accuracy cannot be taken into account in the process of data set difference analysis of big data. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In the attached picture:

[0024] Figure 1 is a flowchart of a method for determining differences between data sets provided in an embodiment of the present application;

[0025] Figure 2 is a flowchart of another method for determining differences between data sets provided in an embodiment of the present application;

[0026] Figure 3 It is a schematic diagram of the hash solution process under the truncated geometric distribution according to the embodiment of the present application;

[0027] Figure 4 This is a schematic diagram of the hash solution process under block truncation geometric distribution according to an embodiment of the present application;

[0028] Figure 5 is a block diagram of a system for determining differences between data sets provided in an embodiment of the present application;

[0029] Figure 6 is a program logic diagram of a system for determining differences between data sets provided in an embodiment of the present application;

[0030] Figure 7 is a program logic diagram of a system preprocessing subsystem for determining differences between data sets provided in an embodiment of the present application;

[0031] Figure 8 is a program logic diagram of a system update subsystem for determining differences between data sets provided in an embodiment of the present application;

[0032] Fig. 9is a program logic diagram of a system computing subsystem for determining differences between data sets provided in an embodiment of the present application;

[0033] Fig.10 is a block diagram of a device for determining differences between data sets provided in an embodiment of the present application;

[0034] Fig.11 is a block diagram of an electronic device according to an embodiment of the present application;

[0035] Fig.12 It is a block diagram of an electronic device of another embodiment provided by the embodiments of the present application. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0037] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0038] In the actual use of data sets, it is often necessary to determine the differences between data sets. For example, in distributed databases and file systems, each host maintains a set of elements (such as records or files) generated during runtime. i and A j Two network-connected hosts need to communicate with each other periodically to obtain their set union for data synchronization. In order to reduce communication overhead, a practical method is to only transmit the elements in their difference set, that is, A i ΔA j In this case, the set difference cardinality can be calculated in advance to measure the required communication bandwidth, latency, and storage, which helps managers avoid systemic problems such as network congestion and memory leaks. In order not to interfere with the normal operation of other processes, services, etc., especially in resource-limited applications, people expect to use a small amount of computing resources to calculate the set difference cardinality.

[0039] For another example, in trajectory monitoring, given various trajectories, each trajectory consists of a set of multiple Global Positioning System (GPS) points, the set difference cardinality is an effective measure of the similarity between different trajectories. For a trajectory, if the set difference cardinality between it and other trajectories is large, the trajectory is considered abnormal.

[0040] For example, in network management scenarios, routers, switches and other devices can only allocate less than a few hundred megabytes (e.g., 1MB) of memory space for computing tasks, while requiring a throughput greater than 100Mbps. In addition, some systems require a bandwidth of more than 50% of the total bandwidth for synchronizing data between two hosts, and prefer to reduce communication overhead. i and A j The cardinality of the set difference between the two requires O((|A i |+|A j |)m e )(where m e is the size of each element in the collection, usually set to 32 or 64 bits) of memory and O(|A i ||A j |) time to store and scan all elements in the two sets. i | and |A j | are respectively set A i and A j Each of these numbers could be in the millions or even billions.

[0041] Several mainstream solutions currently use data summaries to compress and store data elements in the database, and then perform cardinality estimation by merging or not merging data summaries. However, when less storage space is used, the estimation accuracy will be poor, while methods with better estimation accuracy (such as traversal) will incur large storage space costs.

[0042] Since the method of traversing the data elements in the two databases does not meet the actual requirements in terms of time and space, the present invention proposes a solution to achieve data difference comparison by hashing the data outline:

[0043] Figure 1 This embodiment provides a method for determining differences between data sets, which is applied to a data service end.

[0044] The method may include the following steps:

[0045] Step 101 , obtaining multiple data sets to be compared, and determining summary data of each data set by a preset hash function, so that the data in each data set is recorded in the corresponding summary data according to the probability distribution corresponding to the hash function.

[0046] Among them, the hash function satisfies the preset truncated geometric distribution condition; the summary data contains multiple data bits, the data bits in the summary data correspond one-to-one to the data in the data set, and each data bit is used to record the existence of the corresponding data in the corresponding data set according to the Boolean distribution.

[0047] In some embodiments of the present application, a preset hash function is used to process multiple data sets to be compared to determine the summary data of each data set. The key here is that the hash function follows the truncated geometric distribution condition, which ensures that the data in the data set is recorded in the summary data according to the probability distribution corresponding to the hash function. The summary data consists of multiple data bits, each of which corresponds one-to-one to the data in the data set, and uses Boolean distribution to record the existence of each data in its corresponding data set.

[0048] For example, suppose there are two data sets A and B, each containing 100 data points. Based on the truncated geometric distribution, the hash value of each data point can be obtained, and these hash values ​​will be recorded in the summary data. If data A1 exists in data set A, the corresponding data bit in the summary data of data set A will be set to 1; if data point A1 does not exist in data set B, the corresponding data bit in the summary data of data set B will be set to 0. In this way, a summary data can be created for each data set, which contains a summary of the data distribution of the data set. This not only reduces the storage space requirements, but also provides a basis for subsequent data set difference analysis.

[0049] Step 102: perform an exclusive OR operation on each bit in each summary data and the first value of the Boolean distribution to obtain the summary compressed data of each data set.

[0050] In some embodiments of the present application, it is necessary to establish and update a data summary so as to compress and store the preprocessed data. In this process, the data summary is defined as a one-dimensional bit array according to the truncated number (assumed to be m) of the truncated geometric distribution, in which each element is initialized to a second value (usually 0). Through the hash function, the original data is mapped to one of the m integer positions of the summary data, and the element at this position is XORed with the first value (usually 1). The data profile is thereby updated so that this mapping satisfies the geometric distribution.

[0051] For example, suppose there is a summary data B with a length of m=10, and all bits are initially set to 0. Now, there is a data element e, which is mapped to position 5 through the hash function h, that is, h(5)=1. Then the element at position 5 in the summary data B can be XORed with 1, that is, if the original value is 0, it is updated to 1, and if the original value is 1, it is updated to 0. In this way, even if multiple different data elements are mapped to the same position, or the same data element is mapped to the same position multiple times, the final summary data B can still accurately reflect the summary information of the original data set. This method not only compresses the storage space, but also improves the processing speed.

[0052] Step 103, in response to the selection of two target data sets, performs an XOR operation on two target summary compressed data corresponding to each of the two target data sets to obtain summary difference data between the target data sets, so that the data in the difference set of the two target data sets is recorded in the summary difference data according to probability distribution.

[0053] In some embodiments of the present application, the difference cardinality of two given databases is estimated when the data outlines are established respectively. In order to estimate the set difference cardinality between two sets, it is first necessary to calculate the joint bit array of their outline data. This is done by an XOR operation of corresponding bits. This process eliminates the common elements of the two sets and only retains their difference sets.

[0054] For example, suppose there are two data sets, A i and A j , their data summaries are denoted as S i and S j , the length is (m = 10). If S i The bit array of S is [1010011100], and j The bit array of is [1101001100], then the corresponding bits can be XORed, and the result is [0111010000], and this new bit array represents the difference cardinality between the two sets. In this example, the result of the XOR operation shows that there are four first values ​​(i.e. 1) in the results of the two XOR operations, which means that data set A i and A j There are four different elements between them. This method quickly and efficiently estimates the cardinality of the difference without directly comparing every element in the two sets.

[0055] Step 104, determine the frequency of occurrence of the second value of the Boolean distribution in the outline difference data, and use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solve the expected function, and use the solved value as the difference value between the target data sets, so that the difference value is positively correlated with the number of data in the difference set of the two target data sets.

[0056] In some embodiments of the present application, a statistical model is used to estimate the cardinality of the difference between two data sets. According to the estimation method, it can be assumed that the probability of the XOR result of the two outline data being 0 is set as an estimated value. Then, the ratio of the total number of digits occupied by the XOR result of the two outline data being 0 (i.e., the frequency) is used as a statistical value, and then the expected formula can be used to calculate the estimated cardinality as the difference value between the target data sets.

[0057] For example, suppose there are two data profiles S i and S j , with lengths of m=10. After the XOR operation, we get 6 bits of Si,j with values ​​of 0. Therefore, the statistical value The value of is 0.6. Assume that there is an expected function x>0, and where p k The probability of each bit taking the value 1. Then x can be solved iteratively until f(x) is close to U. In this way, the cardinality of the difference between the two data sets can be estimated, that is, This value is positively correlated with the number of data in the difference between the two data sets. Assume that in the first iteration, we get This means that we can estimate that there are 4 different elements between the two datasets. This method provides a fast and accurate way to estimate the size of the difference between the datasets.

[0058] In summary, in the embodiment of the present application, the truncated geometric distribution condition is used so that the data in the data set can be recorded according to the probability distribution corresponding to the hash function, so that the outline data of the data set is determined by using a preset hash function, while maintaining the integrity of the data set, the demand for data storage space is effectively reduced; the outline compressed data is then generated by the XOR operation, which further reduces the data storage demand; then the outline compressed data of the target data set is XORed to quickly obtain the outline difference data between the target data sets; finally, the frequency initial value of the second numerical value of the Boolean distribution in the outline difference data is used to solve the expected function of the truncated geometric distribution to determine the difference value between the data sets, making it simpler than direct data comparison, which also improves the analysis speed. Therefore, the method based on the embodiment of the present application effectively reduces memory usage while ensuring the accuracy of the analysis results, and solves the problem that memory usage and analysis result accuracy cannot be taken into account in the process of data set difference analysis of big data.

[0059] Figure 2 Another method for determining the difference between data sets provided in the application embodiment is applied to the data service end, referring to Figure 2 , the method may include the following steps:

[0060] Step 201 , obtain multiple data sets to be compared, and determine the summary data of each data set through a preset hash function, so that the data in each data set is recorded in the corresponding summary data according to the probability distribution corresponding to the hash function.

[0061] Among them, the hash function satisfies the preset truncated geometric distribution condition; the summary data contains multiple data bits, the data bits in the summary data correspond one-to-one to the data in the data set, and each data bit is used to record the existence of the corresponding data in the corresponding data set according to the Boolean distribution.

[0062] The method shown in this step has been explained in step 101 and will not be repeated here.

[0063] Optionally, the cutoff geometric distribution condition is

[0064] In the case of

[0065] In order to determine the summary data of each data set by a preset hash function, step 201 includes the following sub-steps, in which ln(·) represents a logarithmic operation, represents the rounding operation, k represents the index of the representative term of the truncated geometric distribution, θ represents the random value, α and m represent the preset truncated geometric distribution parameters, and h(e) represents the hash value:

[0066] Sub-step 2011, obtain a random value from a uniform distribution.

[0067] In some embodiments of the present application, in order to ensure the randomness of the hash process and the uniform distribution of data, it is necessary to obtain a random value from the uniform distribution. This random value is the hash value calculated later. The selection of this random value ensures that each data element has a fair chance to be mapped to any position in the hash space, so that the hash processing process of the entire data set is fair and unbiased.

[0068] For example, suppose a data element e needs to be hashed. First, a random number generator can be used to obtain a random value θ between 0 and 1. Assume that the generated random value is θ = 0.62. This value will be used in the next step to calculate the hash value h(e) of the data element e according to the given formula.

[0069] Sub-step 2012, follow Calculate the hash value of the dataset.

[0070] In some embodiments of the present application, by formula Convert the random value θ into an integer hash value, which will be used in the subsequent steps to determine the skeleton data of the dataset.

[0071] For example, if the obtained random value θ is 0.62, and the preset truncated geometric distribution parameter α is 0.5, then the hash value can be calculated according to the formula That is, the integer value 1 is calculated, which will represent the position of the data element in the summary data. This process ensures that the data elements are mapped to the summary data according to the preset probability distribution, thus providing a basis for the difference analysis between data sets.

[0072] Sub-step 2013, when h(e)≤m-1, the hash value is used as the summary data.

[0073] In some embodiments of the present application, if the calculated hash value is less than or equal to the preset index of the summary data (i.e., the total length of the bit array minus one, i.e., the number value of the last bit of the bit array), the hash value is directly used as part of the summary data. This ensures that all data elements can be mapped into the valid range of the summary data.

[0074] For example, suppose there is a data set with parameter m=10, and the hash value of a data element calculated in the previous step is h(e)=3. Since this hash value is less than m-1, it can be directly used as the summary data. In the array of summary data, the position with index 3 is marked as 1, indicating the presence of the data element in the data set. This method allows us to quickly map data elements to summary data while maintaining the integrity and accuracy of the data.

[0075] In sub-step 2014, when h(e)>m-1, m-1 is used as the summary data.

[0076] In some embodiments of the present application, if the calculated hash value exceeds the preset index of the summary data, the preset index is used as part of the summary data instead of the actual hash value. This is done to ensure that all data elements can be mapped into the valid range of the summary data, even if their hash values ​​exceed this range.

[0077] For example, suppose the parameter m of the data set is 10, and the hash value of a data element calculated in the previous step is h(e)=11. Since this hash value is greater than m-1=9, 11 will not be used as the summary data, but m-1, that is, 9, will be used as the summary data. In the array of summary data, the position with index 9 is marked as 1, indicating that there are one or more data elements in the data set mapped to this position. This method ensures the integrity of the summary data and avoids the array out-of-bounds problem caused by the hash value being too large.

[0078] like Figure 3 As shown in the figure, the data flow process of transforming the data sets e0 to e3 into hash values ​​h(e0) to h(e3) under the condition of truncated geometric distribution and then storing them as summary data is given. It can be seen from the figure that each bit is used to store a generated hash value.

[0079] Optionally, the cutoff geometric distribution condition is

[0080] In the case of

[0081] In order to determine the summary data of each data set by a preset hash function, step 201 includes the following sub-steps, in which ln(·) represents a logarithmic operation, represents the rounding operation, k represents the number of the representative item of the truncated geometric distribution, r, w and α represent the preset truncated geometric distribution parameters, and l represents the hash value:

[0082] Sub-step 2015, obtain a random value from a uniform distribution.

[0083] The method shown in this step has been explained in step 2011 and will not be repeated here.

[0084] Sub-step 2016, follow Calculate the hash value of the dataset.

[0085] In some embodiments of the present application, by formula Convert the random value θ into an integer hash value, which will be used in the subsequent steps to determine the skeleton data of the dataset.

[0086] For example, assume that the parameters α = 0.3, r = 2, w = 5, and m = rw = 10. And the random value θ = 0.45 was obtained in the previous step. Calculate according to the formula That is, through calculation, an integer value l can be obtained, which will be used to determine the segment of the data element in the block truncation geometric distribution. This process ensures that the data elements are mapped to the skeleton data according to the preset block truncation geometric distribution, thus providing a basis for the difference analysis between data sets.

[0087] Sub-step 2017, when l≤w-1, uses the hash value as the summary data.

[0088] In some embodiments of the present application, if the calculated hash value is less than or equal to the number of segments of the block truncation geometric distribution minus one, the hash value is directly used as part of the summary data. This step ensures that the data element can be mapped into the valid range of the summary data while maintaining the integrity and accuracy of the data.

[0089] For example, suppose there is a parameter w=5, and the hash value of a data element calculated in the previous steps is l=3. Since l≤w-1, this hash value can be directly used as the summary data. In the array of summary data, the position with index 3 is marked as 1, indicating the existence of the data element in the data set. This method ensures that the data elements can be quickly mapped to the summary data while maintaining the integrity and accuracy of the data. If the array length of the summary data is m, the position of index 3 will correspond to the fourth position in the array (because the index starts from 0).

[0090] Sub-step 2018, when l>w-1, update the hash value with w-1, and generate a random integer in the discontinuous half-open and half-closed interval [rl,r(l+1)),l=0,…,w-1, and use the generated random integer as the summary data.

[0091] In some embodiments of the present application, when the calculated hash value exceeds the preset index of the block truncation geometric distribution (i.e., the number of segments minus one), the preset index is updated to a new hash value, and a random integer is generated within the half-open and half-closed interval determined by the original hash value. Then, this random integer is used as part of the skeleton data. This ensures that even if the hash value of the data element exceeds the preset range, they can still be mapped to the valid interval of the skeleton data.

[0092] For example, suppose there are parameters r=2, w=5, and the hash value of a data element calculated in the previous step is l=6. Since l>w-1, w-1, that is, 4, is used as the new hash value, and a random integer λ is generated in the interval [2·4,2·(4+1))=[8,10). Assuming that the generated random integer is λ=9, this value is used as the skeleton data. In the array of the skeleton data, the position with index 9 is marked as 1. This method ensures the integrity of the skeleton data and also adapts to the characteristics of the block truncated geometric distribution.

[0093] like Figure 4As shown in the figure, the data flow process of transforming data sets e0 to e3 into hash values ​​h(e0) to h(e3) under the condition of block truncation geometric distribution and then storing them as summary data is given. It can be seen from the figure that in the final summary data, every r bits form a block to store the generated hash value.

[0094] Step 202: perform an XOR operation on each bit in each summary data and the first value of the Boolean distribution to obtain the summary compressed data of each data set.

[0095] The method shown in this step has been explained in step 102 and will not be repeated here.

[0096] Step 203, in response to the selection of two target data sets, performs an XOR operation on two target summary compressed data corresponding to each of the two target data sets to obtain summary difference data between the target data sets, so that the data in the difference set of the two target data sets is recorded in the summary difference data according to probability distribution.

[0097] The method shown in this step has been explained in step 103 and will not be repeated here.

[0098] Optionally, in order to perform an XOR operation on two target outline compressed data corresponding to each of the two target data sets to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets are recorded in the outline difference data according to probability distribution, step 203 includes the following sub-steps:

[0099] Step 2031, determining a joint bit array of two target data sets based on the two target outline compressed data.

[0100] Among them, the joint bit array contains multiple binary values, and the two array values ​​in the binary values ​​in the joint bit array correspond to the data in the two target data sets respectively, and each array value is used to record the existence of the corresponding data in the corresponding data set according to the Boolean distribution.

[0101] In some embodiments of the present application, it is necessary to determine the joint bit array of two target data sets based on their outline compressed data. In this process, the outline compressed data of each data set is composed of multiple binary values, which correspond one-to-one to the data in the data set and record the existence of the data in the data set. The joint bit array is formed by comparing and combining the outline compressed data of the two target data sets, which reflects the difference between the two data sets.

[0102] For example, suppose two target data sets A and B are selected, and their summary compressed data are

[1010] and

[1100] respectively. Then compare each bit of the two summary compressed data to determine the joint bit array. For the first bit, A is 1 and B is also 1, so the first bit of the joint bit array is (1,1); for the second bit, A is 0 and B is 1, so the second bit of the joint bit array is (0,1); and so on, we can get the joint bit array [(1,1)(0,1)(1,0)(0,0)]. This joint bit array will be used for subsequent XOR operations to determine the summary difference data between the two data sets.

[0103] Step 2032: Use two array values ​​in the binary value in the joint bit array as two items of an XOR operation to obtain an XOR result, and use each XOR result as one item of the summary difference data.

[0104] In some embodiments of the present application, the binary values ​​in the joint bit array are XORed to obtain the summary difference data. This process involves XORing the corresponding bits in the summary compressed data of the two target data sets, thereby obtaining the summary difference data representing the difference between the two data sets. Each XOR result will be used as an item of the summary difference data, which can effectively reveal the difference between the two data sets under the Boolean distribution.

[0105] For example, if the joint bit array is [(1,1)(0,1)(1,0)(0,0)], then an XOR operation will be performed on each bit in this array. The first bit is 0, the second bit is 1, and the third bit is 1; and so on, the summary difference data

[0110] can be obtained. This summary difference data represents the difference between the two data sets, where each 0 indicates that there is a difference in the data at that position between the two data sets. This method quickly and effectively reveals the difference between the two data sets and provides a basis for further data analysis.

[0106] Step 204, determine the frequency of occurrence of the second value of the Boolean distribution in the summary difference data, and use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solve the expected function, and use the solved value as the difference value between the target data sets, so that the difference value is positively correlated with the number of data in the difference set of the two target data sets.

[0107] The method shown in this step has been described in step 104 and will not be repeated here.

[0108] Optionally, in order to determine the frequency of occurrence of the second value of the Boolean distribution in the summary difference data, step 204 includes the following sub-steps:

[0109] Step 2041, counting the second frequency of occurrence of the second value in the summary difference data and the first frequency of occurrence of the first value in the summary difference data.

[0110] In some embodiments of the present application, it is necessary to count the frequency of occurrence of the first value (1) and the second value (0) of the Boolean distribution in the summary difference data. In this step, the summary difference data needs to be analyzed to calculate the number of occurrences of the first value and the second value therein. This statistical result will be used to calculate the frequency of the difference between the two data sets.

[0111] For example, suppose there is a set of summary difference data [0110101]. In this data, the first value (1) appears 4 times and the second value (0) appears 3 times. Therefore, the first frequency is 4 and the second frequency is 3. This statistical information will be used in the next sub-step to calculate the frequency of the second value, that is, the ratio of the second frequency to the sum of the first frequency and the second frequency. This statistical method is used to provide a means to quantify the size of the difference between two data sets.

[0112] Step 2042: taking the ratio of the second frequency to the sum of the first frequency and the second frequency as the frequency.

[0113] In some embodiments of the present application, it is necessary to calculate the frequency of occurrence of the second value of the Boolean distribution in the summary difference data. This is achieved by dividing the second frequency (the number of times 0 appears) by the sum of the first frequency (the number of times 1 appears) and the second frequency. This ratio will reflect the frequency of occurrence of the second value relative to all values ​​in the summary difference data, thereby providing a quantitative indicator of the size of the difference between the two data sets.

[0114] For example, continuing with the outline difference data [0110101] in the previous embodiment, since it is known that the first frequency (the number of times 1 appears) is 4 and the second frequency (the number of times 0 appears) is 3. Therefore, the frequency of the second value is:

[0115] Frequency = second frequency / (first frequency + second frequency) = 3 / (4 + 3) = 3 / 7 This frequency value indicates that in the summary difference data, the proportion of the second value (0) is about 43.86%. This ratio can be used to estimate the degree of difference between two data sets, where a higher frequency means a greater difference.

[0116] Optional, expects the function to be x>0, in order to use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solve the expected function and use the solved value as the difference value between the target data sets, step 204 includes the following sub-steps:

[0117] Step 2043, using the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, and iteratively solving the expected function according to Newton's method to obtain an iterative solution of the expected function, and using the iterative solution as the difference value between the target data sets.

[0118] In some embodiments of the present application, Newton's method is used to iteratively solve the expected function f(x), wherein the initial value of the expected function is the frequency of occurrence of the second numerical value obtained in sub-step 2042, and approximating the root of the expected function through continuous iterations will reflect the size of the difference between the two data sets.

[0119] For example, suppose the frequency of the second value of the summary difference data is 0.75, then the frequency 0.75 is used as the initial value x0, and then Newton's method is applied to the formula x>0 is solved iteratively. In each iteration, the function and its derivatives are calculated and the value of x is updated until the required accuracy is reached or the number of iterations reaches the preset limit. Finally, an iterative solution can be obtained. It serves as an estimate of the difference between the two data sets. The larger this value, the greater the difference between the two data sets. For example, if the iterative solution is Then it can be considered that there is a difference of 3.5 units between the two data sets. This method provides an effective means to quantify and compare the differences between data sets. By calculation, it can be found that at the tth iteration (t≤1), the estimated difference cardinality is for:

[0120] In summary, in the embodiment of the present application, the truncated geometric distribution condition is used so that the data in the data set can be recorded according to the probability distribution corresponding to the hash function, so that the outline data of the data set is determined by using a preset hash function, while maintaining the integrity of the data set, the demand for data storage space is effectively reduced; the outline compressed data is then generated by the XOR operation, which further reduces the data storage demand; then the outline compressed data of the target data set is XORed to quickly obtain the outline difference data between the target data sets; finally, the frequency initial value of the second numerical value of the Boolean distribution in the outline difference data is used to solve the expected function of the truncated geometric distribution to determine the difference value between the data sets, making it simpler than direct data comparison, which also improves the analysis speed. Therefore, the method based on the embodiment of the present application effectively reduces memory usage while ensuring the accuracy of the analysis results, and solves the problem that memory usage and analysis result accuracy cannot be taken into account in the process of data set difference analysis of big data.

[0121] refer to Figure 5 , which shows a system 30 for determining differences between data sets provided in an embodiment of the present application, applied to a data service end, and the system 30 includes:

[0122] The preprocessing subsystem 301 is used to obtain multiple data sets to be compared, and determine the summary data of each data set through a preset hash function, so that the data in each data set is recorded in the corresponding summary data according to the probability distribution corresponding to the hash function; the hash function satisfies the preset truncated geometric distribution condition; the summary data contains multiple data bits, the data bits in the summary data correspond to the data in the data set one by one, and each data bit is used to record the existence of the corresponding data in the corresponding data set according to the Boolean distribution;

[0123] An updating subsystem 302 is used to perform an XOR operation on each bit in each summary data and a first value of the Boolean distribution to obtain summary compressed data of each data set;

[0124] The computing subsystem 303 is used to perform an XOR operation on two target outline compressed data corresponding to each of the two target data sets in response to the selection of two target data sets, so as to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets are recorded in the outline difference data according to the probability distribution; the computing subsystem is also used to determine the frequency of occurrence of the second value of the Boolean distribution in the outline difference data, and use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solve the expected function, and use the solved value as the difference value between the target data sets, so that the difference value is positively correlated with the amount of data in the difference set of the two target data sets.

[0125] like Figure 6 As shown in the figure, when you need to compare the differences between data set A and data set B, follow the following process:

[0126] S1: Input data set A and data set B into the preprocessing subsystem to obtain the skeleton data with hash codes;

[0127] S2: Inputting the summary data with the hash code into the update subsystem to obtain compressed data;

[0128] S3: Input the obtained compressed data into the computing subsystem to obtain the difference value between the data set A and the data set B.

[0129] Figure 7 It is a further process of step S1, and is performed according to the following process:

[0130] S11: Obtain data set A and data set B;

[0131] S12: Use a hash function to process data set A and data set B respectively, obtain corresponding hash values, and obtain summary data.

[0132] Figure 8 It is a further process of step S1, and is performed according to the following process:

[0133] S21: Initialize a file for storing data outlines;

[0134] S22: Receive the corresponding hash value;

[0135] S23: Update the hash value into the initialized file by XORing it with 1.

[0136] Fig. 9 It is a further process of step S1, and is performed according to the following process:

[0137] S31: receiving the summary data of the data set A and the data set B respectively;

[0138] S32: fusing the outline data of the data set A and the data set B through an XOR process to obtain outline difference data recording the characteristics of the difference set of the data set A and the data set B;

[0139] S33: Solve iteratively according to the outline difference data to obtain the cardinality result.

[0140] Optionally, the cutoff geometric distribution condition is

[0141] In the case of

[0142] In order to determine the summary data of each data set by using a preset hash function, the pre-processing subsystem 301 is further used to:

[0143] Get a random value from a uniform distribution;

[0144] according to Calculate the hash value of the dataset;

[0145] When h(e)≤m-1, the hash value is used as the summary data;

[0146] When h(e)>m-1, m-1 is used as the summary data;

[0147] Where ln(·) represents the logarithmic operation, represents a rounding operation, k represents the index of the representative term of the truncated geometric distribution, θ represents a random value, α and m represent the preset truncated geometric distribution parameters respectively, and h(e) represents a hash value.

[0148] Optionally, the cutoff geometric distribution condition is

[0149] In the case of

[0150] In order to determine the summary data of each data set by using a preset hash function, the pre-processing subsystem 301 is further used to:

[0151] Get a random value from a uniform distribution;

[0152] according to Calculate the hash value of the dataset;

[0153] When l≤w-1, the hash value is used as the summary data;

[0154] In the case of l>w-1, the hash value is updated with w-1, and a random integer is generated in the discontinuous half-open and half-closed interval [rl,r(l+1)),l=0,…,w-1, and the generated random integer is used as the summary data;

[0155] Where ln(·) represents the logarithmic operation, represents the rounding operation, k represents the index of the representative term of the truncated geometric distribution, r , w and α represent the preset truncated geometric distribution parameters respectively, and l represents the hash value.

[0156] Optionally, in order to perform an XOR operation on two target outline compressed data corresponding to each of the two target data sets to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets are recorded in the outline difference data according to probability distribution, the computing subsystem 303 is further used to:

[0157] According to the two target outlines, compressed data is compressed to determine a joint bit array of the two target data sets; the joint bit array includes a plurality of binary values, two array values ​​in the binary values ​​in the joint bit array correspond to the data in the two target data sets respectively, and each array value is used to record the existence of the corresponding data in the corresponding data set according to Boolean distribution;

[0158] Two array values ​​in the binary value in the joint bit array are used as two terms of an exclusive OR operation to obtain an exclusive OR result, and each exclusive OR result is used as one item of the summary difference data.

[0159] Optionally, in order to determine the frequency of occurrence of the second value of the Boolean distribution in the summary difference data, the calculation subsystem 303 is further used to:

[0160] Counting the second frequency of occurrence of the second value in the summary difference data, and the first frequency of occurrence of the first value in the summary difference data;

[0161] The ratio of the second frequency to the sum of the first frequency and the second frequency is taken as the frequency.

[0162] Optional, expects the function to be x>0, in order to use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solve the expected function, and use the solved value as the difference value between the target data sets, the computing subsystem 303 is further used to:

[0163] The frequency is used as the initial value of the expectation function corresponding to the truncated geometric distribution condition, and the expectation function is iteratively solved according to Newton's method to obtain an iterative solution of the expectation function, and the iterative solution is used as the difference value between the target data sets.

[0164] refer to Fig.10 , which shows a device 40 for determining differences between data sets provided in an embodiment of the present application, applied to a data service end, and the device 40 includes:

[0165] The preprocessing module 401 is used to take multiple data sets to be compared, and determine the summary data of each data set through a preset hash function, so that the data in each data set is recorded in the corresponding summary data according to the probability distribution corresponding to the hash function; the hash function satisfies the preset truncated geometric distribution condition; the summary data contains multiple data bits, the data bits in the summary data correspond to the data in the data set one by one, and each data bit is used to record the existence of the corresponding data in the corresponding data set according to the Boolean distribution;

[0166] An updating compression module 402 is used to perform an XOR operation on each bit in each summary data and the first value of the Boolean distribution to obtain the summary compressed data of each data set;

[0167] The difference calculation module 403 is used for performing an XOR operation on two target outline compressed data corresponding to the two target data sets in response to the selection of the two target data sets, so as to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets are recorded in the outline difference data according to probability distribution;

[0168] The analysis module 404 is used to determine the frequency of occurrence of the second value of the Boolean distribution in the summary difference data, and use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solve the expected function, and use the solved value as the difference value between the target data sets, so that the difference value is positively correlated with the number of data in the difference set of the two target data sets.

[0169] Optionally, the cutoff geometric distribution condition is

[0170] In the case of

[0171] The preprocessing module 401 includes:

[0172] A first random value submodule, used to obtain a random value from a uniform distribution;

[0173] The first hash value submodule is used to Calculate the hash value of the dataset;

[0174] A first summary submodule, for using the hash value as summary data when h(e)≤m-1;

[0175] The second summary submodule is used to use m-1 as summary data when h(e)>m-1;

[0176] Where ln(·) represents the logarithmic operation, represents a rounding operation, k represents the index of the representative term of the truncated geometric distribution, θ represents a random value, α and m represent the preset truncated geometric distribution parameters respectively, and h(e) represents a hash value.

[0177] Optionally, the cutoff geometric distribution condition is

[0178] In the case of

[0179] The preprocessing module 401 includes:

[0180] A second random value submodule is used to obtain a random value from a uniform distribution;

[0181] The second hash value submodule is used to Calculate the hash value of the dataset;

[0182] A third summary submodule, for taking the hash value as summary data when l≤w-1;

[0183] A fourth outline submodule is used to update the hash value with w-1 when l>w-1, and generate a random integer in a discontinuous half-open and half-closed interval [rl, r(l+1)), l=0,…,w-1, and use the generated random integer as the outline data;

[0184] Where ln(·) represents the logarithmic operation, represents the rounding operation, k represents the index of the representative term of the truncated geometric distribution, r , w and α represent the preset truncated geometric distribution parameters respectively, and l represents the hash value.

[0185] Optionally, the difference calculation module 403 includes:

[0186] A joint array submodule is used to compress data according to two target outlines and determine a joint bit array of two target data sets; the joint bit array contains multiple binary values, and two array values ​​in the binary values ​​in the joint bit array correspond to the data in the two target data sets one by one, and each array value is used to record the existence of the corresponding data in the corresponding data set according to Boolean distribution;

[0187] The difference submodule is used to use two array values ​​in the binary numerical value in the joint bit array as two items of the XOR operation to obtain an XOR result, and each XOR result is used as one item of the summary difference data.

[0188] Optionally, the analysis module 404 includes:

[0189] A statistical submodule, used to count the second frequency of occurrence of the second value in the summary difference data, and the first frequency of occurrence of the first value in the summary difference data;

[0190] The frequency submodule is used to take the ratio of the second frequency to the sum of the first frequency and the second frequency as the frequency.

[0191] Optional, expects the function to be x>0, the analysis module 404 includes:

[0192] The iterative solution submodule is used to use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, and iteratively solve the expected function according to Newton's method to obtain the iterative solution of the expected function, and use the iterative solution as the difference value between the target data sets.

[0193] In summary, in the embodiment of the present application, the truncated geometric distribution condition is used so that the data in the data set can be recorded according to the probability distribution corresponding to the hash function, so that the outline data of the data set is determined by using a preset hash function, while maintaining the integrity of the data set, the demand for data storage space is effectively reduced; the outline compressed data is then generated by the XOR operation, which further reduces the data storage demand; then the outline compressed data of the target data set is XORed to quickly obtain the outline difference data between the target data sets; finally, the frequency initial value of the second numerical value of the Boolean distribution in the outline difference data is used to solve the expected function of the truncated geometric distribution to determine the difference value between the data sets, making it simpler than direct data comparison, which also improves the analysis speed. Therefore, the method based on the embodiment of the present application effectively reduces memory usage while ensuring the accuracy of the analysis results, and solves the problem that memory usage and analysis result accuracy cannot be taken into account in the process of data set difference analysis of big data.

[0194] Reference Fig.11, the electronic device 500 may include one or more of the following components: a processing component 502 , a memory 504 , a power component 506 , a multimedia component 508 , an audio component 510 , an input / output (I / O) interface 512 , a sensor component 514 , and a communication component 516 .

[0195] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 520 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.

[0196] The memory 504 is used to store various types of data to support the operation of the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, multimedia, etc. The memory 504 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0197] The power supply component 506 provides power to the various components of the electronic device 500. The power supply component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 500.

[0198] The multimedia component 508 includes an interface that provides an output interface between the electronic device 500 and the user. In some embodiments, the interface may include a liquid crystal display (LCD) and a touch panel (TP). If the interface includes a touch panel, the interface may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a multimedia mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0199] The audio component 510 is used to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC), and when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is used to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 516. In some embodiments, the audio component 510 also includes a speaker for outputting audio signals.

[0200] The input / output I / O interface 512 provides an interface between the processing component 502 and the peripheral interface module, which may be a keyboard, a click wheel, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0201] The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the electronic device 500. For example, the sensor assembly 514 can detect the open / closed state of the electronic device 500, the relative positioning of components, such as the display and keypad of the electronic device 500, and the sensor assembly 514 can also detect the position change of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and the temperature change of the electronic device 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 514 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0202] The communication component 516 is used to facilitate wired or wireless communication between the electronic device 500 and other devices. The electronic device 500 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0203] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to implement the methods provided in the embodiments of the present application.

[0204] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, and the instructions can be executed by a processor 520 of an electronic device 500 to perform the above method. For example, the non-transitory storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0205] Fig.12 600 is a block diagram of an electronic device 600 according to another embodiment of the present invention. For example, the electronic device 600 may be provided as a server. Fig.12 , the electronic device 600 includes a processing component 622, which further includes one or more processors, and a memory resource represented by a memory 632, for storing instructions that can be executed by the processing component 622, such as an application. The application stored in the memory 632 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 622 is configured to execute instructions to perform the method provided in the embodiment of the present application.

[0206] The electronic device 600 may also include a power supply component 626 configured to perform power management of the electronic device 600, a wired or wireless network interface 650 configured to connect the electronic device 600 to a network, and an input / output (I / O) interface 658. The electronic device 600 may operate based on an operating system stored in the memory 632, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0207] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0208] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for determining differences between data sets, applied to a data server, characterized in that: include: Acquire multiple data sets to be compared, and determine summary data of each of the data sets by using a preset hash function, so that data in each of the data sets is recorded in the corresponding summary data according to a probability distribution corresponding to the hash function; The hash function satisfies a preset truncated geometric distribution condition; the summary data includes a plurality of data bits, the data bits in the summary data correspond one-to-one to the data in the data set, and each of the data bits is used to record the existence of the corresponding data in the corresponding data set according to a Boolean distribution; Performing an exclusive OR operation on each bit in each of the summary data and the first value of the Boolean distribution, respectively, to obtain summary compressed data of each of the data sets; In response to the selection of two target data sets, performing an XOR operation on two target outline compressed data corresponding to the two target data sets respectively to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets is recorded in the outline difference data according to the probability distribution; Determine the frequency of occurrence of the second value of the Boolean distribution in the outline difference data, and use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solve the expected function, and use the solved value as the difference value between the target data sets, so that the difference value is positively correlated with the amount of data in the difference set of the two target data sets.

2. The method according to claim 1, characterized in that The truncated geometric distribution condition is In the case of, determining the summary data of each of the data sets by a preset hash function includes: Get a random value from a uniform distribution; according to Calculating a hash value of the data set; In the case where h(e)≤m-1, the hash value is used as the summary data; When h(e)>m-1, m-1 is used as the summary data; Where ln(·) represents the logarithmic operation, represents a rounding operation, k represents the number of the representative term of the truncated geometric distribution, θ represents the random value, α and m represent preset truncated geometric distribution parameters respectively, and h(e) represents the hash value.

3. The method according to claim 1, characterized in that The truncated geometric distribution condition is In the case of, determining the summary data of each of the data sets by a preset hash function includes: Get a random value from a uniform distribution; according to Calculating a hash value of the data set; In the case where l≤w-1, the hash value is used as the summary data; In the case of l>w-1, the hash value is updated with w-1, and a random integer is generated in a discontinuous half-open and half-closed interval [rl, r(l+1)), l=0, ..., w-1, and the generated random integer is used as the summary data; Where ln(·) represents the logarithmic operation, represents a rounding operation, k represents the label of the representative item of the truncated geometric distribution, r, w and α represent preset truncated geometric distribution parameters respectively, and l represents the hash value.

4. The method according to claim 1, characterized in that The performing an XOR operation on two target outline compressed data corresponding to each of the two target data sets to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets is recorded in the outline difference data according to the probability distribution, comprises: Determine a joint bit array of the two target data sets according to the two target outline compressed data; the joint bit array includes a plurality of binary values, two array values ​​in the binary values ​​in the joint bit array correspond to the data in the two target data sets respectively, and each array value is used to record the existence of the corresponding data in the corresponding data set according to Boolean distribution; Two array values ​​in the binary value in the joint bit array are used as two items of an exclusive OR operation to obtain an exclusive OR result, and each of the exclusive OR results is used as one item of the summary difference data.

5. The method according to claim 1, characterized in that The determining the frequency of occurrence of the second value of the Boolean distribution in the summary difference data comprises: Counting a second frequency of occurrence of a second value in the summary difference data and a first frequency of occurrence of a first value in the summary difference data; The ratio of the second frequency to the sum of the first frequency and the second frequency is used as the frequency.

6. The method according to claim 2 or 3, characterized in that: The expected function is The step of using the frequency as an initial value of an expected function corresponding to the truncated geometric distribution condition, solving the expected function, and using the solved value as a difference value between the target data sets includes: The frequency is used as the initial value of the expected function corresponding to the truncated geometric distribution condition, and the expected function is iteratively solved according to Newton's method to obtain an iterative solution of the expected function, and the iterative solution is used as the difference value between the target data sets.

7. A system for determining differences between data sets, applied to a data server, characterized in that: The system comprises: A preprocessing subsystem, used to obtain multiple data sets to be compared, and determine the summary data of each of the data sets through a preset hash function, so that the data in each of the data sets is recorded in the corresponding summary data according to the probability distribution corresponding to the hash function; the hash function satisfies a preset truncated geometric distribution condition; the summary data contains multiple data bits, the data bits in the summary data correspond to the data in the data sets one by one, and each of the data bits is used to record the existence of the corresponding data in the corresponding data set according to the Boolean distribution; An updating subsystem, used for performing an exclusive OR operation on each bit in each of the summary data and the first value of the Boolean distribution, so as to obtain the summary compressed data of each of the data sets; A computing subsystem is used for, in response to the selection of two target data sets, performing an XOR operation on two target outline compressed data corresponding to each of the two target data sets to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets are recorded in the outline difference data according to the probability distribution; the computing subsystem is also used for determining the frequency of occurrence of the second value of the Boolean distribution in the outline difference data, and using the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solving the expected function, and using the solved value as the difference value between the target data sets, so that the difference value is positively correlated with the amount of data in the difference set of the two target data sets.

8. A device for determining differences between data sets, applied to a data service end, characterized in that: The device comprises: A preprocessing module, used to take multiple data sets to be compared, and determine the summary data of each of the data sets through a preset hash function, so that the data in each of the data sets is recorded in the corresponding summary data according to the probability distribution corresponding to the hash function; the hash function satisfies a preset truncated geometric distribution condition; the summary data contains multiple data bits, the data bits in the summary data correspond to the data in the data sets one by one, and each of the data bits is used to record the existence of the corresponding data in the corresponding data set according to the Boolean distribution; An updating compression module is used to perform an XOR operation on each bit in each of the summary data and the first value of the Boolean distribution to obtain the summary compressed data of each of the data sets; a difference obtaining module, configured to, in response to the selection of two target data sets, perform an XOR operation on two target outline compressed data corresponding to the two target data sets respectively, so as to obtain outline difference data between the target data sets, so that the data in the difference set of the two target data sets is recorded in the outline difference data according to the probability distribution; An analysis module is used to determine the frequency of occurrence of the second value of the Boolean distribution in the outline difference data, and use the frequency as the initial value of the expected function corresponding to the truncated geometric distribution condition, solve the expected function, and use the solved value as the difference value between the target data sets, so that the difference value is positively correlated with the amount of data in the difference set of the two target data sets.

9. An electronic device, characterized in that: include: A processor, a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform the method as claimed in any one of claims 1 to 6.

Citation Information

Cited By

  • Battery production data difference detection method, device, equipment, medium and product

    CN119537971A