Data classification method and apparatus, electronic device, and computer storage medium

By converting data into a matrix and encrypting and repositioning data between data points, the problems of data leakage and tampering during data classification are solved, achieving efficient and secure data classification.

CN115935234BActive Publication Date: 2025-12-05TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211582874.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-09
Publication Date
2025-12-05
Estimated Expiration
2042-12-09

AI Technical Summary

Technical Problem

Existing technologies pose risks of feature data leakage and tampering during data classification, and it is difficult to find a trusted third party for management, resulting in reduced efficiency, accuracy, and security.

Method used

By converting the data to be classified into matrix form and performing homomorphic encryption, element position changes, and random number processing between the data processing and supplementation ends, the security and accuracy of data classification are improved, ensuring that the data cannot be completely obtained or tampered with during the classification process.

Benefits of technology

It eliminates the need for trusted third parties, effectively preventing data leaks and tampering, improving the efficiency and accuracy of data classification, and enhancing data security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115935234B_ABST
    Figure CN115935234B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data classification method and device, electronic equipment and computer storage medium, which are applied to a data arrangement end. The method comprises the following steps: obtaining a first matrix of a data set to be classified; receiving a second matrix sent by a data supplement end; performing summation processing on the first matrix and the second matrix to obtain a sum matrix, and performing position change processing on elements of the sum matrix to obtain an intermediate matrix; sending the intermediate matrix to the data supplement end, so that the data supplement end receives and decrypts the intermediate matrix, determines a plurality of intermediate elements from the intermediate matrix; receiving the plurality of intermediate elements sent by the data supplement end, determining a plurality of target elements corresponding to the plurality of intermediate elements in the sum matrix, and classifying the target elements corresponding to the data to be classified into corresponding data categories. The present application does not need to involve a trusted third party, and realizes the data classification operation of avoiding data leakage and tampering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and specifically to a data classification method, apparatus, computer device, and readable storage medium. Background Technology

[0002] With the development of computer technology, the efficiency and accuracy of classifying massive amounts of data through classification models or algorithms have been improved.

[0003] However, to ensure the efficiency and accuracy of data classification, a large amount of feature data related to the data to be classified needs to be obtained from different data sources during the model training and prediction phases. This makes the feature data susceptible to leakage and tampering. While a trusted third party can be used to manage this feature data, such parties are difficult to find, and their complete trustworthiness and security cannot be guaranteed, which reduces the efficiency, accuracy, and security of data classification to some extent. Summary of the Invention

[0004] This application provides a data classification method, apparatus, system, electronic device, and computer storage medium that can ensure the authenticity, security, and verification strength of device registration. It can also prevent the same device from quickly and massively registering multiple accounts while offline, reducing the risk of account abuse and the creation of illegal business activities.

[0005] The first aspect of this application provides a data classification method applied to a data processing end, the method comprising:

[0006] Obtain a first matrix of the dataset to be classified, wherein the row number of an element in the first matrix represents the identifier of the data to be classified corresponding to the element, the column number of the element represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category;

[0007] The receiver receives a second matrix sent by the data supplementation end, wherein the second matrix is ​​a homomorphic encryption matrix, the order of the second matrix is ​​equal to the order of the first matrix, and the elements of the second matrix are different from the elements of the first matrix;

[0008] The first matrix and the second matrix are summed to obtain a sum matrix, and the elements of the sum matrix are rearranged to obtain an intermediate matrix, wherein the rearrangement process involves changing the position of the entire row and the entire column elements in the matrix.

[0009] The intermediate matrix is ​​sent to the data supplementation end so that the data supplementation end receives and decrypts the intermediate matrix and determines multiple intermediate elements from the intermediate matrix, wherein the intermediate element is the element in each row of the intermediate matrix that is closest to the data category.

[0010] The system receives the multiple intermediate elements sent by the data supplementation terminal, determines the multiple target elements corresponding to the multiple intermediate elements in the summation matrix, and classifies the data to be classified corresponding to the target elements into the corresponding data categories.

[0011] Accordingly, a second aspect of this application provides a data classification apparatus applied to a data processing end, the apparatus comprising:

[0012] The first matrix acquisition unit is used to acquire a first matrix of the dataset to be classified, wherein the row number of an element in the first matrix represents the identifier of the data to be classified corresponding to the element, the column number of the element represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category.

[0013] The second matrix receiving unit is used to receive a second matrix sent by the data supplementation end, wherein the second matrix is ​​a homomorphic encryption matrix, the order of the second matrix is ​​equal to the order of the first matrix, and the elements of the second matrix are different from the elements of the first matrix.

[0014] The intermediate matrix determination unit is used to sum the first matrix and the second matrix to obtain a sum matrix, and to perform position change processing on the elements of the sum matrix to obtain an intermediate matrix, wherein the position change processing is to change the position of the entire row elements and the entire column elements in the matrix;

[0015] An intermediate matrix sending unit is used to send the intermediate matrix to the data supplementation end, so that the data supplementation end receives and decrypts the intermediate matrix, and determines multiple intermediate elements from the intermediate matrix, wherein the intermediate element is the element in each row of the intermediate matrix that is closest to the data category.

[0016] The target element determination unit is used to receive the plurality of intermediate elements sent by the data supplementation end, determine the plurality of target elements corresponding to the plurality of intermediate elements in the summation matrix, so as to classify the data to be classified corresponding to the target elements into the corresponding data categories.

[0017] Optionally, the first matrix acquisition unit includes:

[0018] The total number of rows acquisition sub-unit is used to acquire the total number of rows in the first matrix, wherein the total number of rows is the total number of data to be classified in the dataset to be classified;

[0019] The total column count acquisition subunit is used to acquire the total number of columns in the first matrix, wherein the total number of columns is the total number of data categories;

[0020] The matrix element calculation subunit is used to calculate the element corresponding to the data to be classified based on the degree of proximity of the data to be classified to the data category.

[0021] The first matrix generation subunit is used to determine the number of rows and columns corresponding to each element based on the identifier of each data to be classified and the data category corresponding to each element, so as to generate the first matrix.

[0022] Optionally, the matrix element calculation subunit is further specifically used for:

[0023] Obtain the first feature vector corresponding to the data to be classified, and the second feature vector corresponding to the data category;

[0024] The similarity between the first feature vector and the second feature vector is calculated to obtain the elements of the data to be classified.

[0025] Optionally, the intermediate matrix determining unit includes:

[0026] The row element acquisition subunit is used to acquire multiple sets of row elements of the summation matrix, where each set of row elements consists of all elements in each row of the summation matrix.

[0027] The column element acquisition subunit is used to acquire multiple sets of column elements of the summation matrix, where each set of column elements consists of all elements in each column of the summation matrix.

[0028] The element-changing subunit is used to change the number of rows corresponding to each group of row elements to the number of rows of any other group of row elements, and to change the number of columns corresponding to each group of column elements to the number of columns of any other group of column elements, so as to obtain the intermediate matrix.

[0029] Optionally, the target element determining unit includes:

[0030] The first row and column number calculation subunit is used to obtain the first row number and first column number corresponding to the intermediate element in the intermediate matrix;

[0031] The second row and column number calculation subunit is used to determine the second row number corresponding to the first row number in the summation matrix, and the second column number of the first column number in the summation matrix;

[0032] The target element determination subunit is used to obtain the target element located in the second row and the second column of the summation matrix.

[0033] Optionally, the first matrix acquisition unit further includes:

[0034] A random number acquisition subunit is used to acquire a random number agreed upon with the data supplementation terminal;

[0035] The first random number acquisition subunit is used to obtain a first random number according to the random number, wherein the first random number and the second random number are opposites of each other, and the second random number is a random value obtained by the data supplementation terminal according to the agreement;

[0036] The element calculation subunit is used to obtain the degree of proximity of the data to be classified to the data category and to calculate the element corresponding to the data to be classified.

[0037] The first element acquisition subunit is used to calculate the sum of each element and the first random number to obtain the first element;

[0038] The first matrix generation subunit is used to determine the number of rows and columns corresponding to each first element based on the identifier of each data to be classified and the data category corresponding to each first element, so as to generate the first matrix.

[0039] Optionally, the device further includes:

[0040] A data center computing unit is used to calculate the data center corresponding to each data category based on the plurality of target elements, wherein the data center contains the mean vector of multiple features to be classified for each data category;

