CN117763619A - Data desensitization method, device, equipment and medium - Google Patents

Data desensitization method, device, equipment and medium Download PDF

Info

Publication number
CN117763619A
CN117763619A CN202410115554.XA CN202410115554A CN117763619A CN 117763619 A CN117763619 A CN 117763619A CN 202410115554 A CN202410115554 A CN 202410115554A CN 117763619 A CN117763619 A CN 117763619A
Authority
CN
China
Prior art keywords
desensitized
data
database table
target
database
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410115554.XA
Other languages
Chinese (zh)
Inventor
史晓涛
孙绍伟
杨博
邢琳
王宇阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202410115554.XA priority Critical patent/CN117763619A/en
Publication of CN117763619A publication Critical patent/CN117763619A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses a data desensitizing method, a device, equipment and a medium. The method is applied to the server in the target environment, and comprises the following steps: establishing a target database table in a host environment based on table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment; desensitizing the data to be desensitized in the database table to be desensitized; the desensitized data is stored in a target database table. According to the technical scheme, cross-platform desensitization processing can be directly carried out on the data of the host environment to obtain desensitized data, and the desensitized data are stored in the target database table with the same table structure as the database table to be desensitized, so that the subsequent data lookup is facilitated.

Description

Data desensitization method, device, equipment and medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data desensitizing method, apparatus, device, and medium.
Background
By means of data desensitization, abuse of private data in enterprises can be effectively prevented, and the private data can be prevented from flowing out of the enterprises without desensitization.
Some units of core systems are deployed in a host environment, host data is also located in a host database, and the host data may include basic data of user basic information, so the data size is generally large, and the data size of a single table is about 10 hundred million levels.
Because of the difference between the host environment and the general open platform, the data desensitization processing of the host environment is generally completed in the host environment. With the application of the open platform desensitization tool, how to desensitize host data in an open platform environment is a technical problem to be solved.
Disclosure of Invention
The invention provides a data desensitization method, a device, equipment and a medium, which can rapidly desensitize a large amount of data in a host environment in an open environment.
According to an aspect of the present invention, there is provided a data desensitizing method applied to a server in a target environment, the method comprising:
establishing a target database table in a host environment based on table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment;
desensitizing the data to be desensitized in the database table to be desensitized;
the desensitized data is stored in a target database table.
According to another aspect of the present invention, there is provided a data desensitizing apparatus, configured as a server in a target environment, the apparatus comprising:
the target database table establishing module is used for establishing a target database table in the host environment based on the table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment;
the desensitization processing module is used for carrying out desensitization processing on the data to be desensitized in the database table to be desensitized;
and the data storage module is used for storing the desensitized data in the target database table.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data desensitization method according to any of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to perform a data desensitization method according to any embodiment of the present invention.
The technical scheme of the embodiment of the application is applied to the server in the target environment, and the method comprises the following steps: establishing a target database table in a host environment based on table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment; desensitizing the data to be desensitized in the database table to be desensitized; the desensitized data is stored in a target database table. According to the technical scheme, cross-platform desensitization processing can be directly carried out on the data of the host environment to obtain desensitized data, and the desensitized data are stored in the target database table with the same table structure as the database table to be desensitized, so that the subsequent data lookup is facilitated.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of data desensitization provided in accordance with an embodiment of the present application;
FIG. 2 is a flow chart of a method of data desensitization provided in accordance with a second embodiment of the present application;
FIG. 3 is a schematic diagram of a data desensitizing apparatus according to a third embodiment of the present application;
fig. 4 is a schematic structural diagram of an electronic device implementing a data desensitizing method according to an embodiment of the present application.
Detailed Description
In order to make the present invention better understood by those skilled in the art, the following description will be made in detail, with reference to the accompanying drawings, in which embodiments of the present invention are shown, and it is apparent that the described embodiments are only some, but not all, embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," "target," and the like in the description and claims of the present invention and in the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of a data desensitizing method according to an embodiment of the present application, where the method may be applied to desensitizing data, and the method may be performed by a data desensitizing device, where the data desensitizing device may be implemented in hardware and/or software, and the data desensitizing device may be configured in an electronic device with data processing capability. As shown in fig. 1, the method is applied to a server in a target environment, and includes:
s110, establishing a target database table in a host environment based on table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment.
In this embodiment, taking a bank as an example, data to be desensitized is located in a host database, and a host environment corresponding to the host database is usually a system operation environment formed by a plurality of servers with relatively strong processing capability, and is generally used for operating a bank core system. The target environment can be an environment corresponding to any open platform, and the desensitization tool in the target environment cannot be directly taken into the host environment for use, because the host environment has a certain difference from the target environment, and the host environment is usually provided with a plurality of settings, such as a forbidden mouse, and the like, which is unfavorable for directly carrying out desensitization in the host environment.
The technical scheme of the embodiment of the application can be executed by the server in the target environment, the server in the target environment desensitizes the data to be desensitized in the host environment, and the desensitized data is stored in the target database in the host environment.
The host environment may be an operating system (which may include software and hardware) of a bank, and the embodiments of the present application are not limited to a specific type of host environment. The target environment may be a different environment than the host environment, including but not limited to: windows, linux, etc.
Specifically, the table structure information of the database table to be desensitized can be read, then in the host environment, a target database is established, a table space is allocated in the target database, then in the table space, the target database table is generated according to the table structure information of the database table to be desensitized, in this way, the table structure of the obtained target database table is the same as the table structure of the database table to be desensitized, and the desensitized data can be stored in the target database table.
Optionally, the method further includes establishing a target partition column and a target partition index together when the target database table is established, where the target partition column and the target partition index are partition columns and partition indexes of the target database table, and are the same as partition columns and partition indexes of the database table to be desensitized.
It should be noted that the number of database tables to be desensitized may be one or more, and likewise, the number of target database tables may be one or more.
In this embodiment, optionally, based on table structure information of the database table to be desensitized, establishing a target database table in the host environment includes: reading a data definition language file of a table building script of a host database; extracting a list establishing script of a database list to be desensitized from the data definition language file; establishing a target database table in the target database based on a table establishment script of the database table to be desensitized; and the table structures of the target database table and the database table to be desensitized are the same.
The data definition language file is a DDL file.
Specifically, using the JDBC (Java Database Connectivity) database application program interface, the host database in the host environment may be operated, for example, a data definition language file of a table-building script in the host database may be obtained through JDBC, table-building script information may be screened from the data definition language file, and a table-building script of a database table to be desensitized may be extracted, which is to build a target database table with the same table structure as the table of the database table to be desensitized in the target database according to the obtained table-building script.
Illustratively, the table construction script DDL file of the host database is automatically read, related SQL statements of the table to be desensitized are screened out, a database table with the same table structure as the host database is built in the target database, and partition columns and partition indexes are built together. The automatic database, the table space and the table structure are automatically created by the arrangement, and compared with a manual creation mode, the manual operation method saves labor cost and avoids errors of manual operation.
S120, desensitizing the data to be desensitized in the database table to be desensitized.
Wherein the desensitization treatment can be performed by a desensitization tool in a target environment, the specific mode of desensitization is not limited in the embodiment of the application,
specifically, after the target database table is generated, reading the data to be desensitized of the database table to be desensitized, and carrying out desensitization treatment on the data to be desensitized to obtain data after desensitization, so as to carry out subsequent treatment.
And S130, storing the desensitized data in a target database table.
Specifically, after the desensitized data is obtained, the desensitized data is directly stored in a target database table.
In this embodiment, optionally, storing the desensitized data in the target database table includes: converting the desensitized data into target data corresponding to a host environment based on the host data character set; the target data is stored in a target database table.
In the embodiment of the application, since the data in the host database uses a special character set, the data is inconsistent with the open environment (target environment) program, so that the desensitization result is messy, and the desensitization fails. To solve this problem, data is converted from the target environment character set to the host data character set so that the data inserted into the host database can be used normally.
For example, if the target environment character set is an ASCII code, the desensitized data may correspond to the ASCII code, and the host data character set needs to be acquired, and the desensitized data is converted into target data corresponding to the host environment; the target data is stored in a target database table.
In this embodiment, optionally, storing the desensitized data in the target database table includes: based on the corresponding relation between the data to be desensitized and the database table to be desensitized, the desensitized data are stored in the corresponding target database table.
Specifically, in general, there is a correspondence between the data to be desensitized and the database table to be desensitized, for example, the a data corresponds to the B position in the table; the target database table is the same as the database table to be desensitized, so that after desensitized A 'data corresponding to the A data is obtained, the A' data is stored in the B position in the target database.
The technical scheme of the embodiment of the application is applied to the server in the target environment, and the method comprises the following steps: establishing a target database table in a host environment based on table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment; desensitizing the data to be desensitized in the database table to be desensitized; the desensitized data is stored in a target database table. According to the technical scheme, cross-platform desensitization processing can be directly carried out on the data of the host environment to obtain desensitized data, and the desensitized data are stored in the target database table with the same table structure as the database table to be desensitized, so that the subsequent data lookup is facilitated.
Example two
Fig. 2 is a flowchart of a data desensitizing method according to a second embodiment of the present application, where the embodiments of the present application are optimized based on the foregoing embodiments. The method is applied to the server in the target environment.
As shown in fig. 2, the method in the embodiment of the application specifically includes the following steps:
s210, establishing a target database table in a host environment based on table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment.
S220, the data to be desensitized respectively corresponding to the database tables to be desensitized are read concurrently.
And S230, carrying out desensitization treatment on the plurality of data to be desensitized concurrently to obtain a plurality of data after desensitization.
And S240, the plurality of desensitized data are stored in the target database table in parallel.
Illustratively, in one achievable process, S220, S230, and S240 may be implemented as: reading the data to be desensitized corresponding to the database tables to be desensitized respectively through a plurality of threads, after the data to be desensitized is read, the threads do not need to release, continuously carrying out desensitization processing on the data to be desensitized concurrently, obtaining a plurality of data after desensitization, and likewise, the threads do not release, storing the data after desensitization to the target database tables concurrently, so as to finish the concurrency processing once, and if the rest database tables to be desensitized still exist, repeating the process.
In this embodiment of the present application, optionally, before concurrently reading data to be desensitized corresponding to each of the plurality of database tables to be desensitized, the method further includes: acquiring data volumes of a plurality of database tables to be desensitized; correspondingly, the method for concurrently reading the data to be desensitized corresponding to the database tables to be desensitized respectively comprises the following steps: determining a preset number of database tables to be desensitized from a plurality of database tables to be desensitized; the preset number of database tables to be desensitized is a preset number of tables which are obtained by sequencing the data volume of the plurality of database tables to be desensitized from large to small and are ranked at the front; the method comprises the steps of concurrently reading data to be desensitized, which correspond to a preset number of database tables to be desensitized respectively; correspondingly, the desensitization processing is carried out on the data to be desensitized concurrently to obtain a plurality of data after desensitization, which comprises the following steps: the method comprises the steps of carrying out desensitization processing on data to be desensitized, which correspond to a preset number of database tables to be desensitized respectively, to obtain data after desensitization of the preset number; correspondingly, the method for storing the plurality of desensitized data in the target database table simultaneously comprises the following steps: and the preset number of data after desensitization are stored in the target database table in parallel, and then the preset number of database tables to be desensitized are determined from the rest database tables to be desensitized.
In one implementation scheme, the data amounts of the plurality of database tables to be desensitized can be acquired first, then sorting is performed according to the data amount, and a preset number (the preset number can be determined according to practical situations, for example, the preset number has a value range of 3 to 20) of database tables to be desensitized is determined from the sorting result, wherein the data amount corresponding to the preset number of database tables to be desensitized is greater than or equal to the data amount of other database tables to be desensitized. And then, the data to be desensitized, which correspond to the database tables to be desensitized in the preset number, are read concurrently, then, the concurrent desensitization is carried out, and then, the concurrent storage is carried out. At this time, the above steps are repeated in the remaining database tables to be desensitized until desensitization is completed for all the database tables to be desensitized.
For example, in order to improve the data processing efficiency, the scheme adopts a multi-stage concurrent technical scheme. The main thread of the data desensitization process firstly inquires the data volume in the database tables to be desensitized, then selects N tables with the largest data volume according to the data volume, and simultaneously carries out the desensitization process on the N tables, and then selects N tables with the largest data volume from the rest tables after the processing is finished, and continuously carries out the desensitization process until all the tables finish the data desensitization. N is generally greater than 3 and less than 20 in view of the efficiency of concurrent processing and the affordability of the database.
In an embodiment of the present application, optionally, the method further includes: if detecting that the difference value of the data quantity of the first database table and the second database table is larger than a difference value threshold value in the preset number of database tables to be desensitized, determining the number of the target threads allocated to the first database table according to the ratio of the data quantity of the first database table and the data quantity of the second database table; according to the number of the target threads, carrying out concurrent processing on each partition column in the first database table; the concurrent processing comprises concurrent reading, concurrent desensitization and concurrent storage.
The first database table may be a database table in which the data amount satisfies a first threshold requirement, among a preset number of database tables to be desensitized, where the first threshold requirement may be that the data amount is maximum, that the data amount is greater than a first set threshold, and so on. The second database table may be a database table in which the data amount satisfies a second threshold requirement, and the second threshold requirement may be that the data amount is minimum, or that the data amount is smaller than a second set threshold, and so on, in a preset number of database tables to be desensitized.
Specifically, after determining a preset number of database tables to be desensitized, judging whether the difference value of the data amounts of the first database table and the second database table is larger than a difference value threshold, if so, indicating that one thread is possibly processed completely, other threads can also process for a long time, specifically because the data amount of the first database table is large, at this time, a plurality of threads can be allocated to the first database table according to the target thread number, so that the processing speed of the first database table is increased.
Further, the target number of threads may be determined according to a ratio of the data amounts of the first database table and the second database table, for example, the ratio is 2, and then 2 threads may be allocated to the first database table, so that the end time of each thread is approximately the same.
Further, when the first database table is processed concurrently according to the number of the target threads, each partition column in the first database table may be processed separately.
Illustratively, when the number of database tables is small or the difference in the data amount of each table is large, the processing time becomes long. Therefore, on the basis of multi-table concurrency, the partition concurrency processing strategy of a single table is added. The strategy aims at a single sheet table with larger data volume, performs concurrent processing according to a partition column, divides the data in the table into N parts according to the value of the partition column, and performs data reading, desensitization processing and data storage after desensitization.
Through experimental measurement and calculation, the host data is desensitized by using a conventional method, and the execution efficiency is about 4W data per minute; the execution efficiency of the method is about 400 ten thousand pieces of data per minute, and the processing efficiency is improved remarkably.
According to the technical scheme, the scheme of desensitizing the host data in the open environment is realized, so that the data in the host environment can be subjected to desensitization processing in the open platform environment, the host environment is not relied on, and the application has stronger adaptability. The technical scheme of automatically creating the database and the table space and automatically synchronizing the database table structure is also used, so that the labor cost is saved and the accuracy is better than that of a manual creation and manual synchronization mode. The method and the device also realize cross-platform character processing through a character string transcoding technology, solve the problem of messy codes caused by inconsistent character strings of an open platform environment and a host environment, and can successfully realize data desensitization. The method and the device have the advantages that the target database table is built, data before and after desensitization are separated and stored, subsequent data use is facilitated, the problem of low data efficiency of an open environment processing host computer is solved through a multi-level concurrent processing mode, and compared with a traditional database operation method, the method and the device remarkably improve the data desensitization processing efficiency.
Example III
Fig. 3 is a schematic structural diagram of a data desensitizing device according to a third embodiment of the present application, where the device may execute the data desensitizing method according to any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 3, the apparatus is configured as a server in a target environment, and includes:
a target database table establishing module 310, configured to establish a target database table in the host environment based on table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment;
a desensitization processing module 320, configured to desensitize data to be desensitized in the database table to be desensitized;
the data storage module 330 is configured to store the desensitized data in the target database table.
According to the technical scheme, the server configured in the target environment comprises: a target database table establishing module 310, configured to establish a target database table in the host environment based on table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment; a desensitization processing module 320, configured to desensitize data to be desensitized in the database table to be desensitized; the data storage module 330 is configured to store the desensitized data in the target database table. According to the technical scheme, cross-platform desensitization processing can be directly carried out on the data of the host environment to obtain desensitized data, and the desensitized data are stored in the target database table with the same table structure as the database table to be desensitized, so that the subsequent data lookup is facilitated.
Optionally, the apparatus further includes:
the concurrent reading module is used for concurrently reading the data to be desensitized, which correspond to the database tables to be desensitized respectively;
accordingly, the desensitization processing module 320 includes:
the concurrent desensitization processing unit is used for performing concurrent desensitization processing on the plurality of data to be desensitized to obtain a plurality of desensitized data;
accordingly, the data storage module 330 includes:
and the concurrency storage unit is used for concurrency storage of the plurality of desensitized data in the target database table.
Optionally, the apparatus further includes:
the data volume acquisition module is used for acquiring the data volumes of a plurality of database tables to be desensitized;
correspondingly, the concurrent reading module comprises:
a database table determining unit for determining a preset number of database tables to be desensitized from the plurality of database tables to be desensitized; the preset number of database tables to be desensitized is a preset number of tables which are obtained by sequencing the data volume of the plurality of database tables to be desensitized from large to small and are ranked at the front;
the concurrency reading unit is used for concurrency reading of the data to be desensitized, which correspond to the database tables to be desensitized in a preset number;
correspondingly, the concurrent desensitization processing unit comprises:
the concurrency desensitization processing subunit is used for carrying out desensitization processing on the concurrency of the data to be desensitized, which correspond to the database tables of the preset number to be desensitized respectively, so as to obtain the data of the preset number after desensitization;
correspondingly, the concurrent storage unit comprises:
and the concurrency storage subunit is used for concurrency storage of the preset number of desensitized data in the target database table, and then determination of the preset number of database tables to be desensitized from the rest database tables to be desensitized.
Optionally, the apparatus further includes:
the target thread number determining module is used for determining the number of the target threads allocated to the first database table according to the ratio of the data volumes of the first database table to the second database table if the difference value of the data volumes of the first database table and the second database table is larger than a difference value threshold value in the preset number of database tables to be desensitized which need to be processed concurrently;
the concurrency processing module is used for carrying out concurrency processing on each partition column in the first database table according to the number of the target threads;
the concurrent processing comprises concurrent reading, concurrent desensitization and concurrent storage.
Optionally, the target database table establishment module 310 includes:
the data definition language file reading unit is used for reading the data definition language file of the table-building script of the host database;
a table establishing script extracting unit for extracting a table establishing script of a database table to be desensitized from the data definition language file;
a target database table establishing unit for establishing a target database table in the target database based on the table establishment script of the database table to be desensitized; and the table structures of the target database table and the database table to be desensitized are the same.
Optionally, the data storage module 330 includes:
a target data conversion unit for converting the desensitized data into target data corresponding to a host environment based on the host data character set;
and the target data storage unit is used for storing the target data in the target database table.
Optionally, the data storage module 330 includes:
and the data storage unit is used for storing the desensitized data in the corresponding target database table based on the corresponding relation between the to-be-desensitized data and the to-be-desensitized database table.
The data desensitizing device provided by the embodiment of the application can execute the data desensitizing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executing method.
Example IV
Fig. 4 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the data desensitization method.
In some embodiments, the data desensitization method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. One or more of the steps of the data desensitization method described above may be performed when the computer program is loaded into RAM 13 and executed by processor 11. Alternatively, in other embodiments, the processor 11 may be configured to perform the data desensitization method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method of desensitizing data for application to a server in a target environment, the method comprising:
establishing a target database table in a host environment based on table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment;
desensitizing the data to be desensitized in the database table to be desensitized;
the desensitized data is stored in a target database table.
2. The method of claim 1, wherein prior to desensitizing the data to be desensitized in the database table to be desensitized, the method further comprises:
concurrently reading data to be desensitized corresponding to the database tables to be desensitized respectively;
correspondingly, the desensitizing treatment is carried out on the data to be desensitized in the database table to be desensitized, which comprises the following steps:
carrying out desensitization treatment on a plurality of data to be desensitized concurrently to obtain a plurality of data after desensitization;
correspondingly, storing the desensitized data in a target database table, including:
and storing the plurality of desensitized data in the target database table simultaneously.
3. The method of claim 2, wherein prior to concurrently reading the data to be desensitized for which the plurality of database tables to be desensitized respectively correspond, the method further comprises:
acquiring data volumes of a plurality of database tables to be desensitized;
correspondingly, the method for concurrently reading the data to be desensitized corresponding to the database tables to be desensitized respectively comprises the following steps:
determining a preset number of database tables to be desensitized from a plurality of database tables to be desensitized; the preset number of database tables to be desensitized is a preset number of tables which are obtained by sequencing the data volume of the plurality of database tables to be desensitized from large to small and are ranked at the front;
the method comprises the steps of concurrently reading data to be desensitized, which correspond to a preset number of database tables to be desensitized respectively;
correspondingly, the desensitization processing is carried out on the data to be desensitized concurrently to obtain a plurality of data after desensitization, which comprises the following steps:
the method comprises the steps of carrying out desensitization processing on data to be desensitized, which correspond to a preset number of database tables to be desensitized respectively, to obtain data after desensitization of the preset number;
correspondingly, the method for storing the plurality of desensitized data in the target database table simultaneously comprises the following steps:
and the preset number of data after desensitization are stored in the target database table in parallel, and then the preset number of database tables to be desensitized are determined from the rest database tables to be desensitized.
4. A method according to claim 3, characterized in that the method further comprises:
if detecting that the difference value of the data quantity of the first database table and the second database table is larger than a difference value threshold value in the preset number of database tables to be desensitized, determining the number of the target threads allocated to the first database table according to the ratio of the data quantity of the first database table and the data quantity of the second database table;
according to the number of the target threads, carrying out concurrent processing on each partition column in the first database table;
the concurrent processing comprises concurrent reading, concurrent desensitization and concurrent storage.
5. The method of claim 1, wherein creating the target database table in the host environment based on the table structure information of the database table to be desensitized comprises:
reading a data definition language file of a table building script of a host database;
extracting a list establishing script of a database list to be desensitized from the data definition language file;
establishing a target database table in the target database based on a table establishment script of the database table to be desensitized; and the table structures of the target database table and the database table to be desensitized are the same.
6. The method of claim 1, wherein storing the desensitized data in the target database table comprises:
converting the desensitized data into target data corresponding to a host environment based on the host data character set;
the target data is stored in a target database table.
7. The method of claim 1, wherein storing the desensitized data in the target database table comprises:
based on the corresponding relation between the data to be desensitized and the database table to be desensitized, the desensitized data are stored in the corresponding target database table.
8. A data desensitizing apparatus, characterized by a server configured in a target environment, the apparatus comprising:
the target database table establishing module is used for establishing a target database table in the host environment based on the table structure information of the database table to be desensitized; the database table to be desensitized is located in a host environment;
the desensitization processing module is used for carrying out desensitization processing on the data to be desensitized in the database table to be desensitized;
and the data storage module is used for storing the desensitized data in the target database table.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the data desensitization method according to any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the data desensitization method according to any one of claims 1-7.
CN202410115554.XA 2024-01-26 2024-01-26 Data desensitization method, device, equipment and medium Pending CN117763619A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410115554.XA CN117763619A (en) 2024-01-26 2024-01-26 Data desensitization method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410115554.XA CN117763619A (en) 2024-01-26 2024-01-26 Data desensitization method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN117763619A true CN117763619A (en) 2024-03-26

