CN112836242A - Data deformation method and device for data table - Google Patents

Data deformation method and device for data table Download PDF

Info

Publication number
CN112836242A
CN112836242A CN202110346703.XA CN202110346703A CN112836242A CN 112836242 A CN112836242 A CN 112836242A CN 202110346703 A CN202110346703 A CN 202110346703A CN 112836242 A CN112836242 A CN 112836242A
Authority
CN
China
Prior art keywords
deformation
data
deformed
field
data table
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
CN202110346703.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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202110346703.XA priority Critical patent/CN112836242A/en
Publication of CN112836242A publication Critical patent/CN112836242A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Storage Device Security (AREA)

Abstract

The invention provides a data deformation method and device of a data table, and relates to the technical field of information security. The method comprises the following steps: acquiring a data table to be deformed; acquiring a deformation field and a corresponding deformation rule from a deformation strategy corresponding to the data table to be deformed; wherein the deformation strategy is preset; and traversing the data table to be deformed, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field to obtain the deformed data table data. The device is used for executing the method. The data deformation method and device of the data table provided by the embodiment of the invention improve the safety of data.

Description

Data deformation method and device for data table
Technical Field
The invention relates to the technical field of information security, in particular to a data deformation method and device of a data table.
Background
Hbase is a component of the Hadoop ecosystem, is a distributed and column-oriented open source database, and works in the form of key/value pairs.
In the HBase database, data needs to be retrieved and stored by row key (Rowkey). In the actual service implementation process, the Rowkey is generally formed by combining a Primary Key (PK) and a Secondary Key (SK) and their hash values, and PK and SK may include multiple service fields. When some application tests are carried out, service data need to be called from an Hbase database, but when the service data comprise sensitive data such as telephone numbers, addresses, names and the like, original data in the Hbase cannot be called directly due to the risk of data leakage, and a traditional data deformation method of a relational database is not suitable for the Hbase database. Therefore, how to realize the deformation of the data in the Hbase database to prevent the data leakage is a problem to be solved in the industry.
Disclosure of Invention
To solve the problems in the prior art, embodiments of the present invention provide a method and an apparatus for transforming data in a data table, which can at least partially solve the problems in the prior art.
In one aspect, the present invention provides a data transformation method for a data table, including:
acquiring a data table to be deformed;
acquiring a deformation field and a corresponding deformation rule from a deformation strategy corresponding to the data table to be deformed; wherein the deformation strategy is preset;
and traversing the data table to be deformed, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field to obtain the deformed data table data.
In another aspect, the present invention provides a data transformation apparatus for a data table, comprising:
the first acquisition module is used for acquiring a data table to be deformed;
the second acquisition module is used for acquiring a deformation field and a corresponding deformation rule from a deformation strategy corresponding to the data table to be deformed; wherein the deformation strategy is preset;
and the traversing module is used for traversing the data table to be deformed, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field to obtain the deformed data table data.
In another aspect, the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the processor implements the steps of the data transformation method for the data table according to any of the above embodiments.
In yet another aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the data deformation method of the data table according to any one of the above embodiments.
The data deformation method and device for the data table provided by the embodiment of the invention can acquire the data table to be deformed, acquire the deformation field and the corresponding deformation rule from the deformation strategy corresponding to the data table to be deformed, traverse the data table to be deformed, deform the data corresponding to the deformation field according to the deformation rule corresponding to the deformation field, acquire the deformed data table data, realize the deformation of sensitive data, avoid the leakage of the sensitive data and improve the safety of the data.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
fig. 1 is a schematic flow chart of a data transformation method for a data table according to an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of a data transformation apparatus of a data table according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a data transformation apparatus of a data table according to another embodiment of the present invention.
Fig. 4 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Fig. 1 is a schematic flow chart of a data transformation method for a data table according to an embodiment of the present invention, and as shown in fig. 1, the data transformation method for a data table according to the embodiment of the present invention includes:
s101, acquiring a data table to be deformed;
specifically, the client terminal can access the Hbase database, and obtain a corresponding data table from the Hbase database according to the data table name as a data table to be deformed. The client terminal includes, but is not limited to, a desktop computer, a notebook computer, and the like.
For example, the data table name corresponding to the data table to be deformed may be configured in the deformed table configuration file, and the Hadoop cluster authentication information may be configured in the configuration file of the Hadoop cluster. The client terminal reads Hadoop cluster authentication information through a configuration file of the Hadoop cluster, logs in the Hadoop cluster, accesses an Hbase database of the Hadoop cluster, obtains a data table name corresponding to a data table to be deformed from a deformation table configuration file, reads the corresponding data table from the Hbase database according to the data table name to serve as the data table to be deformed, and can store the data table to be deformed in a file mode. The Hadoop cluster authentication information includes a cluster authentication user name, an authentication keytab file name, an IP address DNS mapping (a host name and an IP address connection string of all nodes of a cluster), a cluster configuration file (core-site. xml, hbase-site. xml, hdfs-site. xml, jaas. conf, krb5.conf), and the like, and is set according to actual needs, which is not limited in the embodiment of the invention.
S102, obtaining a deformation field and a corresponding deformation rule from a deformation strategy corresponding to the data table to be deformed; wherein the deformation strategy is preset;
specifically, a deformation policy corresponding to the data table to be deformed is preset, and after the client terminal obtains the data table to be deformed, a deformation field and a deformation rule corresponding to the deformation field may be obtained from the deformation policy corresponding to the data table to be deformed. The deformation policy sets which fields correspond to data to be deformed, what deformation rule is adopted for the deformation fields, and the fields to be deformed may be fields in PK and/or SK. It can be understood that the data corresponding to the deformed field is sensitive data and needs to be kept secret.
For example, the deformation strategy corresponding to the data table to be deformed may be set in a deformation strategy configuration file, and the deformation strategy corresponding to the data table to be deformed is obtained by reading the deformation strategy configuration file.
S103, traversing the data table to be deformed, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field to obtain the deformed data table data.
Specifically, after obtaining the deformation field, the client terminal traverses the data table to be deformed, deforms the data corresponding to the deformation field according to the deformation rule corresponding to the deformation field, that is, obtains each data corresponding to the deformation field from the data table to be deformed, then deforms each data according to the deformation rule corresponding to the deformation field, and replaces the original data in the data table to be deformed with the deformed data to obtain the deformed data table data.
The data deformation method for the data table provided by the embodiment of the invention can acquire the data table to be deformed, acquire the deformation field and the corresponding deformation rule from the deformation strategy corresponding to the data table to be deformed, traverse the data table to be deformed, deform the data corresponding to the deformation field according to the deformation rule corresponding to the deformation field, acquire the deformed data table data, realize the deformation of sensitive data, avoid the leakage of the sensitive data and improve the safety of the data.
On the basis of the foregoing embodiments, further, the deformation policy further includes a deformation condition of the deformation field; correspondingly, the traversing the data table to be deformed and the deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field includes:
and traversing the data table to be deformed if the main key or the auxiliary key of the data table to be deformed meets the deformation condition of the deformed field through judgment, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field.
Specifically, the deformation policy further includes a deformation condition of the deformation field, and the deformation condition sets what condition is satisfied by PK or SK to deform the deformation field. The client terminal obtains the PK or SK of the data table to be deformed, then judges whether the PK or SK meets the deformation condition of the deformation field, if the PK or SK meets the deformation condition of the deformation field, the client terminal traverses the data table to be deformed, and deforms the data corresponding to the deformation field according to the deformation rule corresponding to the deformation field. And if the PK or SK does not meet the deformation condition of the deformation field, not deforming the data corresponding to the deformation field.
On the basis of the foregoing embodiments, further, the deformation condition of the deformation field includes:
and if the value corresponding to the preset field included by the main key or the auxiliary key is judged and known to be a set value, deforming the data corresponding to the deformed field.
Specifically, the client terminal obtains a main key of the data table to be deformed, compares a value corresponding to a preset field included in the obtained main key with a set value, and deforms data corresponding to the deformed field if the value corresponding to the preset field included in the main key is the same as the set value. Or
And the client terminal acquires an auxiliary key of the data table to be deformed, compares a value corresponding to a preset field included by the acquired auxiliary key with a set value, and deforms the data corresponding to the deformed field if the value corresponding to the preset field included by the auxiliary key is the same as the set value.
The preset field and the setting value are set according to actual needs, and the embodiment of the invention is not limited.
On the basis of the foregoing embodiments, further, the deformation rule corresponding to the deformation field includes:
and combining the data corresponding to the deformation field with a secret key to obtain combined data, and performing modulus extraction on the combined data to a preset value.
Specifically, for data corresponding to a deformed field such as a communication number, a certificate number, an IP address, and a DNS domain name, the data corresponding to the deformed field may be combined with a secret key to obtain combined data, then the combined data is modulo based on a preset value, and the original data is replaced with a result of the modulo to implement the deformation of the data. The communication number includes but is not limited to a mobile phone number, a fax number and a fixed telephone number; certificate numbers include, but are not limited to, personal identification numbers and organizational codes. The key and the preset value are set according to actual needs, and the embodiment of the invention is not limited. The key may be updated periodically or aperiodically to improve security.
For example, the data corresponding to the communication number is 150xxxxxxxx, a 19-bit key is added after 150xxxxxxxx to obtain combined data K, then the K is used for performing modulus extraction on 10, and the modulus extraction result is taken as the data after 150xxxxxxxx deformation. Wherein the 19-bit key is preset.
On the basis of the foregoing embodiments, further, the deformation rule corresponding to the deformation field includes:
and changing the data corresponding to the deformation field into a preset character string.
Specifically, for data corresponding to a deformed field such as a password, an EMAIL address, a key, and the like, the data corresponding to the deformed field may be changed into a preset character string, and the preset character string is used to replace the original data, so as to deform the data. The preset character string is set according to actual needs, and the embodiment of the invention is not limited.
For example, for the data corresponding to the password (field), the unity is replaced with 88888888.
On the basis of the foregoing embodiments, further, the deformation rule corresponding to the deformation field includes:
if the number of characters included in the data corresponding to the deformation field is judged and known to be larger than 2, reserving first characters and tail characters of the data corresponding to the deformation field, and changing odd-number characters in other characters of the data corresponding to the deformation field into preset characters;
and if the number of characters included in the data corresponding to the deformed field is judged to be less than or equal to 2, changing the first character of the data corresponding to the deformed field into a preset character.
Specifically, for data including chinese characters corresponding to a deformed field such as an address, a user name, etc., the number of characters included in the data corresponding to the deformed field may be counted, and then it is determined whether the number of characters is greater than 2, if the number of characters is unit 2, the first character and the last character of the data corresponding to the deformed field are retained, and then odd-numbered characters in the remaining characters of the data corresponding to the deformed field are changed to preset characters, while even-numbered characters in the remaining characters of the data corresponding to the deformed field may remain unchanged. And if the number of the characters is less than or equal to 2, changing the first character of the data corresponding to the deformation field into a preset character. The remaining characters of the data corresponding to the deformed field refer to characters of the data corresponding to the deformed field except for a first character and a last character, wherein the first character is the first character, and the last character is the last character. The preset characters are set according to actual needs, and the embodiment of the invention is not limited. In addition, the half-angle spaces in the rest characters of the data corresponding to the deformation field can also be kept unchanged as no information is leaked.
For example, the data corresponding to the address field is: and if the number of the characters is 2 and the preset character is Y, replacing the first character 'north' with Y, wherein the deformed data corresponding to the Beijing is Y Beijing.
For example, the data corresponding to the username field is: the keyboard man from north has the number of characters of 8, the preset character of Y, the first character of 'come' and 'man' are kept unchanged, the odd-number characters of 'north', 'date' and 'disc' are changed into Y, and then the corresponding deformed data of the keyboard man from north are as follows: from Y-key Y man.
On the basis of the foregoing embodiments, further, the data transformation method for a data table according to an embodiment of the present invention further includes:
and exporting the deformed data of the data table to a text file.
Specifically, after obtaining the deformed data table data, the client terminal may export the deformed data table data to a text file for subsequent use.
For example, the client terminal may export the deformed data table data to a txt file through an export command of Hbase, so as to obtain a deformed complete data file.
The following describes a specific implementation process of the data transformation method for the data table provided by the embodiment of the present invention, by taking a transformation process of the ABC _ XYZ table of the Hbase database as an example.
The PK of the ABC _ XYZ table is formed by splicing M # N # P # Q four fields by # s, wherein M is an identification number, N is an identification attribute, the data corresponding to the identification attribute is 1, 2 or 3, 1 represents an authentication medium serial number, 2 represents a telephone number/mobile phone number, 3 represents a WeChat ID, P is a type number, and Q channel type. And when the data corresponding to the N is 2, the data corresponding to the N is a specific telephone number or a mobile phone number, and when the data corresponding to the N is 3, the data corresponding to the M is a specific micro signal.
The deformation strategy corresponding to the ABC _ XYZ table comprises a deformation field of M, a deformation rule corresponding to M and a deformation condition of M. The deformation rule corresponding to M comprises: and combining the data corresponding to the deformation field with the 19-bit key to obtain combined data, wherein the combined data performs modulus on the preset value. The deformation conditions of M are as follows: and if the data corresponding to the N is judged and known to be 2 (telephone number/mobile phone number), deforming the data corresponding to the M.
And the client terminal logs in the Hadoop cluster, accesses the Hbase database, and obtains the data of the ABC _ XYZ table from the Hbase database according to the table name ABC _ XYZ to the file stream 1. And then obtaining a deformation field M, a deformation rule corresponding to M and a deformation condition of M from a deformation strategy corresponding to the ABC _ XYZ table.
And the client terminal acquires the data corresponding to the N according to the deformation condition of the M, judges whether the data corresponding to the N is 2 or not, and if the data corresponding to the N is 2, deforms the data corresponding to the M based on the deformation rule corresponding to the M to acquire the deformed data. If the data corresponding to N is not 2, the data corresponding to M does not need to be deformed.
And the client terminal replaces the data corresponding to the M in the file stream 1 with the deformed data corresponding to the M to obtain a file stream 2. And exporting the file stream 2 to a txt file to obtain a deformed complete data file. The file stream 1 and the file stream 2 may be compared to check whether the transformation is completed.
The following describes a specific implementation procedure of the data transformation method of the data table provided in the embodiment of the present invention, taking the transformation of the DEF _ OPQ table of the Hbase database as an example.
The PK of the DEF _ OPQ table is formed by splicing three fields I # J # K with # I being a region number, J being an address and K being a channel type.
The deformation policy corresponding to the DEF _ OPQ table includes deformation rules corresponding to the deformation fields J and J. The deformation rule corresponding to J comprises: if the number of characters included in the data corresponding to the deformation field is judged and known to be larger than 2, reserving first characters and tail characters of the data corresponding to the deformation field, and changing odd-number characters in other characters of the data corresponding to the deformation field into preset characters; and if the number of characters included in the data corresponding to the deformed field is judged to be less than or equal to 2, changing the first character of the data corresponding to the deformed field into a preset character.
And the client terminal logs in the Hadoop cluster, accesses the Hbase database, and obtains the data of the DEF _ OPQ table from the Hbase database according to the table name DEF _ OPQ to the file stream 3. And then obtaining deformation rules corresponding to the deformation fields J and J from the deformation strategy corresponding to the DEF _ OPQ table.
And traversing the file stream 3, and deforming the data corresponding to the J based on the deformation rule corresponding to the J to obtain deformed data. And then replacing the data corresponding to J in the file stream 3 with the deformed data corresponding to J to obtain a file stream 4. And exporting the file stream 4 to a txt file to obtain a deformed complete data file. Wherein, the file stream 3 and the file stream 4 can be compared to check whether the deformation is completed.
The data deformation method of the data table provided by the embodiment of the invention fills the technical blank of the column type storage Hbase database non-forming data extraction and data deformation method, realizes that big data testing and analysis modeling personnel can automatically and configurably extract Hbase data and deform the data according to requirements, improves the safety of the data, and can expand the application range of the Hbase database.
Fig. 2 is a schematic structural diagram of a data transformation apparatus for a data table according to an embodiment of the present invention, and as shown in fig. 2, the data transformation apparatus for a data table according to an embodiment of the present invention includes a first obtaining module 201, a second obtaining module 202, and a traversing module 203, where:
the first obtaining module 201 is configured to obtain a data table to be deformed; the second obtaining module 202 obtains a deformation field and a corresponding deformation rule from a deformation strategy corresponding to the data table to be deformed; wherein the deformation strategy is preset; the traversal module 203 is configured to traverse the data table to be deformed, and deform the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field to obtain the deformed data table data.
Specifically, the first obtaining module 201 may access the Hbase database, and obtain a corresponding data table from the Hbase database according to the name of the data table, as the data table to be deformed.
A deformation policy corresponding to the data table to be deformed is preset, and after the second obtaining module 202 obtains the data table to be deformed, a deformation field and a deformation rule corresponding to the deformation field may be obtained from the deformation policy corresponding to the data table to be deformed. The deformation policy sets which fields correspond to data to be deformed, what deformation rule is adopted for the deformation fields, and the fields to be deformed may be fields in PK and/or SK. It can be understood that the data corresponding to the deformed field is sensitive data and needs to be kept secret.
After obtaining the deformation field, the traversal module 203 traverses the data table to be deformed, deforms the data corresponding to the deformation field according to the deformation rule corresponding to the deformation field, that is, obtains each data corresponding to the deformation field from the data table to be deformed, then deforms each data according to the deformation rule corresponding to the deformation field, and replaces the original data in the data table to be deformed with the deformed data to obtain the deformed data table data.
The data deformation device for the data table provided by the embodiment of the invention can acquire the data table to be deformed, acquire the deformation field and the corresponding deformation rule from the deformation strategy corresponding to the data table to be deformed, traverse the data table to be deformed, deform the data corresponding to the deformation field according to the deformation rule corresponding to the deformation field, acquire the deformed data table data, realize the deformation of sensitive data, avoid the leakage of the sensitive data and improve the safety of the data.
On the basis of the foregoing embodiments, further, the deformation policy further includes a deformation condition of the deformation field; accordingly, the traversal module 203 is specifically configured to:
and traversing the data table to be deformed after judging that the main key or the auxiliary key of the data table to be deformed meets the deformation condition of the deformed field, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field.
On the basis of the foregoing embodiments, further, the deformation condition of the deformation field includes:
and if the main key or the auxiliary key is judged to include the preset field, deforming the data corresponding to the deformed field.
On the basis of the foregoing embodiments, further, the deformation rule corresponding to the deformation field includes:
and combining the data corresponding to the deformation field with a secret key to obtain combined data, and performing modulus extraction on the combined data to a preset value.
On the basis of the foregoing embodiments, further, the deformation rule corresponding to the deformation field includes:
and changing the data corresponding to the deformation field into a preset character string.
On the basis of the foregoing embodiments, further, the deformation rule corresponding to the deformation field includes:
if the number of characters included in the data corresponding to the deformation field is judged and known to be larger than 2, reserving first characters and tail characters of the data corresponding to the deformation field, and changing odd-number characters in other characters of the data corresponding to the deformation field into preset characters;
and if the number of characters included in the data corresponding to the deformed field is judged to be less than or equal to 2, changing the first character of the data corresponding to the deformed field into a preset character.
Fig. 3 is a schematic structural diagram of a data transformation apparatus for a data table according to another embodiment of the present invention, as shown in fig. 3, on the basis of the foregoing embodiments, further, the data transformation apparatus for a data table according to the embodiment of the present invention further includes an export module 204, where:
the export module 204 is configured to export the transformed data table data into a text file.
The embodiment of the apparatus provided in the embodiment of the present invention may be specifically configured to execute the processing flows of the above method embodiments, and the functions of the apparatus are not described herein again, and refer to the detailed description of the above method embodiments.
Fig. 4 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 4, the electronic device may include: a processor (processor)401, a communication Interface (communication Interface)402, a memory (memory)403 and a communication bus 404, wherein the processor 401, the communication Interface 402 and the memory 403 complete communication with each other through the communication bus 404. Processor 401 may call logic instructions in memory 403 to perform the following method: acquiring a data table to be deformed; acquiring a deformation field and a corresponding deformation rule from a deformation strategy corresponding to the data table to be deformed; wherein the deformation strategy is preset; and traversing the data table to be deformed, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field to obtain the deformed data table data.
In addition, the logic instructions in the memory 403 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The present embodiment discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the above-mentioned method embodiments, for example, comprising: acquiring a data table to be deformed; acquiring a deformation field and a corresponding deformation rule from a deformation strategy corresponding to the data table to be deformed; wherein the deformation strategy is preset; and traversing the data table to be deformed, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field to obtain the deformed data table data.
The present embodiment provides a computer-readable storage medium, which stores a computer program, where the computer program causes the computer to execute the method provided by the above method embodiments, for example, the method includes: acquiring a data table to be deformed; acquiring a deformation field and a corresponding deformation rule from a deformation strategy corresponding to the data table to be deformed; wherein the deformation strategy is preset; and traversing the data table to be deformed, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field to obtain the deformed data table data.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (10)