[0041] The first update matrix acquisition unit is used to update the elements of the first matrix according to the data center to obtain the first update matrix;

[0042] The data category sending unit is used to send the data category corresponding to each of the data to be classified to the data supplementation end according to the plurality of target elements, so that the data supplementation end can synchronously calculate the corresponding second update matrix;

[0043] The first iterative calculation unit is used to iteratively and repeatedly execute the steps of calculating the multiple target elements according to the first update matrix and the second update matrix until a preset condition for stopping iteration is met.

[0044] A data classification method provided in the third aspect of this application, applied to a data supplementation end, includes:

[0045] Obtain the second matrix of the dataset to be classified, wherein the second matrix is ​​a homomorphic encryption matrix, the row number of the element in the second matrix represents the identifier of the data to be classified corresponding to the element, the column number of the element represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category;

[0046] The second matrix is ​​sent to the data processing end, so that the data processing end adds the stored first matrix and the second matrix to obtain a sum matrix, and performs position change processing on the elements of the sum matrix to obtain an intermediate matrix. The order of the first matrix is ​​equal to the order of the second matrix, the elements of the first matrix are different from the elements of the second matrix, and the position change processing is to change the position of the entire row elements and the entire column elements in the matrix.

[0047] Receive and decrypt the intermediate matrix, and determine multiple intermediate elements from the intermediate matrix, wherein the intermediate element is the element in each row of the intermediate matrix that is closest to the data category;

[0048] The multiple intermediate elements are sent to the data processing terminal so that the data processing terminal can determine the multiple target elements corresponding to the multiple intermediate elements in the summation matrix, so as to classify the data to be classified corresponding to the target elements into the corresponding data categories.

[0049] A data classification device is provided in a fourth aspect of the embodiments of this application, applied to a data supplementation end, the device comprising:

[0050] The second matrix acquisition unit is used to acquire a second matrix of the dataset to be classified, wherein the second matrix is ​​a homomorphic encryption matrix, the row number of the element in the second matrix represents the identifier of the data to be classified corresponding to the element, the column number of the element represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category.

[0051] The second matrix sending unit is used to send the second matrix to the data processing end, so that the data processing end adds the stored first matrix and the second matrix to obtain a sum matrix, and performs position change processing on the elements of the sum matrix to obtain an intermediate matrix. The first matrix has the same order as the second matrix, the elements of the first matrix are different from the elements of the second matrix, and the position change processing is to change the position of the entire row elements and the entire column elements in the matrix.

[0052] An intermediate element determination unit is used to receive and decrypt the intermediate matrix, and determine multiple intermediate elements from the intermediate matrix, wherein the intermediate element is the element in each row of the intermediate matrix that is closest to the data category.

[0053] An intermediate element sending unit is used to send the plurality of intermediate elements to the data processing end, so that the data processing end can determine the plurality of target elements corresponding to the plurality of intermediate elements in the summation matrix, so as to classify the data to be classified corresponding to the target elements into the corresponding data categories.

[0054] Optionally, the intermediate element determining unit includes:

[0055] The intermediate row element acquisition subunit is used to acquire multiple sets of intermediate row elements of the intermediate matrix, where each set of intermediate row elements consists of all elements in each row of the intermediate matrix.

[0056] The intermediate element determines the sub-unit, which is used to select the element with the highest similarity to the data category from each group of intermediate row elements to obtain the multiple intermediate elements.

[0057] Optionally, the second matrix acquisition unit includes:

[0058] A random number acquisition subunit is used to acquire random numbers agreed upon with the data processing terminal;

[0059] The second random number acquisition subunit is used to obtain a second random number according to the random number, wherein the second random number is the opposite of the first random number, and the first random number is a random value obtained by the data processing terminal according to the agreement.

[0060] The data category acquisition subunit is used to obtain the degree of proximity of the data to be classified to the data category and to calculate the elements of the data to be classified.

[0061] The first element calculation subunit is used to calculate the sum of each element and the second random number to obtain the first element;

[0062] The second matrix generation subunit is used to determine the number of rows and columns corresponding to each first element based on the identifier of each data to be classified and the data category corresponding to each first element, so as to generate the second matrix.

[0063] An electronic device provided in the fifth aspect of this application includes:

[0064] Processor and storage media;

[0065] The processor is used to implement various instructions;

[0066] The storage medium is used to store multiple instructions, which are loaded and executed by the processor using the data classification method described above.

[0067] A sixth aspect of this application also provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to execute steps in any of the data classification methods provided in this application.

[0068] A seventh aspect of this application also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implement any of the data classification methods provided in the embodiments of this application.

[0069] Therefore, the technical solution of this application does not require a trusted third party to participate in the collection and management of the data to be classified. By converting the data to be classified in each data terminal into a matrix required for classification calculation, and by performing encryption, element position changes, and random number additions on the matrix through different data terminals during the classification process, it is possible to prevent any data terminal from completely obtaining or tampering with the data from other data terminals. This can prevent the leakage and tampering of the data to be classified, and improve the efficiency, accuracy and security of data classification.

[0070] Therefore, the data classification method of this application can solve the technical problems in the existing data classification process, which require obtaining a large amount of feature data of the data to be classified from different data sources, resulting in data leakage and tampering, and the difficulty in finding a safe and reliable third party, which reduces the efficiency, accuracy and security of data classification. Attached Figure Description

[0071] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0072] Figure 1a This is a schematic diagram illustrating an application scenario of the data classification system provided in this application embodiment;

[0073] Figure 1b This is a flowchart illustrating the data classification method provided in an embodiment of this application;

[0074] Figure 1c This is another flowchart illustrating the data classification method provided in the embodiments of this application;

[0075] Figure 1d This is another flowchart illustrating the data classification method provided in the embodiments of this application;

[0076] Figure 1e This is another flowchart illustrating the data classification method provided in the embodiments of this application;

[0077] Figure 1f This is a schematic diagram illustrating the interaction between the data processing terminal and the data classification terminal provided in an embodiment of this application;

[0078] Figure 1g This is another schematic diagram illustrating the interaction between the data processing terminal and the data classification terminal provided in this application embodiment;

[0079] Figure 2a This is a schematic diagram illustrating the summation of the first and second matrices provided in an embodiment of this application;

[0080] Figure 2b This is a schematic diagram illustrating the positional change processing of the summation matrix provided in an embodiment of this application;

[0081] Figure 3a This is a schematic diagram of the structure of the data classification device provided in the embodiments of this application;

[0082] Figure 3b This is another structural schematic diagram of the data classification device provided in the embodiments of this application;

[0083] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0084] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0085] In the technical solution provided in this application, the data classification method of this application can be implemented by using natural language processing (NLP) technology in the field of artificial intelligence (AI).

[0086] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0087] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.

[0088] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods for enabling effective communication between humans and computers using natural language. NLP is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language people use in daily life—and thus it has a close relationship with linguistic research. NLP technologies typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.

[0089] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and instructional learning.

[0090] With the research and advancement of artificial intelligence (AI) technology, AI is being studied and applied in various fields, such as smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, autonomous driving, drones, robots, smart healthcare, and smart customer service. It is believed that with the development of technology, AI will be applied in more fields and play an increasingly important role.

[0091] This application provides a data classification method, apparatus, electronic device, and storage medium. The data classification method provided can be implemented via a data processing terminal or a data supplementation terminal. Both the data processing terminal and the data supplementation terminal store data to be classified, as well as various features contained within the data. The data processing terminal can obtain a second matrix of the data to be classified sent by at least one data supplementation terminal. After processing the second matrix in conjunction with a first matrix locally generated by the data processing terminal, the data category corresponding to the data to be classified is obtained. Therefore, in this data classification system, there is generally one data processing terminal and one or more data supplementation terminals. The data supplementation terminal essentially provides the data processing terminal with different feature data corresponding to the data to be classified.

[0092] Please see Figure 1a , Figure 1a This is a schematic diagram illustrating an application scenario of the data classification system provided in this application embodiment. The system may include a terminal 10 and a server 11.

[0093] like Figure 1a As shown, terminal 10 and server 11 are connected via a network, such as a wired or wireless network. Terminal 10 may include, but is not limited to, portable terminals such as mobile phones and tablets with various network platform applications installed, as well as fixed terminals such as computers, kiosks, and advertising machines. Server 11 provides users with various business services, including a service push server and a user recommendation server.

[0094] It is understood that in this application scenario, both terminal 10 and server 11 can obtain user-related data to be classified with the user's authorization and permission, so that both terminal 10 and server 11 can act as data processing or data supplementation ends to execute the data classification method of this application.

[0095] It should be noted that, Figure 1a The illustrated application scenario diagram of the data classification system is merely an example. The terminals, servers, and application scenarios described in this application embodiment are for the purpose of more clearly illustrating the technical solutions of this application embodiment and do not constitute a limitation on the technical solutions provided in this application embodiment. As those skilled in the art will know, with the evolution of the system and the emergence of new business scenarios, the technical solutions provided in this application embodiment are also applicable to similar technical problems.

[0096] Terminal 10 can be a data processing terminal, and can be used for:

[0097] Obtain a first matrix of the dataset to be classified; receive a second matrix sent by a data supplementation end; sum the first matrix and the second matrix to obtain a sum matrix, and perform positional manipulation on the elements of the sum matrix to obtain an intermediate matrix; send the intermediate matrix to the data supplementation end so that the data supplementation end can receive and decrypt the intermediate matrix, and determine multiple intermediate elements from the intermediate matrix; receive the multiple intermediate elements sent by the data supplementation end, determine multiple target elements corresponding to the multiple intermediate elements in the sum matrix, and classify the data to be classified corresponding to the target elements into the corresponding data categories.

[0098] Terminal 10 can be a data supplement terminal and can be used for:

[0099] Obtain a second matrix of the dataset to be classified; send the second matrix to a data processing terminal so that the data processing terminal adds the stored first matrix to the second matrix to obtain a summation matrix, and performs positional manipulation on the elements of the summation matrix to obtain an intermediate matrix; receive and decrypt the intermediate matrix, and determine multiple intermediate elements from the intermediate matrix; send the multiple intermediate elements to the data processing terminal so that the data processing terminal determines multiple target elements corresponding to the multiple intermediate elements in the summation matrix, so as to classify the data to be classified corresponding to the target elements into the corresponding data categories.

[0100] The steps of the data classification method performed by the terminal 10 can also be performed by the server 11.

[0101] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0102] Furthermore, in the embodiments of this application, "multiple" refers to two or more. The terms "first" and "second," etc., in the embodiments of this application are used for distinguishing descriptions and should not be construed as implying relative importance.

[0103] The following sections provide detailed descriptions of each example. It should be noted that the order in which the embodiments are described is not intended to limit the preferred order of the embodiments.

[0104] Please see Figure 1b In this embodiment, a data classification method is provided, applied to the data processing end, such as... Figure 1b As shown, the specific process of this data classification method can be as follows:

[0105] Step 101: Obtain the first matrix of the dataset to be classified.

[0106] The dataset to be classified is a collection of data containing multiple data to be classified. In this application, the data to be classified can be any data that needs to be classified in a data classification scenario. For example, the data to be classified can be user objects, items, images, text, etc.

[0107] Taking a shopping-related data classification scenario as an example, in some embodiments of this scenario, the data to be classified can be food or food images. Data classification operations can be used to categorize the food or food images into corresponding data categories. For example, the food or food images can be categorized into data categories such as beverages, fruits and vegetables, and grains.

[0108] In some embodiments of this scenario, the data to be classified can also be user objects. For example, by combining the object characteristics corresponding to different user objects, the user objects can be classified into data categories related to the user objects' shopping preferences through data classification operations. For example, different user objects to be classified can be categorized into data categories such as those that tend to buy beverages, those that tend to buy fruits and vegetables, and those that tend to buy grains.

[0109] In the first matrix, the row number of an element represents the identifier of the data to be classified corresponding to that element. The identifier of the data to be classified can be used to accurately determine the corresponding data to be classified in the dataset. For example, if the data to be classified is a user object, the identifier of the data to be classified can be the user object's name, code, employee number, or the device number or mobile phone number of the terminal used by the user object. As another example, if the data to be classified is an image, the identifier of the data to be classified can be the image's storage name, number, QR code, etc.

[0110] It should be noted that, in order to accurately determine the data category to which multiple data of the same type belong, the object types of the data to be classified in different rows of the first matrix are the same. For example, the data to be classified in the first row of the first matrix is ​​user object A, and the data to be classified in the second row is user object B, so that the object type of both is user object. There will be no data to be classified with different object types in the first matrix, such as item objects and text objects.

[0111] The column number of an element represents the data category it corresponds to. For example, the data category corresponding to a user's shopping preferences could include category A products, category B products, category C products, etc., and the data category corresponding to the sentiment analysis of a text object could include positive sentiment text, neutral sentiment text, negative sentiment text, etc.

[0112] In this matrix, each element represents the degree of proximity of the data to be classified into different data categories. It can be understood that after determining the identifier and corresponding data category of the data to be classified, elements in different rows of the first matrix correspond to different data to be classified, and elements in different columns of the first matrix correspond to different data categories. Since the probability of each data to be classified belonging to a different data category is different, the elements of the first matrix can be used to represent the degree of proximity of each data to be classified into different data categories.

[0113] Please refer to the figure. Figure 2a , Figure 2a This is a schematic diagram illustrating the summation of the first and second matrices provided in an embodiment of this application. For example... Figure 2a The first matrix shown has different rows corresponding to different data to be classified. For example, the first row of the first matrix contains elements corresponding to data to be classified as 1, and the second row contains elements corresponding to data to be classified as 2. Correspondingly, different columns correspond to different data categories. For example, the first column of the first matrix corresponds to data category k1, and the second column corresponds to data category k2. Therefore, the elements in the first row and first column of the first matrix represent the degree of proximity of the data to be classified as k1 to data category k1.

[0114] Optionally, step 101 may also include:

[0115] Obtain the total number of rows in the first matrix, where the total number of rows is the total number of data to be classified in the dataset to be classified;

[0116] Obtain the total number of columns in the first matrix, where the total number of columns is the total number of data categories;

[0117] Calculate the element corresponding to the data to be classified based on the degree of proximity in which the data to be classified belongs to the data category;

[0118] Based on the identifier of each piece of data to be classified and the data category corresponding to each element, the number of rows and columns corresponding to each element are determined to generate the first matrix.

[0119] Understandably, in data classification scenarios, to meet efficiency and business needs, it's often necessary to classify large amounts of data. For example, in a product recommendation data classification scenario, multiple user objects can be categorized into corresponding product data categories to determine which type of product a particular user object is more inclined to purchase. Therefore, the first matrix can be a high-order matrix with multiple rows and columns, such as... Figure 2a As shown, the first matrix can be an n*k matrix containing n rows and k columns, where n is the total number of data to be classified and k is the total number of data categories corresponding to the data to be split.

[0120] It is understandable that in data classification scenarios, to ensure the efficiency and accuracy of data classification, it is usually necessary to obtain all data categories that the data to be classified may be classified into or are highly likely to be classified into. For example, food may be classified into multiple data categories such as beverages, fruits and vegetables, and grains, so the total number of columns in the first matrix is ​​3. Alternatively, if it is necessary to classify solid food data, the beverage category can be deleted according to the classification requirements, resulting in a total of 2 columns in the first matrix. Or, the beverage category can be replaced with snacks, and the total number of columns in the first matrix remains 3. Therefore, this embodiment does not limit the total number of rows and columns in the first matrix.

[0121] It is understandable that once the total number of rows and columns of the first matrix are determined, as well as the meanings represented by the number of rows and columns, the matrix elements located in each row and column of the first matrix can be obtained based on the proximity of each data point to be classified to each data category.

[0122] Optionally, the step "calculating the element corresponding to the data to be classified based on the degree of proximity of the data to be classified to the data category" may include:

[0123] Obtain the first feature vector corresponding to the data to be classified, and the second feature vector corresponding to the data category;

[0124] The similarity between the first feature vector and the second feature vector is calculated to obtain the elements of the data to be classified.

[0125] In some embodiments, the numerical value corresponding to the closeness of the data to be classified to belong to a certain data category can be obtained by calculating the distance or similarity between feature vectors, for example, calculating the distance or similarity between the first feature vector of the feature to be classified and the second feature vector of the data category. It can be understood that the smaller the calculated distance, or the larger the calculated similarity, the closer the data to be classified is to belonging to that data category.

