Data security sharing method, device, medium and equipment based on trusted space

By configuring keys and rules in a trusted space, extracting and desensitizing data and then encrypting and storing it, security risks in the data sharing process are resolved, and data security, controllability, and effective utilization are achieved.

CN119046978BActive Publication Date: 2025-10-10SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411049419.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-01
Publication Date
2025-10-10
Estimated Expiration
2044-08-01

AI Technical Summary

Technical Problem

In the existing technology, there are data security risks in the data sharing process, such as data leakage, unclear responsibilities, and difficult to control permissions, which make it impossible to effectively share and utilize data.

Method used

Through a data security sharing method based on a trusted space, the data provider configures keys, sensitive data discovery rules, desensitization rules, and sampling strategies for the data user, extracts data, desensitizes it, and then encrypts and stores it. In a distributed storage system in the trusted space, record information is generated and authorized to the data user.

Benefits of technology

It achieves data security and controllability, separates data ownership and usage rights, ensures the security and controllability of data during use, and supports multiple data sources and access rights management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046978B_ABST
    Figure CN119046978B_ABST
Patent Text Reader

Abstract

The application provides a data security sharing method and device based on a trusted space, a medium and equipment. The method comprises the following steps: obtaining a data use application initiated by a data user; approving the data use application, and creating a corresponding secret key for the data user after the approval; configuring a corresponding data source, sensitive data discovery rule, desensitization rule, sampling strategy and sampling method according to the data use application; extracting data from the data source; identifying sensitive data in the extracted data; desensitizing the sensitive data by using the desensitization rule; encrypting the desensitized data by using the secret key, and storing the sample data into a distributed storage system of the trusted space; creating record information; authorizing the record information to the data user, and notifying the data user after the authorization succeeds, so that the data user pulls the sample data from the distributed storage system. The application ensures data security and controllability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a data security sharing method, device, medium and equipment based on a trusted space. Background Art

[0002] The current state of data sharing primarily stems from managers' inability to fully understand the distribution of sensitive data, sensitive data assets, and sensitive accounts. Due to the increased volume and complexity of aggregated data, as well as its constant dynamic change, managers lack a comprehensive understanding of the distribution of sensitive data assets within big data platforms. This results in an inability to implement access control over data access and usage, posing significant data security risks. During both internal data use and external data sharing, there are also risks of malicious manipulation by internal and third-party personnel, misuse of data call interfaces, and leaks of shared data. There is even the risk of secondary leaks by third-party recipients.

[0003] Furthermore, sharing and exchanging large amounts of data can lead to data leaks. Data integration and sharing involve the centralized storage and management of large data sets. Large amounts of data are aggregated into the platform's big data storage and management system. The aggregation of confidential or internally sensitive data stored and processed by multiple departments may involve state secrets. Inadequate data protection can easily lead to data leaks. Therefore, open data is susceptible to leakage.

[0004] Furthermore, the continuous flow of data leads to unclear division of responsibilities, difficulty in controlling authority, and difficulty in holding people accountable for problems. The data integration and sharing process involves multiple parties, such as data providers, data sharing and exchange service providers, and data users. The data flows between these parties, leading to unclear confidentiality responsibilities.

[0005] The above reasons lead to data owners being "dare not", "unwilling" and "unable" to share data, resulting in the inability to activate the data and realize the maximum value of the data. Summary of the Invention

[0006] In response to at least one of the above technical problems, embodiments of the present invention provide a method, apparatus, medium, and device for secure data sharing based on a trusted space.

[0007] In a first aspect, a data security sharing method based on a trusted space provided by an embodiment of the present invention is performed by a data provider, and the method includes:

[0008] Obtain data usage applications initiated by data users;

[0009] Approving the data use application, and creating a corresponding key for the data user after approval;

[0010] According to the data use application, a corresponding data source, sensitive data discovery rule, desensitization rule, sampling strategy and sampling method are configured;

[0011] According to the sampling strategy and the sampling method, data is extracted from the data source;

[0012] Sensitive data in the extracted data is identified by using the sensitive data discovery rule;

[0013] The sensitive data is desensitized by using the desensitization rule;

[0014] The desensitized data is encrypted by using the key, the encrypted data is used as sample data, and the sample data is stored in a distributed storage system of a trusted space;

[0015] Record information corresponding to the sample data is created, and the record information includes a storage address of the sample data in the distributed storage system;

[0016] The record information is authorized to the data user, and the data user is notified after successful authorization, so that the data user pulls the sample data from the distributed storage system.

[0017] In one embodiment, the data user fills in the data use application according to business requirements in the debugging environment and submits the data use application to the production environment, so that the production environment assigns the data use application to the corresponding data provider according to the matching rule; wherein the data use application includes the name of the data user, the type of the data used and the purpose of the data.

[0018] In one embodiment, according to the data use application, the corresponding data source, sensitive data discovery rule, desensitization rule, sampling strategy and sampling method are configured, including at least one of the following:

[0019] The data source is configured as a database or a representational state transfer API;

[0020] The sensitive data discovery rule is configured as a regular expression and / or an enumeration method;

[0021] The desensitization rule is configured as at least one of replacement, masking, erasure and encryption;

[0022] The sampling strategy is configured as a sampling strategy according to a fixed number of rows or a sampling strategy according to a proportion;

[0023] The sampling method is configured as a random sampling method, a fast sampling method or a stratified sampling method.

[0024] In one embodiment, the sampling method is the random sampling method; correspondingly, the extracting data from the data source according to the sampling strategy and the sampling method comprises at least one of the following:

[0025] In the case where the data source is the database, if the sampling strategy is the strategy of sampling according to fixed row number, a ratio between a preset sampling quantity and total data quantity is taken as a sampling ratio, a random function is used to generate a random number for each data in the database, if a random number of a data is less than the sampling ratio, the data is extracted, until a number of extracted data reaches the preset sampling quantity;

[0026] In the case where the data source is the database, if the sampling strategy is the strategy of sampling according to proportion, a random function is used to generate a random number for each data in the database, if a random number of a data is less than a preset sampling proportion, the data is extracted, until a number of extracted data reaches a product between the preset sampling proportion and total data quantity;

