CN107526813A - A kind for the treatment of method and apparatus for the data that desensitize - Google Patents
A kind for the treatment of method and apparatus for the data that desensitize Download PDFInfo
- Publication number
- CN107526813A CN107526813A CN201710739970.7A CN201710739970A CN107526813A CN 107526813 A CN107526813 A CN 107526813A CN 201710739970 A CN201710739970 A CN 201710739970A CN 107526813 A CN107526813 A CN 107526813A
- Authority
- CN
- China
- Prior art keywords
- objects
- file
- desensitization
- data
- target
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/21—Design, administration or maintenance of databases
- G06F16/214—Database migration support
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/258—Data format conversion from or to a database
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Computational Linguistics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention provides a kind for the treatment of method and apparatus for the data that desensitize, this method includes:If detecting, the data for target desensitization data export operation, then obtain a plurality of desensitization record of target matrix and the every multiple desensitization field names corresponding to record that desensitize in target database corresponding to target desensitization data, wherein, the target desensitization data that data export operation represents to be stored in the target matrix of target database are exported to target type file;A plurality of desensitization record and corresponding multiple desensitization field names are stored in List objects, List objects include multiple Map objects, and a Map object stores multiple desensitization field names corresponding to a desensitization record and this desensitization record;Create the file object of target type file;Data in List objects are added in file object;Data in file object are exported into target type file.The present invention can export the data after desensitization from database to file, be easy to data processing.
Description
Technical field
The present invention relates to data desensitization technical field, more particularly to a kind for the treatment of method and apparatus for the data that desensitize.
Background technology
With the development and the arrival in big data epoch of information technology, data circulation turns into release data bonus and value
Main Means and approach, and sensitive data lacks effective management and control in circulation, in excessive risk state.In recent years, sensitive data
Incident of leakage is of common occurrence.What sensitive data leakage was brought is not only economic loss, while compromises financial institution and government
The public credibility of the authoritative institutions such as department, heavy damage social credit system, it is harmonious with whole society health to have impact on related industry
Development.
Under such historical background, preventing the leakage of sensitive data becomes the problem of particularly significant, current existing skill
The desensitization to initial data in database is realized by data desensitization gateway in art, so as to obtain the data that desensitize, and will desensitization
Data move forward to another database.Desensitization and migration of the sensitive data between database are realized, but it is unreal
Existing export of the sensitive data from database to file.
Therefore, prior art there will naturally be the problem of can not exporting the desensitization data from database to file.
The content of the invention
The invention provides a kind for the treatment of method and apparatus for the data that desensitize, to solve can not incite somebody to action present in prior art
The problem of desensitization data from database are exported to file.
In order to solve the above problems, according to an aspect of the present invention, the invention discloses a kind of processing for the data that desensitize
Method, including:
If detecting, the data for target desensitization data export operation, obtain mesh corresponding to the target desensitization data
Multiple desensitization field names corresponding to a plurality of desensitization record and every desensitization record of target matrix in database are marked, wherein,
The target desensitization data that data export operation represents to be stored in the target matrix of the target database export to
Target type file;
The a plurality of desensitization record and corresponding the multiple desensitization field name are stored in List objects, the List
Object includes multiple Map objects, and a Map object stores multiple desensitization words corresponding to a desensitization record and this desensitization record
Name section;
Create the file object of the target type file;
Data in the List objects are added in the file object;
Data in the file object are exported into the target type file.
According to another aspect of the present invention, the invention also discloses a kind of processing unit for the data that desensitize, including:
Acquisition module, if for detecting that the data for target desensitization data export operation, obtain the target and take off
The a plurality of desensitization record of target matrix and every multiple desensitizations corresponding to record of desensitizing in target database corresponding to quick data
Field name, wherein, the data export operation represents the target that will be stored in the target matrix of the target database
Desensitization data are exported to target type file;
Memory module, for a plurality of desensitization record and corresponding the multiple desensitization field name to be stored in into List
Object, the List objects include multiple Map objects, and a Map object stores a desensitization record and this desensitization record pair
The multiple desensitization field names answered;
Creation module, for creating the file object of the target type file;
Add module, for the data in the List objects to be added in the file object;
Export module, for the data in the file object to be exported into the target type file.
Compared with prior art, the present invention includes advantages below:
The present invention is exported the data in List objects to meeting mesh by the way that desensitization data are directed into List objects
In the file object for marking type file form, finally, the desensitization data in file object are exported to target type file, realized
The data after desensitization from database are exported to the purpose of file, are easy to data processing.
Brief description of the drawings
Fig. 1 is a kind of step flow chart of the processing method embodiment of desensitization data of the present invention;
Fig. 2 is a kind of structured flowchart of the processing unit embodiment of quick data of the present invention.
Embodiment
In order to facilitate the understanding of the purposes, features and advantages of the present invention, it is below in conjunction with the accompanying drawings and specific real
Applying mode, the present invention is further detailed explanation.
Reference picture 1, a kind of step flow chart of the processing method embodiment of desensitization data of the present invention is shown, specifically may be used
To comprise the following steps:
Step 101, if detecting, the data for target desensitization data export operation, obtain the target desensitization data
The a plurality of desensitization record of target matrix and the every multiple desensitization field names corresponding to record that desensitize in corresponding target database
Claim;
Wherein, the data export operation represents to take off the target being stored in the target matrix of the target database
Quick data are exported to target type file;
Wherein, the embodiment of the present invention can crawl treats that derived target is former from source database (i.e. target database) in advance
Beginning data (that is, multiple field names corresponding to a plurality of target record and every target record in target matrix), then,
The target initial data is desensitized (for example, a plurality of target record in target matrix can be desensitized, so as to
To a plurality of desensitization record, and multiple field names corresponding to every target record can be desensitized, it is multiple so as to obtain
Desensitize field name), so as to obtain target desensitization data, wherein, the specific implementation for desensitization process can be existing skill
Any one desensitization mode, the present invention are not limited to this in art.
Although in addition, it should be noted that herein by the target initial data after desensitization with " a plurality of desensitization record " with
And " multiple desensitization field names " is named, and still, is not offered as a plurality of record in the target matrix by desensitization process
Cross, do not indicate that each field name in the target matrix by desensitization process mistake, is simply named by this way equally
Since express record data accessed in step 101 and field name and include passing through the data that desensitization process is crossed.
And in concrete practice, it can be needed according to desensitization to carry out spirit to the part or all of data in target matrix
Desensitization living, i.e. only the partial data in a few records can be desensitized, and/or to certain several field name etc. group
Conjunction mode carries out flexible desensitization process.
For example, the target desensitization data that the data in original user table obtain after desensitization process are as shown in table 1 below:
Table 1
Wherein, the first row id, name, age, gender in table 1 are desensitization field name;
Every data line in the second row~fourth line in table 1 then represents a desensitization record, here including 3 desensitizations
Record, the particular content during every desensitization records can then be referred to as desensitization entry, such as the desensitization record of the first row data
Item includes 1, Zhang San, 20, man.
Step 102, a plurality of desensitization record and corresponding the multiple desensitization field name are stored in List objects,
The List objects include multiple Map objects, and a Map object stores more corresponding to a desensitization record and this desensitization record
Individual desensitization field name;
Wherein it is possible to the data after desensitizing are stored in a List<Map<String,Object>>In set, wherein,
The number of desensitization record of the number of element with being related in target desensitization data is identical in List objects, therefore, List in this example
Object is respectively Map1, Map2, Map3 including 3 Map objects, and each Map object stores a desensitization record and should
Multiple desensitization field names corresponding to bar desensitization record, wherein, String is desensitization field name in Map objects, and object is
The data item of this desensitization record corresponding to the desensitization field name.
List objects are after the data in storing target matrix as shown in following codes:
List<map<String,Object>>
List(0)
Map1<”id”,”1”>
Map1<" name ", " Zhang San ">
Map1<”age”,”20”>
Map1<" gender ", " man ">
Wherein, Map1 objects are stored in List (0), be stored with Map1 objects the second line number in table 1 according to this and
Desensitization field name corresponding to second row data.
List(1)
Map2<”id”,”2”>
Map2<" name ", " Li Si ">
Map2<”age”,”21”>
Map2<" gender ", " female ">
Wherein, Map2 objects are stored in List (1), the third line data for being stored with Map2 objects in table 1 and
Desensitization field name corresponding to the third line data.
List(2)
Map3<”id”,”3”>
Map3<" name ", " king five ">
Map3<”age”,”22”>
Map3<" gender ", " man ">
Wherein, Map3 objects are stored in List (2), the fourth line data that are stored with Map3 objects in table 1 and
Desensitization field name corresponding to fourth line data.
Herein, the length of List objects is 3, the record of corresponding three students, list (0)=map1, in corresponding table 1
First student, list (1)=map2, second student in corresponding table 1, list (2)=map3, the in corresponding table 1 the 3rd
Individual student.
So, just the data conversion after being desensitized in the tables of data in database is stored into List set.
Step 103, the file object of the target type file is created;
Wherein, due to needing exist for exporting the data after desensitizing in database into file, then just need to create here
Build the file object of target type file derived from needing.
Step 104, the data in the List objects are added in the file object;
Wherein it is possible to the data during List is gathered in each Map objects are added in this document object.
Step 105, the data in the file object are exported into the target type file.
Finally, it is possible to export the desensitization data being stored with the file object of desensitization data to target type text
In part, wherein, by the form of file object that is created in step 103 with the form of the target type file be it is consistent,
Therefore, directly the desensitization data filled in file object are exported to target type file here, so that it may so that the desensitization of filling
Storage format in data fit target type file.
By means of the technical scheme of the above embodiment of the present invention, the present invention by desensitization data by being directed into List objects
In, and the data in List objects are exported into the file object for meeting target type file format, finally, by file object
In desensitization data export to target type file, realize and export the data after desensitization from database to file
Purpose, be easy to data processing.
In one embodiment, when the target type file is XML file,
When performing above-mentioned steps 103, it is possible to create the Document objects of corresponding XML file;
Create Element objects and be added in the Document objects;
When performing step 104, it is possible to by every desensitization record of each Map objects storage in the List objects with
And corresponding multiple desensitization field names are added in the Element objects of the Document objects.
Alternatively, in one embodiment, before step 105 is performed, method according to embodiments of the present invention also includes:
The Document objects are converted into character string;
Then when performing step 105, then the character string that can be will convert into exports to XML file.
Illustrated with reference to an instantiation by List<Map<String,Object>>Turn xml document form:
First, the data format of Document objects corresponding to illustratively XML file is carried out, its data format is as follows:
<nodes>
<node>
<Key label=" key1 ">value1</key>
<Key label=" key2 ">value2</key>
......
</node>
<node>
<Key label=" key1 ">value1</key>
<Key label=" key2 ">value2</key>
......
</node>
</nodes>
Wherein, every a line in each node corresponding data table records, the field name in label correspondence databases,
Value to should field name numerical value.
In specific implementation, the bag quoted is needed in this example:Org.dom4j, Document pairs can be created by the bag
As.
Found out according to the basic format of the Document objects of xml document, when implementing, the present invention is implemented
Example can be placed on the data inside List objects inside nodes labels, and its subtab node is then inside correspondence database
Recorded per a line, field name corresponding to database is then the label attributes inside key labels.Specifically, the embodiment of the present invention
It can need to realize that the data in List set change into the character string of XML file by following code:
public static String listtoXml(List list)throws Exception{
Document document=DocumentHelper.createDocument ();// initialization one
Document objects, for adding XML content, that is, create the Document objects of corresponding XML file.
Element nodesElement=document.addElement (" nodes ");// initialization one
Element objects, it represents the element in XML document, and element can include attribute, other elements or text, if element contains
Text, then represent the text in text node, and text is stored in text node forever.Now create a father node
Nodes, for recording all data inside List objects.That is, Element objects are created and added to described Document pairs
As in.
Int i=0;
for(Object o:List) // traversal list
{
Element nodeElement=nodesElement.addElement (" node ");// initialization Element
Object, the child node node of nodes nodes is created, for every a line record data in record sheet 1.
if(o instanceof Map){
for(Object obj:((Map) o) .keySet ()) // traversal map
{
Element keyElement=nodeElement.addElement (" key ");// Element pairs of initialization
As the child node key of establishment node nodes, for recording the specific data of each lattice, i.e. data item.
keyElement.addAttribute("label",String.valueOf(obj));The label of //key nodes
Strong, the field name of correspondence database of attribute, i.e. Map objects.
keyElement.setText(String.valueOf(((Map)o).get(obj)));//key nodes it is specific
The value of content, i.e. map, the value of correspondence database.
return doctoString(document);// by Document objects switch to character string return, turning character
Specific coding is set when string, xml is UTF8 coding.
}
Wherein, after the data in List objects being directed into Document objects, the data format of Document objects is such as
Under:
<nodes>
<node>
<Key label=" id ">1</key>
<Key label=" name ">Zhang San</key>
<Key label=" age ">20</key>
<Key label=" gender ">Man</key>
</node>
<node>
<Key label=" id ">2</key>
<Key label=" name ">Li Si</key>
<Key label=" age ">21</key>
<Key label=" gender ">Female</key>
</node>
<node>
<Key label=" id ">3</key>
<Key label=" name ">King five</key>
<Key label=" age ">22</key>
<Key label=" gender ">Man</key>
</node>
</nodes>
Wherein, Document objects turn String method code realize it is as follows:
To this just by a List<Map<String,Object>>Conversion is for the string format of xml document, most
Afterwards, exactly character string str returned above is output in the XML file of establishment, the output of file is exactly a simple I/O
Detailed repeat just no longer is done in operation, it should be noted that when XML file is created is using .xml as suffix.
Alternatively, in another embodiment, when the target type file is the Excel file of first version,
When performing step 103, then it can pass through HSSFWorkbook pairs of the Excel file for creating corresponding first version
As;And create HSSFSheet objects and be added in the HSSFWorkbook objects to realize;
When performing step 104, then can be remembered by every desensitization for storing each Map objects in the List objects
Record and corresponding multiple desensitization field names are added to the HSSFSheet objects of the HSSFWorkbook objects
Realize;
And when performing step 105, then can be by the way that the data in the HSSFWorkbook objects be exported to first
The Excel file of version, and the extension name of the Excel file of the first version is arranged to .xls to realize.
In an instantiation, the Excel file of first version here is for 2007 versions or less than 2007 versions
Excel file.
2007 versions and less than in the Excel file of 2007 versions each book (sheet) data volume limitation
For 256 * 65536 rows of row;
Needed when the desensitization data in List objects are changed into 2007 versions and the Excel file less than 2007 versions
The bag of reference is:org.apache.poi.hssf.usermodel.
* 2007 versions and line number data volume less than each sheet in the Excel file of 2007 versions are limited to
65536 rows;
*@param List<Map<String,Object>>
*@return
*/
public static HSSFWorkbook listtoExcleOld(List<Map<String,Object>>
list){
HSSFWorkbook workbook=new HSSFWorkbook ();// create corresponding 2007 versions and be less than
The HSSFWorkbook objects of the Excel file of 2007 versions.
Field name in String [] keysStr=list.get (0) .keySet () // acquisition database.
.toArray(new String[]{});
HSSFSheet sheet=workbook.getSheetAt (workbook
.getNumberOfSheets()-1);// create HSSFSheet objects and added to described HSSFWorkbook pairs
As in.
HSSFRow row=null;
HSSFCell cell=null;
Int rowNum=sheet.getLastRowNum ();
buildTitleOld(sheet,keysStr);
For (int i=0;i<list.size();I++) // by the List objects storage of each Map objects it is every
Bar desensitization record and corresponding multiple desensitization field names are added to the HSSFSheet of the HSSFWorkbook objects
In object.
Finally, can be by the data in the HSSFWorkbook objects (i.e. workbook) filled with desensitization data of return
Export the Excel file of the Excel file to 2007 versions and less than 2007 versions, and by the Excel of the first version
The extension name of file is arranged to .xls.
Alternatively, in another embodiment, when the target type file is the Excel file of the second edition,
When performing step 103, then the XSSFWorkbook objects of Excel file can be corresponded to by creating;And create
XSSFSheet objects are simultaneously added in the XSSFWorkbook objects to realize;
When performing step 104, then can be remembered by every desensitization for storing each Map objects in the List objects
Record and corresponding multiple desensitization field names are added to the XSSFSheet objects of the XSSFWorkbook objects
Realize;
And when performing step 105, then can be by the way that the data in the XSSFWorkbook objects be exported to second
The Excel file of version, and the extension name of the Excel file of the second edition is arranged to .xlsx to realize.
In an instantiation, the Excel file of the second edition here is the Excel file higher than 2007 versions.
The bag quoted is needed to be when the desensitization data in List objects to be changed into the Excel file higher than 2007 versions:
org.apache.poi.xssf.usermodel。
* the line number data volume upper limit higher than each sheet in the Excel file of 2007 versions is more than 1,000,000.
*@param List<Map<String,Object>>
*@return
*/
public static XSSFWorkbook listtoExcleNew(List<Map<String,Object>>
list){
XSSFWorkbook workbook=new XSSFWorkbook ();// create to should be higher than that 2007 versions
The XSSFWorkbook objects of Excel file.
Field name in String [] keysStr=list.get (0) .keySet () // acquisition database.
.toArray(new String[]{});
XSSFSheet sheet=workbook.getSheetAt (workbook
.getNumberOfSheets()-1);// create XSSFSheet objects and added to described XSSFWorkbook pairs
As in.
XSSFRow row=null;
XSSFCell cell=null;
Int rowNum=sheet.getLastRowNum ();
buildTitleNew(sheet,keysStr);
For (int i=0;i<list.size();I++) // by the List objects storage of each Map objects it is every
Bar desensitization record and corresponding multiple desensitization field names are added to the XSSFSheet of the XSSFWorkbook objects
In object.
Finally, can be by the data in the XSSFWorkbook objects (i.e. workbook) filled with desensitization data of return
Export to the Excel file higher than 2007 versions, and by the expansion of the Excel file of the second edition (i.e. higher than 2007 versions)
Exhibition name is arranged to .xlsx.
Wherein, do needed when I/O outputs distinguish two versions excel files, and change corresponding to suffix name.
In another embodiment, the method for the embodiment of the present invention can also by file (such as excel files .xls or
Compressed package corresponding to their difference of person) it imported into database:
By taking Excel file as an example:
A kind of situation is that database table has been built up, and table name respective file name, field name respective file gauge outfit, it is possible to
Being introduced directly into for file is realized, then flow is as follows:
File uploads onto the server disk, then obtains the filename of this document, inquires about in database and whether there is table name
For the tables of data of file name, if in the presence of reading file content, and store the List objects mentioned into above-described embodiment
In, then, the data in List objects are desensitized, finally, will desensitize what data output inquired into target database
In above-mentioned tables of data.
, wherein it is desired to it is noted that before data are write, it is necessary in reading database corresponding table field name, as
Global variable uses, to match data corresponding to List objects the inside;
If file to be uploaded is compressed package, the situation of multiple files is there may be inside compressed package, then locating
When managing multiple files, it is necessary to file is traveled through and and database inside tables of data correspond, to not building
The file throw exception of table, remaining paper normally import.
Another situation is that database does not build tables of data to file that should be to be uploaded, but the file uploaded is ZIP
Bag, and the inside contains a SQL file, then flow is as follows:
User upload compressed package files (i.e. ZIP bags), the present invention decompress compressed package, and judge decompress after file in be
It is no to have SQL files, if it does not exist, then flow terminates throw exception;
And if there is SQL files, then perform in SQL files and build table statement, wherein, this, which builds table statement, can make to be built
The table name of vertical tables of data corresponds to the filename of file to be uploaded in compressed package, the field name respective file gauge outfit of tables of data;
Dished out if table failure is built and build table exception;
If building telogenesis work(, the method for the embodiment of the present invention reads the data of Excel file in the file after decompressing, and
Store in the List objects mentioned into above-described embodiment, then, the data in List objects are desensitized, finally, will be de-
In the above-mentioned tables of data that quick data output is created into target database.
Wherein, when SQL files are performed, sql sentences have to comply with syntax rule, otherwise can cause to build table failure,
Can batch carry out build table handling and the importing of file, wherein, the target database can be informix databases,
Oracle tables of data.All it is to use batch processing when all data are handled, improves the processing of data to a certain extent
Speed.
Property illustrated below is listed in the partial code being directed into the data in Excel file in target database:
/**
* the field information of tables of data is obtained
In a concrete practice, data desensitization gateway is deployed in the information system of business bank of Dang XX cities, to him
Sensitive data carry out desensitization operation, then in order to facilitate the use of client, client propose from DB2 database desensitize generate
The demand of file, then the desensitization data realized using the above method can of the embodiment of the present invention in DB2 database are led
Go out the effect to excel files.
The above-mentioned technical proposal of the embodiment of the present invention is carried out for the Data Migration function in current data desensitization gateway
Related extension, ensure that the diversity and practicality of function, greatly enhances the Experience Degree of user;Also, pass through
Java code realizes export and the import feature of file, more more stable than exporting importing processing by instrument, it is ensured that data
Integrality;In addition, employing the realization of multithreading when the export of file and import feature is realized, can hold simultaneously
Row multiple tasks and multiple files, greatly accelerate the processing speed of Data Migration;In addition, carried out by data desensitization gateway
The export and importing of file, it is no longer necessary to other data base tools, reduce somewhat production cost.In addition,
When file is imported into database, it would be preferable to support existing various types of databases.
It should be noted that for embodiment of the method, in order to be briefly described, therefore it is all expressed as to a series of action group
Close, but those skilled in the art should know, the embodiment of the present invention is not limited by described sequence of movement, because according to
According to the embodiment of the present invention, some steps can use other orders or carry out simultaneously.Secondly, those skilled in the art also should
Know, embodiment described in this description belongs to preferred embodiment, and the involved action not necessarily present invention is implemented
Necessary to example.
It is corresponding with the method that the embodiments of the present invention are provided, reference picture 2, show a kind of desensitization data of the invention
Processing unit embodiment structured flowchart, can specifically include following module:
Acquisition module 21, if for detecting that the data for target desensitization data export operation, obtain the target
The a plurality of desensitization record of target matrix and every multiple corresponding to record takes off of desensitizing in target database corresponding to the data that desensitize
Quick field name, wherein, the data export operation represents the mesh that will be stored in the target matrix of the target database
Mark desensitization data are exported to target type file;
Memory module 22, for a plurality of desensitization record and corresponding the multiple desensitization field name to be stored in
List objects, the List objects include multiple Map objects, and a Map object stores a desensitization record and this desensitizes and remembered
Multiple desensitization field names corresponding to record;
Creation module 23, for creating the file object of the target type file;
Add module 24, for the data in the List objects to be added in the file object;
Export module 25, for the data in the file object to be exported into the target type file.
Alternatively,
The creation module 23, including:
First creates submodule, for when the target type file is XML file, creating corresponding XML file
Document objects;
Second creates submodule, for creating Element objects and being added in the Document objects;
The add module 24 includes:
First addition submodule, for every desensitization of each Map objects storage in the List objects to be recorded and
Corresponding multiple desensitization field names are added in the Element objects of the Document objects.
Alternatively, described device also includes:
Modular converter, for the Document objects to be converted into character string;
The export module 25, including:
First export submodule, the character string for will convert into export to XML file.
Alternatively, the creation module 23 includes:
3rd creates submodule, for when the target type file is the Excel file of first version, creating corresponding
The HSSFWorkbook objects of Excel file;
4th creates submodule, for creating HSSFSheet objects and being added in the HSSFWorkbook objects;
The add module 24 includes:
Second addition submodule, for every desensitization of each Map objects storage in the List objects to be recorded and
Corresponding multiple desensitization field names are added in the HSSFSheet objects of the HSSFWorkbook objects;
The export module 25, including:
Second export submodule, for the data in the HSSFWorkbook objects to be exported to first version
Excel file, and the extension name of the Excel file of the first version is arranged to .xls.
Alternatively,
The creation module 23, including:
5th creates submodule, for when the target type file is the Excel file of the second edition, creating corresponding
The XSSFWorkbook objects of Excel file;
6th creates submodule, for creating XSSFSheet objects and being added in the XSSFWorkbook objects;
The add module 24 includes:
3rd addition submodule, for every desensitization of each Map objects storage in the List objects to be recorded and
Corresponding multiple desensitization field names are added in the XSSFSheet objects of the XSSFWorkbook objects;
The export module 25, including:
3rd export submodule, for the data in the XSSFWorkbook objects to be exported to the second edition
Excel file, and the extension name of the Excel file of the second edition is arranged to .xlsx.
For device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, it is related
Part illustrates referring to the part of embodiment of the method.
Each embodiment in this specification is described by the way of progressive, what each embodiment stressed be with
The difference of other embodiment, between each embodiment identical similar part mutually referring to.
It should be understood by those skilled in the art that, the embodiment of the embodiment of the present invention can be provided as method, apparatus or calculate
Machine program product.Therefore, the embodiment of the present invention can use complete hardware embodiment, complete software embodiment or combine software and
The form of the embodiment of hardware aspect.Moreover, the embodiment of the present invention can use one or more wherein include computer can
With in the computer-usable storage medium (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.) of program code
The form of the computer program product of implementation.
The embodiment of the present invention is with reference to method according to embodiments of the present invention, terminal device (system) and computer program
The flow chart and/or block diagram of product describes.It should be understood that can be by computer program instructions implementation process figure and/or block diagram
In each flow and/or square frame and the flow in flow chart and/or block diagram and/or the combination of square frame.These can be provided
Computer program instructions are set to all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing terminals
Standby processor is to produce a machine so that is held by the processor of computer or other programmable data processing terminal equipments
Capable instruction is produced for realizing in one flow of flow chart or multiple flows and/or one square frame of block diagram or multiple square frames
The device for the function of specifying.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing terminal equipments
In the computer-readable memory to work in a specific way so that the instruction being stored in the computer-readable memory produces bag
The manufacture of command device is included, the command device is realized in one flow of flow chart or multiple flows and/or one side of block diagram
The function of being specified in frame or multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing terminal equipments so that
Series of operation steps is performed on computer or other programmable terminal equipments to produce computer implemented processing, so that
The instruction performed on computer or other programmable terminal equipments is provided for realizing in one flow of flow chart or multiple flows
And/or specified in one square frame of block diagram or multiple square frames function the step of.
Although having been described for the preferred embodiment of the embodiment of the present invention, those skilled in the art once know base
This creative concept, then other change and modification can be made to these embodiments.So appended claims are intended to be construed to
Including preferred embodiment and fall into having altered and changing for range of embodiment of the invention.
Finally, it is to be noted that, herein, such as first and second or the like relational terms be used merely to by
One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation
Between any this actual relation or order be present.Moreover, term " comprising ", "comprising" or its any other variant meaning
Covering including for nonexcludability, so that process, method, article or terminal device including a series of elements are not only wrapped
Those key elements, but also the other element including being not expressly set out are included, or is also included for this process, method, article
Or the key element that terminal device is intrinsic.In the absence of more restrictions, wanted by what sentence "including a ..." limited
Element, it is not excluded that other identical element in the process including the key element, method, article or terminal device also be present.
Processing method to a kind of data that desensitize provided by the present invention and a kind of processing unit for the data that desensitize above, enter
Go and be discussed in detail, specific case used herein is set forth to the principle and embodiment of the present invention, and the above is implemented
The explanation of example is only intended to help the method and its core concept for understanding the present invention;Meanwhile for the general technology people of this area
Member, according to the thought of the present invention, there will be changes in specific embodiments and applications, in summary, this explanation
Book content should not be construed as limiting the invention.
Claims (10)
- A kind of 1. processing method for the data that desensitize, it is characterised in that including:If detecting, the data for target desensitization data export operation, obtain number of targets corresponding to the target desensitization data According to multiple desensitization field names corresponding to a plurality of desensitization record and every desensitization record of target matrix in storehouse, wherein, it is described The target desensitization data that data export operation represents to be stored in the target matrix of the target database are exported to target Type file;The a plurality of desensitization record and corresponding the multiple desensitization field name are stored in List objects, the List objects Including multiple Map objects, a Map object stores multiple desensitization field names corresponding to a desensitization record and this desensitization record Claim;Create the file object of the target type file;Data in the List objects are added in the file object;Data in the file object are exported into the target type file.
- 2. according to the method for claim 1, it is characterised in that when the target type file is XML file,The file object for creating the target type file, including:Create the Document objects of corresponding XML file;Create Element objects and be added in the Document objects;The data by the List objects are added in the file object, including:Every desensitization record of each Map objects storage in the List objects and corresponding multiple desensitization field names are added Add in the Element objects of the Document objects.
- 3. according to the method for claim 2, it is characterised in that the data by the file object export to described Before target type file, methods described also includes:The Document objects are converted into character string;Data in the file object are exported into the target type file, including:The character string that will convert into exports to XML file.
- 4. according to the method for claim 1, it is characterised in that as the Excel that the target type file is first version During file,The file object for creating the target type file, including:Create the HSSFWorkbook objects of corresponding Excel file;Create HSSFSheet objects and be added in the HSSFWorkbook objects;The data by the List objects are added in the file object, including:Every desensitization record of each Map objects storage in the List objects and corresponding multiple desensitization field names are added Add in the HSSFSheet objects of the HSSFWorkbook objects;The data by the file object export to the target type file, including:Data in the HSSFWorkbook objects are exported to the Excel file of first version, and by the first version The extension name of Excel file be arranged to .xls.
- 5. according to the method for claim 1, it is characterised in that as the Excel that the target type file is the second edition During file,The file object for creating the target type file, including:Create the XSSFWorkbook objects of corresponding Excel file;Create XSSFSheet objects and be added in the XSSFWorkbook objects;The data by the List objects are added in the file object, including:Every desensitization record of each Map objects storage in the List objects and corresponding multiple desensitization field names are added Add in the XSSFSheet objects of the XSSFWorkbook objects;The data by the file object export to the target type file, including:Data in the XSSFWorkbook objects are exported to the Excel file of the second edition, and by the second edition The extension name of Excel file be arranged to .xlsx.
- A kind of 6. processing unit for the data that desensitize, it is characterised in that including:Acquisition module, if for detecting that the data for target desensitization data export operation, obtain the target desensitization number According to multiple desensitization fields corresponding to a plurality of desensitization record and every desensitization record of target matrix in corresponding target database Title, wherein, the data export operation represents to desensitize the target being stored in the target matrix of the target database Data are exported to target type file;Memory module, for a plurality of desensitization record and corresponding the multiple desensitization field name to be stored in into List pairs As the List objects include multiple Map objects, and a Map object stores a desensitization record and this desensitization record is corresponding Multiple desensitization field names;Creation module, for creating the file object of the target type file;Add module, for the data in the List objects to be added in the file object;Export module, for the data in the file object to be exported into the target type file.
- 7. device according to claim 6, it is characterised in thatThe creation module, including:First creates submodule, for when the target type file is XML file, creating corresponding XML file Document objects;Second creates submodule, for creating Element objects and being added in the Document objects;The add module includes:First addition submodule, for by every desensitization record of each Map objects storage in the List objects and correspondingly Multiple desensitization field names added to the Document objects the Element objects in.
- 8. device according to claim 7, it is characterised in that described device also includes:Modular converter, for the Document objects to be converted into character string;The export module, including:First export submodule, the character string for will convert into export to XML file.
- 9. device according to claim 6, it is characterised in thatThe creation module includes:3rd creates submodule, for when the target type file is the Excel file of first version, creating corresponding The HSSFWorkbook objects of Excel file;4th creates submodule, for creating HSSFSheet objects and being added in the HSSFWorkbook objects;The add module includes:Second addition submodule, for by every desensitization record of each Map objects storage in the List objects and correspondingly Multiple desensitization field names added to the HSSFWorkbook objects the HSSFSheet objects in;The export module, including:Second export submodule, for the data in the HSSFWorkbook objects to be exported to the Excel texts of first version Part, and the extension name of the Excel file of the first version is arranged to .xls.
- 10. device according to claim 6, it is characterised in thatThe creation module, including:5th creates submodule, for when the target type file is the Excel file of the second edition, creating corresponding The XSSFWorkbook objects of Excel file;6th creates submodule, for creating XSSFSheet objects and being added in the XSSFWorkbook objects;The add module includes:3rd addition submodule, for by every desensitization record of each Map objects storage in the List objects and correspondingly Multiple desensitization field names added to the XSSFWorkbook objects the XSSFSheet objects in;The export module, including:3rd export submodule, for the data in the XSSFWorkbook objects to be exported to the Excel texts of the second edition Part, and the extension name of the Excel file of the second edition is arranged to .xlsx.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710739970.7A CN107526813A (en) | 2017-08-23 | 2017-08-23 | A kind for the treatment of method and apparatus for the data that desensitize |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201710739970.7A CN107526813A (en) | 2017-08-23 | 2017-08-23 | A kind for the treatment of method and apparatus for the data that desensitize |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN107526813A true CN107526813A (en) | 2017-12-29 |
Family
ID=60682117
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201710739970.7A Pending CN107526813A (en) | 2017-08-23 | 2017-08-23 | A kind for the treatment of method and apparatus for the data that desensitize |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN107526813A (en) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108446571A (en) * | 2018-03-22 | 2018-08-24 | 安徽八六物联科技有限公司 | A kind of big data desensitization method |
| CN109190405A (en) * | 2018-09-03 | 2019-01-11 | 佛山科学技术学院 | A kind of government affairs big data desensitization process method and device |
| CN110135184A (en) * | 2018-02-09 | 2019-08-16 | 中兴通讯股份有限公司 | A kind of method, apparatus, equipment and the storage medium of static data desensitization |
| CN110222084A (en) * | 2019-05-06 | 2019-09-10 | 北京奇安信科技有限公司 | The report method and device of hotspot device monitoring information, storage medium, terminal |
| CN110532805A (en) * | 2019-09-05 | 2019-12-03 | 国网山西省电力公司阳泉供电公司 | Data desensitization method and device |
| CN110781515A (en) * | 2019-10-25 | 2020-02-11 | 上海凯馨信息科技有限公司 | Static data desensitization method and desensitization device |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101231665A (en) * | 2008-02-20 | 2008-07-30 | 中兴通讯股份有限公司 | Apparatus and method for educing data into Excel files from database |
| US20080209444A1 (en) * | 2007-02-27 | 2008-08-28 | Garrett Andrew J | Method, system and program product for defining imports into and exports out from a database system using spread sheets by use of a control language |
| CN105808539A (en) * | 2014-12-29 | 2016-07-27 | 北京航天测控技术有限公司 | Data import and export method and device |
-
2017
- 2017-08-23 CN CN201710739970.7A patent/CN107526813A/en active Pending
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080209444A1 (en) * | 2007-02-27 | 2008-08-28 | Garrett Andrew J | Method, system and program product for defining imports into and exports out from a database system using spread sheets by use of a control language |
| CN101231665A (en) * | 2008-02-20 | 2008-07-30 | 中兴通讯股份有限公司 | Apparatus and method for educing data into Excel files from database |
| CN105808539A (en) * | 2014-12-29 | 2016-07-27 | 北京航天测控技术有限公司 | Data import and export method and device |
Non-Patent Citations (7)
| Title |
|---|
| CHRIS KNOWLES等: "《ASP.NET XML高级编程 C#编程篇》", 31 December 2002, 清华大学出版社 * |
| MICHAEL KAY: "《XSLT程序员参考手册 原书》", 31 March 2002, 机械工业出版社 * |
| 周春容等: "《JSP与Servlet开发技术基础》", 31 March 2013, 东软电子出版社 * |
| 明日科技: "《Java Web从入门到精通》", 30 September 2012, 清华大学出版社 * |
| 朱印宏等: "《高等院校计算机系列规划教材 Dreamweaver动态网站开发与设计教程》", 30 September 2014, 机械工业出版社 * |
| 李波等: "《PowerDesigner 16从入门到精通》", 31 January 2016, 清华大学出版社 * |
| 林雪南: "基于Apache POI解析Excel文件及内存使用分析", 《电脑编程技巧与维护》 * |
Cited By (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110135184A (en) * | 2018-02-09 | 2019-08-16 | 中兴通讯股份有限公司 | A kind of method, apparatus, equipment and the storage medium of static data desensitization |
| CN110135184B (en) * | 2018-02-09 | 2023-12-22 | 中兴通讯股份有限公司 | Method, device, equipment and storage medium for desensitizing static data |
| CN108446571A (en) * | 2018-03-22 | 2018-08-24 | 安徽八六物联科技有限公司 | A kind of big data desensitization method |
| CN109190405A (en) * | 2018-09-03 | 2019-01-11 | 佛山科学技术学院 | A kind of government affairs big data desensitization process method and device |
| CN110222084A (en) * | 2019-05-06 | 2019-09-10 | 北京奇安信科技有限公司 | The report method and device of hotspot device monitoring information, storage medium, terminal |
| CN110222084B (en) * | 2019-05-06 | 2021-10-22 | 奇安信科技集团股份有限公司 | Method and device, storage medium, and terminal for reporting hotspot device monitoring information |
| CN110532805A (en) * | 2019-09-05 | 2019-12-03 | 国网山西省电力公司阳泉供电公司 | Data desensitization method and device |
| CN110532805B (en) * | 2019-09-05 | 2023-01-24 | 国网山西省电力公司阳泉供电公司 | Data desensitization method and device |
| CN110781515A (en) * | 2019-10-25 | 2020-02-11 | 上海凯馨信息科技有限公司 | Static data desensitization method and desensitization device |
| CN110781515B (en) * | 2019-10-25 | 2023-09-26 | 上海凯馨信息科技有限公司 | Static data desensitizing method and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN107526813A (en) | A kind for the treatment of method and apparatus for the data that desensitize | |
| CN110023925B (en) | Generate, access, and display lineage metadata | |
| Head | The A nthropoceneans | |
| CN103605706A (en) | Knowledge map based resource retrieval method | |
| Malik et al. | A generic methodology for geo‐related data semantic annotation | |
| GB2466427A (en) | Storing of changes to baseline table in a database | |
| Sharma et al. | Database management systems—an efficient, effective, and augmented approach for organizations | |
| KR101740783B1 (en) | System and Method for Evaluation and Management Seismic Hazard | |
| Pritchard | Dangerous Beauty: Aesthetics, Politics, and Power in Anthropocene: The Human Epoch | |
| Jeong et al. | Data management technologies for infrastructure monitoring | |
| Mukhopadhyay et al. | Developing geodetic search interface through auto-generation of geographic name authority datasets | |
| Carlen et al. | Convexity and concentration | |
| Ferreira et al. | A practical solution to synchronise structured and non-structured repositories | |
| CN111400593A (en) | An innovation and entrepreneurship education incubation platform | |
| Spoiala et al. | The semantic representation of open data regarding the Romanian companies | |
| Andrews et al. | Knowledge discovery through creating formal contexts | |
| Holm et al. | Design principles for micro models | |
| Lee et al. | Visualize Field Data in Fusion Tables-Take Chung Hua University Plant Map as Example | |
| Korde et al. | A digital approach to access and manage distributed data | |
| Lerner | At the forge: CouchDB views | |
| Kondo et al. | An Analysis of Learning Processes on Online Notes using Scrapbox | |
| Scheider et al. | Inhalts-und Kontextbeschreibung-Neuartige Informationsdienste für Bibliotheken mit Linked Spatio-Temporal Data | |
| Ariyani et al. | Linking spatial information of cultural heritage metadata with geo linked open data | |
| Remer et al. | Air entrapment mechanism of a drop impacting a microstructured surface | |
| Wang et al. | A numerical study on wind-driven runback characteristics of a thin water film flow over a solid surface |
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 | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171229 |
|
| RJ01 | Rejection of invention patent application after publication |