[0126] In some embodiments, the first feature vector can be obtained by encoding feature data related to the data to be classified. The relevant feature data can be data used in the data classification scenario when classifying the data to be classified. For example, if the data to be classified is a user object, the relevant feature data could be the user object's age, gender, etc.; or if the data to be classified is an image, the relevant feature data could be the image size, the content displayed in the image, the color values ​​of different pixels in the image, etc.

[0127] In some embodiments, the second feature vector can be obtained by encoding any data belonging to the data category. In some embodiments, the second feature vector can also be obtained directly from the label of the data category, or it can be generated directly according to user settings; this embodiment does not impose any restrictions on this.

[0128] In some embodiments, the data to be classified can be mapped to two vertices in a clustering coordinate system using the K-means clustering algorithm. The distance between the two vertices is used as the degree of proximity of the data to be classified into that data category. For example... Figure 2a The elements of the first row of the first matrix are represented by distance values ​​such as 1, 2, 3, etc.

[0129] In some embodiments, the similarity between the first feature vector and the second feature vector can also be calculated; for example, a similarity value of 80% can be represented as 0.8. Therefore, the elements of the first matrix can also be represented by the similarity values ​​of the data to be classified to each data category.

[0130] Therefore, the method of this application converts the data to be classified into the corresponding first matrix, so that subsequent data classification operations can be performed without obtaining the specific relevant feature data of the data to be classified. This effectively avoids the risk of leakage and tampering of the data to be classified from various data sources during the data classification process.

[0131] Optionally, step 101 may also include:

[0132] Obtain a random number agreed upon with the data supplement terminal;

[0133] Based on the random number, a first random number is obtained by agreement, wherein the first random number and the second random number are opposites of each other, and the second random number is a random value obtained by agreement at the data supplement terminal;

[0134] Obtain the degree of proximity of the data to be classified to the data category, and calculate the element corresponding to the data to be classified;

[0135] Calculate the sum of each element and the first random number to obtain the first element;

[0136] Based on the identifier of each piece of data to be classified and the data category corresponding to each first element, the number of rows and columns corresponding to each first element are determined to generate the first matrix.

[0137] To further enhance the security of the data to be classified at each end during the data classification process, in some embodiments, the data processing end can agree on a random number with other data supplementation ends and add the random number to the elements of the first matrix to prevent each data end from obtaining matrix elements from other data ends.

[0138] In some embodiments, the random number can be generated by first generating a common seed function using the secure aggregation algorithm of DH (Diffie-Hellman key exchange), and then generating a random number agreed upon between the two data ends based on the common seed function of the two data ends.

[0139] In some embodiments, each agreed-upon random number can be divided into a first random number and a second random number, which are opposites of each other, and assigned to the two data ends of the agreed-upon random number to process the elements of their respective matrices. For example, if the agreed-upon random number between the data processing end P and the data supplementation end Q is 5, then the first random number obtained by the data processing end P can be 5, while the second random number obtained by the data supplementation end Q can be -5. Figure 2a Taking the first matrix as an example, each element can be added with the random number to obtain the first element with different values. For example, the first element of the first row and first column of the first matrix can be (1+5)=6.

[0140] Therefore, the method of this application can prevent the original data of the matrices from being leaked or tampered with by agreeing on random numbers between each pair of data ends and using these agreed-upon random numbers to fuzz the matrix elements. Furthermore, when performing the summation operation of the first and second matrices subsequently, the first and second random numbers, which are opposites of each other, can be eliminated by summation. Thus, this random number fuzzing method can significantly improve the security and privacy of data classification without affecting the data classification calculation results.

[0141] Step 102: Receive the second matrix sent by the data supplement end.

[0142] In this matrix, the order of the second matrix is ​​the same as that of the first matrix, but the elements of the second matrix are different from those of the first matrix. As mentioned earlier, both the data supplementation end and the data processing end store feature data related to the data to be classified. Different data supplementation ends can store different types of feature data. Taking user objects as the data to be classified as an example, data supplementation end O can store three feature data of the user object: age, consumption habits, and gender. Data supplementation end Q can store two feature data of the user object: employee ID and consumption habits. Furthermore, the consumption habit feature data corresponding to data supplementation ends O and Q can also come from the user object's consumption habits in different months.

[0143] As can be seen from the above, in order to ensure the comprehensiveness and diversity of the data to be classified between different data terminals, and to improve the accuracy of data classification by using rich feature data, the data processing terminal and each data supplement terminal can store different types of feature data, or they can store feature data of the same type but different values. This embodiment does not impose any restrictions on this.

[0144] The second matrix can be a homomorphically encrypted matrix. It's understandable that, to ensure security and efficiency during data classification, the data supplementation end can perform homomorphic encryption on the second matrix, allowing the data processing end to directly perform subsequent matrix summation on the encrypted second matrix without decryption, thus balancing the security and efficiency of the entire data classification process.

[0145] Step 103: Summate the first matrix and the second matrix to obtain a summation matrix, and rearrange the elements of the summation matrix to obtain an intermediate matrix.

[0146] like Figure 2a As shown, after obtaining the second matrix of the ciphertext at the data processing end, the first and second matrices can be summed by adding the elements of the first and second matrices to obtain the following result: Figure 2b The summation matrix

[0147] Optionally, step 103 may also include:

[0148] Obtain multiple sets of row elements of the summation matrix, where each set of row elements consists of all elements in each row of the summation matrix;

[0149] Obtain multiple sets of column elements of the summation matrix, where each set of column elements consists of all elements in each column of the summation matrix;

[0150] The number of rows corresponding to each group of row elements is changed to the number of rows of any other group of row elements, and the number of columns corresponding to each group of column elements is changed to the number of columns of any other group of column elements to obtain the intermediate matrix.

[0151] The position change processing involves altering the positions of entire row and column elements within the matrix. In some embodiments, the data processing end can perform position change processing on the summation matrix using a shuffle algorithm.

[0152] by Figure 2bTaking a summation matrix as an example, the data processing end can first record the identifier of the data to be classified corresponding to each element in the summation matrix, as well as the data category corresponding to the data to be classified. For example, the element 1+1 in the summation matrix can be recorded as element A located in the first row and first column of the summation matrix, corresponding to data to be classified 1 and data category k1. In some embodiments, after recording the initial position of each element, the data processing end can use a shuffle algorithm to perform position changes on each group of row elements and each group of column elements of the summation matrix to obtain an intermediate matrix.

[0153] Still as Figure 2b As shown, after the elements A, B, and C in the first row of the summation matrix corresponding to the data to be classified 1 are rearranged, these three elements are moved to the second row of the intermediate matrix. Correspondingly, after the elements A, D, and G in the first column of the summation matrix corresponding to data category k1 are rearranged, these three elements are moved to the second column of the intermediate matrix. It can be understood that by performing the above-mentioned positional rearrangement on the elements in the summation matrix using the shuffle algorithm, the original positions of each element in the summation matrix can be disrupted, but the identifier and data category of the data to be classified corresponding to each element remain unchanged. For example, the position of element A in the summation matrix is ​​adjusted from the first row and first column to the second row and second column of the intermediate matrix, and the data to be classified 1 is also correspondingly adjusted from the first row to the second row of the intermediate matrix, and data category k1 is also correspondingly adjusted from the first column to the second column of the intermediate matrix. Therefore, through the above method, while enhancing data security and privacy, the correspondence between each element in the intermediate matrix and the identifier and data category of the original data to be classified remains unchanged.

[0154] Step 104: Send the intermediate matrix to the data supplementation end so that the data supplementation end can receive and decrypt the intermediate matrix and determine multiple intermediate elements from the intermediate matrix.

[0155] In some embodiments, the data processing end can send the intermediate matrix to the data supplementation end. Since the data supplementation end is the encryptor of the elements in the second matrix, the data supplementation end can decrypt the encrypted elements in the intermediate matrix to obtain the plaintext intermediate matrix.

[0156] The intermediate elements can be the elements in each row of the intermediate matrix that have the highest similarity to the data category. This is because each element in the first and second matrices represents the degree of proximity of the data to be classified to a certain data category, and the values ​​of each element in the intermediate matrix are obtained by summing the first matrix and multiple second matrices. This allows the elements of the intermediate matrix to reflect the comprehensive similarity of the data to be classified to each data category under different feature data. For example, if the data to be classified, 1, has the highest similarity to data category k1 in the first matrix, after summing the matrices, it might ultimately be calculated that the data to be classified, 1, has the highest similarity to data category k2, reflecting a more reasonable similarity in classifying the data to be classified to each data category. The specific process for determining multiple intermediate elements at the data supplement end can be found in step 203.

[0157] Step 105: Receive the multiple intermediate elements sent by the data supplementation terminal, determine the multiple target elements corresponding to the multiple intermediate elements in the summation matrix, and classify the data to be classified corresponding to the target elements into the corresponding data categories.

[0158] It's understandable that after determining multiple intermediate elements at the data supplementation end, although each intermediate element reflects the closest data category to which a particular data point to be classified belongs, the position of each intermediate element is obtained after positional manipulation by the data processing end. This means the data supplementation end cannot determine which data point to classify into which specific data category based on the intermediate elements. Therefore, the data processing end can receive multiple intermediate elements sent by the data supplementation end and, based on the initial positions of each element in the summation matrix recorded by the data processing end, determine multiple target elements corresponding to these intermediate elements.

[0159] Optionally, step 105 may also include:

[0160] Obtain the first row number and first column number of the intermediate element in the intermediate matrix;

[0161] Determine the second row number corresponding to the first row number in the summation matrix, and the second column number of the first column number in the summation matrix;

[0162] Obtain the target element located at the second row and second column number in the summation matrix.

[0163] Still with Figure 2bTaking the summation matrix and intermediate matrix as an example, suppose that element A in the intermediate matrix decrypted by the data supplementation end is 1+1=1+10=11, element B is 2+2=2+8=10, and element C is 3+3=3+6=9. Assume that the elements of the first and second matrices represent the distance between the first and second eigenvectors, allowing the data supplementation end to determine that the element C with the smallest value is the intermediate element at that row number. Furthermore, the data supplementation end can send this intermediate element C, along with the corresponding first row and first column numbers, to the data processing end. This allows the data processing end to determine the second row and second column numbers corresponding to the first row and first column numbers, respectively, based on the initial positional relationships of the elements in the recorded summation matrix.

[0164] Still with Figure 2b Taking the summation matrix and intermediate matrix as an example, element C has 2 rows and 1 column. The data processing end can handle positional changes to determine that the corresponding second row number in the summation matrix is ​​1 and the corresponding second column number is 3. This allows us to determine that element C corresponds to element 3+3 in the summation matrix, ultimately determining that the data to be classified, 1, belongs to data category k3. Correspondingly, the data processing end can use this method of finding the first row and first column number to determine the corresponding target element for each intermediate element, and then use each target element to determine the data category for each piece of data to be classified in this round of data classification.

[0165] Optionally, the method in this application embodiment may further include:

[0166] Based on the plurality of target elements, calculate the data center corresponding to each data category, wherein the data center contains the mean vector of multiple features to be classified for each data category;

[0167] Based on the data center, update the elements of the first matrix to obtain the first update matrix;

[0168] Based on the multiple target elements, the data category corresponding to each of the data to be classified is sent to the data supplementation end, so that the data supplementation end can synchronously calculate the corresponding second update matrix;

[0169] Based on the first update matrix and the second update matrix, the steps of calculating the multiple target elements are iteratively repeated until a preset condition for stopping the iteration is met.

[0170] In some embodiments, after multiple target elements are determined, the data processing end and each data supplement end can recalculate the data center corresponding to each data category. In some embodiments, according to the rules of the clustering algorithm, the data center can contain the mean vector of multiple features to be classified for each data category. Taking the aforementioned example, data 1 to be classified belongs to data category k3. Assuming that after calculation by the data processing end, data 2 to be classified also belongs to data category k3, the updated data center of data category k3 can be the mean vector of data 1 and data 2 to be classified. Assuming that in the clustering coordinate system, the coordinates of data 1 to be classified are (1, 1) and the coordinates of data 2 to be classified are (2, 2), the updated data center of data category k3 is the mean of the coordinates of the two (1.5, 1.5).

[0171] It is understandable that after the data processing end and each data supplement end update their respective data centers, the data processing end can update the elements of the first matrix based on the updated data centers, generating a first update matrix. Correspondingly, each data supplement end can also update the elements of the second matrix based on the updated data centers, generating a second update matrix. This allows the data processing end and each data supplement end to iteratively and repeatedly execute the steps of calculating the target elements based on the first and second update matrices until a preset condition for stopping iteration is met. In some embodiments, the preset condition may include the number of iterations reaching a preset threshold, or the data classification results of multiple data to be classified no longer changing, etc.

[0172] Therefore, the technical solution of this application does not require a trusted third party to participate in the collection and management of the data to be classified. By converting the data to be classified in each data terminal into a matrix required for classification calculation, and by performing encryption, element position changes, and random number additions on the matrix through different data terminals during the classification process, it is possible to prevent any data terminal from completely obtaining or tampering with the data from other data terminals. This can prevent the leakage and tampering of the data to be classified, and improve the efficiency, accuracy and security of data classification.

[0173] Therefore, the data classification method of this application can solve the technical problems in the existing data classification process, which require obtaining a large amount of feature data of the data to be classified from different data sources, resulting in data leakage and tampering, and the difficulty in finding a safe and reliable third party, which reduces the efficiency, accuracy and security of data classification.

[0174] Please see Figure 1c In this embodiment, a data classification method is provided, applied to the invited party that assists the inviting party in completing the registration, such as... Figure 1c As shown, the specific process of this data classification method can be as follows:

[0175] Step 201: Obtain the second matrix of the dataset to be classified.

[0176] The second matrix is ​​a homomorphic encryption matrix. The row number of an element in the second matrix represents the identifier of the data to be classified corresponding to the element, the column number of an element represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category.

[0177] As described in step 102 above, the second matrix can be a matrix of the same order as the first matrix but with different elements. In some embodiments, the second matrix can be calculated using feature data of a different type from the data to be classified in the data processing terminal, or using feature data of the same type but with different eigenvalues ​​as the matrix to be classified in the data processing terminal.

[0178] Optionally, step 201 may include:

[0179] Obtain a random number agreed upon with the data processing terminal;

[0180] Based on the random number, a second random number is obtained by agreement, wherein the second random number is the opposite of the first random number, and the first random number is a random value obtained by agreement at the data processing end;

[0181] Obtain the degree of proximity of the data to be classified to the data category, and calculate the elements of the data to be classified;

[0182] Calculate the sum of each element and the second random number to obtain the first element;

[0183] Based on the identifier of each piece of data to be classified and the data category corresponding to each first element, the number of rows and columns corresponding to each first element are determined to generate the second matrix.

[0184] As described in step 101 above, after the corresponding random numbers are determined at the data processing end and each data supplement end, a second random number that is the opposite of the first random number can be issued to the data supplement end. This second random number is used to fuzz the elements in the second matrix, thereby improving the security and privacy of the data classification process.

[0185] In some embodiments, if the data classification operation includes multiple data supplementation ends, only one data supplementation end may perform homomorphic encryption on its second matrix so that the elements in the summation matrix calculated by the data sorting end are necessarily in ciphertext. This embodiment does not restrict which of the multiple data supplementation ends performs homomorphic encryption on the second matrix.

[0186] Step 202: Send the second matrix to the data processing terminal so that the data processing terminal adds the stored first matrix and the second matrix to obtain a sum matrix, and performs positional manipulation on the elements of the sum matrix to obtain an intermediate matrix.

[0187] The order of the first matrix is ​​the same as that of the second matrix, and the elements of the first matrix are different from those of the second matrix. The position change processing involves changing the position of the entire row and the entire column elements in the matrix.

[0188] Step 203: Receive and decrypt the intermediate matrix, and determine multiple intermediate elements from the intermediate matrix.

[0189] The intermediate element is the element in each row of the intermediate matrix that is most similar to the data category.

[0190] Optionally, step 203 may include:

[0191] Obtain multiple sets of intermediate row elements of the intermediate matrix, where each set of intermediate row elements consists of all elements in each row of the intermediate matrix;

[0192] From each group of intermediate row elements, the element with the highest similarity to the data category is selected to obtain the plurality of intermediate elements.

[0193] As described in step 105 above, the data supplementation end can decrypt the elements in the intermediate matrix to obtain each element in the intermediate matrix, determine the intermediate element from each row of elements, and obtain the intermediate element corresponding to each data to be classified.

[0194] Step 204: Send the plurality of intermediate elements to the data processing terminal so that the data processing terminal can determine the plurality of target elements corresponding to the plurality of intermediate elements in the summation matrix, so as to classify the data to be classified corresponding to the target elements into the corresponding data categories.