[0027] In the case where the data source is the RESTful API, if the sampling strategy is the strategy of sampling according to fixed row number, a data quantity per page is set, a ratio between a preset sampling quantity and the data quantity per page is taken as a page number; an upward rounding value of a ratio between total data quantity and the data quantity per page is taken as a maximum page code; if the preset sampling quantity is less than the total data quantity, a number of pages from 1 to the maximum page code is randomly selected, data in the randomly selected number of pages is extracted; if the preset sampling quantity is greater than or equal to the total data quantity, data from 1 to the maximum page code is extracted;

[0028] In the case where the data source is the RESTful API, if the sampling strategy is the strategy of sampling according to proportion, a data quantity per page is set, a product between a preset sampling proportion and total data quantity is taken as a sampling quantity, a ratio between the sampling quantity and the data quantity per page is taken as a page number; an upward rounding value of a ratio between total data quantity and the data quantity per page is taken as a maximum page code; if the preset sampling quantity is less than the total data quantity, a number of pages from 1 to the maximum page code is randomly selected, data in the randomly selected number of pages is extracted; if the preset sampling quantity is greater than or equal to the total data quantity, data from 1 to the maximum page code is extracted.

[0029] In one embodiment, the sampling method is the fast sampling method; correspondingly, the extracting data from the data source according to the sampling strategy and the sampling method comprises at least one of the following:

[0030] In the case where the data source is the database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the data in the database is sorted using the default sorting rule of the database engine, and a preset sampling quantity of data is extracted from the sorted data;

[0031] In the case where the data source is the database, if the sampling strategy is a strategy of sampling according to a ratio, the product of the preset sampling ratio and the total amount of data is used as the sampling quantity, the data in the database is sorted using the default sorting rule of the database engine, and the extracted quantity of data is extracted from the sorted data;

[0032] In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the amount of data per page is set; the ratio between the preset sampling number and the amount of data per page is used as the page number; the ratio between the total amount of data and the amount of data per page is rounded up as the maximum page number; if the preset sampling number is less than the total amount of data, pages of the number of pages are randomly selected from page number 1 to the maximum page number, and data from the randomly selected pages of the number of pages are extracted; if the preset sampling number is greater than or equal to the total amount of data, all data between page number 1 and the maximum page number are extracted;

[0033] In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to proportion, the amount of data per page is set; the product of the preset extraction ratio and the total amount of data is used as the extraction quantity, and the ratio between the extraction quantity and the amount of data per page is used as the number of pages; the ratio between the total amount of data and the amount of data per page is rounded up as the maximum page number; if the preset sampling quantity is less than the total amount of data, pages of the page number are randomly selected from page number 1 to the maximum page number, and data in the randomly selected pages of the page number are extracted; if the preset sampling quantity is greater than or equal to the total amount of data, all data between page number 1 to the maximum page number are extracted.

[0034] In one embodiment, the sampling method is the stratified sampling method. Accordingly, extracting data from the data source according to the sampling strategy and the sampling method includes at least one of the following:

[0035] In the case that the data source is a database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, a hierarchical column field is determined, all values of the hierarchical column field in the database and data amounts corresponding to each value are queried, a ratio between the preset sampling number and the total data amount is taken as an extraction ratio, and a product between the extraction ratio and the data amount corresponding to each value is taken as an extraction number component corresponding to the value, and data of the extraction number component corresponding to each value is queried and extracted from the database by executing a query statement;

[0036] In the case that the data source is a database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, a hierarchical column field is determined, all values of the hierarchical column field in the database and data amounts corresponding to each value are queried, a ratio between the preset sampling number and the total data amount is taken as an extraction ratio, and a product between the extraction ratio and the data amount corresponding to each value is taken as an extraction number component corresponding to the value, and data of the extraction number component corresponding to each value is queried and extracted from the database by executing a query statement;

[0037] In the case that the data source is a database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, a hierarchical column field is determined, all values of the hierarchical column field in the database and data amounts corresponding to each value are queried, a ratio between the preset sampling number and the total data amount is taken as an extraction ratio, and a product between the extraction ratio and the data amount corresponding to each value is taken as an extraction number component corresponding to the value, and data of the extraction number component corresponding to each value is queried and extracted from the database by executing a query statement;

[0038] In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to proportion, the hierarchical column field is determined, and all values ​​of the hierarchical column field in the representational state transfer API and the data volume corresponding to each value are queried; the product of the preset extraction ratio and the data volume corresponding to each value is calculated to obtain the extraction quantity component corresponding to the value; the data volume per page is set; the ratio between the extraction quantity component corresponding to each value and the data volume per page is calculated to obtain the number of extracted pages corresponding to the value; the ratio between the data volume corresponding to each value and the data volume per page is rounded up to obtain the corresponding maximum page number; if the extraction quantity component corresponding to each value is less than the data volume corresponding to the value, a page of the extraction page number corresponding to the value is randomly selected from page number 1 to the maximum page number corresponding to the value, and the data of the page is extracted; if the extraction quantity component corresponding to each value is greater than or equal to the data volume corresponding to the value, all data from page number 1 to the maximum page number corresponding to the value are extracted.

[0039] In one embodiment, the data user is used to customize the required program by dragging data processing components on the process canvas, debug the required program using the sample data, and run actual data using the required program after successful debugging.

[0040] According to a second aspect, a data security sharing device based on a trusted space provided by an embodiment of the present invention is deployed on a data provider, and the device includes:

[0041] The application acquisition module is used to obtain data use applications initiated by data users;

[0042] A key creation module is used to review and approve the data use application and create a corresponding key for the data user after approval;

[0043] A first configuration module is used to configure corresponding data sources, sensitive data discovery rules, desensitization rules, sampling strategies and sampling methods according to the data use application;

[0044] A first extraction module, configured to extract data from the data source according to the sampling strategy and the sampling method;

[0045] A first identification module is configured to identify sensitive data in the extracted data using the sensitive data discovery rule;

[0046] A desensitization processing module, configured to perform desensitization processing on the sensitive data using the desensitization rules;

[0047] A data encryption module is used to encrypt the desensitized data using the key, use the encrypted data as sample data, and store the sample data in a distributed storage system in a trusted space;

[0048] An information recording module, configured to create record information corresponding to the sample data, wherein the record information includes a storage address of the sample data in the distributed storage system;

[0049] The authorization notification module is used to authorize the record information to the data user and notify the data user after the authorization is successful, so that the data user can pull the sample data from the distributed storage system.

[0050] According to a third aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method provided in the first aspect.

[0051] According to a fourth aspect, an embodiment of the present invention provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method provided in the first aspect is implemented.

[0052] The data security sharing method, device, medium and equipment based on the trusted space provided by the embodiment of the present invention are as follows: the data user submits an application for the use of data in the debugging environment. After approval, the data user is configured with the data source of the relevant field, the sensitive data discovery rules and desensitization rules, sampling strategy and sampling method, etc., and the extracted data is subjected to sensitive identification and desensitization, and then the data is encrypted and stored in the distributed storage system of the trusted space. Then, record information is generated and authorized to the data user. The data user can use the sample data to write code to process the business in the debugging environment. After the debugging program is debugged normally using the sample data in the debugging environment, the real data can be used to execute the program and obtain the real data processing results. It can be seen that the embodiment of the present invention realizes that the data is available but not visible, the data does not move but the program moves, ensures the security of the data, supports multiple data sources, has the functions of data access permission management, data sampling, data encryption, etc., realizes the separation of data ownership and usage rights, and ensures that the data is safe and controllable. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 Schematic diagram of a flow chart of a data security sharing method based on a trusted space in one embodiment of the present invention;

[0054] Figure 2 This is a structural block diagram of a data security sharing device based on a trusted space in one embodiment of the present invention. DETAILED DESCRIPTION

[0055] In a first aspect, an embodiment of the present invention provides a data security sharing method based on a trusted space, the method being executed by a data provider, see Figure 1 The method includes S110 to S190:

[0056] S110. Obtaining a data use application initiated by a data user;

[0057] In actual scenarios, the data user can fill out a data usage application in the debugging environment according to business needs and submit the data usage application to the production environment, so that the production environment can assign the data usage application to the corresponding data provider according to matching rules; wherein, the data usage application includes the name of the data user, the type of data used and the purpose of the data.

[0058] Among them, data types include, for example, bank card information, residents' daily consumption information, etc.

[0059] S120: Approving the data use application, and creating a corresponding key for the data user after approval;

[0060] The key includes a public key and a private key.

[0061] Among them, the key encryption and decryption methods include the symmetric encryption algorithm AES-256, the national encryption SM4, the asymmetric encryption algorithm RSA-1024, the national encryption SM2, etc.

[0062] S130. Configure corresponding data sources, sensitive data discovery rules, desensitization rules, sampling strategies, and sampling methods according to the data use application;

[0063] In one embodiment, in S130, configuring the corresponding data source, sensitive data discovery rules, desensitization rules, sampling strategy, and sampling method according to the data use application may include at least one of the following:

[0064] (1) Configuring the data source to be a database or a representational state transfer API;

[0065] If the data source is a database, configure the database instance information such as the database type, IP address, port number, user name, and password.

[0066] Among them, if the data source is a representational state transfer API, namely restAPI, configure the API and the parameters used for query, such as the page number pageNo, the amount of data per page pageSize, and establish an http or https connection to facilitate subsequent data retrieval.

[0067] The data source or data source front-end is connected to the production environment using a VPN. Data source information and data consumer information are encrypted using a key created for the data consumer and stored in the runtime environment.

[0068] Among them, after the data source configuration is completed, the basic information of the data source (including table structure, total amount of data in the data table, etc.) is automatically synchronized to the running environment, but the data in the data table will not be synchronized.

[0069] (2) configuring the sensitive data discovery rules as regular expressions and / or enumeration methods;

[0070] Since the data tables of the above data sources may contain sensitive data such as ID card numbers and mobile phone numbers, they need to be desensitized for security reasons. Sensitive data discovery rules are rules for discovering sensitive data. Sensitive data discovery rules support two methods: regular expressions and enumeration.

[0071] In a production environment, you can pre-set regular expressions tailored to the business attributes of each user organization for selection. For example, financial organizations can pre-set regular expressions for bank card numbers, while social security organizations can pre-set regular expressions for social security card numbers. Custom regular expressions are also supported.

[0072] Among them, the enumeration method: matches sensitive data according to keywords, and the matched keywords are identified as sensitive data and need to be desensitized.

[0073] (3) configuring the desensitization rule to be at least one of replacement, masking, erasure, and encryption;

[0074] Among them, the desensitization rule refers to replacing sensitive data with special symbols or encryption algorithms after it is identified to achieve the purpose of desensitization. The embodiment of the present invention supports multiple desensitization rules such as replacement, masking, erasure, and encryption.

[0075] Replacement: Replaces the matched sensitive data with administrator-defined data, such as a fixed string value.

[0076] Among them, Masking: Mask the matched sensitive data with administrator-defined data, supporting masking offset, masking length, and masking direction. For example, use an asterisk (*) to mask 5 characters from the second digit of the ID number from the front to the back.

[0077] Among them, Erase: directly erase the matched sensitive data.

[0078] Among them, encryption: encrypts the matched sensitive data using an encryption algorithm to replace the sensitive data.

[0079] (4) configuring the sampling strategy to be a strategy of sampling according to a fixed number of rows or a strategy of sampling according to a proportion;

[0080] (5) The sampling method is configured as a random sampling method, a rapid sampling method or a stratified sampling method.

[0081] S140, extracting data from the data source according to the sampling strategy and the sampling method;

[0082] In one embodiment, the sampling method is the random sampling method; correspondingly, extracting data from the data source according to the sampling strategy and the sampling method in S140 includes at least one of the following:

[0083] (1) When the data source is the database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the ratio between the preset sampling number and the total amount of data is used as the sampling ratio, and a random function is used to generate a random number for each data in the database. If the random number of a data is less than the sampling ratio, the data is extracted until the number of extracted data reaches the preset sampling number;

[0084] (2) When the data source is the database, if the sampling strategy is a strategy of sampling according to a ratio, a random function is used to generate a random number for each piece of data in the database. If the random number of a piece of data is less than a preset sampling ratio, the piece of data is extracted until the number of extracted pieces of data reaches the product of the preset sampling ratio and the total amount of data;

[0085] (3) When the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the amount of data per page is set, and the ratio between the preset sampling number and the amount of data per page is used as the number of pages; the rounded-up value of the ratio between the total amount of data and the amount of data per page is used as the maximum page number; if the preset sampling number is less than the total amount of data, the number of pages is randomly selected from page number 1 to the maximum page number, and the data in the randomly selected number of pages is extracted; if the preset sampling number is greater than or equal to the total amount of data, all the data between page number 1 and the maximum page number is extracted;

[0086] (4) In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling in proportion, the amount of data per page is set, the product of the preset sampling ratio and the total amount of data is used as the sampling quantity, and the ratio of the sampling quantity to the amount of data per page is used as the number of pages; the rounded-up value of the ratio between the total amount of data and the amount of data per page is used as the maximum page number; if the preset sampling quantity is less than the total amount of data, pages of the page number are randomly selected from page number 1 to the maximum page number, and data in the randomly selected pages of the page number are extracted; if the preset sampling quantity is greater than or equal to the total amount of data, all data between page number 1 and the maximum page number are extracted.

[0087] In one embodiment, the sampling method is the rapid sampling method. Accordingly, extracting data from the data source according to the sampling strategy and the sampling method in S140 includes at least one of the following:

[0088] (1) When the data source is the database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the data in the database is sorted using the default sorting rule of the database engine, and a preset sampling number of data is extracted from the sorted data;

[0089] (2) When the data source is the database, if the sampling strategy is a strategy of sampling according to a ratio, the product of the preset sampling ratio and the total amount of data is used as the sampling quantity, the data in the database is sorted using the default sorting rule of the database engine, and the data of the extracted quantity is extracted from the sorted data;

[0090] (3) When the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the amount of data per page is set; the ratio between the preset sampling number and the amount of data per page is used as the number of pages; the ratio between the total amount of data and the amount of data per page is rounded up as the maximum page number; if the preset sampling number is less than the total amount of data, the number of pages is randomly selected from page number 1 to the maximum page number, and the data in the randomly selected number of pages is extracted; if the preset sampling number is greater than or equal to the total amount of data, all the data between page number 1 and the maximum page number is extracted;

[0091] (4) When the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling in proportion, the amount of data per page is set; the product of the preset extraction ratio and the total amount of data is used as the extraction quantity, and the ratio between the extraction quantity and the amount of data per page is used as the number of pages; the ratio between the total amount of data and the amount of data per page is rounded up as the maximum page number; if the preset sampling quantity is less than the total amount of data, pages of the page number are randomly selected from page number 1 to the maximum page number, and data in the randomly selected pages of the page number are extracted; if the preset sampling quantity is greater than or equal to the total amount of data, all data between page number 1 and the maximum page number are extracted.

[0092] In one embodiment, the sampling method is the stratified sampling method. Accordingly, extracting data from the data source according to the sampling strategy and the sampling method in S140 may include at least one of the following:

[0093] (1) When the data source is a database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, a stratified column field is determined, and all values ​​of the stratified column field in the database and the amount of data corresponding to each value are queried; the ratio between the preset sampling number and the total amount of data is used as the extraction ratio, and the product of the extraction ratio and the amount of data corresponding to each value is used as the extraction quantity component corresponding to the value, and the data of the extraction quantity component corresponding to each value is queried and extracted from the database by executing a query statement;

[0094] (2) When the data source is a database, if the sampling strategy is a strategy of sampling according to a ratio, a stratified column field is determined, and all values ​​of the stratified column field in the database and the amount of data corresponding to each value are queried; the product of the preset extraction ratio and the amount of data corresponding to each value is used as the extraction quantity component corresponding to the value, and the data of the extraction quantity component corresponding to each value is queried and extracted from the database by executing a query statement;

[0095] (3) in the case that the data source is a REST API, if the sampling strategy is a strategy of sampling according to a fixed number of rows, a hierarchical column field is determined, all values of the hierarchical column field in the REST API and data amounts corresponding to each value are queried, a ratio between a preset sampling number and a total amount of data is taken as an extraction ratio, a product between the extraction ratio and a data amount corresponding to each value is taken as an extraction number component corresponding to the value, a data amount per page is set, a ratio between the extraction number component corresponding to each value and the data amount per page is taken as an extraction page number corresponding to the value, an upward rounding of a ratio between the data amount corresponding to each value and the data amount per page is calculated to obtain a maximum page number corresponding to the value, if the extraction number component corresponding to each value is less than the data amount corresponding to the value, pages with the extraction page number corresponding to the value are randomly selected between a page number 1 and the maximum page number corresponding to the value, and data of the pages is extracted, if the extraction number component corresponding to each value is greater than or equal to the data amount corresponding to the value, data from a page number 1 to the maximum page number corresponding to the value is extracted;

[0096] (4) in the case that the data source is a REST API, if the sampling strategy is a strategy of sampling according to a proportion, a hierarchical column field is determined, all values of the hierarchical column field in the REST API and data amounts corresponding to each value are queried, a product between a preset extraction proportion and a data amount corresponding to each value is calculated to obtain an extraction number component corresponding to the value, a data amount per page is set, a ratio between the extraction number component corresponding to each value and the data amount per page is calculated to obtain an extraction page number corresponding to the value, an upward rounding of a ratio between the data amount corresponding to each value and the data amount per page is calculated to obtain a maximum page number corresponding to the value, if the extraction number component corresponding to each value is less than the data amount corresponding to the value, pages with the extraction page number corresponding to the value are randomly selected between a page number 1 and the maximum page number corresponding to the value, and data of the pages is extracted, if the extraction number component corresponding to each value is greater than or equal to the data amount corresponding to the value, data from a page number 1 to the maximum page number corresponding to the value is extracted.

[0097] It can be seen that the sampling process is different for different data sources, different sampling strategies and different sampling methods.

[0098] S150, sensitive data in the extracted data is identified by using the sensitive data discovery rule;

[0099] S160, the sensitive data is desensitized by using the desensitization rule;

[0100] S170: Encrypt the desensitized data using the key, use the encrypted data as sample data, and store the sample data in a distributed storage system in a trusted space;

[0101] S180: Create record information corresponding to the sample data, where the record information includes a storage address of the sample data in the distributed storage system;

[0102] S190: Authorize the record information to the data user, and notify the data user after the authorization is successful, so that the data user can pull the sample data from the distributed storage system.

[0103] As can be seen, the data source, the data tables and table fields to be sampled, the sensitive data discovery rules and desensitization rules, the sampling strategy, the sampling method, etc. are configured. After the configuration is completed, it is automatically connected to the data source through a trusted channel according to the configured data source information, and the data of the corresponding fields in the corresponding data table are pulled according to the sampling strategy and sampling method. Sensitive data is identified and desensitized according to the sensitive data discovery rules and desensitization rules. After desensitization, it is encrypted with a key and stored in a distributed storage system in a trusted space. A corresponding record is synchronously created in the debugging environment. The record contains the storage address of the sample data, data source information, data user information, etc., and the record information is authorized only to the data user. After successful authorization, a message notification is sent to the data user.