1. A method of data transformation of a data table, comprising:
acquiring a data table to be deformed;
acquiring a deformation field and a corresponding deformation rule from a deformation strategy corresponding to the data table to be deformed; wherein the deformation strategy is preset;
and traversing the data table to be deformed, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field to obtain the deformed data table data.
2. The method of claim 1, wherein the deformation policy further comprises a deformation condition for the deformation field; correspondingly, the traversing the data table to be deformed and the deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field includes:
and traversing the data table to be deformed if the main key or the auxiliary key of the data table to be deformed meets the deformation condition of the deformed field through judgment, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field.
3. The method of claim 2, wherein the deformation condition of the deformation field comprises:
and if the value corresponding to the preset field included by the main key or the auxiliary key is judged and known to be a set value, deforming the data corresponding to the deformed field.
4. The method of claim 1, wherein the deformation rule corresponding to the deformation field comprises:
and combining the data corresponding to the deformation field with a secret key to obtain combined data, and performing modulus extraction on the combined data to a preset value.
5. The method of claim 1, wherein the deformation rule corresponding to the deformation field comprises:
and changing the data corresponding to the deformation field into a preset character string.
6. The method of claim 1, wherein the deformation rule corresponding to the deformation field comprises:
if the number of characters included in the data corresponding to the deformation field is judged and known to be larger than 2, reserving first characters and tail characters of the data corresponding to the deformation field, and changing odd-number characters in other characters of the data corresponding to the deformation field into preset characters;
and if the number of characters included in the data corresponding to the deformed field is judged to be less than or equal to 2, changing the first character of the data corresponding to the deformed field into a preset character.
7. The method of any of claims 1 to 6, further comprising:
and exporting the deformed data of the data table to a text file.
8. A data morphing arrangement for a data table, comprising:
the first acquisition module is used for acquiring a data table to be deformed;
the second acquisition module is used for acquiring a deformation field and a corresponding deformation rule from a deformation strategy corresponding to the data table to be deformed; wherein the deformation strategy is preset;
and the traversing module is used for traversing the data table to be deformed, and deforming the data corresponding to the deformed field according to the deformation rule corresponding to the deformed field to obtain the deformed data table data.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202110346703.XA 2021-03-31 2021-03-31 Data deformation method and device for data table Pending CN112836242A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110346703.XA CN112836242A (en) 2021-03-31 2021-03-31 Data deformation method and device for data table

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110346703.XA CN112836242A (en) 2021-03-31 2021-03-31 Data deformation method and device for data table

