CN117526965A - Intelligent compression storage method for bank data, computer equipment and storage medium - Google Patents
Intelligent compression storage method for bank data, computer equipment and storage medium Download PDFInfo
- Publication number
- CN117526965A CN117526965A CN202311622038.8A CN202311622038A CN117526965A CN 117526965 A CN117526965 A CN 117526965A CN 202311622038 A CN202311622038 A CN 202311622038A CN 117526965 A CN117526965 A CN 117526965A
- Authority
- CN
- China
- Prior art keywords
- data
- row
- length
- value
- row element
- 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
- 238000000034 method Methods 0.000 title claims abstract description 34
- 238000007906 compression Methods 0.000 title claims abstract description 32
- 230000006835 compression Effects 0.000 title claims abstract description 32
- 238000013144 data compression Methods 0.000 claims abstract description 30
- 239000011159 matrix material Substances 0.000 claims description 49
- 238000004590 computer program Methods 0.000 claims description 7
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000013500 data storage Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 238000001514 detection method Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 2
- 238000010606 normalization Methods 0.000 description 2
- RWSOTUBLDIXVET-UHFFFAOYSA-N Dihydrogen sulfide Chemical compound S RWSOTUBLDIXVET-UHFFFAOYSA-N 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
The invention provides an intelligent compression storage method for bank data, computer equipment and storage media, which are used for acquiring bank data information, encoding the bank data information into binary data sequences, dividing the binary data sequences into a plurality of binary data subsequences with first data lengths, counting the quantity of the binary data subsequences meeting requirements to obtain target quantity, acquiring data compression efficiency indexes corresponding to the first data lengths according to the lengths of the binary data sequences, the target quantity and the first data lengths, obtaining optimal first data lengths from the data compression efficiency indexes, dividing the binary data sequences by the optimal first data lengths to obtain a plurality of binary data target subsequences, compressing and storing the binary data target subsequences, and carrying out data division by combining the actual conditions of binary data to be compressed, thereby improving the data compression efficiency.
Description
Technical Field
The invention relates to an intelligent compression storage method for bank data, computer equipment and a storage medium.
Background
People transact various services through banks, such as: a great deal of banking data information is generated by the deposit and withdrawal service, the financial service, the related financial consultation service, the enterprise financial service, etc. Accordingly, the bank data information needs to be compressed and stored, and as the bank data information is encoded into binary data under normal conditions and then is compressed and stored, the existing data compression and storage method usually directly adopts a compression algorithm to compress the data, and the actual condition of binary data to be compressed is not combined, so that the compression efficiency is lower.
Disclosure of Invention
The invention provides an intelligent compression storage method for bank data, computer equipment and a storage medium, which are used for solving the technical problems.
An intelligent compression storage method for bank data comprises the following steps:
acquiring bank data information and encoding the bank data information into a binary data sequence;
setting a preset number of first data lengths, wherein each first data length is even, dividing the binary data sequence into a plurality of binary data subsequences of the first data length for any one first data length, and counting the number of the binary data subsequences of data codes in a data coding set corresponding to the first data length in each binary data subsequence to obtain a target number; the data coding database comprises a plurality of first data lengths and data coding sets corresponding to the first data lengths;
acquiring data compression efficiency indexes corresponding to the first data lengths according to the length of the binary data sequences, the target number and the first data lengths, and acquiring the optimal first data length according to the data compression efficiency indexes;
dividing the binary data sequence by the optimal first data length to obtain a plurality of binary data target subsequences, and compressing each binary data target subsequence;
storing each compressed binary data target sub-sequence.
Further, the process for obtaining the data coding database comprises the following steps:
dividing the first data length by 2 to obtain a second data length;
and for any one second data length, acquiring all binary data under the second data length, respectively carrying out exclusive nor operation on any two binary data to obtain corresponding first operation data and second operation data, splicing the first operation data and the second operation data to form a data code, and acquiring all data codes under the second data length to form the data code set.
Further, according to the length of the binary data sequence, the target number and the first data length, obtaining a data compression efficiency index corresponding to each first data length includes:
for any one first data length, calculating the ratio of the length of the binary data sequence to the first data length to obtain a first ratio;
and calculating the product of the first ratio and the target number corresponding to the first data length, and normalizing the product to obtain the data compression efficiency index corresponding to the first data length.
Further, obtaining the optimal first data length according to the data compression efficiency index includes:
and determining the first data length corresponding to the maximum data compression efficiency index as the optimal first data length.
Further, before storing each binary data target sub-sequence after compression, the intelligent bank data compression and storage method further comprises the following steps: each compressed binary data target sub-sequence is encrypted.
Further, encrypting each compressed binary data target sub-sequence, including:
forming a decimal data matrix according to each binary data target subsequence after compression;
obtaining characteristic indexes of each row of elements according to the numerical values of each row of elements in the decimal data matrix;
for any row element except the first row element and the last row element in the decimal data matrix, acquiring the difference condition between the characteristic index of the row element and the characteristic index of the adjacent row element, and determining whether the row element is overlapped with the adjacent row element;
and obtaining an encryption matrix after the decimal data matrix is subjected to superposition operation.
Further, obtaining the characteristic index of each row of elements according to the numerical value of each row of elements in the decimal data matrix, including:
for any row of elements, obtaining the maximum value and the minimum value in the numerical values of the row of elements, respectively calculating the sum value and the difference value of the maximum value and the minimum value to obtain a first sum value and a first difference value, and calculating the ratio of the first difference value to the first sum value to obtain a first ratio;
calculating the average value of the numerical values of the elements in the row to obtain a first average value, calculating the average value of the numerical values of all the elements in the decimal data matrix to obtain a second average value, calculating the absolute value of the difference between the first average value and the second average value, and calculating the sum of the absolute value of the difference and a first preset positive number to obtain a second sum;
and calculating the ratio of the first ratio and the second sum as the characteristic index of the line element.
Further, for any row element except the first row element and the last row element in the decimal data matrix, acquiring a difference condition between the characteristic index of the row element and the characteristic index of the adjacent row element, and determining whether the row element is overlapped with the adjacent row element comprises:
setting any row element except the first row element and the last row element in the decimal data matrix as an ith row element, wherein the total row number of the decimal data matrix is n, i=2, 3, … … and n-1;
calculating the absolute value of the difference between the characteristic indexes of the ith row element and the ith-1 row element to obtain a first absolute value of the difference, calculating the absolute value of the difference between the characteristic indexes of the ith row element and the ith+1 row element to obtain a second absolute value of the difference, and calculating the average value of the first absolute value of the difference and the second absolute value of the difference to obtain a third average value;
and comparing the third average value with a preset threshold value, and if the third average value is larger than the preset threshold value, superposing each element in the i-1 th row and each element in the i+1 th row with the numerical value of the corresponding element in the i th row, and replacing the numerical value of the corresponding element in the i th row with the superposed numerical value to obtain the encrypted element corresponding to the i th row element.
The computer equipment comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the steps of the intelligent compression storage method for bank data when executing the computer program.
A computer storage medium having stored thereon a computer program which when executed by a processor performs the steps of the banking data intelligent compression storage method described above.
The invention has the following beneficial effects: firstly encoding bank data information into binary data sequences, then setting a plurality of first data lengths, dividing the binary data sequences into a plurality of binary data subsequences of the first data lengths for any one first data length, counting the number of data codes belonging to a corresponding first data length in a data encoding database under each first data length, then acquiring data compression efficiency indexes corresponding to each first data length according to the length, the target number and the first data length of the binary data sequences, acquiring the optimal first data length according to the data compression efficiency indexes, finally dividing, compressing and storing the binary data sequences according to the optimal first data length, and firstly determining the data division length according to the actual condition of the binary data sequences corresponding to the bank data information, namely carrying out data division according to the actual condition of binary data to be compressed, thereby improving the data compression efficiency.
Drawings
FIG. 1 is a flow chart of an intelligent compression and storage method for bank data;
fig. 2 is a data encryption flow chart.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
In order to explain the technical solutions described in the present application, the following description will be given by way of specific embodiments.
The embodiment provides an intelligent compression storage method for bank data, as shown in fig. 1, comprising the following steps:
step 1: acquiring bank data information and encoding the bank data information into a binary data sequence:
and acquiring bank data information to be processed, wherein the bank data information comprises various types of bank data information, and the specific types and the specific data volume are determined by actual scenes. It should be understood that the banking data information may be banking data generated when the user transacts related business, such as deposit and withdrawal business data, financial business data, user information change business data, and the like.
And then encoding the bank data information into a binary data sequence, wherein the binary encoding mode can adopt the existing UTF16 encoding mode, UTF8 encoding mode, ASCII encoding mode and the like, and the description is omitted. It should be understood that when binary encoding is performed on the bank data information, the bank data information may be ordered according to a preset sequence, for example, the bank data information may be ordered according to a data type or a sequence of data generation time, and the ordered bank data information may be binary encoded.
Step 2: setting a preset number of first data lengths, wherein each first data length is an even number, dividing the binary data sequence into a plurality of binary data subsequences of the first data length for any one first data length, and counting the number of data codes in a data coding set corresponding to the first data length in a data coding database to obtain a target number; the data coding database comprises a plurality of first data lengths and data coding sets corresponding to the first data lengths:
the number of the first data lengths is set according to actual needs, in this embodiment, each first data length is selected from the interval [ X1, X2], X1 and X2 are positive integers greater than 2, and in order to facilitate subsequent processing, each first data length is an even number, in this embodiment, the first data length is at least 4, for example: 4. 6, 8, 10, etc.
The method comprises the steps of presetting a data coding database, wherein the data coding database comprises a plurality of first data lengths and data coding sets corresponding to the first data lengths. The first data length related in the data encoding database may be identical to the preset first data length, or may include the preset first data length, that is, may include other first data lengths in addition to the preset first data length. In the data coding database, each first data length corresponds to a data coding set, and the data coding set comprises a plurality of binary data codes. As a specific embodiment, the process of obtaining the data encoding database includes: setting a plurality of second data lengths, wherein the second data lengths are the same as the first data lengths in number and correspond to each other one by one, and dividing the first data lengths by 2 to obtain corresponding second data lengths.
And for any one second data length, acquiring all binary data under the second data length, respectively carrying out exclusive nor operation on any two binary data to obtain corresponding first operation data and second operation data, splicing the first operation data and the second operation data to form a data code, acquiring all data codes under the second data length to form a data code set corresponding to the second data length, and further obtaining a data code set corresponding to the first data length corresponding to the second data length due to one-to-one correspondence between the second data length and the first data length, wherein the data code sets corresponding to the first data length corresponding to the second data length are obtained in a contract mode. Such as: the second data length is equal to 2, and all binary data with the data length of 2 are acquired, wherein the binary data is as follows: 00. 01, 10 and 11, wherein the first operation data obtained by performing exclusive-or operation on 00 and 01 are 10, the second operation data is 01, the first operation data and the second operation data are spliced, the constituted data is encoded as 1001, the first operation data obtained by performing exclusive-or operation on 00 and 10 are 01, the second operation data is 10, the first operation data and the second operation data are spliced, the constituted data is encoded as 0110, the first operation data obtained by performing exclusive-or operation on 00 and 11 are 00, the second operation data is 11, the first operation data and the second operation data are spliced, the constituted data is encoded as 0011, the first operation data obtained by performing exclusive-or operation on 01 and 10 are 00, the second operation data is 11, the constituted data is encoded as 0011, the first operation data obtained by performing exclusive-or operation on 01 and 11 are respectively, the first operation data obtained by performing exclusive-or operation on 01 and 11 are 10, the first operation data obtained by performing exclusive-or operation on 01 and 10 are encoded as 10. The repeated data codes are deleted and only one of the data codes is reserved. Therefore, the set of data codes corresponding to the second data length equal to 2 is: 1001. 0110, 0011, namely, the data coding set corresponding to the first data length equal to 4 is: 1001. 0110, 0011. Similarly, when the second data length is equal to 3, all binary data with the data length of 3 are acquired, which is: 000. 001, 010, 011, 100, 101, 110 and 111, and then obtaining the data codes corresponding to any two binary data, thereby obtaining the data code set corresponding to the data length of 3, namely the data code set corresponding to the first data length of 6. The data encoding sets of the other first data lengths can be calculated.
It should be understood that by adopting the above processing manner, a more accurate, reliable and comprehensive data coding set can be obtained, so that the efficiency of subsequent data compression is improved.
For any one first data length, dividing the binary data sequence into a plurality of binary data sub-sequences of the first data length, wherein the length of each obtained binary data sub-sequence is the first data length. Then, counting whether each binary data subsequence belongs to data encoding in a data encoding set corresponding to the first data length in a data encoding database, specifically: the initial count is 0, if the binary data subsequence belongs to one of the data codes in the data code set corresponding to the first data length in the data code database, the count is increased by 1, through the mode, each binary data subsequence judges whether the binary data subsequence belongs to the data code in the data code set corresponding to the first data length in the data code database, and finally the obtained count is the number of the binary data subsequences belonging to the data code in the data code set corresponding to the first data length in the data code database and is set as the target number corresponding to the first data length.
It should be understood that if the binary data sequence cannot be uniformly divided into a plurality of binary data sub-sequences with the first data length, that is, the length of the last sub-sequence obtained is smaller than the first data length, it is determined that the last sub-sequence does not belong to the data codes in the data code set corresponding to the first data length in the data code database.
By adopting the mode, the target number corresponding to each first data length can be obtained.
The more the target number, i.e., the more data codes that are present in the data coding database, the higher the compression efficiency, and therefore the target number has a positive correlation with the compression efficiency.
Step 3: according to the length of the binary data sequence, the target number and the first data length, acquiring a data compression efficiency index corresponding to each first data length, and acquiring an optimal first data length according to the data compression efficiency index:
the length of the binary data sequence, i.e. the total number of binary numbers in the binary data sequence, is obtained.
Since the smaller the length of binary data, the higher the compression efficiency, and the larger the target number, the higher the compression efficiency. Therefore, for any one first data length, calculating the ratio of the length of the binary data sequence to the first data length to obtain a first ratio, calculating the product of the first ratio and the target number corresponding to the first data length, normalizing the product, and taking the normalized product value as the data compression efficiency index corresponding to the first data length. The normalization may be performed by an existing normalization method, for example, a calculation formula is adopted: 1-e -x Normalizing, wherein x represents the product, and e is a natural constant.
By adopting the above manner, the data compression efficiency index corresponding to each first data length can be obtained, and the optimal first data length is obtained therefrom, and the larger the data compression efficiency index is, the better the corresponding compression effect is indicated, so in this embodiment, the first data length corresponding to the maximum data compression efficiency index is determined as the optimal first data length.
Step 4: dividing the binary data sequence by the optimal first data length to obtain a plurality of binary data target subsequences, and compressing each binary data target subsequence:
dividing a binary data sequence by the optimal first data length to obtain a plurality of binary data target subsequences, wherein if the binary data sequence can be equally divided by the optimal first data length, the lengths of the obtained binary data target subsequences are all the optimal first data length; if the binary data sequence cannot be equally divided by the optimal first data length, the length of the last binary data target sub-sequence is smaller than the optimal first data length.
Then, each binary data target sub-sequence is compressed, and it should be understood that the data compression is performed by using an existing data compression algorithm, such as huffman coding, dictionary compression algorithm (such as LZW compression algorithm), and the like, to obtain each compressed binary data target sub-sequence.
Step 5: storing each binary data target sub-sequence after compression:
in this embodiment, before storing each binary data target subsequence after compression, the intelligent bank data compression and storage method further includes: and encrypting each binary data target subsequence after compression, so as to improve the security of data storage. As a specific embodiment, as shown in fig. 2, the encryption process includes:
step (1): forming a decimal data matrix according to each binary data target subsequence after compression:
because the compressed binary data target subsequences are still binary data sequences, the compressed binary data target subsequences are spliced to obtain a binary data total sequence, binary data of every preset number of bits in the binary data total sequence is then converted into decimal data, for example, every 8 bits of binary data is converted into decimal data, so that the binary data total sequence is converted into a decimal data sequence, and then the decimal data sequence is converted into a decimal data matrix according to the total number of bits of the decimal data sequence, specifically: taking every M decimal data in the decimal data matrix as one row of the matrix to obtain a decimal data matrix with multiple rows and multiple columns. In this embodiment, the principle of the matrix is: the decimal data sequence can be converted into exactly one complete data matrix, for example, if the total number of bits of the decimal data sequence is 20, it can be converted into one 4*5 decimal data matrix. It should be appreciated that if the decimal data sequence cannot be converted to a complete data matrix, then the blank position in the resulting matrix may be set to 0. It should be understood that, for facilitating the subsequent processing, the minimum limit of the number of rows of the decimal data matrix is 3 rows, and in this embodiment, the minimum number of rows of the decimal data matrix is set to 6 rows.
Step (2): obtaining characteristic indexes of elements in each row according to the numerical values of elements in each row in the decimal data matrix:
the characteristic index of each row element reflects the characteristic information of each row element. Because each element in the decimal data matrix is a decimal number, that is, each element corresponds to a specific numerical value, in this embodiment, for any row of elements, the maximum value and the minimum value in the numerical values of the row of elements are obtained, the sum of the maximum value and the minimum value is calculated to obtain a first sum value, the difference between the maximum value and the minimum value is calculated to obtain a first difference value, and the ratio of the first difference value and the first sum value is calculated to obtain a first ratio value. Then, calculating the average value of the numerical values of the elements in the row to obtain a first average value, calculating the average value of the numerical values of all the elements in the decimal data matrix to obtain a second average value, calculating the absolute value of the difference between the first average value and the second average value, and calculating the sum of the absolute value of the difference and a first preset positive number to obtain a second sum value. The first preset positive number is used for preventing the denominator from being 0, and the specific value of the first preset positive number is set by actual needs, such as 1. Finally, calculating the ratio of the first ratio and the second sum as the characteristic index of the line element.
The calculation formula of the characteristic index A of any row of elements is given as follows:
wherein Y1 is a first ratio, Z1 is a first average value, Z2 is a second average value, and B is a first preset positive number.
In the above calculation formula, the numerator reflects the difference between the values of the corresponding row element, and the larger the numerator is, the more obvious the characteristic of the value of the row element is. The denominator reflects the difference between the row element and the matrix as a whole, the smaller the difference, the more pronounced the character of the values of the row element.
Step (3): for any row element except the first row element and the last row element in the decimal data matrix, acquiring the difference condition between the characteristic index of the row element and the characteristic index of the adjacent row element, and determining whether the row element is overlapped with the adjacent row element or not:
in this embodiment, the difference comparison needs to be performed according to each row element and the row elements adjacent to each other up and down, and since the first row element and the last row element in the decimal data matrix do not have the row elements adjacent to each other up and down at the same time, the first row element and the last row element do not participate in the subsequent processing. Then, for any row element except the first row element and the last row element in the decimal data matrix, a difference condition between the characteristic index of the row element and the characteristic index of the adjacent row element is acquired, and whether the row element is overlapped with the adjacent row element is determined, specifically:
setting any row element except the first row element and the last row element in the decimal data matrix as the i-th row element, and setting the total row number of the decimal data matrix as n, i=2, 3, … …, n-1.
Calculating the absolute value of the difference between the characteristic indexes of the ith row element and the ith-1 row element to obtain a first absolute value of the difference, calculating the absolute value of the difference between the characteristic indexes of the ith row element and the ith+1 row element to obtain a second absolute value of the difference, and calculating the average value of the first absolute value of the difference and the second absolute value of the difference to obtain a third average value. The third average value reflects the characteristic difference condition between the ith row element and the upper and lower adjacent row elements, and the larger the third average value is, the more obvious the characteristic difference between the ith row element and the upper and lower adjacent row elements is.
A threshold is preset, which is set by the actual situation, and it should be understood that the setting of the threshold needs to satisfy that at least one row of elements is capable of data superimposition. Comparing the third average value with the preset threshold value, if the third average value is larger than the preset threshold value, which indicates that the characteristic difference between the elements in the i-1 row and the elements in the upper and lower adjacent rows is obvious, overlapping each element in the i-1 row and each element in the i+1 row with the numerical value of the corresponding element in the i row, replacing the numerical value of the corresponding element in the i row with the overlapped numerical value to obtain the encrypted element corresponding to the i row element, namely, if the number of the elements in each row is M, adding the numerical value of the j element in the i-1 row, the numerical value of the j element in the i row and the numerical value of the j element in the i+1 row for the j element, and updating, namely, encrypting, so as to obtain the encrypted i row element. If the third average value is smaller than or equal to the preset threshold value, the ith row element is not processed.
It should be understood that the difference between the elements in the ith row before and after encryption is that the values of the elements are different, and because the elements in the ith row are also adjacent rows of the ith-1 row, if the elements in the ith row participate in whether to perform superposition judgment, the original data before encryption of the elements in the ith row are adopted. That is, the numerical values of the elements before encryption are used in the superposition judgment and superposition operation of each line of element parameters and the elements of the adjacent lines.
Step (4): obtaining an encryption matrix after the decimal data matrix is subjected to superposition operation:
by adopting the mode, whether any row element except the first row element and the last row element is overlapped with the adjacent row element is realized, wherein the row participating in the overlapping operation outputs the encrypted row element; the rows not participating in the superposition operation output themselves; and the elements in the first row and the elements in the last row are not processed, and finally the encryption matrix after the superposition operation is output. Thus, the updating of the decimal data matrix, namely the encryption, is completed, and the obtained encryption matrix after the decimal data matrix is subjected to superposition operation is the updated decimal data matrix.
Finally, the encryption matrix is stored, for example, in a preset memory.
The present embodiment also provides a computer device, including: memory and a processor. The memory is connected with the processor through a bus. The memory is used for storing program instructions. The processor is configured to execute the intelligent compressed storage method for bank data described in fig. 1 when the program instructions are executed.
The present embodiment also provides a computer storage medium having stored thereon a computer program executable to implement the intelligent compressed storage method for bank data described in fig. 1. The specific implementation and the effective effects of the intelligent compression and storage method for bank data can be seen from the above, and are not repeated here.
Claims (10)
1. An intelligent compression storage method for bank data is characterized by comprising the following steps:
acquiring bank data information and encoding the bank data information into a binary data sequence;
setting a preset number of first data lengths, wherein each first data length is even, dividing the binary data sequence into a plurality of binary data subsequences of the first data length for any one first data length, and counting the number of the binary data subsequences of data codes in a data coding set corresponding to the first data length in each binary data subsequence to obtain a target number; the data coding database comprises a plurality of first data lengths and data coding sets corresponding to the first data lengths;
acquiring data compression efficiency indexes corresponding to the first data lengths according to the length of the binary data sequences, the target number and the first data lengths, and acquiring the optimal first data length according to the data compression efficiency indexes;
dividing the binary data sequence by the optimal first data length to obtain a plurality of binary data target subsequences, and compressing each binary data target subsequence;
storing each compressed binary data target sub-sequence.
2. The intelligent compressed storage method for bank data according to claim 1, wherein the process of obtaining the data encoding database comprises:
dividing the first data length by 2 to obtain a second data length;
and for any one second data length, acquiring all binary data under the second data length, respectively carrying out exclusive nor operation on any two binary data to obtain corresponding first operation data and second operation data, splicing the first operation data and the second operation data to form a data code, and acquiring all data codes under the second data length to form the data code set.
3. The intelligent compression and storage method of bank data according to claim 1, wherein obtaining the data compression efficiency index corresponding to each first data length according to the length of the binary data sequence, the target number and the first data length comprises:
for any one first data length, calculating the ratio of the length of the binary data sequence to the first data length to obtain a first ratio;
and calculating the product of the first ratio and the target number corresponding to the first data length, and normalizing the product to obtain the data compression efficiency index corresponding to the first data length.
4. The intelligent compressed storage method for bank data according to claim 1, wherein obtaining the optimal first data length according to the data compression efficiency index comprises:
and determining the first data length corresponding to the maximum data compression efficiency index as the optimal first data length.
5. The intelligent compressed storage method for bank data according to claim 1, wherein before storing each binary data target sub-sequence after the compression, the intelligent compressed storage method for bank data further comprises: each compressed binary data target sub-sequence is encrypted.
6. The intelligent compressed storage method for banking data according to claim 5, wherein encrypting each binary data target sub-sequence after compression includes:
forming a decimal data matrix according to each binary data target subsequence after compression;
obtaining characteristic indexes of each row of elements according to the numerical values of each row of elements in the decimal data matrix;
for any row element except the first row element and the last row element in the decimal data matrix, acquiring the difference condition between the characteristic index of the row element and the characteristic index of the adjacent row element, and determining whether the row element is overlapped with the adjacent row element;
and obtaining an encryption matrix after the decimal data matrix is subjected to superposition operation.
7. The intelligent compression and storage method of bank data according to claim 6, wherein the obtaining the characteristic index of each row element according to the numerical value of each row element in the decimal data matrix comprises:
for any row of elements, obtaining the maximum value and the minimum value in the numerical values of the row of elements, respectively calculating the sum value and the difference value of the maximum value and the minimum value to obtain a first sum value and a first difference value, and calculating the ratio of the first difference value to the first sum value to obtain a first ratio;
calculating the average value of the numerical values of the elements in the row to obtain a first average value, calculating the average value of the numerical values of all the elements in the decimal data matrix to obtain a second average value, calculating the absolute value of the difference between the first average value and the second average value, and calculating the sum of the absolute value of the difference and a first preset positive number to obtain a second sum;
and calculating the ratio of the first ratio and the second sum as the characteristic index of the line element.
8. The intelligent compressed storage method for bank data according to claim 6, wherein, for any row element except the first row element and the last row element in the decimal data matrix, obtaining a difference condition between the characteristic index of the row element and the characteristic index of its adjacent row element, and determining whether the row element is overlapped with its adjacent row element, includes:
setting any row element except the first row element and the last row element in the decimal data matrix as an ith row element, wherein the total row number of the decimal data matrix is n, i=2, 3, … … and n-1;
calculating the absolute value of the difference between the characteristic indexes of the ith row element and the ith-1 row element to obtain a first absolute value of the difference, calculating the absolute value of the difference between the characteristic indexes of the ith row element and the ith+1 row element to obtain a second absolute value of the difference, and calculating the average value of the first absolute value of the difference and the second absolute value of the difference to obtain a third average value;
and comparing the third average value with a preset threshold value, and if the third average value is larger than the preset threshold value, superposing each element in the i-1 th row and each element in the i+1 th row with the numerical value of the corresponding element in the i th row, and replacing the numerical value of the corresponding element in the i th row with the superposed numerical value to obtain the encrypted element corresponding to the i th row element.
9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the intelligent compressed storage method of banking data according to any one of claims 1 to 8.
10. A computer storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the intelligent compressed storage method for banking data of any one of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311622038.8A CN117526965A (en) | 2023-11-30 | 2023-11-30 | Intelligent compression storage method for bank data, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311622038.8A CN117526965A (en) | 2023-11-30 | 2023-11-30 | Intelligent compression storage method for bank data, computer equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117526965A true CN117526965A (en) | 2024-02-06 |
Family
ID=89752992
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311622038.8A Pending CN117526965A (en) | 2023-11-30 | 2023-11-30 | Intelligent compression storage method for bank data, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117526965A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118152623A (en) * | 2024-05-13 | 2024-06-07 | 贵州现代数智科技有限公司 | Intelligent logistics information storage method and system based on cloud platform |
-
2023
- 2023-11-30 CN CN202311622038.8A patent/CN117526965A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118152623A (en) * | 2024-05-13 | 2024-06-07 | 贵州现代数智科技有限公司 | Intelligent logistics information storage method and system based on cloud platform |
CN118152623B (en) * | 2024-05-13 | 2024-07-30 | 贵州现代数智科技有限公司 | Intelligent logistics information storage method and system based on cloud platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111880998B (en) | Service system anomaly detection method and device, computer equipment and storage medium | |
CN111783875A (en) | Abnormal user detection method, device, equipment and medium based on cluster analysis | |
CN117526965A (en) | Intelligent compression storage method for bank data, computer equipment and storage medium | |
CN112579462B (en) | Test case acquisition method, system, equipment and computer readable storage medium | |
CN112116436A (en) | Intelligent recommendation method and device, computer equipment and readable storage medium | |
CN111723360B (en) | Credential code processing method, device and storage medium | |
CN112990583B (en) | Method and equipment for determining model entering characteristics of data prediction model | |
US20160019211A1 (en) | A process for obtaining candidate data from a remote storage server for comparison to a data to be identified | |
CN114915478A (en) | Multi-Agent-based network attack scene identification method for intelligent park industrial control system based on distributed correlation analysis | |
Chen et al. | A high-throughput FPGA accelerator for short-read mapping of the whole human genome | |
CN112905125A (en) | Data storage and reading method based on high-precision calculation of computer | |
CN112801712A (en) | Advertisement putting strategy optimization method and device | |
CN114356919A (en) | Watermark embedding method, tracing method and device for structured database | |
CN117829837A (en) | Data processing method and system for digital currency | |
CN114268323A (en) | Data compression coding method and device supporting line memory and time sequence database | |
CN116738009B (en) | Method for archiving and backtracking data | |
CN116049905A (en) | Tamper-proof system based on detecting system file change | |
CN105991609B (en) | A kind of risk case determines method and device | |
CN111639351B (en) | Battery tracing management coding encryption and decryption method based on self-encoder and Henon mapping | |
CN115408390A (en) | Data processing method and device and electronic equipment | |
CN114490547A (en) | Data compression method, device, equipment and medium | |
CN114443843A (en) | Industrial safety event type identification method, device, equipment and storage medium | |
CN115088038A (en) | Improved quality value compression framework in aligned sequencing data based on new context | |
CN113792749A (en) | Time series data abnormity detection method, device, equipment and storage medium | |
CN117459322B (en) | Computer software data encryption method based on Internet of things |
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 |