[0104] In one embodiment, the data user can be used to: customize the required program by dragging data processing components on the process canvas, debug the required program using the sample data, and run actual data using the required program after successful debugging.

[0105] Among them, the data processing components are pre-set, mainly including data connection components, custom SQL components, custom Python program components, data output components, etc. Users can complete programming by dragging and dropping components.

[0106] The data connection component has two input terminals, Input 1 and Input 2, and one output terminal. Supported connection types include inner join, left join, right join, and full join. Supports selecting connection conditions, and the fields to be output from the left and right tables can be selected separately through the field selector. Select two record information to connect to the two input terminals respectively. The data connection component will replace the input terminals with the library table names in the distributed storage system in the trusted space according to the mapping relationship, and obtain data from the distributed storage system according to the library table names. It will then decrypt the data using the private key in the above-mentioned key, perform data query based on the connection type and connection selection conditions, obtain query data, encrypt the query data using the public key in the key, and output it to a temporary table in the distributed storage system in the trusted space, and output the temporary table name to the output terminal.

[0107] Among them, the custom SQL component has four input terminals: input 1, input 2, input 3, input 4 and one output terminal. Each input terminal can only connect to a data source (for example, specific access record information) or an output terminal whose output type is a data table type of the upstream component. The custom SQL component is also used for data query. It is an enhanced version of the data connection component. It supports users to customize query SQL according to the input terminal, but does not support operations to modify the original data in the database. The custom SQL component is used to replace the record information input from the four input terminals with the library table name in the distributed storage system in the trusted space according to the mapping relationship, and obtain data from the distributed storage system according to the library table name, and then decrypt the obtained data. After decryption, data query is performed according to the connection type and connection selection conditions to obtain query data. The query data is encrypted with the public key in the key and output to a temporary table in the distributed storage system in the trusted space. The temporary table name is output to the output terminal, which can then be used as the input of the downstream component.

[0108] The custom Python program component executes the user's business logic. This component has four inputs and four outputs. Each input can only connect to a data source or an upstream component whose output type is a data table. Each input contains a name field representing the name of the input data source or the name of the upstream component's output. The type field indicates the input type: 0 indicates input data of table type, 2 indicates input data of file type, and the uri field indicates the input's library table name or file path in a distributed storage system within the trusted data space. The component comes pre-installed with a third-party library and implements data reading from the input, performing business processing on the data, and encrypting the processed data before outputting it to a database table. The database here refers to the system's built-in big data distributed storage system.

[0109] The data output component must be used in conjunction with a custom Python program component to export run results. The implementation is as follows: the data output component has only one input port, pre-installs a third-party library, and implements the upload(output_name, local_path) method, where the output_name parameter is the mapped name of the upstream component's output port, and local_path is the directory where the data is exported.

[0110] Furthermore, after the data user completes the programming of the custom program by dragging and dropping components on the process canvas, he or she first uses sample data to debug the custom program. The debugging environment will send the custom program entered on the process canvas together with the component information to the self-developed pipeline service deployed by the debugging environment. Based on the component information, the service will obtain the corresponding image information, resource usage configuration, node information that needs to be run, etc., and call the K8S API of the debugging environment according to the order in which the components are executed. A debugging environment K8S container is started for each component, and the containers are executed on different nodes in the debugging environment until all components are completed. 24 hours after the execution is completed, the debugging environment container will be cleaned up and destroyed together with the temporary table data.

[0111] Only after a custom program has been successfully debugged can it be run with real data. When running with real data, the debugging environment sends the custom program or custom SQL data entered on the process canvas, along with component information, log information, and data user information, to the production environment via a REST API. The production environment's backend service converts the data source information into real data source information based on logical mapping information and decrypts it using a key. This service then uses a REST API to call the self-developed pipeline service deployed in the production environment. Based on the component information, this service retrieves the corresponding image information, resource usage configuration, and node information required for execution. The production environment's Kubernetes API is called based on the order in which the components are executed. Each component is launched in a production Kubernetes container, which executes on different nodes in the production environment until all components have completed. After all components have completed, the production environment's backend monitoring service sends the execution results to the debugging environment via a REST API to notify the data user. The production environment's containers are cleaned up and destroyed 24 hours after execution, along with the temporary table data.

[0112] The production and debugging environments described above are separate Kubernetes clusters deployed on separate physical or virtual machines. A network gatekeeper is deployed between the two clusters to isolate them. The gatekeeper only exposes a single port, through which all communication between the production and debugging environments occurs. Both environments are deployed with the same self-developed pipeline service and the same base image of custom components.

[0113] As can be seen, in the embodiments of the present invention, a data user submits an application for data use in the debugging environment. After approval, the data user is configured with data sources in related fields, sensitive data discovery and desensitization rules, sampling strategies, and sampling methods. The extracted data is then subjected to sensitive identification and desensitization, and encrypted and stored in a distributed storage system in a trusted space. Record information is then generated and authorized to the data user. The data user can then use the sample data in the debugging environment to write code to process business operations. Only after the debugging environment uses the sample data to debug the program normally can the program be executed using real data to obtain the actual data processing results.

[0114] The above solution ensures data availability without visibility, ensuring data remains static while programs remain active, ensuring data security. Furthermore, containerized deployment ensures cross-platform system availability, high availability, and ease of maintenance. This approach supports multiple data sources and includes features such as data access control, data sampling, and data encryption. The isolation of the debugging and production environments separates data ownership and usage rights, ensuring data security and control.

[0115] In a second aspect, an embodiment of the present invention provides a data security sharing device based on a trusted space, characterized in that the device is deployed on a data provider, see Figure 2 , the device comprises:

[0116] The application acquisition module is used to obtain data use applications initiated by data users;

[0117] A key creation module is used to review and approve the data use application and create a corresponding key for the data user after approval;

[0118] A first configuration module is used to configure corresponding data sources, sensitive data discovery rules, desensitization rules, sampling strategies and sampling methods according to the data use application;

[0119] A first extraction module, configured to extract data from the data source according to the sampling strategy and the sampling method;

[0120] A first identification module is configured to identify sensitive data in the extracted data using the sensitive data discovery rule;

[0121] a desensitization processing module configured to perform desensitization processing on the sensitive data according to the desensitization rule;

[0122] a data encryption module configured to encrypt the desensitized data by using the key, store the encrypted data as sample data in a distributed storage system of a trusted space, and

[0123] an information recording module configured to create record information corresponding to the sample data, the record information including a storage address of the sample data in the distributed storage system;

[0124] an authorization notification module configured to authorize the record information to the data user, and notify the data user after successful authorization, so that the data user pulls the sample data from the distributed storage system.

[0125] In one embodiment, the data user fills in a data use application according to business requirements in a debugging environment and submits the data use application to a production environment, so that the production environment assigns the data use application to the corresponding data provider according to a matching rule; wherein the data use application includes the name of the data user, the type of the data used, and the purpose of the data.

[0126] In one embodiment, the first configuration module is specifically configured to perform at least one of the following:

[0127] configure the data source as a database or a representational state transfer API;

[0128] configure the sensitive data discovery rule as a regular expression and / or an enumeration method;

[0129] configure the desensitization rule as at least one of replacement, masking, erasure, and encryption;

[0130] configure the sampling strategy as a sampling strategy according to a fixed number of rows or a sampling strategy according to a proportion;

[0131] configure the sampling method as a random sampling method, a fast sampling method, or a stratified sampling method.

[0132] In one embodiment, the sampling method is the random sampling method; correspondingly, the first extraction module is specifically configured to perform at least one of the following:

[0133] In the case where the data source is the database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the ratio between the preset sampling number and the total amount of data is used as the sampling ratio, and a random function is used to generate a random number for each data item in the database. If the random number of a data item is less than the sampling ratio, the data item is extracted until the number of extracted data items reaches the preset sampling number;

[0134] In the case where the data source is the database, if the sampling strategy is a strategy of sampling according to a ratio, a random function is used to generate a random number for each piece of data in the database. If the random number of a piece of data is less than a preset sampling ratio, the piece of data is extracted until the number of extracted pieces of data reaches the product of the preset sampling ratio and the total amount of data;

[0135] In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the amount of data per page is set, and the ratio between the preset sampling number and the amount of data per page is used as the page number; the ratio between the total amount of data and the amount of data per page is rounded up as the maximum page number; if the preset sampling number is less than the total amount of data, pages of the number of pages are randomly selected from page number 1 to the maximum page number, and data from the randomly selected pages of the number of pages are extracted; if the preset sampling number is greater than or equal to the total amount of data, all data between page number 1 and the maximum page number are extracted;

[0136] In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to proportion, the amount of data per page is set, the product of the preset sampling ratio and the total amount of data is used as the sampling quantity, and the ratio of the sampling quantity to the amount of data per page is used as the number of pages; the rounded-up value of the ratio between the total amount of data and the amount of data per page is used as the maximum page number; if the preset sampling quantity is less than the total amount of data, pages of the page number are randomly selected from page number 1 to the maximum page number, and data in the randomly selected pages of the page number are extracted; if the preset sampling quantity is greater than or equal to the total amount of data, all data between page number 1 and the maximum page number are extracted.

[0137] In one embodiment, the sampling method is the fast sampling method. Accordingly, the first extraction module is specifically configured to perform at least one of the following:

[0138] In the case where the data source is the database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the data in the database is sorted using the default sorting rule of the database engine, and a preset sampling quantity of data is extracted from the sorted data;

[0139] In the case where the data source is the database, if the sampling strategy is a strategy of sampling according to a ratio, the product of the preset sampling ratio and the total amount of data is used as the sampling quantity, the data in the database is sorted using the default sorting rule of the database engine, and the extracted quantity of data is extracted from the sorted data;

[0140] In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the amount of data per page is set; the ratio between the preset sampling number and the amount of data per page is used as the page number; the ratio between the total amount of data and the amount of data per page is rounded up as the maximum page number; if the preset sampling number is less than the total amount of data, pages of the number of pages are randomly selected from page number 1 to the maximum page number, and data from the randomly selected pages of the number of pages are extracted; if the preset sampling number is greater than or equal to the total amount of data, all data between page number 1 and the maximum page number are extracted;

[0141] In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to proportion, the amount of data per page is set; the product of the preset extraction ratio and the total amount of data is used as the extraction quantity, and the ratio between the extraction quantity and the amount of data per page is used as the number of pages; the ratio between the total amount of data and the amount of data per page is rounded up as the maximum page number; if the preset sampling quantity is less than the total amount of data, pages of the page number are randomly selected from page number 1 to the maximum page number, and data in the randomly selected pages of the page number are extracted; if the preset sampling quantity is greater than or equal to the total amount of data, all data between page number 1 to the maximum page number are extracted.

[0142] In one embodiment, the sampling method is the stratified sampling method. Accordingly, the first extraction module is specifically configured to perform at least one of the following:

[0143] In the case where the data source is a database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, a stratified column field is determined, all values ​​of the stratified column field in the database and the amount of data corresponding to each value are queried; a ratio between a preset sampling quantity and the total amount of data is used as an extraction ratio, and the product of the extraction ratio and the amount of data corresponding to each value is used as an extraction quantity component corresponding to the value; and data of the extraction quantity component corresponding to each value is queried and extracted from the database by executing a query statement;

[0144] In the case where the data source is a database, if the sampling strategy is a strategy of sampling according to a proportion, a stratified column field is determined, all values ​​of the stratified column field in the database and the amount of data corresponding to each value are queried; the product of a preset extraction ratio and the amount of data corresponding to each value is used as the extraction quantity component corresponding to the value, and data of the extraction quantity component corresponding to each value is queried and extracted from the database by executing a query statement;

[0145] In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to a fixed number of rows, then determine the hierarchical column field, query all values ​​of the hierarchical column field in the representational state transfer API and the data volume corresponding to each value; use the ratio between the preset sampling quantity and the total data volume as the extraction ratio, and multiply the product of the extraction ratio and the data volume corresponding to each value as the extraction quantity component corresponding to the value; set the data volume per page; use the ratio between the extraction quantity component corresponding to each value and the data volume per page as the number of extracted pages corresponding to the value; calculate the ratio between the data volume corresponding to each value and the data volume per page and round it up to obtain the maximum page number corresponding to the value; if the extraction quantity component corresponding to each value is less than the data volume corresponding to the value, randomly select a page with the extraction page number corresponding to the value from page number 1 to the maximum page number corresponding to the value, and extract the data of the page; if the extraction quantity component corresponding to each value is greater than or equal to the data volume corresponding to the value, then extract all the data from page number 1 to the maximum page number corresponding to the value;

[0146] In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to proportion, the hierarchical column field is determined, and all values ​​of the hierarchical column field in the representational state transfer API and the data volume corresponding to each value are queried; the product of the preset extraction ratio and the data volume corresponding to each value is calculated to obtain the extraction quantity component corresponding to the value; the data volume per page is set; the ratio between the extraction quantity component corresponding to each value and the data volume per page is calculated to obtain the number of extracted pages corresponding to the value; the ratio between the data volume corresponding to each value and the data volume per page is rounded up to obtain the corresponding maximum page number; if the extraction quantity component corresponding to each value is less than the data volume corresponding to the value, a page of the extraction page number corresponding to the value is randomly selected from page number 1 to the maximum page number corresponding to the value, and the data of the page is extracted; if the extraction quantity component corresponding to each value is greater than or equal to the data volume corresponding to the value, all data from page number 1 to the maximum page number corresponding to the value are extracted.

[0147] In one embodiment, the data user is used to customize the required program by dragging data processing components on the process canvas, debug the required program using the sample data, and run actual data using the required program after successful debugging.

[0148] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the device provided by the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0149] In a third aspect, an embodiment of the present invention provides a computer-readable medium having computer instructions stored thereon. When the computer instructions are executed by a processor, the processor executes the method provided in the first aspect.

[0150] Specifically, a system or device equipped with a storage medium can be provided, on which software program codes that implement the functions of any of the above-mentioned embodiments are stored, and a computer (or CPU or MPU) of the system or device can be enabled to read and execute the program codes stored in the storage medium.

[0151] In this case, the program code itself read from the storage medium can realize the function of any one of the above-mentioned embodiments, and thus the program code and the storage medium storing the program code constitute part of the present invention.

[0152] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, the program code can be downloaded from a server computer via a communication network.

[0153] In addition, it should be clear that the functions of any of the above embodiments can be achieved not only by executing the program code read by the computer, but also by enabling the operating system operating on the computer to complete part or all of the actual operations based on the instructions of the program code.

[0154] In addition, it can be understood that the program code read from the storage medium is written into a memory provided in an expansion board inserted into the computer or into a memory provided in an expansion module connected to the computer, and then based on the instructions of the program code, a CPU installed on the expansion board or expansion module is enabled to perform part or all of the actual operations, thereby realizing the functions of any of the above embodiments.

[0155] It is understandable that the explanation, specific implementation methods, beneficial effects, examples, etc. of the relevant contents in the computer-readable medium provided in the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0156] In a fourth aspect, an embodiment of this specification provides a computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, it implements the method in any one of the embodiments in the specification.

[0157] It is understandable that the explanation, specific implementation, beneficial effects, examples, etc. of the relevant contents in the computing device provided by the embodiment of the present invention can be found in the corresponding parts of the method provided in the first aspect, and will not be repeated here.

[0158] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.

[0159] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention may be implemented using hardware, software, widgets, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0160] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. A data security sharing method based on a trusted space, characterized in that: The method is performed by a data provider, and includes: Obtain data usage applications initiated by data users; Approving the data use application, and creating a corresponding key for the data user after approval; Configure the corresponding data source, sensitive data discovery rules, desensitization rules, sampling strategy and sampling method according to the data use application; Extracting data from the data source according to the sampling strategy and the sampling method; Using the sensitive data discovery rule, identifying sensitive data in the extracted data; Using the desensitization rules to desensitize the sensitive data; Encrypting the desensitized data using the key, using the encrypted data as sample data, and storing the sample data in a distributed storage system in a trusted space; Creating record information corresponding to the sample data, the record information including a storage address of the sample data in the distributed storage system; Authorizing the record information to the data user, and notifying the data user after successful authorization, so that the data user can pull the sample data from the distributed storage system; Configure the data source to be a database or a representational state transfer API; Among them, if the data source is a representational state transfer API, namely restAPI, configure the API and the parameters used for query, such as the page number pageNo, the amount of data per page pageSize, and establish an http or https connection to facilitate subsequent data retrieval.

2. The method according to claim 1, characterized in that The data user fills out a data usage application in the debugging environment according to business needs and submits the data usage application to the production environment, so that the production environment allocates the data usage application to the corresponding data provider according to matching rules; wherein the data usage application includes the name of the data user, the type of data used and the purpose of the data.

3. The method according to claim 1, characterized in that The configuration of the corresponding data source, sensitive data discovery rules, desensitization rules, sampling strategy, and sampling method according to the data use application includes at least one of the following: Configure the data source to be a database or a representational state transfer API; Configuring the sensitive data discovery rule as a regular expression and / or enumeration method; Configuring the desensitization rule to be at least one of replacement, masking, erasure, and encryption; Configuring the sampling strategy to be a strategy of sampling according to a fixed number of rows or a strategy of sampling according to a proportion; The sampling method is configured as a random sampling method, a rapid sampling method, or a stratified sampling method.

4. The method according to claim 3, characterized in that The sampling method is the random sampling method; correspondingly, extracting data from the data source according to the sampling strategy and the sampling method includes at least one of the following: In the case where the data source is the database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the ratio between the preset sampling number and the total amount of data is used as the sampling ratio, and a random function is used to generate a random number for each data item in the database. If the random number of a data item is less than the sampling ratio, the data item is extracted until the number of extracted data items reaches the preset sampling number; In the case where the data source is the database, if the sampling strategy is a strategy of sampling according to a ratio, a random function is used to generate a random number for each piece of data in the database. If the random number of a piece of data is less than a preset sampling ratio, the piece of data is extracted until the number of extracted pieces of data reaches the product of the preset sampling ratio and the total amount of data; In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the amount of data per page is set, and the ratio between the preset sampling number and the amount of data per page is used as the number of pages; the ratio between the total amount of data and the amount of data per page is rounded up as the maximum page number; If the preset sampling number is less than the total amount of data, randomly selecting the number of pages from page number 1 to the maximum page number, and extracting the data from the randomly selected number of pages; If the preset sampling quantity is greater than or equal to the total amount of data, all data from page 1 to the maximum page number are extracted; In the case where the data source is a representational state transfer API, if the sampling strategy is a proportional sampling strategy, the amount of data per page is set, the product of the preset sampling ratio and the total amount of data is used as the sampling quantity, the ratio of the sampling quantity to the amount of data per page is used as the page quantity; and the value of the ratio between the total amount of data and the amount of data per page, rounded up, is used as the maximum page number; If the preset sampling number is less than the total amount of data, randomly selecting the number of pages from page number 1 to the maximum page number, and extracting the data from the randomly selected number of pages; If the preset sampling quantity is greater than or equal to the total amount of data, all data from page number 1 to the maximum page number are extracted.