[0195] As described in step 105 above, the data processing end can determine the corresponding target element for each intermediate element based on the search method of the first row number and the first column number, so as to determine the data category corresponding to each data to be classified in this round of data classification operation based on each target element.

[0196] Therefore, the technical solution of this application does not require a trusted third party to participate in the collection and management of the data to be classified. By converting the data to be classified in each data terminal into a matrix required for classification calculation, and by performing encryption, element position changes, and random number additions on the matrix through different data terminals during the classification process, it is possible to prevent any data terminal from completely obtaining or tampering with the data from other data terminals. This can prevent the leakage and tampering of the data to be classified, and improve the efficiency, accuracy and security of data classification.

[0197] Therefore, the data classification method of this application can solve the technical problems in the existing data classification process, which require obtaining a large amount of feature data of the data to be classified from different data sources, resulting in data leakage and tampering, and the difficulty in finding a safe and reliable third party, which reduces the efficiency, accuracy and security of data classification.

[0198] Another specific process of the above data classification method is as follows, see reference. Figure 1d and Figure 1f This method is applied to the data processing end:

[0199] Step 301: Determine the total number of rows in the first matrix;

[0200] Step 302: Determine the total number of columns in the first matrix;

[0201] Step 303: Determine the elements of the first matrix, as well as the number of rows and columns corresponding to each element, and generate the first matrix;

[0202] Step 304: Receive the second matrix sent by the data supplementation end;

[0203] Step 305: Summate the first matrix and the second matrix to obtain the sum matrix;

[0204] Step 306: Perform positional manipulation on the elements of the summation matrix to obtain the intermediate matrix, and record the positional manipulation relationships;

[0205] Step 307: Send the intermediate matrix to the data supplementation end;

[0206] Step 308: Receive multiple intermediate elements sent by the data supplementation end;

[0207] Step 309: Based on the positional relationship, determine the multiple target elements in the summation matrix of the multiple intermediate elements;

[0208] Step 310: Based on multiple target elements, determine the data category of each data to be classified, and send the data category of each data to be classified to the data supplementation end;

[0209] Step 311: Calculate the new data center and the first update matrix, and iteratively repeat the calculation of the new target element until the preset condition for stopping iteration is met.

[0210] Another specific process of the above data classification method is as follows, see reference. Figure 1e and Figure 1g This method is applied to the data supplementation end:

[0211] Step 401: Determine the total number of rows in the second matrix;

[0212] Step 402: Determine the total number of columns in the second matrix;

[0213] Step 403: Determine the elements of the second matrix, as well as the number of rows and columns corresponding to each element, and generate the second matrix;

[0214] Step 404: Send the second matrix to the data processing end;

[0215] Step 405: Receive and decrypt the intermediate matrix sent by the data processing end;

[0216] Step 406: Determine multiple intermediate elements from the intermediate matrix;

[0217] Step 407: Send multiple intermediate elements to the data processing terminal;

[0218] Step 408: Receive the data category corresponding to each piece of data to be classified from the data processing terminal;

[0219] Step 409: Calculate the new data center and the second update matrix according to the data category corresponding to each piece of data to be classified;

[0220] Step 410: Iterate and repeat the calculation of the new target element until the preset condition for stopping iteration is met.

[0221] The method described in the above embodiments will be further described in detail below.

[0222] like Figure 3a The diagram shown is a structural schematic of a data classification device provided in an embodiment of this application. This device can be applied to a data processing end and includes:

[0223] The first matrix acquisition unit 501 is used to acquire a first matrix of the dataset to be classified, wherein the number of rows in the first matrix represents the identifier of the data to be classified corresponding to the element, the number of columns in the first matrix represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category.

[0224] The second matrix receiving unit 502 is used to receive a second matrix sent by the data supplementation end, wherein the second matrix is ​​a homomorphic encryption matrix, the order of the second matrix is ​​equal to the order of the first matrix, and the elements of the second matrix are different from the elements of the first matrix.

[0225] The intermediate matrix determination unit 503 is used to sum the first matrix and the second matrix to obtain a sum matrix, and to perform position change processing on the elements of the sum matrix to obtain an intermediate matrix, wherein the position change processing is to change the position of the entire row elements and the entire column elements in the matrix;

[0226] The intermediate matrix sending unit 504 is used to send the intermediate matrix to the data supplementation end, so that the data supplementation end receives and decrypts the intermediate matrix and determines multiple intermediate elements from the intermediate matrix, wherein the intermediate element is the element in each row of the intermediate matrix that is closest to the data category.

[0227] The target element determination unit 505 is used to receive the plurality of intermediate elements sent by the data supplementation end, determine the plurality of target elements corresponding to the plurality of intermediate elements in the summation matrix, so as to classify the data to be classified corresponding to the target elements into the corresponding data categories.

[0228] Optionally, the first matrix acquisition unit 501 includes:

[0229] The total number of rows acquisition sub-unit is used to acquire the total number of rows in the first matrix, wherein the total number of rows is the total number of data to be classified in the dataset to be classified;

[0230] The total column count acquisition subunit is used to acquire the total number of columns in the first matrix, wherein the total number of columns is the total number of data categories;

[0231] The matrix element calculation subunit is used to calculate the element corresponding to the data to be classified based on the degree of proximity of the data to be classified to the data category.

[0232] The first matrix generation subunit is used to determine the number of rows and columns corresponding to each element based on the identifier of each data to be classified and the data category corresponding to each element, so as to generate the first matrix.

[0233] Optionally, the matrix element calculation subunit is further specifically used for:

[0234] Obtain the first feature vector corresponding to the data to be classified, and the second feature vector corresponding to the data category;

[0235] The similarity between the first feature vector and the second feature vector is calculated to obtain the elements of the data to be classified.

[0236] Optionally, the intermediate matrix determining unit 503 includes:

[0237] The row element acquisition subunit is used to acquire multiple sets of row elements of the summation matrix, where each set of row elements consists of all elements in each row of the summation matrix.

[0238] The column element acquisition subunit is used to acquire multiple sets of column elements of the summation matrix, where each set of column elements consists of all elements in each column of the summation matrix.

[0239] The element-changing subunit is used to change the number of rows corresponding to each group of row elements to the number of rows of any other group of row elements, and to change the number of columns corresponding to each group of column elements to the number of columns of any other group of column elements, so as to obtain the intermediate matrix.

[0240] Optionally, the target element determination unit 505 includes:

[0241] The first row and column number calculation subunit is used to obtain the first row number and first column number corresponding to the intermediate element in the intermediate matrix;

[0242] The second row and column number calculation subunit is used to determine the second row number corresponding to the first row number in the summation matrix, and the second column number of the first column number in the summation matrix;

[0243] The target element determination subunit is used to obtain the target element located in the second row and the second column of the summation matrix.

[0244] Optionally, the first matrix acquisition unit 501 further includes:

[0245] A random number acquisition subunit is used to acquire a random number agreed upon with the data supplementation terminal;

[0246] The first random number acquisition subunit is used to obtain a first random number according to the random number, wherein the first random number and the second random number are opposites of each other, and the second random number is a random value obtained by the data supplementation terminal according to the agreement;

[0247] The element calculation subunit is used to obtain the degree of proximity of the data to be classified to the data category and to calculate the element corresponding to the data to be classified.

[0248] The first element acquisition subunit is used to calculate the sum of each element and the first random number to obtain the first element;

[0249] The first matrix generation subunit is used to determine the number of rows and columns corresponding to each first element based on the identifier of each data to be classified and the data category corresponding to each first element, so as to generate the first matrix.

[0250] Optionally, the device further includes:

[0251] A data center computing unit is used to calculate the data center corresponding to each data category based on the plurality of target elements, wherein the data center contains the mean vector of multiple features to be classified for each data category;

[0252] The first update matrix acquisition unit is used to update the elements of the first matrix according to the data center to obtain the first update matrix;

[0253] The data category sending unit is used to send the data category corresponding to each of the data to be classified to the data supplementation end according to the plurality of target elements, so that the data supplementation end can synchronously calculate the corresponding second update matrix;

[0254] The first iterative calculation unit is used to iteratively and repeatedly execute the steps of calculating the multiple target elements according to the first update matrix and the second update matrix until a preset condition for stopping iteration is met.

[0255] like Figure 3b The diagram shown is a structural schematic of a data classification device provided in an embodiment of this application. This device can be applied to a data supplementation end and includes:

[0256] The second matrix acquisition unit 601 is used to acquire a second matrix of the dataset to be classified, wherein the second matrix is ​​a homomorphic encryption matrix, the row number of the element in the second matrix represents the identifier of the data to be classified corresponding to the element, the column number of the element represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category.

[0257] The second matrix sending unit 602 is used to send the second matrix to the data processing end, so that the data processing end adds the stored first matrix and the second matrix to obtain a sum matrix, and performs position change processing on the elements of the sum matrix to obtain an intermediate matrix. The order of the first matrix is ​​equal to the order of the second matrix, the elements of the first matrix are different from the elements of the second matrix, and the position change processing is to change the position of the entire row elements and the entire column elements in the matrix.

[0258] Intermediate element determination unit 603 is used to receive and decrypt the intermediate matrix, and determine multiple intermediate elements from the intermediate matrix, wherein the intermediate element is the element in each row of the intermediate matrix that is closest to the data category.

[0259] The intermediate element sending unit 604 is used to send the plurality of intermediate elements to the data processing end, so that the data processing end can determine the plurality of target elements corresponding to the plurality of intermediate elements in the summation matrix, so as to classify the data to be classified corresponding to the target elements into the corresponding data categories.

[0260] Optionally, the intermediate element determining unit 603 includes:

[0261] The intermediate row element acquisition subunit is used to acquire multiple sets of intermediate row elements of the intermediate matrix, where each set of intermediate row elements consists of all elements in each row of the intermediate matrix.

[0262] The intermediate element determines the sub-unit, which is used to select the element with the highest similarity to the data category from each group of intermediate row elements to obtain the multiple intermediate elements.

[0263] Optionally, the second matrix acquisition unit 601 includes:

[0264] A random number acquisition subunit is used to acquire random numbers agreed upon with the data processing terminal;

[0265] The second random number acquisition subunit is used to obtain a second random number according to the random number, wherein the second random number is the opposite of the first random number, and the first random number is a random value obtained by the data processing terminal according to the agreement.

[0266] The data category acquisition subunit is used to obtain the degree of proximity of the data to be classified to the data category and to calculate the elements of the data to be classified.

[0267] The first element calculation subunit is used to calculate the sum of each element and the second random number to obtain the first element;

[0268] The second matrix generation subunit is used to determine the number of rows and columns corresponding to each first element based on the identifier of each data to be classified and the data category corresponding to each first element, so as to generate the second matrix.

[0269] Therefore, the technical solution of this application does not require a trusted third party to participate in the collection and management of the data to be classified. By converting the data to be classified in each data terminal into a matrix required for classification calculation, and by performing encryption, element position changes, and random number additions on the matrix through different data terminals during the classification process, it is possible to prevent any data terminal from completely obtaining or tampering with the data from other data terminals. This can prevent the leakage and tampering of the data to be classified, and improve the efficiency, accuracy and security of data classification.

[0270] Therefore, the data classification method of this application can solve the technical problems in the existing data classification process, which require obtaining a large amount of feature data of the data to be classified from different data sources, resulting in data leakage and tampering, and the difficulty in finding a safe and reliable third party, which reduces the efficiency, accuracy and security of data classification.

[0271] This application also provides an electronic device, which can be a terminal, server, or other similar device. Figure 4 As shown, it illustrates a structural schematic diagram of the electronic device involved in the embodiments of this application, specifically:

[0272] The electronic device may include components such as a processor 701 with one or more processing cores, a memory 702 with one or more computer-readable storage media, a power supply 703, an input unit 704, and a communication unit 705. Those skilled in the art will understand that... Figure 4 The electronic device structure shown does not limit the electronic device and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. Wherein:

[0273] The processor 701 is the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes various functions and processes data by running or executing software programs and / or units stored in the memory 702, and by calling data stored in the memory 702. In some embodiments, the processor 701 may include one or more processing cores; in some embodiments, the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 701.

[0274] The memory 702 can be used to store software programs and units. The processor 701 executes various functional applications and data processing by running the software programs and units stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 702 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.

[0275] The electronic device also includes a power supply 703 that supplies power to the various components. In some embodiments, the power supply 703 can be logically connected to the processor 701 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. The power supply 703 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0276] The electronic device may also include an input unit 704, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.

[0277] The electronic device may also include a communication unit 705. In some embodiments, the communication unit 705 may include a wireless unit, through which the electronic device can perform short-range wireless transmission, thereby providing users with wireless broadband internet access. For example, the communication unit 705 can be used to help users send and receive emails, browse web pages, and access streaming media.

[0278] Although not shown, the electronic device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 701 in the electronic device loads the executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 runs the application programs stored in the memory 702 to realize various functions, as follows:

[0279] A location verification request is initiated to the invited terminal, so that the invited terminal returns location verification information based on the location verification request;

[0280] The location verification information of the invited terminal is verified. When the location verification information of the invited terminal and the location verification information of the inviting terminal pass the location consistency verification, the inviting terminal successfully requests registration.

[0281] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.

[0282] As can be seen from the above, the technical solution of this application does not require a trusted third party to participate in the collection and management of the data to be classified. By converting the data to be classified in each data terminal into a matrix required for classification calculation, and by performing encryption, element position changes, and random number additions on the matrix through different data terminals during the classification process, it is possible to prevent any data terminal from completely obtaining or tampering with the data from other data terminals. This can prevent the leakage and tampering of the data to be classified, and improve the efficiency, accuracy and security of data classification.

[0283] Therefore, the data classification method of this application can solve the technical problems in the existing data classification process, which require obtaining a large amount of feature data of the data to be classified from different data sources, resulting in data leakage and tampering, and the difficulty in finding a safe and reliable third party, which reduces the efficiency, accuracy and security of data classification.

[0284] Therefore, embodiments of this application provide a computer-readable storage medium storing a plurality of instructions that can be loaded by a processor to execute steps in any of the data classification methods provided in embodiments of this application. For example, the instructions can execute the following steps:

[0285] A location verification request is initiated to the invited terminal, so that the invited terminal returns location verification information based on the location verification request;

[0286] The location verification information of the invited terminal is verified. When the location verification information of the invited terminal and the location verification information of the inviting terminal pass the location consistency verification, the inviting terminal successfully requests registration.

[0287] The storage medium may include: read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0288] Therefore, the technical solution of this application does not require a trusted third party to participate in the collection and management of the data to be classified. By converting the data to be classified in each data terminal into a matrix required for classification calculation, and by performing encryption, element position changes, and random number additions on the matrix through different data terminals during the classification process, it is possible to prevent any data terminal from completely obtaining or tampering with the data from other data terminals. This can prevent the leakage and tampering of the data to be classified, and improve the efficiency, accuracy and security of data classification.

[0289] Therefore, the data classification method of this application can solve the technical problems in the existing data classification process, which require obtaining a large amount of feature data of the data to be classified from different data sources, resulting in data leakage and tampering, and the difficulty in finding a safe and reliable third party, which reduces the efficiency, accuracy and security of data classification.

[0290] Since the instructions stored in the storage medium can execute the steps in any of the data classification methods provided in the embodiments of this application, the beneficial effects that any of the data classification methods provided in the embodiments of this application can achieve can be realized, as detailed in the preceding embodiments, and will not be repeated here.

[0291] The foregoing has provided a detailed description of a data classification method, apparatus, system, electronic device, and computer storage medium provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A data classification method, characterized in that, Applied to the data processing end, the method includes: Obtain a first matrix of the dataset to be classified, wherein the row number of an element in the first matrix represents the identifier of the data to be classified corresponding to the element, the column number of the element represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category; The receiver receives a second matrix sent by the data supplementation end, wherein the second matrix is ​​a homomorphic encryption matrix, the order of the second matrix is ​​equal to the order of the first matrix, and the elements of the second matrix are different from the elements of the first matrix; The first matrix and the second matrix are summed to obtain a sum matrix, and the elements of the sum matrix are rearranged to obtain an intermediate matrix, wherein the rearrangement process involves changing the position of the entire row and the entire column elements in the matrix. The intermediate matrix is ​​sent to the data supplementation end so that the data supplementation end receives and decrypts the intermediate matrix and determines multiple intermediate elements from the intermediate matrix, wherein the intermediate element is the element in each row of the intermediate matrix that is closest to the data category. The system receives the multiple intermediate elements sent by the data supplementation terminal, determines the multiple target elements corresponding to the multiple intermediate elements in the summation matrix, and classifies the data to be classified corresponding to the target elements into the corresponding data categories.

2. The data classification method according to claim 1, characterized in that, The process of obtaining the first matrix of the dataset to be classified includes: Obtain the total number of rows in the first matrix, where the total number of rows is the total number of data to be classified in the dataset to be classified; Obtain the total number of columns in the first matrix, where the total number of columns is the total number of data categories; Calculate the element corresponding to the data to be classified based on the degree of proximity in which the data to be classified belongs to the data category; Based on the identifier of each piece of data to be classified and the data category corresponding to each element, the number of rows and columns corresponding to each element are determined to generate the first matrix.

3. The data classification method according to claim 2, characterized in that, The step of calculating the element corresponding to the data to be classified based on the degree of proximity of the data to be classified to the data category includes: Obtain the first feature vector corresponding to the data to be classified, and the second feature vector corresponding to the data category; The similarity between the first feature vector and the second feature vector is calculated to obtain the elements of the data to be classified.

4. The data classification method according to claim 1, characterized in that, The step of repositioning the elements of the summation matrix to obtain the intermediate matrix includes: Obtain multiple sets of row elements of the summation matrix, where each set of row elements consists of all elements in each row of the summation matrix; Obtain multiple sets of column elements of the summation matrix, where each set of column elements consists of all elements in each column of the summation matrix; The number of rows corresponding to each group of row elements is changed to the number of rows of any other group of row elements, and the number of columns corresponding to each group of column elements is changed to the number of columns of any other group of column elements to obtain the intermediate matrix.

5. The data classification method according to claim 1, characterized in that, Determining the multiple target elements corresponding to the multiple intermediate elements in the summation matrix includes: Obtain the first row number and first column number of the intermediate element in the intermediate matrix; Determine the second row number corresponding to the first row number in the summation matrix, and the second column number of the first column number in the summation matrix; Obtain the target element located at the second row and second column number in the summation matrix.

6. The data classification method according to claim 1, characterized in that, The process of obtaining the first matrix of the dataset to be classified also includes: Obtain a random number agreed upon with the data supplement terminal; Based on the random number, a first random number is obtained by agreement, wherein the first random number and the second random number are opposites of each other, and the second random number is a random value obtained by agreement at the data supplement terminal; Obtain the degree of proximity of the data to be classified to the data category, and calculate the element corresponding to the data to be classified; Calculate the sum of each element and the first random number to obtain the first element; Based on the identifier of each piece of data to be classified and the data category corresponding to each first element, the number of rows and columns corresponding to each first element are determined to generate the first matrix.

7. The data classification method according to claim 1, characterized in that, The method further includes: Based on the plurality of target elements, calculate the data center corresponding to each data category, wherein the data center contains the mean vector of multiple features to be classified for each data category; Based on the data center, update the elements of the first matrix to obtain the first update matrix; Based on the multiple target elements, the data category corresponding to each of the data to be classified is sent to the data supplementation end, so that the data supplementation end can synchronously calculate the corresponding second update matrix; Based on the first update matrix and the second update matrix, the steps of calculating the multiple target elements are iteratively repeated until a preset condition for stopping the iteration is met.

8. A data classification method, characterized in that, Applied to the data supplementation end, the method includes: Obtain the second matrix of the dataset to be classified, wherein the second matrix is ​​a homomorphic encryption matrix, the row number of the element in the second matrix represents the identifier of the data to be classified corresponding to the element, the column number of the element represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category; The second matrix is ​​sent to the data processing end, so that the data processing end adds the stored first matrix and the second matrix to obtain a sum matrix, and performs position change processing on the elements of the sum matrix to obtain an intermediate matrix. The order of the first matrix is ​​equal to the order of the second matrix, the elements of the first matrix are different from the elements of the second matrix, and the position change processing is to change the position of the entire row elements and the entire column elements in the matrix. Receive and decrypt the intermediate matrix, and determine multiple intermediate elements from the intermediate matrix, wherein the intermediate element is the element in each row of the intermediate matrix that is closest to the data category; The multiple intermediate elements are sent to the data processing terminal so that the data processing terminal can determine the multiple target elements corresponding to the multiple intermediate elements in the summation matrix, so as to classify the data to be classified corresponding to the target elements into the corresponding data categories.

9. The method according to claim 8, characterized in that, The step of determining multiple intermediate elements from the intermediate matrix includes: Obtain multiple sets of intermediate row elements of the intermediate matrix, where each set of intermediate row elements consists of all elements in each row of the intermediate matrix; From each group of intermediate row elements, the element with the highest similarity to the data category is selected to obtain the plurality of intermediate elements.

10. The method according to claim 8, characterized in that, The process of obtaining the second matrix of the dataset to be classified includes: Obtain a random number agreed upon with the data processing terminal; Based on the random number, a second random number is obtained by agreement, wherein the second random number is the opposite of the first random number, and the first random number is a random value obtained by agreement at the data processing end; Obtain the degree of proximity of the data to be classified to the data category, and calculate the elements of the data to be classified; Calculate the sum of each element and the second random number to obtain the first element; Based on the identifier of each piece of data to be classified and the data category corresponding to each first element, the number of rows and columns corresponding to each first element are determined to generate the second matrix.

11. A data classification device, characterized in that, The device, used in data processing, includes: The first matrix acquisition unit is used to acquire a first matrix of the dataset to be classified, wherein the row number of an element in the first matrix represents the identifier of the data to be classified corresponding to the element, the column number of the element represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category. The second matrix receiving unit is used to receive a second matrix sent by the data supplementation end, wherein the second matrix is ​​a homomorphic encryption matrix, the order of the second matrix is ​​equal to the order of the first matrix, and the elements of the second matrix are different from the elements of the first matrix. The intermediate matrix determination unit is used to sum the first matrix and the second matrix to obtain a sum matrix, and to perform position change processing on the elements of the sum matrix to obtain an intermediate matrix, wherein the position change processing is to change the position of the entire row elements and the entire column elements in the matrix; An intermediate matrix sending unit is used to send the intermediate matrix to the data supplementation end, so that the data supplementation end receives and decrypts the intermediate matrix, and determines multiple intermediate elements from the intermediate matrix, wherein the intermediate element is the element in each row of the intermediate matrix that is closest to the data category. The target element determination unit is used to receive the plurality of intermediate elements sent by the data supplementation end, determine the plurality of target elements corresponding to the plurality of intermediate elements in the summation matrix, so as to classify the data to be classified corresponding to the target elements into the corresponding data categories.

12. A data classification device, characterized in that, The device, applied to a data supplementation end, includes: The second matrix acquisition unit is used to acquire a second matrix of the dataset to be classified, wherein the second matrix is ​​a homomorphic encryption matrix, the row number of the element in the second matrix represents the identifier of the data to be classified corresponding to the element, the column number of the element represents the data category corresponding to the element, and the element represents the degree of proximity of the data to be classified to the data category. The second matrix sending unit is used to send the second matrix to the data processing end, so that the data processing end adds the stored first matrix and the second matrix to obtain a sum matrix, and performs position change processing on the elements of the sum matrix to obtain an intermediate matrix. The first matrix has the same order as the second matrix, the elements of the first matrix are different from the elements of the second matrix, and the position change processing is to change the position of the entire row elements and the entire column elements in the matrix. An intermediate element determination unit is used to receive and decrypt the intermediate matrix, and determine multiple intermediate elements from the intermediate matrix, wherein the intermediate element is the element in each row of the intermediate matrix that is closest to the data category. An intermediate element sending unit is used to send the plurality of intermediate elements to the data processing end, so that the data processing end can determine the plurality of target elements corresponding to the plurality of intermediate elements in the summation matrix, so as to classify the data to be classified corresponding to the target elements into the corresponding data categories.

13. An electronic device, characterized in that, include: Processor and storage media; The processor is used to implement various instructions; The storage medium is used to store multiple instructions, which are loaded by a processor and executed as described in any one of claims 1 to 10.

14. A computer-readable storage medium storing executable instructions, characterized in that, When the executable instructions are executed by the processor, they implement the data classification method according to any one of claims 1-10.

15. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the data classification method according to any one of claims 1-10.

Citation Information

Patent Citations

  • Data processing method, server and computer readable medium

    CN107977713A

  • Shop classification method and device and computer storage medium

    CN115131068A