Family

ID=90318344

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410115554.XA Pending CN117763619A (en) 2024-01-26 2024-01-26 Data desensitization method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117763619A (en)

Similar Documents

Publication Publication Date Title
CN116167352B (en) Data processing method, device, electronic equipment and storage medium
CN114816578B (en) Program configuration file generation method, device and equipment based on configuration table
CN114428674A (en) Task scheduling method, device, equipment and storage medium
CN117763619A (en) Data desensitization method, device, equipment and medium
CN116303013A (en) Source code analysis method, device, electronic equipment and storage medium
CN114896418A (en) Knowledge graph construction method and device, electronic equipment and storage medium
CN116126296A (en) Control method and device based on multiple associated date selectors and electronic equipment
CN117171206A (en) Query method, query device, electronic equipment and storage medium
CN116108589B (en) Method, device, equipment and medium for constructing core model
CN112527126B (en) Information acquisition method and device and electronic equipment
CN115576902B (en) Method, device, equipment and medium for processing calibration description file
CN117453746A (en) Method, device, equipment and medium for data cycle screening
CN116955394A (en) Data query method, device, equipment and medium
CN116401269A (en) Data query method and device, electronic equipment and storage medium
CN117033402A (en) Data access method, device, equipment and storage medium
CN116108254A (en) Object matching method, device, equipment and medium
CN117632734A (en) Performance test method of database, electronic equipment and storage medium
CN117370399A (en) Form comparison method and device, target database and storage medium
CN116523051A (en) Model mixed-precision reasoning method, device, equipment and storage medium
CN117216145A (en) Data storage method, device, equipment and medium
CN117032756A (en) Software updating method and device, electronic equipment and storage medium
CN117033227A (en) Distributed database testing method, device, equipment and medium
CN117806619A (en) Data processing method, device, electronic equipment and medium
CN117827840A (en) Index creation method and device, electronic equipment and storage medium
CN117520601A (en) Graph database query method and device, storage medium, equipment and product

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination