Multi-version database data desensitization method and device, equipment and storage medium
By creating Docker images and containers locally, we can quickly restore multi-version databases and export structured data. We can also use data anonymization applications for secure anonymization, which solves the problems of complexity and inefficiency in multi-version database environments and improves data processing efficiency and security.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-27
- Publication Date
- 2026-04-14
AI Technical Summary
Existing technologies for data recovery and de-identification of multi-version databases suffer from problems such as complex environmental dependencies, severe version conflicts, low operational efficiency, and high hardware resource consumption, making it difficult to meet the timeliness requirements of enterprises.
By creating Docker images and containers locally, we can achieve rapid recovery of multiple versions of databases and export of structured data. We also use data anonymization applications for secure anonymization to ensure that each database environment is isolated from the others and avoid version conflicts.
It improves data recovery and desensitization efficiency, reduces operational risks, reduces hardware resource consumption, adapts to the rapid evolution of enterprise technology stacks, and reduces the risk of information leakage.
Smart Images

Figure CN121859356A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and includes, but is not limited to, a method, apparatus, device, and storage medium for de-identifying multi-version database data. Background Technology
[0002] As enterprises deepen their digital transformation, databases have become a critical component carrying core business data. In daily operations, data analysis, and test development, it is frequently necessary to restore, extract, and anonymize backup files from production databases to ensure data availability and security in non-production environments. Traditionally, this process heavily relies on manual operations by data recovery and anonymization personnel. This involves logging into the server host to install and configure the corresponding database version, executing backup data restoration commands, writing export scripts to extract data, and coordinating with an anonymization platform to process sensitive information. Furthermore, conflicts exist between different types / versions of databases on the same server host, necessitating the installation of multiple types / versions of databases on different server hosts. With the continuous expansion of business scale, the demand for database recovery and anonymization of new types or versions is increasing. The need to set up the environment before data recovery and anonymization makes it difficult to meet timeliness requirements, leading to a series of challenges including low efficiency, error-proneness, complex environment dependencies, and high data security risks. Summary of the Invention
[0003] In view of this, the de-identification method, apparatus, device, and storage medium for multi-version database data provided in the embodiments of this application enable rapid recovery, structured data export, and secure de-identification of multi-type and multi-version databases on a single host, thereby improving data recovery and de-identification efficiency.
[0004] The method, apparatus, device, and storage medium for de-identifying multi-version database data provided in this application are implemented as follows: One aspect of this application provides a method for desensitizing multi-version database data, the method comprising: Create at least one type of database corresponding Docker image locally, and a container corresponding to each Docker image; Retrieve structured data corresponding to each database based on the container corresponding to each database; Each structured data point is anonymized to obtain the corresponding anonymized data in the database.
[0005] In one possible implementation, at least one type of database corresponding Docker image and a corresponding container for each Docker image are created locally, including: Obtain database information and raw data for at least one type of database, with each raw data stored in its corresponding backup directory; Create a corresponding Docker image based on the database information of each database; Create a container for each Docker image.
[0006] In one possible implementation, a corresponding Docker image is created based on the database information of each database, including: Create corresponding Docker images based on the database information and runtime environment of each database; Each Docker image includes a pre-installed initialization script to configure the database.
[0007] In one possible implementation, a container is created for each Docker image, including: Each Docker image uses a container creation command to create a corresponding container, and each container has a corresponding data directory. Mount the backup directory of the original data for each database to the data directory of the corresponding container.
[0008] In one possible implementation, the structured data corresponding to each database is obtained based on the container corresponding to that database, including: Execute database recovery commands within the container corresponding to each database to restore the original data in the backup directory of the container to structured data.
[0009] In one possible implementation, each piece of structured data is anonymized to obtain the corresponding anonymized data in the database, including: Each structured data point undergoes preprocessing and data encryption to obtain encrypted data; Data anonymization is applied to anonymize encrypted data, resulting in anonymized data for the database.
[0010] In one possible implementation, the method also includes: Transmit the desensitized data to the target testing environment.
[0011] Another aspect of this application embodiment also provides a de-identification device for multi-version database data, the device comprising: The image creation module is used to create Docker images corresponding to at least one type of database locally, as well as containers corresponding to each Docker image; The data acquisition module is used to acquire the structured data corresponding to each database based on the container corresponding to each database. The data anonymization module is used to anonymize each piece of structured data to obtain the corresponding anonymized data in the database.
[0012] In one possible implementation, the image creation module is further used for: Obtain database information and raw data for at least one type of database, with each raw data stored in its corresponding backup directory; Create a corresponding Docker image based on the database information of each database; Create a container for each Docker image.
[0013] In one possible implementation, the image creation module is further used for: Create corresponding Docker images based on the database information and runtime environment of each database; Each Docker image includes a pre-installed initialization script to configure the database.
[0014] In one possible implementation, the image creation module is further used for: Each Docker image uses a container creation command to create a corresponding container, and each container has a corresponding data directory. Mount the backup directory of the original data for each database to the data directory of the corresponding container.
[0015] In one possible implementation, the data acquisition module is further used for: Execute database recovery commands within the container corresponding to each database to restore the original data in the backup directory of the container to structured data.
[0016] In one possible implementation, the data anonymization module is further used for: Each structured data point undergoes preprocessing and data encryption to obtain encrypted data; Data anonymization is applied to anonymize encrypted data, resulting in anonymized data for the database.
[0017] In one possible implementation, the device further includes: The data transmission module is used to transmit de-identified data to the target testing environment.
[0018] The electronic device provided in this application includes a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements the method described in this application.
[0019] The computer-readable storage medium provided in this application embodiment stores a computer program thereon, which, when executed by a processor, implements the method provided in this application embodiment.
[0020] The data anonymization method, apparatus, device, and storage medium for multi-version databases provided in this application involve creating at least one type of database corresponding Docker image locally, and a container corresponding to each Docker image. Structured data corresponding to each database is obtained based on the container for each database. Anonymization processing is performed on each piece of structured data to obtain anonymized data for the database. This application achieves rapid construction and isolation of the database recovery environment by establishing database images and using containerization technology. It also enables rapid recovery, structured data export, and secure anonymization of multiple types and versions of databases on a single host, improving data recovery and anonymization efficiency. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the 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.
[0022] Figure 1 A flowchart illustrating a method for de-identifying multi-version database data according to an embodiment of this application is shown. Figure 2 A schematic diagram illustrating a data anonymization process for a multi-version database according to an embodiment of this application is shown. Figure 3 A schematic diagram illustrating another de-identification process for multi-version database data according to an embodiment of this application is shown; Figure 4 A schematic diagram of a de-identification device for multi-version database data according to an embodiment of this application is shown; Figure 5 A schematic diagram of an electronic device according to an embodiment of this application is shown. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of this application will be further described in detail below with reference to the accompanying drawings of the embodiments of this application. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0025] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0026] It should be noted that the terms "first, second, third" used in the embodiments of this application are used to distinguish similar or different objects and do not represent a specific order of objects. It can be understood that "first, second, third" can be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0027] The data anonymization method for multi-version databases in this application can be executed by any electronic device, including but not limited to mobile phones, wearable devices (such as smartwatches, smart bracelets, smart glasses, etc.), tablets, laptops, in-vehicle terminals, and PCs (Personal Computers). The functionality implemented by this method can be achieved by a processor in the electronic device calling program code. Of course, the program code can be stored in a computer storage medium. Therefore, the electronic device includes at least a processor and a storage medium.
[0028] The data anonymization method for multi-version databases described in this application can be used in application scenarios requiring anonymization of any type of data. For example, this application can be applied to scenarios where data anonymization is performed before data sharing and exchange. Alternatively, it can be applied to scenarios where data anonymization is performed during development and testing.
[0029] Some related technologies, when using computer technology to assist manual data masking, suffer from several drawbacks. Firstly, they rely on "online" masking solutions that are already running database instances, failing to address the fundamental challenges of "offline" recovery and processing of database backup files. Secondly, they lack the ability to encapsulate and isolate multi-version and multi-type database environments. Thirdly, they lack end-to-end recovery and masking capabilities, failing to achieve a streamlined process from backup file recovery and structured export to masked transmission. Furthermore, these technologies typically mask data for single-category databases, unable to mask data for multiple categories of databases using a single device, and thus unable to handle complex scenarios involving various databases and their different versions of backup files.
[0030] In other words, current data masking technologies suffer from the following technical problems: Complex environment management and susceptibility to conflicts: They cannot create, isolate, or manage multi-version database environments; deploying different versions of databases on the same host is difficult; dependencies are complex; and recovery failures are easily caused by conflicts with library files and ports. Incomplete process: They are merely standalone data recovery or data masking technologies, lacking comprehensive technologies for backup recovery, data export, and transfer to a test environment. Lack of flexibility and scalability: They struggle to flexibly support new databases or versions, have poor scalability, and cannot adapt to the rapid evolution of enterprise technology stacks. Dependence on the underlying platform environment: They rely on existing database environments, specific backup software, or platforms, lacking universality, adaptability, and portability.
[0031] Therefore, it can be seen that the technical problem solved by the embodiments of this application is how to solve the problems of complex environment dependency, serious version conflict, low operation efficiency and high hardware resource consumption in the current data recovery and desensitization process.
[0032] The following describes in detail the data anonymization scheme for multi-version databases according to embodiments of this application, with reference to the accompanying drawings.
[0033] Figure 1 A flowchart illustrating a method for de-identifying multi-version database data according to an embodiment of this application is shown. Figure 1 As shown, the desensitization method for multi-version database data in this application embodiment may include the following steps S10-S20.
[0034] For ease of description, the method for desensitizing multi-version database data in this application embodiment is described using an electronic device as the execution subject. It should be understood that the execution subject in this application embodiment can also be a processor or chip in an electronic device, and this application embodiment does not impose any limitations.
[0035] Step S10: Create at least one type of database corresponding Docker image locally, and a container corresponding to each Docker image.
[0036] In one possible implementation, when data recovery and data anonymization are required for data in at least one type of database, the electronic device can locally create a Docker image for each database and a corresponding container for each Docker image. The "at least one type of database" in this application can include different categories of databases, such as MySQL, PostgreSQL, Oracle, and SQL Server. It can also include different versions of the same type of database, such as MySQL versions 5.7 and 8.0, and PostgreSQL versions 12, 13, 14, and 15. In other words, the electronic device can create corresponding Docker images and containers for different types or different versions of the same type of database.
[0037] In some embodiments, the electronic device can first acquire database information and raw data corresponding to at least one type of database, with each raw data stored in a corresponding backup directory. Then, based on the database information of each database, a corresponding Docker image is created, followed by a container for each Docker image. Alternatively, raw data can be acquired by connecting backup data from at least one type of external database to a local data recovery host via a backup and recovery system, and using a script to restore the backup data as raw data to a specified local backup directory. Simultaneously, database information is determined based on the database type and version of each database; that is, the database information is used to characterize the type and version of the corresponding database.
[0038] Optionally, the method of creating Docker images based on the database information of each database in this application embodiment can include creating corresponding Docker images based on the database information and runtime environment of each database. Then, an initialization script is pre-installed within each Docker image to implement database configuration. That is, the electronic device can first determine the category and version of each database, and then customize the Dockerfile file according to the category, version, and runtime environment of that database. Based on the official or customized base image, it can install the corresponding version of the database software, configure the running parameters, and pre-install backup and restore tools, data export tools, network tools, and dependencies.
[0039] In some embodiments, to facilitate the management of multiple different Docker images, after the Docker image for each database is built, the electronic device can also use version tags to identify each Docker image (e.g., mysql:5.7, etc.) and push it to a private Docker Registry (Docker image repository) for centralized management, so as to realize image version backtracking, fast pull and consistency verification.
[0040] Further, after the creation of the Docker image is completed, the electronic device can enter the pre - installed initialization script in the image to implement the environment configuration and optimization of the database. The process of this environment configuration can be to automatically configure database parameters, character sets, time zones, etc., to ensure that the database can run normally after the container starts. This optimization process can be to optimize the container resource limits (CPU, memory) to avoid resource competition.
[0041] In some embodiments, after the Docker image of each database is created in the embodiments of the present application, the container corresponding to each Docker image is created. Among them, the electronic device can use the container creation command of each Docker image to create the corresponding container, and each container has a corresponding data directory. Then, the backup directory of the original data corresponding to each database is mounted to the data directory of the corresponding container. Exemplarily, when the electronic device stores the Docker image in the Docker image repository for management, the electronic device can determine the Docker image tag according to the information such as the database type and version included in the database information, and pull the corresponding Docker image from the created Docker image repository based on this tag, and then use the container creation command (docker run command) to create the container corresponding to the Docker.
[0042] Further, after the container creation is completed, in order to ensure that the original data corresponding to the database can be synchronously processed through the corresponding container, the electronic device can mount the backup directory on the local of the electronic device to the data directory in the container by adding the -v parameter when creating the container, that is, binding the backup directory corresponding to the same database to the data directory to achieve file sharing between the host and the container. When a file is modified in the container, it will be synchronized to the local host, and vice versa.
[0043] Step S20: Obtain the structured data corresponding to the database based on the container corresponding to each database.
[0044] In a possible implementation manner, after the electronic device creates the corresponding Docker image and the corresponding container for each type of database, due to the binding of the backup directory and the data directory of the container, the electronic device can obtain the structured data corresponding to the database through the container corresponding to the database. That is, the electronic device can execute the database recovery command in the container corresponding to each database to restore the original data in the backup directory corresponding to the container to structured data. Exemplarily, for the MySQL database, the electronic device can use mysql -u username -p <backup.sql to restore the original data in the backup target to operable structured data, and at this time, the recovered structured data can be entered in the container.
[0045] In some embodiments, after the electronic device acquires structured data from the database, it can also automatically export the data content and table structure from the database for subsequent processing. For example, after acquiring the structured data, the electronic device can use a database-specific tool within the container to export the data, such as using `mysqldump --skip-lock-tables --result-file= / export / data.sql database_name` for MySQL, to export the data as structured data in TXT or CSV format. Simultaneously, the electronic device can also export the database table structure definition files (DDL), such as by using `mysqldump --no-data` or a database metadata query command, and save them as a separate SQL file for subsequent data reconstruction or structure comparison.
[0046] Optionally, in this embodiment of the application, the exported structured data and table structure files can be stored in a temporary directory (such as / export / ) within the container, and automatically synchronized to a specified directory on the host (such as / data / exports / ) through Docker volume mapping, ensuring that the host can directly access these files.
[0047] Step S30: De-identify each structured data to obtain the corresponding de-identified data in the database.
[0048] In one possible implementation, after recovering the structured data from each database, the electronic device can perform de-identification processing on each piece of structured data to obtain the de-identified data corresponding to the database. Optionally, in this embodiment, each piece of structured data can be preprocessed and encrypted before de-identification processing to obtain encrypted data. Then, the encrypted data is de-identified based on a data de-identification application to obtain the de-identified data corresponding to the database. This de-identification process based on a data de-identification application can be performed by transmitting the encrypted data to a local data de-identification application for de-identification processing. Alternatively, the encrypted data can be sent to another data de-identification platform for de-identification processing via a data de-identification application deployed therein.
[0049] Optionally, the preprocessing of structured data by electronic devices may include preprocessing operations such as format verification, encoding conversion, and compression. This process ensures that the obtained structured data meets the input requirements of the data anonymization application. In this embodiment, the encryption of the preprocessed structured data can be achieved through the SFTP (SSH File Transfer Protocol) network protocol. That is, the preprocessed structured data can be encrypted and transmitted to the data anonymization application via the SFTP service. During transmission, key authentication and data encryption measures are employed to prevent data leakage.
[0050] In some embodiments, after receiving encrypted data, the data anonymization application can automatically process it according to preset anonymization rules (such as masking, replacing, hashing, or encrypting fields like name, ID card number, and mobile phone number) to generate an anonymized data file as the anonymized data. Furthermore, after completing the data anonymization, the electronic device can also transmit the anonymized data to the target testing environment for testing. Optionally, this transmission process can also be performed encrypted via SFTP service.
[0051] Figure 2 This diagram illustrates a data anonymization process for a multi-version database according to an embodiment of this application. Figure 2 As shown in the embodiment of this application, the electronic device can start a data backup and recovery system upon receiving a data extraction request work order. This system restores structured data to the target host using methods such as creating a database Docker image container. The data is then encrypted via SFTP and sent to a data desensitization platform for desensitization processing using a data desensitization application. The desensitized data is then transmitted to the test environment.
[0052] Figure 3 This diagram illustrates another de-identification process for multi-version database data according to an embodiment of this application. Figure 3 As shown, in this embodiment, the electronic device can start the data backup and recovery system upon receiving a data extraction request. The data backup and recovery system first restores the original data to the backup directory of the target host, then builds Docker images for each database and stores them in an image repository. It further pulls each Docker image from the image repository and creates corresponding containers, mounting the backup directory corresponding to the same database to the container's data directory, so as to export the corresponding structured data by starting the container. Then, it encrypts the structured data via SFTP and sends it to a data desensitization platform. The data desensitization application performs data scanning and desensitization based on preset desensitization rules to obtain desensitized data, which is then transmitted to the test environment.
[0053] Based on the aforementioned technical features, this application embodiment can encapsulate different database types and versions using Docker images, ensuring that each database environment is isolated from the others. Each database recovery task runs in an independent container, avoiding version conflicts and dependency chaos, and improving the recovery success rate. This method supports mainstream database types (such as MySQL, KingBaseES, etc.) and can easily be extended to new database versions or types. When adding a new database type or version, only the corresponding image needs to be built and the image repository updated; no modification to the core process code is required, adapting to future business development needs. Simultaneously, the container ensures manageable lifecycles, automatically releasing resources after the operation ends, avoiding long-term occupation of server resources and reducing operational costs. Furthermore, the entire data desensitization process can be performed within the container and exported using structured data, combined with secure SFTP transmission to the desensitization platform, ensuring that sensitive data has been desensitized before testing, reducing the risk of information leakage. Moreover, databases of the same version and type can be operated using the same operation manual, facilitating standardized management of data recovery and desensitization operations, reducing operational risks, and improving data processing efficiency and consistency. Furthermore, embodiments of this application can also adopt a modular design for each functional module (such as image management, container operation, data export, and de-identified transmission), supporting independent upgrades and replacements, and reducing system maintenance complexity.
[0054] It should be understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0055] Based on the foregoing embodiments, this application provides a desensitization device for multi-version database data. The device includes various modules and units included in each module, which can be implemented by a processor; of course, it can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), microprocessor (MPU), digital signal processor (DSP), or field programmable gate array (FPGA), etc.
[0056] Figure 4 A schematic diagram of a de-identification device for multi-version database data according to an embodiment of this application is shown. Figure 4 As shown, the data anonymization device for multi-version database data in this application embodiment includes: Image creation module 40 is used to create Docker images corresponding to at least one type of database locally, as well as containers corresponding to each Docker image; Data acquisition module 41 is used to acquire structured data corresponding to each database based on the container corresponding to each database; The data desensitization module 42 is used to desensitize each structured data to obtain the corresponding desensitized data in the database.
[0057] In one possible implementation, the image creation module 40 is further used for: Obtain database information and raw data for at least one type of database, with each raw data stored in its corresponding backup directory; Create a corresponding Docker image based on the database information of each database; Create a container for each Docker image.
[0058] In one possible implementation, the image creation module 40 is further used for: Create corresponding Docker images based on the database information and runtime environment of each database; Each Docker image includes a pre-installed initialization script to configure the database.
[0059] In one possible implementation, the image creation module 40 is further used for: Each Docker image uses a container creation command to create a corresponding container, and each container has a corresponding data directory. Mount the backup directory of the original data for each database to the data directory of the corresponding container.
[0060] In one possible implementation, the data acquisition module 41 is further used for: Execute database recovery commands within the container corresponding to each database to restore the original data in the backup directory of the container to structured data.
[0061] In one possible implementation, the data desensitization module 42 is further used for: Each structured data point undergoes preprocessing and data encryption to obtain encrypted data; Data anonymization is applied to anonymize encrypted data, resulting in anonymized data for the database.
[0062] In one possible implementation, the device further includes: The data transmission module is used to transmit de-identified data to the target testing environment.
[0063] The descriptions of the above device embodiments are similar to those of the above method embodiments, and have similar beneficial effects. For technical details not disclosed in the device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0064] It should be noted that, in the embodiments of this application... Figure 4 The data anonymization device for multi-version databases shown is illustrative of module division, representing only one logical functional division; in actual implementation, other division methods may be used. Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, exist as separate physical entities, or be integrated into one unit with two or more units. The integrated units can be implemented in hardware, as software functional units, or a combination of both.
[0065] It should be noted that, in the embodiments of this application, if the above-described methods are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware and software combination.
[0066] Figure 5 A schematic diagram of an electronic device according to an embodiment of this application is shown. For example... Figure 5 As shown in the figure, this application provides an electronic device, which can be a server, and its internal structure diagram can be as follows. Figure 5 As shown, the electronic device includes a processor 520, a memory, and a transceiver 540 connected via a system bus 510. The processor 520 provides computing and control capabilities. The memory includes a non-volatile storage medium 531 and internal memory 532. The non-volatile storage medium 531 stores an operating system, computer programs, and a database. The internal memory 532 provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium 531. The database stores data. The transceiver 540 communicates with external terminals via a network connection. When the computer program is executed by the processor 520, it implements the methods described above.
[0067] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor 520, implements the steps of the method provided in the above embodiments.
[0068] This application provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps in the method provided in the above-described method embodiments.
[0069] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0070] In one possible implementation, the shooting prompting device provided in this application can be implemented as a computer program, which can be configured as follows: Figure 5 The device operates on the electronic device shown. The memory of the electronic device can store the various program modules that make up the above-described apparatus. The computer program composed of the various program modules causes the processor 520 to execute the steps of the methods in the various embodiments of this application described in this specification.
[0071] It should be noted that the descriptions of the storage medium and device embodiments above are similar to the descriptions of the method embodiments above, and have similar beneficial effects. For technical details not disclosed in the storage medium, storage medium, and device embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.
[0072] It should be understood that the phrases "one embodiment," "an embodiment," or "some embodiments" mentioned throughout the specification mean that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, phrases such as "in one possible implementation," "in one embodiment," or "in some embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above-described processes do not imply a sequential order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above-described embodiments are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments. The descriptions of the various embodiments above tend to emphasize the differences between the various embodiments; their similarities or commonalities can be referred to mutually, and for the sake of brevity, they will not be repeated here.
[0073] In this article, the term "and / or" is merely a description of the relationship between related objects, indicating that there can be three kinds of relationships. For example, object A and / or object B can represent three situations: object A exists alone, object A and object B exist simultaneously, and object B exists alone.
[0074] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0075] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple modules or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or modules can be electrical, mechanical, or other forms.
[0076] The modules described above as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules. They may be located in one place or distributed across multiple network units. Some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs.
[0077] In addition, each functional module in the various embodiments of this application can be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the integrated modules can be implemented in hardware or in the form of hardware plus software functional units.
[0078] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0079] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, or the parts that contribute to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause an electronic device to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0080] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0081] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0082] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0083] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for desensitizing multi-version database data, characterized in that, The method includes: Create at least one type of database corresponding Docker image locally, and a container corresponding to each Docker image; Obtain the structured data corresponding to each database based on the container corresponding to each database; Each of the structured data is anonymized to obtain the anonymized data corresponding to the database.
2. The method according to claim 1, characterized in that, The step of creating at least one type of database corresponding Docker image locally, and a container corresponding to each Docker image, includes: Obtain database information and raw data corresponding to at least one type of database, with each raw data stored in a corresponding backup directory; Create a corresponding Docker image based on the database information of each of the databases; Create a container for each of the Docker images.
3. The method according to claim 2, characterized in that, The step of creating a corresponding Docker image based on the database information of each of the databases includes: Create corresponding Docker images based on the database information and operating environment of each of the databases; Each Docker image includes a pre-installed initialization script to configure the database.
4. The method according to claim 2, characterized in that, Creating the container corresponding to each Docker image includes: Each Docker image is used to create a corresponding container using the container creation command, and each container has a corresponding data directory; Mount the backup directory of the original data corresponding to each database to the data directory of the corresponding container.
5. The method according to claim 4, characterized in that, The step of obtaining the structured data corresponding to each database based on the container corresponding to each database includes: Execute a database recovery command within the container corresponding to each database to restore the original data in the backup directory corresponding to the container into structured data.
6. The method according to claim 1, characterized in that, The process of de-identifying each piece of structured data to obtain the de-identified data corresponding to the database includes: Each of the structured data items is preprocessed and encrypted to obtain encrypted data; The encrypted data is desensitized using a data desensitization application to obtain the desensitized data corresponding to the database.
7. The method according to claim 1, characterized in that, The method further includes: The desensitized data is transmitted to the target testing environment.
8. A data anonymization device for multi-version databases, characterized in that, The device includes: The image creation module is used to create Docker images corresponding to at least one type of database locally, as well as containers corresponding to each Docker image; The data acquisition module is used to acquire the structured data corresponding to each database based on the container corresponding to each database. The data desensitization module is used to desensitize each piece of structured data to obtain the desensitized data corresponding to the database.
9. An electronic device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.