Publications (1)

Publication Number Publication Date
CN112836242A true CN112836242A (en) 2021-05-25

Family

ID=75930775

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110346703.XA Pending CN112836242A (en) 2021-03-31 2021-03-31 Data deformation method and device for data table

Country Status (1)

Country Link
CN (1) CN112836242A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110781515A (en) * 2019-10-25 2020-02-11 上海凯馨信息科技有限公司 Static data desensitization method and desensitization device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110781515A (en) * 2019-10-25 2020-02-11 上海凯馨信息科技有限公司 Static data desensitization method and desensitization device

Similar Documents

Publication Publication Date Title
JP6599906B2 (en) Login account prompt
JP6582277B1 (en) Block chain history storage system and block chain history storage method
CN111488594B (en) Permission checking method and device based on cloud server, storage medium and terminal
CN112036125B (en) Document management method and device and computer equipment
CN110909373A (en) Access control method, device, system and storage medium
US10700934B2 (en) Communication control device, communication control method, and computer program product
CN103870480A (en) Dynamic data masking method and database system
CN112559526A (en) Data table export method and device, computer equipment and storage medium
CN108365949B (en) Client real-name system information management method, device and system
CN110929173A (en) Method, device, equipment and medium for identifying same person
CN113282591A (en) Authority filtering method and device, computer equipment and storage medium
CN111641554B (en) Message processing method and device and computer readable storage medium
CN111090616B (en) File management method, corresponding device, equipment and storage medium
CN112836242A (en) Data deformation method and device for data table
CN116055067A (en) Weak password detection method, device, electronic equipment and medium
CN107315806B (en) Embedded storage method and device based on file system
CN108733425B (en) Service change information sending method and device, electronic equipment and storage medium
CN115879157A (en) Data security search method and device, equipment, medium and product thereof
CN106559554A (en) A kind of communication processing method, device
CN113312669B (en) Password synchronization method, device and storage medium
CN109670108B (en) Information filtering method and device
CN114547059A (en) Platform data updating method and device and computer equipment
CN113342647A (en) Test data generation method and device
CN113285933A (en) User access control method and device, electronic equipment and storage medium
CN112187700A (en) WAF security rule matching method, equipment and storage medium

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