5. The method according to claim 3, characterized in that The sampling method is the rapid sampling method. Correspondingly, extracting data from the data source according to the sampling strategy and the sampling method includes at least one of the following: In the case where the data source is the database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the data in the database is sorted using the default sorting rule of the database engine, and a preset sampling quantity of data is extracted from the sorted data; In the case where the data source is the database, if the sampling strategy is a strategy of sampling according to a ratio, the product of the preset sampling ratio and the total amount of data is used as the sampling quantity, the data in the database is sorted using the default sorting rule of the database engine, and the extracted quantity of data is extracted from the sorted data; In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to a fixed number of rows, the amount of data per page is set; the ratio between the preset number of samples and the amount of data per page is used as the number of pages; the ratio between the total amount of data and the amount of data per page is rounded up as the maximum page number; If the preset sampling number is less than the total amount of data, randomly selecting the number of pages from page number 1 to the maximum page number, and extracting the data from the randomly selected number of pages; If the preset sampling quantity is greater than or equal to the total amount of data, all data from page 1 to the maximum page number are extracted; In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to a ratio, the amount of data per page is set; the product of the preset extraction ratio and the total amount of data is used as the extraction quantity, and the ratio between the extraction quantity and the amount of data per page is used as the page quantity; Rounding up the ratio of the total amount of data to the amount of data per page as the maximum page number; If the preset sampling number is less than the total amount of data, randomly selecting the number of pages from page number 1 to the maximum page number, and extracting the data from the randomly selected number of pages; If the preset sampling quantity is greater than or equal to the total amount of data, all data from page number 1 to the maximum page number are extracted.

6. The method according to claim 3, characterized in that The sampling method is the stratified sampling method. Correspondingly, extracting data from the data source according to the sampling strategy and the sampling method includes at least one of the following: In the case where the data source is a database, if the sampling strategy is a strategy of sampling according to a fixed number of rows, a stratified column field is determined, all values ​​of the stratified column field in the database and the amount of data corresponding to each value are queried; a ratio between a preset sampling quantity and the total amount of data is used as an extraction ratio, and the product of the extraction ratio and the amount of data corresponding to each value is used as an extraction quantity component corresponding to the value; and data of the extraction quantity component corresponding to each value is queried and extracted from the database by executing a query statement; In the case where the data source is a database, if the sampling strategy is a strategy of sampling according to proportion, determining a stratification column field, querying all values ​​of the stratification column field in the database and the amount of data corresponding to each value; The product of the preset extraction ratio and the amount of data corresponding to each value is used as the extraction quantity component corresponding to the value, and the data of the extraction quantity component corresponding to each value is queried and extracted from the database by executing a query statement; In the case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to a fixed number of rows, then determining a stratified column field, querying all values ​​of the stratified column field in the representational state transfer API and the amount of data corresponding to each value; using the ratio between the preset sampling number and the total amount of data as the extraction ratio, and multiplying the product of the extraction ratio and the amount of data corresponding to each value as the extraction quantity component corresponding to the value; Set the amount of data per page; take the ratio between the extraction quantity component corresponding to each value and the amount of data per page as the number of extracted pages corresponding to the value; Calculate the ratio between the amount of data corresponding to each value and the amount of data per page and round it up to obtain the maximum page number corresponding to the value; If the extraction quantity component corresponding to each value is less than the data amount corresponding to the value, then a page corresponding to the extraction quantity of the value is randomly selected from page number 1 to the maximum page number corresponding to the value, and the data of the page is extracted; If the extraction quantity component corresponding to each value is greater than or equal to the amount of data corresponding to the value, then all data from page number 1 to the maximum page number corresponding to the value will be extracted; In a case where the data source is a representational state transfer API, if the sampling strategy is a strategy of sampling according to proportion, determining a hierarchical column field, and querying all values ​​of the hierarchical column field in the representational state transfer API and the amount of data corresponding to each value; Calculate the product of the preset extraction ratio and the data volume corresponding to each value to obtain the extraction quantity component corresponding to the value; Set the amount of data per page; Calculate the ratio between the extraction quantity component corresponding to each value and the amount of data per page to obtain the number of extracted pages corresponding to the value; Calculate the ratio between the amount of data corresponding to each value and the amount of data per page and round it up to obtain the corresponding maximum page number; If the extraction quantity component corresponding to each value is less than the data amount corresponding to the value, then a page corresponding to the extraction quantity of the value is randomly selected from page number 1 to the maximum page number corresponding to the value, and the data of the page is extracted; If the extraction quantity component corresponding to each value is greater than or equal to the amount of data corresponding to the value, then all data from page number 1 to the maximum page number corresponding to the value will be extracted.

7. The method according to claim 1, characterized in that The data user customizes the required program by dragging and dropping data processing components on the process canvas, debugs the required program using the sample data, and runs actual data using the required program after successful debugging.

8. A data security sharing device based on a trusted space, characterized in that: The device is deployed on a data provider, and includes: The application acquisition module is used to obtain data use applications initiated by data users; A key creation module is used to review and approve the data use application and create a corresponding key for the data user after approval; A first configuration module is used to configure corresponding data sources, sensitive data discovery rules, desensitization rules, sampling strategies and sampling methods according to the data use application; A first extraction module, configured to extract data from the data source according to the sampling strategy and the sampling method; A first identification module is configured to identify sensitive data in the extracted data using the sensitive data discovery rule; A desensitization processing module, configured to perform desensitization processing on the sensitive data using the desensitization rules; A data encryption module is used to encrypt the desensitized data using the key, use the encrypted data as sample data, and store the sample data in a distributed storage system in a trusted space; An information recording module, configured to create record information corresponding to the sample data, wherein the record information includes a storage address of the sample data in the distributed storage system; The authorization notification module is used to authorize the record information to the data user and notify the data user after the authorization is successful, so that the data user can pull the sample data from the distributed storage system.

9. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed in a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

10. A computing device, characterized in that The method comprises a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Desensitization platform for structured data

    CN110399733A

  • Data sharing method and device

    CN117874811A