Data sharing method, apparatus, device, storage medium, and program product
By performing random mapping and pseudo-random operations on the raw data to generate an encoding matrix, the problem of poor data privacy in inter-departmental information sharing platforms is solved, achieving both privacy and security in data sharing and improving efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING TOPWALK INFORMATION TECH CO LTD
- Filing Date
- 2024-01-19
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies, information sharing between departments is done in plaintext, which leads to poor data privacy and affects the degree and security of information sharing.
By randomly mapping multiple raw data, position indices and sequences are generated to form an encoding matrix. Pseudo-random operations are then used to determine the data to be shared, thus avoiding the leakage of local data other than the data to be shared.
It achieves privacy and security in data sharing, improves data sharing efficiency, avoids repetitive coding processes, and ensures data privacy and security.
Smart Images

Figure CN118013568B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of data sharing, and in particular to a data sharing method and device, equipment, storage medium and program product. BACKGROUND
[0002] With the construction of e-government infrastructure, various types of business data and information resources play an important role within the department. Due to the independent construction of the system by each department, the departments are not connected, resulting in a low information linkage rate between departments.
[0003] Currently, cross-department information sharing and services are often achieved through an inter-department information sharing platform (ISSP).
[0004] However, the information sharing method of the inter-department information sharing platform is plaintext sharing, which leads to poor data privacy, thereby affecting the degree of information sharing and security. SUMMARY
[0005] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a data sharing method, device, equipment, storage medium and program product, which can avoid the leakage of data other than the data to be shared in local data, and ensure the privacy and security of data sharing.
[0006] In a first aspect, the present application provides a data sharing method. The method comprises:
[0007] performing first random mapping on a plurality of first original data to obtain a position index in a first sequence corresponding to each of the first original data; performing second random mapping on each of the first original data to obtain a second sequence corresponding to each of the first original data; the first sequence is a row in a matrix obtained by performing first random mapping on the plurality of first original data;
[0008] performing third mapping on each of the second sequences according to the position index to obtain an encoding matrix, and performing pseudo-random operation on the plurality of first original data based on the encoding matrix to obtain a first operation result;
[0009] receiving a second operation result corresponding to a plurality of second original data sent by a second object, determining data to be shared according to the first operation result and the second operation result, and sending the data to be shared to a first object and / or the second object; the second operation result is obtained by performing pseudo-random operation on the plurality of second original data by the second object based on the encoding matrix.
[0010] In a possible implementation manner of the first aspect, the number of rows of the encoding matrix is the same as the length of the first sequence; and the number of columns of the encoding matrix is the same as the length of the second sequence.
[0011] In a possible implementation manner of the first aspect, the second sequence is mapped to the encoding matrix according to the position index, including: for each first original data, the second sequence corresponding to the first original data is mapped to an encoding sequence according to the position index, and the encoding matrix of the plurality of first original data is generated based on all encoding sequences corresponding to the first original data and all position indexes.
[0012] In a possible implementation manner of the first aspect, for each first original data, the second sequence corresponding to the first original data is mapped to an encoding sequence according to the position index, including: the row index in the encoding matrix is determined according to the position index, and the second sequence is mapped to one or more rows of encoding sequences in the encoding matrix according to the row index.
[0013] In a possible implementation manner of the first aspect, the result obtained after the second sequence is subjected to the XOR operation with one or more rows of encoding sequences in the encoding matrix is related.
[0014] In a possible implementation manner of the first aspect, the encoding matrix of the plurality of first original data is generated based on all encoding sequences corresponding to the first original data and all position indexes, including: for each encoding sequence, a row of the encoding matrix is generated according to the row index corresponding to the encoding sequence.
[0015] In a possible implementation manner of the first aspect, the to-be-shared data is determined according to the first operation result and the second operation result, including: the first operation result and the second operation result are compared, and the first original data or the second original data corresponding to the same element in the first operation result and the second operation result is determined as the to-be-shared data.
[0016] In a possible implementation manner of the first aspect, the position index in the first sequence corresponding to each first original data is obtained by performing the first random mapping on the plurality of first original data, including: the first random operation is performed on the first original data to obtain a random value corresponding to the first original data, and the random value is taken as the position index corresponding to the first original data.
[0017] The second aspect of the present application further provides a data sharing method. The method comprises:
[0018] receiving an encoding matrix sent by a first object;
[0019] performing a pseudo-random operation on a plurality of second original data based on the encoding matrix to obtain a second operation result;
[0020] The second operation result is sent to the first object.
[0021] In a third aspect, the present application provides a data sharing device. The device comprises:
[0022] The mapping module is configured to perform first random mapping on the plurality of first original data to obtain a position index in a first sequence corresponding to each first original data; and perform second random mapping on each first original data to obtain a second sequence corresponding to each first original data. The first sequence is a row in a matrix obtained by performing the first random mapping on the plurality of first original data.
[0023] The operation module is configured to perform third mapping on each second sequence according to the position index to obtain an encoding matrix, and perform pseudo-random operation on the plurality of first original data based on the encoding matrix to obtain a first operation result.
[0024] The sharing module is configured to receive a second operation result corresponding to a plurality of second original data sent by a second object, determine to-be-shared data according to the first operation result and the second operation result, and send the to-be-shared data to the first object and / or the second object. The second operation result is obtained by performing pseudo-random operation on the plurality of second original data based on the encoding matrix by the second object.
[0025] In a fourth aspect, the present application provides a computer device. The computer device comprises a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the method of the first aspect is implemented.
[0026] In a fifth aspect, the present application provides a computer readable storage medium. The computer readable storage medium stores a computer program. When the computer program is executed by a processor, the method of the first aspect is implemented.
[0027] In a sixth aspect, the present application provides a computer program product. The computer program product comprises a computer program. When the computer program is executed by a processor, the method of the first aspect is implemented.
[0028] This application provides a data sharing method, apparatus, device, storage medium, and program product. One party sharing the data can perform a first random mapping on multiple local first raw data sets to obtain the position index of the corresponding row (i.e., first sequence) in the matrix for each first raw data set. Then, a second random mapping is performed on each first raw data set to obtain a second sequence corresponding to each first raw data set. Next, for each first raw data set, the second sequences corresponding to all first raw data sets are mapped into an encoding matrix based on the position index, completing the encoding of multiple first raw data sets. Finally, a pseudo-random operation is performed on the first and second raw data sets based on the encoding matrix by an inter-departmental information sharing platform, and the data to be shared is determined based on the results of the two operations. The method provided in this application allows one party to directly encode local data, and then the inter-departmental information sharing platform determines the data to be shared based on the encoding matrix and the other party's data, avoiding the leakage of data other than the data to be shared in the local data set, thus ensuring the privacy and security of data sharing. Moreover, the encoding matrix in this application is generated based on the original data of one of the objects (i.e., the first object). When this object needs to share data with multiple other different objects, the encoding matrix can be used directly without generating a new encoding matrix. Compared with the prior art, which requires encoding based on the original data of two or more parties sharing data, and requires re-encoding every time a shared object is changed, this application generates an encoding matrix based on the data of only one party, without repeated encoding, thus improving the efficiency of data sharing. Attached Figure Description
[0029] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:
[0030] Figure 1 This is a diagram illustrating the application environment of a data sharing method in one embodiment.
[0031] Figure 2 This is a flowchart illustrating a data sharing method in one embodiment;
[0032] Figure 3 This is another flowchart illustrating the data sharing method in one embodiment;
[0033] Figure 4 This is a structural block diagram of a data sharing device in one embodiment;
[0034] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0035] The application will be described in further detail below with reference to the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related application, and not to limit the application. In addition, it should be noted that, for the sake of description, only the parts related to the application are shown in the drawings.
[0036] It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict. The application will be described in further detail below with reference to the drawings and embodiments. In addition, the term "and / or" herein is only used to describe the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, and not to describe a specific order of the objects.
[0037] The data sharing method provided by the embodiments of the present application can be applied to the application environment as shown in Figure 1 . Among them, the inter-department information sharing platform 106 is deployed on the server 102 and the server 104 respectively, and the server 102 and the server 104 communicate through the network. The server 102 and the server 104 can encode the local data through the locally deployed inter-department information sharing platform 106, and determine the data to be shared according to the encoding result. Among them, the server 102 can be implemented by an independent server or a server cluster composed of multiple servers; the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0038] In one embodiment, as shown in Figure 2 , a data sharing method is provided. Taking the server 102 in Figure 1 as an example, the method includes the following steps:
[0039] Step 101, performing first random mapping on a plurality of first original data to obtain a position index in a first sequence corresponding to each first original data; performing second random mapping on each first original data to obtain a second sequence corresponding to each first original data.
[0040] Among them, the first original data is private data of the server 102 side, which is stored locally on the server 102. The plurality of first original data can be represented as {x1,...,x i ,…,x n}. The first sequence is a row in the matrix obtained by performing first random mapping on the plurality of first original data.
[0041] In the embodiments of the present application, the first random mapping is performed on the plurality of first original data to generate a matrix V, each first original data corresponds to a row (i.e., a first sequence) in the matrix V, and each first original data is mapped to a corresponding position in the corresponding row in the matrix V, so as to obtain a position index corresponding to each first original data. For example, the first original data x1 is mapped to the 5th and 8th positions in the first row of the matrix V, and the position index corresponding to the first original data x1 is 5 and 8; the first original data x2 is mapped to the 3rd and 7th positions in the second row of the matrix V, and the position index corresponding to the first original data x2 is 3 and 7; the first original data x6 is mapped to the 5th and 11th positions in the sixth row of the matrix V, and the position index corresponding to the first original data x6 is 5 and 11.
[0042] It can be understood that if the length of the first sequence is v, the matrix V is a matrix of n rows and v columns.
[0043] Then, the second random mapping is performed on the plurality of first original data to generate a matrix X, each first original data corresponds to a row (i.e., a second sequence) in the matrix X. Each value in the second sequence is a first value or a second value. The first value is 0 and the second value is 1, or the first value is 1 and the second value is 0, i.e., the second sequence obtained by the second random mapping of each first original data is a bit sequence.
[0044] It can be understood that if the length of the second sequence is x, the matrix X is a matrix of n rows and x columns.
[0045] In a possible implementation, the second random mapping can be performed on the plurality of first original data by using a hash function to obtain the second sequence h(x i ) corresponding to each first original data.
[0046] It can be understood that the mapping manner of the first random mapping is different from the mapping manner of the second random mapping.
[0047] In step 102, the third mapping is performed on each second sequence according to the position index to obtain an encoding matrix, and a pseudo-random operation is performed on the plurality of first original data based on the encoding matrix to obtain a first operation result.
[0048] The number of rows of the encoding matrix is the same as the length of the first sequence, and the number of columns of the encoding matrix is the same as the length of the second sequence, i.e., the encoding matrix is a matrix of v rows and x columns.
[0049] In the embodiments of the present application, the second sequence corresponding to the first original data can be further encoded according to the position index, and each second sequence is mapped to one or more rows of encoded sequences in the encoding matrix. After obtaining all the encoded sequences by mapping each second sequence, the encoding matrix D corresponding to the plurality of first original data can be formed based on all the encoded sequences.
[0050] After obtaining the encoding matrix, the first original data can be encoded based on the encoding matrix. For example, the encoding matrix and the plurality of first original data can be input into an Oblivious Pseudo-Random Function (OPRF) for operation to obtain a first operation result.
[0051] In actual application, after obtaining the encoding matrix, the inter-department information sharing platform 106 deployed on the server 102 can take the encoding matrix as a key of the OPRF, and call the OPRF protocol to operate on the plurality of first original data, thereby obtaining the first operation result.
[0052] Step 103, receiving the second operation result corresponding to the plurality of second original data sent by the second object, determining the to-be-shared data according to the first operation result and the second operation result, and sending the to-be-shared data to the first object and / or the second object.
[0053] The first object can be the server 102, and the second object can be the server 104. The second original data is private data of the server 104 side and is stored locally in the server 104. The plurality of second original data can be represented as {y1,..., y i ,…,y m}.
[0054] The second operation result is obtained by pseudo-random operation of the second object on the plurality of second original data based on the encoding matrix.
[0055] In the embodiments of the present application, the server 102 can send the encoding matrix to the server 104, and the inter-department information sharing platform 106 deployed on the server 104 can perform pseudo-random operation on the plurality of second original data based on the encoding matrix to obtain the second operation result, and then send it to the server 102.
[0056] Since the first operation result and the second operation result are obtained by encoding the plurality of first original data and the plurality of second original data based on the same encoding matrix, the operation results of the same data in the plurality of first original data and the plurality of second original data are the same. Therefore, after receiving the second operation result sent by the server 104, the inter-department information sharing platform 106 deployed on the server 102 can compare the first operation result and the second operation result, and determine the same data in the plurality of first original data and the plurality of second original data, i.e. the to-be-shared data, according to the comparison result.
[0057] Finally, the inter-department information sharing platform 106 can send the to-be-shared data to the first object and / or the second object according to the demand of the first object and the second object for the to-be-shared data. For example, if the first object is a vehicle management department and the second object is a housing management department, the inter-department information sharing platform deployed on the server of the vehicle management department can save the personnel information in the server locally when the vehicle management department needs the personnel information after determining the personnel information of the person who has both a vehicle and a house, thereby protecting the user data privacy of the user without a vehicle in the housing management department, and send the personnel information to the housing management department when the housing management department needs the personnel information. For example, if the first object is a public security department and the second object is a certain commission office, the inter-department information sharing platform deployed on the server of the public security department can save the to-be-shared data in the server locally when the public security department needs the to-be-shared data after determining the to-be-shared data, and send the to-be-shared data to the commission office when the commission office needs the to-be-shared data.
[0058] The data sharing method provided in the embodiments of the present application can be used by one party of data sharing to perform first random mapping on a plurality of first original data locally to obtain a position index of a corresponding row in a matrix corresponding to each first original data, perform second random mapping on each first original data to obtain a second sequence corresponding to each first original data. Then, for each first original data, the second sequence corresponding to all first original data is mapped into a coding sequence according to the position index, and a coding matrix of the plurality of first original data is generated based on all coding sequences corresponding to each first original data and all position indexes, and the coding of the plurality of first original data is completed. Finally, the inter-department information sharing platform performs pseudo-random operation on the first original data and the second original data based on the coding matrix, and determines the data to be shared according to the two operation results. The method provided in the embodiments of the present application can directly encode the local data by one party of data sharing, and then determine the data to be shared based on the coding matrix and the data of the other party through the inter-department information sharing platform, thereby avoiding the leakage of data other than the data to be shared in the local data, and ensuring the privacy and security of data sharing. Moreover, the coding matrix in the present application is generated based on the original data of one object (i.e., the first object), and when the object needs to share data with other multiple different objects, the coding matrix can be directly used without generating a new coding matrix, compared with the prior art which needs to encode the original data of two or more parties of data sharing, and each replacement of a sharing object needs to re-encode, the present application only generates a coding matrix based on the data of one party, without repeated encoding, thereby improving the efficiency of data sharing.
[0059] The above embodiments introduce a scheme of obtaining the position index corresponding to each first original data through first random mapping. In another embodiment of the present application, the position index can be determined by a random value obtained through random operation. For example, the above-mentioned "performing first random mapping on a plurality of first original data to obtain a position index in a first sequence corresponding to each first original data" specifically includes the following steps:
[0060] Performing first random operation on the first original data to obtain a random value corresponding to the first original data, and taking the random value as the position index corresponding to the first original data.
[0061] In the embodiments of the present application, at least one random function or hash function can be used to perform first random operation on each first original data to obtain one or more random values corresponding to each first original data, and the one or more random values are taken as the position index corresponding to the first original data.
[0062] For example, two random functions h1 and h2 can be used to obtain a random value h1(x) corresponding to the first original data x iA first random operation is performed to obtain two random values corresponding to each first original data, i.e., h1(x i ) and h2(x i ), and as the position index corresponding to the first original data x i .
[0063] In a possible implementation, the plurality of first original data can be input into a Bloom filter, and each first original data is mapped by a random function in the Bloom filter, each first original data is mapped into a first sequence, and the first sequences corresponding to the plurality of first original data form a matrix V. For example, the random functions h1 and h2 in the Bloom filter perform operations on the first original data x1, and the operation results are 5 and 8, i.e., h1(x1)=5 and h2(x1)=8, then the first sequence obtained by the Bloom filter performing the first random mapping on x1 can be 000010010000, and the first sequence is the first row of the matrix V, and the position index of x1 is 5 and 8; the random functions h1 and h2 in the Bloom filter perform operations on the first original data x2, and the operation results are 3 and 7, i.e., h1(x2)=3 and h2(x2)=7, then the first sequence obtained by the Bloom filter performing the first random mapping on the first original data x2 can be 001000100000, and the first sequence is the second row of the matrix V, and the position index of x2 is 3 and 7; the random functions h1 and h2 in the Bloom filter perform operations on the first original data x6, and the operation results are 5 and 11, i.e., h1(x6)=5 and h2(x6)=11, then the first sequence obtained by the Bloom filter performing the first random mapping on the first original data x6 can be 000010000010, and the first sequence is the sixth row of the matrix V, and the position index of x6 is 5 and 11.
[0064] The method provided by the embodiment of the application can obtain random values corresponding to each first original data by the first random operation, and the random values are used as the position index. The position index obtained by the embodiment of the application based on the random operation has strong randomness and higher security, and thus the security of the coding matrix determined based on the position index is ensured.
[0065] The foregoing embodiment introduces a scheme of mapping the second sequence into the coding matrix according to the position index. In another embodiment of the application, the coding matrix can be formed by the coding sequence obtained by mapping the second sequence. For example, the foregoing "mapping each second sequence according to the position index to obtain the coding matrix" specifically includes the following steps:
[0066] For each first original data, a second sequence corresponding to the first original data is mapped to an encoded sequence according to the position index, and an encoded matrix of the plurality of first original data is generated based on all encoded sequences corresponding to each first original data and all position indexes.
[0067] In the embodiments of the present application, the row index of the encoded sequence obtained by mapping the second sequence can be determined according to the position index.
[0068] In a possible implementation, the position index can be determined as the row index of the encoded sequence in the encoded matrix. For example, the position indexes of the first original data x1 are 5 and 8, and the positions of the two encoded sequences corresponding to the first original data x1 obtained by mapping the second sequence can be the 5th row and the 8th row in the encoded matrix.
[0069] In a possible implementation, the operation result of the position index can be determined as the row index of the encoded sequence in the encoded matrix. For example, when the operation is a sum operation, the position indexes of a certain first original data are 5 and 8, and the position of the encoded sequence corresponding to the first original data obtained by mapping the second sequence can be the 13th row in the encoded matrix.
[0070] The method provided in the embodiments of the present application maps each second sequence to an encoded sequence according to the position index, and forms an encoded matrix based on all encoded sequences. The method provided in the embodiments of the present application can further encode the second sequence to generate an encoded matrix through the position index corresponding to each first original data, so that the sharing platform determines the to-be-shared data based on the encoded matrix and the data of the other party, avoids the leakage of data other than the to-be-shared data in the local data, and ensures the privacy and security of data sharing.
[0071] The foregoing embodiments introduce a scheme of mapping the second sequence to an encoded sequence based on the position index. In another embodiment of the present application, the row index of the encoded matrix can be determined according to the position index, so as to obtain each row of encoded sequences of the encoded matrix. For example, the foregoing “for each first original data, mapping the second sequence corresponding to the first original data to an encoded sequence according to the position index” specifically includes the following steps:
[0072] The row index in the encoded matrix is determined according to the position index, and the second sequence is mapped to one or more rows of encoded sequences in the encoded matrix according to the row index.
[0073] In this embodiment, the position index can be used as the row index of the encoded sequence obtained by the second sequence mapping in the encoding matrix. For example, if the position index of the first original data x1 is 5 and 8, the two encoded sequences obtained by the second sequence mapping corresponding to the first original data x1 can be located in rows 5 and 8 of the encoding matrix; if the position index of the first original data x2 is 3 and 7, the two encoded sequences obtained by the second sequence mapping corresponding to the first original data x2 can be located in rows 3 and 7 of the encoding matrix; if the position index of the first original data x6 is 5 and 11, the two encoded sequences obtained by the second sequence mapping corresponding to the first original data x6 can be located in rows 5 and 11 of the encoding matrix.
[0074] Then, the second sequence corresponding to each of the first original data is encoded, and each second sequence is mapped to one or more rows in the encoding matrix. For example, the second sequence corresponding to the first original data x1 is encoded, and the second sequence is mapped to the 5th row and the 8th row of the encoding matrix.
[0075] In one possible implementation, the second sequence is related to the result obtained by XORing one or more rows of encoded sequences in the encoding matrix.
[0076] That is, the corresponding second sequence can be obtained by XOR operation of one or more rows of encoded sequences corresponding to the first original data. Specifically, this can be achieved by the following formula (1):
[0077]
[0078] Where h1(x) i ) and h2(x i ) represents the first original data x i The corresponding position index; h(x) i ) represents the first original data x i The corresponding second sequence; For the h1(x)th element in the encoding matrix D i ) row encoding sequence; For the h2(x)th element in the encoding matrix D i ) row encoding sequence.
[0079] For example, if i is 1, then x i When x1 is a given value, h1(x1) and h2(x1) are 5 and 8 respectively. Therefore, the second sequence corresponding to x1 is mapped to the 5th row encoding sequence d5 and the 8th row encoding sequence d8 in the encoding matrix D. The relationship between encoding sequences d5, d8, and the second sequence h(x1) is as follows:
[0080] And the mapping of the second sequence according to the position index of each first original data can obtain a plurality of relational expressions, such as Then, all the encoding sequences can be determined by randomly generating one or more encoding sequences and the above relational expressions. For example, the encoding sequences d5, d8 and d 11 are calculated by the above relational expressions; d7 and d3 are randomly generated and calculated by the above relational expressions. For example, d8, d5 and d 11 are calculated by the above relational expressions; d7 and d3 are randomly generated and calculated by the above relational expressions.
[0081] Further, in another embodiment of the present application, after determining the row index and the corresponding encoding sequence based on the above embodiment according to the position index, the encoding matrix can be formed based on all the encoding sequence combinations. For example, the above-mentioned "generating the encoding matrix of the plurality of first original data based on all the encoding sequences corresponding to the plurality of first original data and all the position indexes" specifically includes the following steps:
[0082] For each encoding sequence, a row of the encoding matrix is generated according to the row index corresponding to the encoding sequence.
[0083] In the embodiment of the present application, after obtaining the row encoding sequence and the row index corresponding to the row encoding sequence based on the above embodiment, the encoding matrix can be formed by arranging the encoding sequences according to the corresponding row indexes.
[0084] The method provided in the embodiment of the present application determines the row index in the encoding matrix according to the position index, maps the second sequence into one or more rows of encoding sequences in the encoding matrix according to the row index, and finally generates the encoding matrix according to the encoding matrix and the corresponding row index. The method provided in the embodiment of the present application can further encode the second sequence according to the position index corresponding to the first original data to generate the encoding matrix, so that the sharing platform determines the data to be shared based on the encoding matrix and another party's data, avoids the leakage of data other than the data to be shared in the local data, and ensures the privacy and security of data sharing.
[0085] The above-mentioned embodiments introduce a scheme for determining the data to be shared according to the pseudo-random operation results of the first original data and the second original data. In another embodiment of the present application, the data to be shared can be determined according to the comparison results of the two operation results. For example, the above-mentioned "determining the data to be shared according to the first operation result and the second operation result" specifically includes the following steps:
[0086] Comparing the first operation result and the second operation result, and determining the first original data or the second original data corresponding to the same elements in the first operation result and the second operation result as the data to be shared.
[0087] In the embodiments of the present application, since the first operation result and the second operation result are obtained by encoding the plurality of first original data and the plurality of second original data based on the same encoding matrix, the operation results of the same data in the plurality of first original data and the plurality of second original data are the same. Therefore, the elements at the same positions in the first operation result and the second operation result can be compared in sequence, for example, the first element in the first operation result and the first element in the second operation result are compared, the second element in the first operation result and the second element in the second operation result are compared, and so on.
[0088] Then, the original data (the first original data or the second original data) corresponding to the elements with the same comparison result is determined as the to-be-shared data. For example, the first element in the first operation result and the first element in the second operation result are the same, and the first original data x1 and the second original data y1 are the same. Therefore, x1 or y1 can be determined as the to-be-shared data. It can be understood that x1 and y1 are personnel information of the same person, and the person has both a car and a house.
[0089] The method provided in the embodiments of the present application can compare the elements at the same positions in the first operation result and the second operation result, and determine the original data corresponding to the elements with the same comparison result as the to-be-shared data. The leakage of the data other than the to-be-shared data in the local data of any party can be avoided, and the privacy and security of data sharing are ensured.
[0090] In one embodiment, as shown in Figure 3 , a data sharing method is provided. Taking the server 104 in Figure 1 as an example, the method comprises the following steps:
[0091] Step 201: receiving an encoding matrix sent by a first object.
[0092] In the embodiments of the present application, after the inter-department information sharing platform 106 generates the encoding matrix based on the plurality of first original data, the server 102 can send the encoding matrix to the server 104, so that the server 104 (i.e., a second object) receives the encoding matrix sent by the server 102 (i.e., a first object).
[0093] Step 202: performing pseudo-random operation on a plurality of second original data based on the encoding matrix to obtain a second operation result.
[0094] In the embodiments of the present application, the inter-department information sharing platform 106 deployed on the server 104 can encode the plurality of second original data based on the encoding matrix. For example, the encoding matrix and the plurality of second original data can be input into a careless pseudo-random function to perform operation, and a second operation result is obtained.
[0095] In actual application, after obtaining the encoding matrix, the inter-department information sharing platform 106 deployed on the server 104 can take the encoding matrix as the key of the OPRF, and call the OPRF protocol to operate the plurality of second original data, so as to obtain the second operation result.
[0096] Step 203: sending the second operation result to the first object.
[0097] In the embodiment of the application, after obtaining the second operation result, the server 104 can send the second operation result to the server 102 (i.e. the first object), so that the inter-department information sharing platform 106 determines the to-be-shared data according to the first operation result and the second operation result.
[0098] The data sharing method provided in the embodiment of the application can code the local data based on the encoding matrix determined by the other party, and send the coded result to the other party, so that the other party determines the to-be-shared data according to the coding result, thereby avoiding the leakage of data other than the to-be-shared data in the local data, and ensuring the privacy and security of data sharing.
[0099] In one embodiment, a data sharing method is provided, comprising the following steps:
[0100] 1. A first object obtains a plurality of first original data {x1,...,x i ,…,x n} locally, constructs a matrix V by using a Bloom filter, the matrix V is composed of 0 and 1; and obtains the position index h1(x i ) and h2(x i ) of each first original data based on the random functions h1 and h2 in the Bloom filter.
[0101] 2. The first object obtains a plurality of first original data {x1,...,x i ,…,x n} locally, constructs a matrix X by using a hash function h, and the behavior of the matrix X is h(x i ).
[0102] 3. Each row encoding sequence of the encoding matrix D is determined based on the relationship , and each row encoding sequence constitutes the encoding matrix D.
[0103] In one possible implementation, after each row encoding sequence constitutes a matrix, the encoding matrix D is obtained by transposing, i.e. D=(d1,...,d m ) T .
[0104] This step is essentially a further coding of the second sequence h(x i ).
[0105] 4. The first object calls the OPRF protocol, and the OPRF performs operations on the multiple first original data with the encoding matrix D as a key to obtain a first operation result.
[0106] 5. The first object sends the encoding matrix D to the second object, the second object calls the OPRF protocol, and the OPRF performs operations on the multiple second original data with the encoding matrix D as a key to obtain a second operation result, and sends the second operation result to the first object.
[0107] 6. The inter-department information sharing platform compares the first operation result and the second operation result, and determines original data corresponding to elements with the same position and the same elements as the to-be-shared data.
[0108] 7. The inter-department information sharing platform sends the to-be-shared data to the first object and / or the second object.
[0109] In the method provided by the embodiment of the application, the inter-department information sharing platform can determine common data in the local data of the first object and the second object based on the encoding results of the local data of the first object and the second object, and determine the common data as the to-be-shared data, thereby avoiding leakage of data other than the to-be-shared data in the local data and ensuring the privacy and security of data sharing.
[0110] It should be noted that although the operations of the method of the application are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all of the shown operations must be performed to achieve the desired result. On the contrary, the steps depicted in the flowchart can change the order of execution. Additionally or alternatively, some steps can be omitted, combined into one step, and / or divided into multiple steps.
[0111] Further reference is made to Figure 4 which shows an exemplary structural block diagram of an apparatus for data sharing according to an embodiment of the application.
[0112] In one embodiment, the data sharing apparatus comprises a mapping module 301, a generating module 302, and an encoding matrix sending module 303, wherein:
[0113] The mapping module 301 is configured to perform first random mapping on the multiple first original data to obtain a position index in a first sequence corresponding to each first original data, and perform second random mapping on each first original data to obtain a second sequence corresponding to each first original data. The first sequence is a row in a matrix obtained by performing first random mapping on the multiple first original data.
[0114] The operation module 302 is configured to perform third mapping on each second sequence according to the position index to obtain an encoding matrix, and perform pseudo-random operation on the plurality of first original data based on the encoding matrix to obtain a first operation result.
[0115] The sharing module 303 is configured to receive a second operation result corresponding to the plurality of second original data sent by the second object, determine the to-be-shared data according to the first operation result and the second operation result, and send the to-be-shared data to the first object and / or the second object. The second operation result is obtained by performing pseudo-random operation on the plurality of second original data based on the encoding matrix.
[0116] In one embodiment, the number of rows of the encoding matrix is the same as the length of the first sequence; and the number of columns of the encoding matrix is the same as the length of the second sequence.
[0117] In one embodiment, the operation module 302 is specifically configured to, for each first original data, map the second sequence corresponding to the first original data to an encoding sequence according to the position index, and generate the encoding matrix of the plurality of first original data based on all the encoding sequences corresponding to the first original data and all the position indexes.
[0118] In one embodiment, the operation module 302 is further configured to determine a row index in the encoding matrix according to the position index, and map the second sequence to one or more rows of encoding sequences in the encoding matrix according to the row index.
[0119] In one embodiment, the result obtained by performing exclusive or operation on the second sequence and one or more rows of encoding sequences in the encoding matrix is related.
[0120] In one embodiment, the operation module 302 is further configured to, for each encoding sequence, generate a row of the encoding matrix according to the row index corresponding to the encoding sequence.
[0121] In one embodiment, the sharing module 303 is specifically configured to compare the first operation result and the second operation result, and determine the first original data or the second original data corresponding to the same elements in the first operation result and the second operation result as the to-be-shared data.
[0122] In one embodiment, the mapping module 301 is specifically configured to perform first random operation on the first original data to obtain a random value corresponding to the first original data, and take the random value as the position index corresponding to the first original data.
[0123] It should be understood that the modules described in the above data sharing apparatuses are described with reference to the modules of the data sharing apparatuses Figures 2-4The various steps in the described methods correspond. Thus, the operations and features described above for the methods equally apply to the apparatus and modules contained therein, which will not be described again. The apparatus can be pre- implemented in a browser or other secure application of an electronic device, or can be loaded into a browser or secure application thereof of an electronic device by downloading or the like. The corresponding units in the apparatus can cooperate with the units in the electronic device to realize the solutions of the embodiments of the present application.
[0124] Reference is made below Figure 5 , which shows a structural schematic diagram of a computer system 400 suitable for realizing a terminal device or a server of the embodiments of the present application.
[0125] As shown in Figure 5 , the computer system 400 includes a central processing unit (CPU) 401, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 402 or programs loaded from a storage portion 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the system 400 are also stored. The CPU 401, the ROM 402, and the RAM 403 are connected to each other through a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0126] The following components are connected to the I / O interface 405: an input portion 406 including a keyboard, a mouse, and the like; an output portion 407 including a cathode ray tube (CRT), a liquid crystal display (LCD), and the like, and a speaker, and the like; a storage portion 408 including a hard disk, and the like; and a communication portion 409 including a network interface card such as a LAN card, a modem, and the like. The communication portion 409 performs communication processing via a network such as the Internet. A drive 410 is also connected to the I / O interface 405 as necessary. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like is attached to the drive 410 as necessary, so that a computer program read therefrom is installed into the storage portion 408 as necessary.
[0127] In particular, according to the embodiments of the present disclosure, the processes described above with reference to Figures 2-4 can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for executing Figures 2-4 the methods. In such embodiments, the computer program can be downloaded and installed from a network via the communication portion 409, and / or installed from the removable medium 411.
[0128] It should be noted that the computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium or a combination thereof. The computer-readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a computer-readable storage medium can include, but are not limited to, the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer-readable storage medium can be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium can include a computer-readable storage medium and can also include a computer-readable propagation medium, which can be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable medium can have been made or become, for example, by being processed into a tangible medium from or in connection with one or more computer-readable signal media or transitory media, which can include a computer-readable storage medium or combination of the foregoing. The program code can be transmitted using any suitable medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0129] The computer program product of the present application can be implemented by a hardware-based module, a software module executed by a processor, or a combination of software modules and hardware modules. The programs can be stored in the computer-readable storage medium or computer-readable signal medium. The computer-readable storage medium, the computer-readable signal medium and the computer-readable media can be the same or different. The computer-readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a computer-readable storage medium can include, but are not limited to, the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer-readable storage medium can be any tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present application, a computer-readable signal medium can include a computer-readable storage medium and can also include a computer-readable propagation medium, which can be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable medium can have been made or become, for example, by being processed into a tangible medium from or in connection with one or more computer-readable signal media or transitory media, which can include a computer-readable storage medium or combination of the foregoing. The program code can be transmitted using any suitable medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0130] The units or modules described in the embodiments of the present application can be implemented in the form of software or in the form of hardware. The described units or modules can also be arranged in a processor. In some cases, the names of the units or modules do not constitute a limitation on the units or modules themselves.
[0131] As another aspect, the present application also provides a computer readable storage medium, which can be included in the computer device described in the above embodiments, or can exist separately and not be assembled into the computer device. The computer readable storage medium stores one or more programs, and when the programs are used by one or more processors to execute the methods described in the present application.
[0132] The embodiments of the present application provide a computer program product, which includes instructions that, when executed, cause the method described in the embodiments of the present application to be performed.
[0133] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0134] The above description is merely preferred embodiments of the present application and a description of the principles of the technology used. Those skilled in the art should understand that the scope of the application involved in the present application is not limited to the technical solutions formed by the specific combinations of the above technical features, and also covers other technical solutions formed by any combination of the above technical features or equivalent features without departing from the inventive concept. For example, the above features can be replaced with technical features disclosed in the present application (but not limited to) having similar functions to form technical solutions.
Claims
1. A data sharing method, characterized in that, The method includes: A first random mapping is performed on multiple first original data to obtain a position index in a first sequence corresponding to each first original data; a second random mapping is performed on each first original data to obtain a second sequence corresponding to each first original data; the first sequence is a row in a matrix obtained by performing the first random mapping on the multiple first original data. A third mapping is performed on each of the second sequences according to the position index to obtain an encoding matrix. A pseudo-random operation is then performed on the plurality of first original data based on the encoding matrix to obtain a first operation result. The system receives the second operation results corresponding to multiple second original data sent by the second object, determines the data to be shared based on the first operation result and the second operation result, and sends the data to be shared to the first object and / or the second object; the second operation result is obtained by the second object performing pseudo-random operation on the multiple second original data based on the encoding matrix.
2. The method according to claim 1, characterized in that, The number of rows in the encoding matrix is the same as the length of the first sequence; the number of columns in the encoding matrix is the same as the length of the second sequence.
3. The method according to claim 1, characterized in that, The step of performing a third mapping on each of the second sequences based on the position index to obtain an encoding matrix includes: For each of the first original data, the second sequence corresponding to the first original data is mapped to an encoded sequence according to the position index, and an encoding matrix of the plurality of first original data is generated based on all encoded sequences and all position indices corresponding to each of the first original data.
4. The method according to claim 3, characterized in that, For each piece of the first original data, mapping the second sequence corresponding to the first original data to an encoded sequence according to the position index includes: The row index in the encoding matrix is determined based on the position index, and the second sequence is mapped to one or more rows of encoding sequences in the encoding matrix based on the row index.
5. The method according to claim 4, characterized in that, The second sequence is related to the result obtained by XORing one or more rows of the encoded sequence in the encoded matrix.
6. The method according to claim 3, characterized in that, The step of generating the encoding matrix of the plurality of first original data based on all encoded sequences and all position indices corresponding to each of the first original data includes: For each of the encoded sequences, a row of the encoding matrix is generated based on the row index corresponding to the encoded sequence.
7. The method according to claim 1, characterized in that, The step of determining the data to be shared based on the first calculation result and the second calculation result includes: The first calculation result and the second calculation result are compared, and the first original data or the second original data corresponding to the same element in the first calculation result and the second calculation result are determined as the data to be shared.
8. The method according to claim 1, characterized in that, The step of performing a first random mapping on multiple first original data to obtain the position index in the first sequence corresponding to each first original data includes: A first random operation is performed on the first original data to obtain a random value corresponding to the first original data, and the random value is used as the position index corresponding to the first original data.
9. A data sharing method, characterized in that, The method includes: The encoding matrix is received from a first object. The encoding matrix is obtained by the first object performing a first random mapping on multiple first original data to obtain a position index in a first sequence corresponding to each first original data, performing a second random mapping on each first original data to obtain a second sequence corresponding to each first original data, and performing a third mapping on each second sequence according to the position index. The first sequence is a row in the matrix obtained by performing the first random mapping on the multiple first original data. Based on the encoding matrix, a pseudo-random operation is performed on multiple second original data to obtain a second operation result; The result of the second operation is sent to the first object.
10. A data sharing device, characterized in that, The device includes: The mapping module is used to perform a first random mapping on multiple first original data to obtain a position index in a first sequence corresponding to each first original data; and to perform a second random mapping on each first original data to obtain a second sequence corresponding to each first original data; the first sequence is a row in a matrix obtained by performing the first random mapping on the multiple first original data. The operation module is used to perform a third mapping on each of the second sequences according to the position index to obtain an encoding matrix, and to perform a pseudo-random operation on the plurality of first original data based on the encoding matrix to obtain a first operation result; The sharing module is used to receive the second operation results corresponding to multiple second original data sent by the second object, determine the data to be shared based on the first operation result and the second operation result, and send the data to be shared to the first object and / or the second object; the second operation result is obtained by the second object performing pseudo-random operation on the multiple second original data based on the encoding matrix.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.
12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.