Data processing method and device, electronic equipment and computer readable storage medium
By generating and saving line verification codes for the data, the problem of monitoring the illegal tampering of structured data is solved, and secure registration and tampering detection of data are achieved.
Patent Information
- Application Number
- CN202510130665.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-05
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2045-02-05
AI Technical Summary
Existing technologies are insufficient to quickly and effectively monitor and prevent structured data from being illegally tampered with in the background, and traditional auditing methods are inefficient.
By acquiring the data source information and characteristics of the target data, a verification code is generated and saved along with the data source information and target data characteristics as index information, thereby achieving data registration and tamper-proof protection.
It achieves tamper-proof protection for both structured and unstructured data, ensuring data storage security and registration objectivity, and enabling timely detection of data tampering.
Smart Images

Figure CN119577812B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of data processing, in particular to the technical field of data security, data storage and the like. Specifically, the present disclosure relates to a data processing method and device, an electronic device and a computer readable storage medium. BACKGROUND
[0002] With the advent of the digital age, more and more files are in the form of electronic information and archives. Due to the tamperability of electronic files, there is an urgent need for a tamper-proof protection tool to monitor the tamper-proofing of electronic files to ensure the authenticity of the data when used, and it is particularly important to be able to be discovered in time when the data is modified. In addition, a large amount of structured data is stored in many current business information systems, and how to prevent structured data from being illegally tampered with is also a very difficult problem. It is obviously not a quick and effective method to identify whether the data has been illegally tampered with by auditing the database storing the structured data. SUMMARY
[0003] The present disclosure provides a data processing method and device, an electronic device and a computer readable storage medium.
[0004] According to a first aspect of the present disclosure, a data processing method is provided, which comprises:
[0005] obtaining target data and data source information corresponding to the target data; determining whether the target data is registered according to the data source information;
[0006] in the case where the target data is not registered, obtaining a target data feature of the target data, and registering the target data according to the target data feature;
[0007] generating a line verification code corresponding to the target data according to at least the data source information and the target data feature, and saving the data source information, the target data feature and the line verification code as index information.
[0008] According to a second aspect of the present disclosure, a data processing device is provided, which comprises:
[0009] a data feature module, configured to obtain target data and data source information corresponding to the target data; and determine whether the target data is registered according to the data source information;
[0010] a data registration module, configured to, in the case where the target data is not registered, obtain a target data feature of the target data, and register the target data according to the target data feature;
[0011] An index information module is configured to generate a line verification code corresponding to the target data according to at least the data source information and the target data feature, and save the data source information, the target data feature, and the line verification code as index information.
[0012] According to a third aspect of the present disclosure, an electronic device is provided, which comprises:
[0013] at least one processor; and
[0014] a memory in communication with the at least one processor; wherein
[0015] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the data processing method.
[0016] According to a fourth aspect of the present disclosure, a non-transitory computer readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to perform the data processing method.
[0017] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program which, when executed by a processor, implements the data processing method.
[0018] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0019] The accompanying drawings are used to better understand the present scheme, and do not constitute a limitation on the present disclosure. Among them:
[0020] Figure 1 is a flowchart of a data processing method provided by an embodiment of the present disclosure;
[0021] Figure 2 is a flowchart of part of another data processing method provided by an embodiment of the present disclosure;
[0022] Figure 3 is a schematic diagram of the generation process of a tamper-proof verification chain in another data processing method provided by an embodiment of the present disclosure;
[0023] Figure 4 is a flowchart of part of another data processing method provided by an embodiment of the present disclosure;
[0024] Figure 5 is a flowchart of part of another data processing method provided by an embodiment of the present disclosure;
[0025] Figure 6 is a flow diagram of part of steps of another data processing method provided by the embodiments of the present disclosure;
[0026] Figure 7 is a flow diagram of part of steps of another data processing method provided by the embodiments of the present disclosure;
[0027] Figure 8 is a flow diagram of part of steps of another data processing method provided by the embodiments of the present disclosure;
[0028] Figure 9 is a structural diagram of a data processing apparatus provided by the embodiments of the present disclosure;
[0029] Figure 10 is a block diagram of an electronic device for implementing the data processing method of the embodiments of the present disclosure. DETAILED DESCRIPTION
[0030] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to assist in understanding, and should be considered as merely exemplary. Thus, those skilled in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Also, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0031] The embodiments of the present disclosure provide a data processing method and apparatus, an electronic device, and a computer readable storage medium.
[0032] The data processing method provided by the embodiments of the present disclosure can be executed by a terminal device or a server, etc. electronic device, and the terminal device can be a vehicle-mounted device, a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. The method can be implemented by a processor invoking computer readable program instructions stored in a memory. Alternatively, the method can be executed by a server.
[0033] Figure 1 A flow diagram of the data processing method provided by the embodiments of the present disclosure is shown. As shown in Figure 1 The data processing method provided in the embodiments of the present disclosure can include steps S110, S120, and S130.
[0034] In step S110, target data and data source information corresponding to the target data are acquired; and whether the target data is registered is determined according to the data source information;
[0035] In step S120, in a case where the target data is not registered, target data features of the target data are acquired, and the target data is registered according to the target data features;
[0036] In step S130, a line verification code corresponding to the target data is generated according to at least the data source information and the target data features, and the data source information, the target data features and the line verification code are saved as index information.
[0037] For example, the target data can be structured data or unstructured data.
[0038] The structured data refers to data organized according to a predefined data model, and is usually data stored in a relational database and capable of being queried and operated using SQL (Structured Query Language).
[0039] The unstructured data usually refers to data other than the structured data, and generally refers to data stored in a file form on a computer storage medium, such as various electronic documents, video data, audio data, executable programs and all binary sequences.
[0040] In some possible implementation manners, in step S110, the target data can be acquired by communicating with a computer storing the target data, and the data source information corresponding to the target data is also acquired at the same time.
[0041] In a case where the target data is structured data, the data source information corresponding to the target data can include an IP address of a computer where the target data is located, a database name where the target data is located, a data table name where the target data is located, and the like.
[0042] In a case where the target data is unstructured data, the data source information corresponding to the target data can include an IP (Internet Protocol) address of a computer where the target data is located, a storage path of the target data, a file name corresponding to the target data, and the like.
[0043] In some possible implementation manners, the binary stream corresponding to the target data can also be acquired at the same time when the target data is acquired, and the binary stream is saved as backup data of the target data in a storage medium, so that in a case where the target data is lost or it is needed to compare the modified target data with the target data before modification, the binary stream is acquired from the storage medium to restore the target data or to compare the data contents.
[0044] In some possible implementation manners, determining whether the target data is registered according to the data source information can include: searching the index information library according to the data source information, and determining that the target data has been registered in a case where the data source information is searched in the index information library; or determining that the target data has not been registered in a case where the data source information is not searched in the index information library.
[0045] The index information library includes index information corresponding to a plurality of registered data, and the index information corresponding to each registered data includes data source information corresponding to the registered data.
[0046] Since it is impossible to store two data in the same position of the computer or the same position of the database at the same time, if the data source information corresponding to the target data is searched in the index information library, it can be determined that the target data has been registered.
[0047] In some possible implementation manners, in step S120, the target data feature of the target data can be acquired by using a data feature extractor.
[0048] In some possible implementation manners, the target data can be encrypted by using an encryption algorithm, and the encryption result can be used as the target data feature corresponding to the target data.
[0049] For example, a hash value of the target data can be calculated by using a hash algorithm, and the hash value of the target data can be used as the target data feature of the target data.
[0050] In some possible implementation manners, registering the target data according to the target data feature can include: encrypting and storing the target data.
[0051] In some specific implementation manners, the target data and the registered data are combined to form a data sequence, and the target data is encrypted and stored by using chain encryption of the data sequence.
[0052] In some possible implementation manners, the chain encryption of the data sequence can include: generating a verification chain code of an n th data according to a verification chain code of an (n-1) th data and a data feature of the n th data.
[0053] The data sequence includes N data, and n is an integer greater than 1 and less than or equal to N.
[0054] The verification chain code of the n th data can be acquired by encrypting the verification chain code of the (n-1) th data and the data feature of the n th data by using an encryption algorithm.
[0055] Of course, when the verification chain code is calculated, a time stamp or the like can be added to increase the encryption strength of the verification chain code.
[0056] The encryption algorithm can be the SHA (Secure Hash Algorithm) series, including various algorithms such as SHA-1, SHA-256, SHA-512, etc. SHA-1 generates a 160-bit hash value, while SHA-256 and SHA-512 generate 256-bit and 512-bit hash values, respectively.
[0057] The encryption algorithm can also be MD5 (Message-Digest Algorithm). MD5 is a widely used cryptographic hash function that can generate a 128-bit (16-byte) hash value to ensure the integrity of information transmission.
[0058] Of course, other encryption algorithms are also within the protection scope of the embodiments of the present disclosure.
[0059] In some possible implementations, the first data of the data sequence adopts a tamper-proof verification initial code, and the data feature of the first data is used to generate a verification chain code of the first data using an encryption algorithm.
[0060] The tamper-proof verification initial code can be a randomly generated GUID (Globally Unique Identifier) value.
[0061] By saving the verification chain code of the target data, the target data can be registered, and by saving the verification initial code of the tamper-proof verification chain and the end chain code of the tamper-proof verification chain, the full-chain logical lock of the tamper-proof verification chain can be implemented, thereby protecting all registered data.
[0062] In some possible implementations, in step S130, the data source information corresponding to the target data and the target data feature corresponding to the target data can be encrypted using an algorithm to generate a line verification code corresponding to the target data.
[0063] The algorithm can be MD5 or SHA (Secure Hash Algorithm) 256 or other custom algorithms.
[0064] In some possible implementations, the data source information corresponding to the target data, the target data feature corresponding to the target data, and the line verification code corresponding to the target data can be used as index information corresponding to the target data and saved to an index information library.
[0065] After saving the index information corresponding to the target data to the index information library, the target data becomes registered data.
[0066] The data processing method provided by the embodiments of the present disclosure is not only suitable for application scenarios of preventing tampering of unstructured data, but also suitable for application scenarios of preventing tampering of structured data, such as protection of real estate registration book data tables in real estate registration services, and protection of market subject registration information in market supervision.
[0067] In the data processing method provided by the embodiments of the present disclosure, the row verification code corresponding to the target data is generated according to the data source information of the target data that has not been registered and the target data characteristics. In this way, after the registered target data is tampered with, whether the content of the target data is tampered with is determined by comparing the target characteristic information of the target data with the target characteristic information of the registered target data, whether the index information of the registered target data is tampered with is determined by comparing the row verification code, and the storage security of the target data and the objectivity of registration and verification are effectively ensured through the verification of two dimensions of “horizontal” and “vertical”.
[0068] The data processing method provided by the embodiments of the present disclosure will be described in detail below.
[0069] As described above, the registration of the target data according to the target data characteristics can be to save the target data by encryption.
[0070] Figure 2 A flowchart of one implementation of the registration of the target data according to the target data characteristics, that is, saving the target data by encryption, is shown in FIG. 2. Figure 2 As shown in FIG. 2, the registration of the target data according to the target data characteristics, that is, saving the target data by encryption, can include steps S210 and S220.
[0071] In step S210, a current timestamp is obtained, and a verification chain code corresponding to the target data is calculated by a pre-set algorithm according to an end chain code, the current timestamp, and the target data characteristics; the end chain code is a pre-stored end node of the tamper-proof verification chain;
[0072] In step S220, the verification chain code is added and saved as a new end node of the tamper-proof verification chain.
[0073] In some possible implementations, in step S210, the current timestamp is a timestamp corresponding to the current time.
[0074] The calculation of the verification chain code corresponding to the target data according to the end chain code, the current timestamp, and the target data characteristics can be to encrypt the end chain code, the current timestamp, and the target data characteristics by using a pre-set algorithm, and to take the obtained encryption result as the verification chain code corresponding to the target data. The encryption algorithm can be MD5, SHA256 algorithm, or the like.
[0075] The end chain code is an end node of a pre-stored tamper-proof verification chain. The tamper-proof verification chain can be a verification chain composed of verification chain codes corresponding to the registered data obtained in a registration process of the registered data.
[0076] In some possible implementations, in step S220, the verification chain code corresponding to the target data is added to the tamper-proof verification chain as an end node of a new tamper-proof verification chain and is stored in the tamper-proof verification chain.
[0077] Figure 3 A schematic diagram of a generation process of the tamper-proof verification chain in some specific embodiments is shown as follows. Figure 3 As shown, a randomly generated GUID random code R1 is generated as a tamper-proof verification initial code of the tamper-proof verification chain.
[0078] When the target data 1 is obtained and needs to be registered, since the tamper-proof verification chain has only one node, i.e., the tamper-proof verification initial code R1, the tamper-proof verification initial code R1 is the end chain code, the hash value H1 of the target data 1 is obtained, the verification chain code V1 of the target data 1 is obtained using the formula V1=F(R1, H1), and the verification chain code V1 is written into the tamper-proof verification chain.
[0079] When the target data 2 is obtained and needs to be registered, since the tamper-proof verification chain includes the tamper-proof verification initial code and the verification chain code V1, the verification chain code V1 is the end chain code, the hash value H2 of the target data 2 is obtained, the verification chain code V2 of the target data 2 is obtained using the formula V2=F(V1, H2), and the verification chain code V2 is written into the tamper-proof verification chain as an end node of the tamper-proof verification chain.
[0080] When the target data 3 is obtained and needs to be registered, at this time, the verification chain code V2 is the end chain code of the tamper-proof verification chain, the hash value H3 of the target data 3 is obtained, the verification chain code V3 of the target data 3 is obtained using the formula V3=F(V2, H3), and the verification chain code V3 is written into the tamper-proof verification chain as an end node of the tamper-proof verification chain.
[0081] By analogy, when the target data n is obtained and needs to be registered, at this time, the verification chain code V(n-1) is the end chain code of the tamper-proof verification chain, the hash value H(n) of the target data n is obtained, the verification chain code V(n) of the target data n is obtained using the formula V(n)=F[V(n-1), H(n)], and the verification chain code V(n) is written into the tamper-proof verification chain as an end node of the tamper-proof verification chain.
[0082] The F is a pre-set algorithm, such as an algorithm function of the MD5 algorithm.
[0083] In some specific implementations, the current timestamp T(n) can also be used to obtain the verification chain code of the target data, that is, the verification chain code V1 of the target data 1 is obtained using the formula V1=F(R1, H1, T1), the verification chain code V2 of the target data 2 is obtained using the formula V2=F[V1, H2, T2], the verification chain code V3 of the target data 3 is obtained using the formula V3=F[V2, H3, T3], and so on, and the verification chain code V(n) of the target data n is obtained using the formula V(n)=F[V(n-1), H(n), T(n)].
[0084] Other parameters can also be used to obtain the verification chain code of the target data, and the calculation method is consistent with the use of the current timestamp, which will not be described here.
[0085] Figure 4 Fig. 4 shows a flowchart of one implementation of generating the row verification code corresponding to the target data and saving the index information after saving the verification chain code corresponding to the target data as the end node of the tamper-proof verification chain. Figure 4 As shown in Fig. 4, generating the row verification code corresponding to the target data and saving the index information can include step S410 and step S420.
[0086] In step S410, the row verification code corresponding to the target data is generated according to the data source information, the current timestamp, the target data characteristics, and the current node position of the verification chain code in the tamper-proof verification chain.
[0087] In step S420, the data source information, the current timestamp, the target data characteristics, the current node position, and the row verification code are saved as index information.
[0088] In some possible implementations, in step S410, the current node position of the verification chain code corresponding to the target data in the tamper-proof verification chain can be determined to be the mth node of the tamper-proof verification chain, and m is the current node position.
[0089] The data source information corresponding to the target data, the target data characteristics corresponding to the target data, the current timestamp corresponding to the target data, and the current node position can be encrypted using an algorithm to generate the row verification code corresponding to the target data.
[0090] The algorithm can be MD5 or SHA 256 or other custom algorithms.
[0091] In some possible implementations, in step S420, the data source information corresponding to the target data, the target data characteristics corresponding to the target data, the current timestamp corresponding to the target data, the current node position, and the row verification code corresponding to the target data can be saved as the index information corresponding to the target data in the index information library.
[0092] In some specific implementations, the index information library can be in the form of a database, which includes at least one data table, and each data table includes a plurality of index information,
[0093] The data table can include the following fields:
[0094]
[0095] The data source information corresponding to the target data can be saved as the field value corresponding to the data source information field, the target data feature corresponding to the target data can be saved as the field value corresponding to the data feature field, the current timestamp corresponding to the target data can be saved as the field value corresponding to the timestamp field, the current node position can be saved as the field value corresponding to the tamper-proof verification chain ID field, and the row verification code corresponding to the target data can be saved as the field value corresponding to the row verification code field.
[0096] After the saving is completed, the saved index information can be displayed or prompt information can be generated to prompt that the target data registration is completed.
[0097] As described above, the target data can also have been registered. If the target data is registered, consistency comparison can be performed between the target data and the registered data to determine whether the registered data is modified, and the corresponding index information position is saved as the field value corresponding to the history ID field.
[0098] Figure 5 A flowchart of one implementation of using target data and registered data for consistency comparison and registering target data when inconsistent is shown. As shown in Figure 5 Consistency comparison between the target data and the registered data can include steps S510, S520, and S530.
[0099] In step S510, in the case where the target data is registered, the target data feature corresponding to the data source information in the index information library is obtained as the record feature;
[0100] In step S520, in the case where the target data feature and the record feature are inconsistent, the target data is registered according to the target data feature;
[0101] In step S530, at least according to the data source information and the target data feature, the row verification code corresponding to the target data is generated, and the data source information, the target data feature, and the row verification code are saved as the index information.
[0102] In some possible implementation manners, in step S510, there can be multiple pieces of index information including data source information in the index information library, and the field values corresponding to the data characteristic fields in the multiple pieces of index information are the record characteristics.
[0103] In some possible implementation manners, in step S520, when all the record characteristics are inconsistent with the target data characteristics, it is indicated that the data stored in the position corresponding to the data source information is modified, that is, the target data is modified data, and therefore, it is necessary to re-register the target data.
[0104] Registering the target data can include obtaining a current timestamp, calculating a verification chain code corresponding to the target data according to the end chain code, the current timestamp and the target data characteristics by using a pre-set algorithm, and adding and saving the verification chain code as a new end node of the anti-tampering verification chain.
[0105] The calculating of the verification chain code corresponding to the target data according to the end chain code, the current timestamp and the target data characteristics by using the pre-set algorithm can be that the end chain code, the current timestamp and the target data characteristics are encrypted by using the pre-set algorithm, and the obtained encryption result is taken as the verification chain code corresponding to the target data, and the verification chain code corresponding to the target data is added and saved as the end node of the new anti-tampering verification chain.
[0106] The encryption algorithm can be MD5 or SHA256 algorithm.
[0107] The end chain code is a pre-saved end node of an anti-tampering verification chain. The anti-tampering verification chain can be a verification chain composed of the verification chain codes corresponding to the registered data obtained in the registration process of the registered data. The generation process of the anti-tampering verification chain is as shown in Figure 3 and will not be described here again.
[0108] When the field values corresponding to the data characteristic fields in the index information corresponding to the data source information newly written in the index information library are consistent with the target data characteristics, it is indicated that the data stored in the position corresponding to the data source information has not been modified compared with the data after the last modification, and therefore, it is not necessary to re-register the target data.
[0109] In some possible implementation manners, in step S530, the data source information corresponding to the target data and the target data characteristics corresponding to the target data can be encrypted by using an algorithm to generate a row verification code corresponding to the target data. The algorithm can be MD5 or SHA256 or other self-defined algorithm.
[0110] In some possible implementation manners, the data source information corresponding to the target data, the target data feature corresponding to the target data, and the row verification code corresponding to the target data can be taken as index information corresponding to the target data, and saved to the index information library.
[0111] Figure 6 A flowchart of one implementation manner of generating the row verification code corresponding to the target data and saving the index information is shown in FIG. 6. Figure 6 As shown in FIG. 6, generating the row verification code corresponding to the target data and saving the index information can include step S610, step S620, and step S630.
[0112] In step S610, the position of the index information corresponding to the data source information in the index information library in the index information library is obtained as a historical node position.
[0113] In step S620, the row verification code corresponding to the target data is generated according to the data source information, the current timestamp, the target data feature, the historical node position, and the node position of the verification chain code in the tamper-proof verification chain.
[0114] In step S630, the data source information, the current timestamp, the target data feature, the node position of the verification chain code in the tamper-proof verification chain, the historical node position, and the row verification code are saved as index information.
[0115] In some possible implementation manners, in step S610, there can be multiple index information including the data source information in the index information library. The position of the index information corresponding to the most recently written data source information in the index information library in the index information library can be taken as the historical node position, and the historical node position is empty when it is registered for the first time.
[0116] The multiple index information represents that the data stored in the position corresponding to the data source information has been modified multiple times, and the data after each modification has been registered, and the corresponding index information has been generated and saved.
[0117] Therefore, the index information corresponding to the most recently written data source information in the index information library is the index information corresponding to the most recent modification of the data stored in the position corresponding to the data source information.
[0118] The position of the index information of the most recently written data source information in the index information library in the index information library is the ID corresponding to the index information in the index information library.
[0119] Taking the position of the index information of the most recently written data source information in the index information library in the index information library as the historical node position can trace back to the position registered after the most recent modification of the data stored in the position corresponding to the data source information through the historical node position.
[0120] In some possible implementation manners, in step S620, the data source information corresponding to the target data, the target data feature corresponding to the target data, the current timestamp corresponding to the target data, the historical node position obtained in step S610, and the node position of the verification chain code corresponding to the target data in the tamper-proof verification chain can be encrypted using an algorithm to generate a row verification code corresponding to the target data.
[0121] The algorithm can be MD5 or SHA 256 or other custom algorithms.
[0122] In some possible implementation manners, in step S630, the data source information corresponding to the target data can be saved as a field value corresponding to a data source information field, the target data feature corresponding to the target data can be saved as a field value corresponding to a data feature field, the current timestamp corresponding to the target data can be saved as a field value corresponding to a timestamp field, the node position of the verification chain code corresponding to the target data in the tamper-proof verification chain can be saved as a field value corresponding to a tamper-proof verification chain ID field, the historical node position obtained in step S610 can be saved as a field value corresponding to a historical ID field, and the row verification code corresponding to the target data can be saved as a field value corresponding to a row verification code field.
[0123] After the saving is completed, the saved index information can be displayed or prompt information can be generated to prompt that the target data is registered.
[0124] Through the above method, the modification process of the data stored in the same position can be recorded, and the modification order of the data can be obtained through the writing order of the index information corresponding to the same data source information.
[0125] In some possible implementation manners, the method provided by the embodiments of the present disclosure can be used to monitor data.
[0126] That is, in the case where the target data is unstructured data, the target data can be monitored, and when a disk operation such as writing or deleting the target data is monitored, the data processing method provided by the embodiments of the present disclosure is triggered.
[0127] That is, the target data after the operation is obtained as the target data in the data processing method provided by the embodiments of the present disclosure, the target data and the data source information corresponding to the target data are obtained, and the target data feature corresponding to the data source information in the index information library is obtained as a record feature; in the case where the target data feature is inconsistent with the record feature, the target data is registered according to the target data feature; and at least according to the data source information and the target data feature, a row verification code corresponding to the target data is generated, and the data source information, the target data feature, and the row verification code are saved as index information.
[0128] The specific implementation process is as described above, and will not be described here again.
[0129] Compared with unstructured data, structured data is stored in a database, and in order to monitor the structured data, the DBA (data administrator) permission of the database where the target data is located needs to be obtained, so as to realize the monitoring of the target data. Specifically, a trigger can be created to monitor the change of the target data.
[0130] Among them, the trigger is created on the data table corresponding to the target data, and when the target data is added, deleted or modified, the trigger is triggered.
[0131] An automatic monitoring record table can also be created. After the trigger is triggered, a record will be added to the automatic monitoring record table, recording the data table name of the data change detected, the primary key ID value of the data change row, the time of the data change, and the like. By checking the automatic monitoring record table at regular intervals, when it is found that the table has added a new record, the data processing method provided by the embodiment of the present disclosure is triggered.
[0132] That is, the target data after the operation is obtained as the target data in the data processing method provided by the embodiment of the present disclosure, the target data and the data source information corresponding to the target data are obtained, the target data characteristics corresponding to the data source information in the index information library are obtained as the record characteristics; in the case where the target data characteristics and the record characteristics are inconsistent, the target data is registered according to the target data characteristics; at least according to the data source information and the target data characteristics, the row verification code corresponding to the target data is generated, and the data source information, the target data characteristics and the row verification code are saved as the index information.
[0133] The specific implementation process is as described above, and will not be repeated here.
[0134] It should be emphasized that in the case where the target data is the full table data corresponding to the data table, each row of the data table can be used as a target data Figure 2 The method registers, and the primary key ID value of each row of data is written into the index information as part of the data source information corresponding to the target data.
[0135] In some possible implementation manners, in the case where the target data is modified each time, a data modification log is generated and the data modification log is stored in an encrypted manner.
[0136] Figure 7 A flowchart of one implementation manner of generating a data modification log and storing the data modification log in an encrypted manner is shown, as shown in Figure 7 Generating a data modification log and storing the data modification log in an encrypted manner can include steps S710 and S720.
[0137] In step S710, in the case that the target data feature is inconsistent with the record feature value, a data modification log is generated according to at least the data source information and the time of obtaining the target data;
[0138] In step S720, a file feature value of the data modification log is obtained, and the data modification log is registered according to the file feature value.
[0139] In some possible implementation manners, in step S710, in the case that all the record features are inconsistent with the target data feature, it is indicated that the data stored in the position corresponding to the data source information is modified, that is, the target data in the current execution process is modified data, therefore, the target data needs to be re-registered, and new index information is generated, and the registration method is as shown in Figure 5 and Figure 6 which will not be described herein again.
[0140] In some possible implementation manners, the time of obtaining the target data is taken as the data modification completion time, and the data modification log is generated according to the data modification completion time and the data source information corresponding to the target data.
[0141] The data modification log can also include the storage position of the binary stream corresponding to the target data in the storage medium and the position of the index information corresponding to the target data in the index information library and the like.
[0142] In some possible implementation manners, in step S720, the data modification log can be registered by using the method as shown in Figure 3 .
[0143] That is, after the first data modification log is generated, the file chain code W1 of the first data modification log is obtained by using the formula V1=F(R1,H1), and the file chain code W1 is written into the modification log verification chain. Wherein, R1 is the initial code of the modification log verification chain, H1 is the hash value corresponding to the content of the first data modification log, that is, the file feature value corresponding to the first data modification log, and F is an encryption function corresponding to an encryption algorithm.
[0144] After the second data modification log is generated, the file chain code W2 of the second data modification log is obtained by using the formula W2=F(W1,H2), and the file chain code W2 is written into the modification log verification chain. Wherein, H2 is the hash value corresponding to the content of the second data modification log.
[0145] After the third data modification log is generated, the file chain code W3 of the third data modification log is obtained by using the formula W3=F(W2,H3), and the file chain code W3 is written into the modification log verification chain. Wherein, H3 is the hash value corresponding to the content of the third data modification log.
[0146] Similarly, in the case that the data modification log generated in step S710 is the nth data modification log, the file chain code W(n) of the nth data modification log is obtained using the formula W(n) = F[W(n-1), H(n)], and the file chain code W(n) is written into the modification log verification chain. Wherein, H(n) is the hash value corresponding to the content of the nth data modification log.
[0147] In some possible implementation manners, when a user wants to verify whether the registered data is tampered, the line verification code in the index information can be used for verification.
[0148] Figure 8 A flowchart of an implementation manner of verifying through the line verification code in the index information is shown as follows. Figure 8 As shown in the figure, verifying through the line verification code in the index information can include steps S810, S820, S830 and S840.
[0149] In step S810, the data to be verified and the verification data source corresponding to the data to be verified are obtained; and the verification data feature of the data to be verified is obtained.
[0150] In step S820, the verification data source is used to search in the index information library, and the index information library includes index information corresponding to a plurality of registered data.
[0151] In step S830, in the case that the verification data source is searched in the index information library, a calculation verification code corresponding to the data to be verified is generated according to at least the verification data source and the verification data feature.
[0152] In step S840, in the case that the calculation verification code is inconsistent with the line verification code corresponding to the verification data source in the index information library, a data tampering warning is issued.
[0153] In some possible implementation manners, in step S810, the data to be verified can be obtained through interaction with the user, and the verification data source corresponding to the data to be verified is also obtained at the same time.
[0154] Wherein, in the case that the data to be verified is structured data, the verification data source corresponding to the data to be verified can include the IP address of the computer where the data to be verified is located, the database name where the data to be verified is located, the data table name where the data to be verified is located, etc.
[0155] In the case that the data to be verified is unstructured data, the verification data source corresponding to the data to be verified can include the IP address of the computer where the data to be verified is located, the storage path of the data to be verified, the file name corresponding to the data to be verified, etc.
[0156] The target data feature of the target data can be consistent with the target data feature corresponding to the target data. For example, a hash value of the to-be-verified data can be calculated by using a hash algorithm, and the hash value of the to-be-verified data can be used as the verification data feature of the to-be-verified data.
[0157] In some possible implementation manners, in steps S820 and S830, the verification data source is searched in the index information library, and if the verification data source is searched in the index information library, it is determined that the data corresponding to the position of the verification data source has been registered; otherwise, if the verification data source is not searched in the index information library, it is determined that the data corresponding to the position of the verification data source has not been registered.
[0158] The calculated verification code corresponding to the to-be-verified data is generated according to the field values of the fields other than the data feature field and the row verification code in the latest index information corresponding to the writing time of the verification data source.
[0159] In some possible implementation manners, in step S840, if the calculated verification code is consistent with the field value corresponding to the row verification code field, it indicates that the data feature of the data modified last time by the verification data source corresponding to the position of the verification data is consistent with the data feature of the to-be-verified data, that is, the to-be-verified data is consistent with the data modified last time by the verification data source corresponding to the position of the verification data.
[0160] Otherwise, it indicates that the to-be-verified data is inconsistent with the data modified last time by the verification data source corresponding to the position of the verification data, that is, the data content is tampered or the index information is tampered. Therefore, a data tampering warning needs to be issued to prompt a user that the data is at risk of being tampered.
[0161] After the anti-tampering verification chain is generated, self-consistency verification of the anti-tampering verification chain can be performed at regular time intervals to verify that the anti-tampering verification chain is not tampered. The self-consistency verification can specifically include:
[0162] The end chain code saved in the encrypted memory is obtained, and the end node of the current anti-tampering verification chain is compared. Only when the two are consistent, the state is considered to be normal, otherwise, a serious alarm will be triggered.
[0163] The anti-tampering verification initial code saved in the secret memory is obtained, and the index information is sorted in ascending order according to the field values corresponding to the anti-tampering verification chain ID field in the index information,
[0164] Obtain the field value corresponding to the data feature field of the first index information in the sorting, and calculate the verification chain code with it and the initial code of the anti-tampering chain. If the verification chain code matches the first verification chain code in the anti-tampering verification chain, continue to use the verification chain code and the field value corresponding to the data feature field of the second index information in the sorting to calculate the verification chain code. If the verification chain code matches the second verification chain code in the anti-tampering verification chain, continue to use the verification chain code and the field value corresponding to the data feature field of the third index information in the sorting to calculate the verification chain code. And so on, until all index information is verified, thus completing the self-consistency verification of the anti-tampering verification chain.
[0165] While performing self-consistency verification of the anti-tampering verification chain, row verification is also performed on the index information that records the anti-tampering verification chain ID to verify that the index information of the registered data has not been tampered with.
[0166] Specifically, the verification code for each row of the index information is calculated row by row, starting from the smallest row, to check if it matches the recorded row verification code. Only when the calculated row verification code matches the row verification code of the corresponding row is the index information considered tampered with, thus completing the self-consistency verification of the index information.
[0167] Once the self-consistency of the anti-tampering verification chain and index information both pass, it indicates successful self-consistency; otherwise, it indicates failure, stops the subsequent verification process, and triggers a system self-consistency failure alarm. A self-consistency verification log is generated regardless of success or failure.
[0168] The self-consistency verification log records information such as the start and end times of the self-consistency verification, the end chaincode of the tamper-proof verification chain, and the self-consistency verification results.
[0169] The self-consistency verification log records should be registered using a method similar to that used for data modification logs.
[0170] Based on and Figure 1 The method shown follows the same principle. Figure 9 A schematic diagram of the structure of a data processing apparatus provided in an embodiment of this disclosure is shown, such as... Figure 9 As shown, the data processing device 90 may include:
[0171] The data feature module 910 is used to acquire target data and the corresponding data source information; and to determine whether the target data has been registered based on the data source information.
[0172] The data registration module 920 is used to obtain the target data characteristics of the target data when the target data has not been registered, and to register the target data according to the target data characteristics;
[0173] The index information module 930 is configured to generate a line verification code corresponding to the target data according to the data source information and the target data feature, and save the data source information, the target data feature, and the line verification code as index information.
[0174] In the data processing apparatus provided in the embodiments of the present disclosure, the line verification code corresponding to the target data is generated according to the data source information and the target data feature of the unregistered target data. In this way, after the registered target data is tampered with, whether the content of the target data is tampered with is determined by comparing the target feature information of the target data with the target feature information of the registered target data, whether the index information of the registered target data is tampered with is determined by comparing the line verification code, and the storage security of the target data and the objectivity of the registration and verification are effectively ensured through the verification in the two dimensions of “horizontal” and “vertical”.
[0175] It can be understood that the above modules of the data processing apparatus in the embodiments of the present disclosure have the functions of the corresponding steps of the data processing method in the embodiments shown in the above Figure 1 The functions can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. The above modules can be software and / or hardware, and the above modules can be implemented separately or integrated. For the function description of the modules of the data processing apparatus, refer to the corresponding description of the data processing method in the embodiments shown in the above Figure 1 , which will not be described here.
[0176] In the technical solutions of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure, and application of the user's personal information comply with relevant laws and regulations, necessary security measures are taken, and the public order and good customs are not violated.
[0177] In the technical solutions of the present disclosure, the authorization or consent of the user is obtained before the user's personal information is acquired or collected.
[0178] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device, a readable storage medium, and a computer program product.
[0179] The electronic device includes at least one processor and a memory connected with the at least one processor in communication. The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the data processing method provided in the embodiments of the present disclosure.
[0180] Compared with the prior art, the electronic device generates a line verification code corresponding to target data according to data source information and target data characteristics of the target data that has not been registered, so that after the registered target data is tampered with, whether the content of the target data is tampered with is determined by comparing the target characteristic information of the target data with the target characteristic information of the registered target data, whether the index information of the registered target data is tampered with is determined by comparing the line verification code, and the storage security of the target data and the objectivity of registration and verification are effectively ensured through the verification in two dimensions of "horizontal" and "vertical".
[0181] The readable storage medium is a non-transitory computer readable storage medium storing computer instructions, wherein the computer instructions are used to make a computer execute the data processing method provided in the embodiments of the present disclosure.
[0182] Compared with the prior art, the electronic device generates a line verification code corresponding to target data according to data source information and target data characteristics of the target data that has not been registered, so that after the registered target data is tampered with, whether the content of the target data is tampered with is determined by comparing the target characteristic information of the target data with the target characteristic information of the registered target data, whether the index information of the registered target data is tampered with is determined by comparing the line verification code, and the storage security of the target data and the objectivity of registration and verification are effectively ensured through the verification in two dimensions of "horizontal" and "vertical".
[0183] The computer program product comprises a computer program, and the computer program realizes the data processing method provided in the embodiments of the present disclosure when executed by a processor.
[0184] Compared with the prior art, the electronic device generates a line verification code corresponding to target data according to data source information and target data characteristics of the target data that has not been registered, so that after the registered target data is tampered with, whether the content of the target data is tampered with is determined by comparing the target characteristic information of the target data with the target characteristic information of the registered target data, whether the index information of the registered target data is tampered with is determined by comparing the line verification code, and the storage security of the target data and the objectivity of registration and verification are effectively ensured through the verification in two dimensions of "horizontal" and "vertical".
[0185] Figure 10A schematic block diagram of an example electronic device 1000 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0186] like Figure 10 As shown, device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1002 or a computer program loaded into random access memory (RAM) 1003 from storage unit 1008. The RAM 1003 may also store various programs and data required for the operation of device 1000. The computing unit 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Input / output (I / O) interface 1005 is also connected to bus 1004.
[0187] Multiple components in device 1000 are connected to I / O interface 1005, including: input unit 1006, such as keyboard, mouse, etc.; output unit 1007, such as various types of monitors, speakers, etc.; storage unit 1008, such as disk, optical disk, etc.; and communication unit 1009, such as network card, modem, wireless transceiver, etc. Communication unit 1009 allows device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0188] The computing unit 1001 can be various general purpose and / or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs various methods and processes described above, such as the data processing method. For example, in some embodiments, the data processing method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed onto the device 1000 via the ROM 1002 and / or the communication unit 1009. When the computer program is loaded onto the RAM 1003 and executed by the computing unit 1001, one or more steps of the data processing method described above can be performed. Alternatively, in other embodiments, the computing unit 1001 can be configured to perform the data processing method by any other suitable means, such as by means of firmware.
[0189] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0190] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0191] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0192] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0193] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0194] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0195] It should be understood that the various forms of flow shown above can be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure can be performed in parallel, in series, or in a different order, without limitation herein, so long as the desired results of the technology disclosed in the present disclosure are achieved.
[0196] The specific implementation described above does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A data processing method, comprising: obtaining target data and data source information corresponding to the target data; determining whether the target data is registered according to the data source information; in the case where the target data is not registered, obtaining target data features of the target data, and registering the target data according to the target data features; generating a line verification code corresponding to the target data according to at least the data source information and the target data features, and saving the data source information, the target data features, and the line verification code as index information; wherein the registration of the target data according to the target data features comprises: obtaining a current timestamp, and calculating a verification chain code corresponding to the target data according to an end chain code, the current timestamp, and the target data features by a pre-set algorithm; the end chain code is an end node of a pre-stored tamper-proof verification chain; adding and saving the verification chain code as a new end node of the tamper-proof verification chain; the generation of the line verification code corresponding to the target data according to at least the data source information and the target data features, and the saving of the data source information, the target data features, and the line verification code as index information, comprises: generating the line verification code corresponding to the target data according to the data source information, the current timestamp, the target data features, and a current node position of the verification chain code in the tamper-proof verification chain; and saving the data source information, the current timestamp, the target data features, the current node position, and the line verification code as index information.
2. The method of claim 1, wherein, the determination of whether the target data is registered according to the data source information comprises: searching in an index information library using the data source information; the index information library comprises index information corresponding to a plurality of registered data; in the case where the data source information is searched in the index information library, it is determined that the target data is registered; in the case where the data source information is not searched in the index information library, it is determined that the target data is not registered.
3. The method of claim 2, further comprising: in the case where the target data is registered, obtaining target data features corresponding to the data source information in the index information library as record features; in the case where the target data features are inconsistent with the record features, registering the target data according to the target data features; generating a line verification code corresponding to the target data according to at least the data source information and the target data features, and saving the data source information, the target data features, and the line verification code as index information.
4. The method of claim 3, wherein, the registration of the target data according to the target data features comprises: obtaining a current timestamp, and calculating a verification chain code corresponding to the target data according to an end chain code, the current timestamp, and the target data features by a pre-set algorithm; the end chain code is an end node of a pre-stored tamper-proof verification chain; adding and saving the verification chain code as a new end node of the tamper-proof verification chain; The at least according to the data source information and the target data characteristics, generate the line verification code corresponding to the target data, save the data source information, the target data characteristics, the line verification code as index information, including: Obtain the position of the index information corresponding to the data source information in the index information library as the historical node position; According to the data source information, the current timestamp, the target data characteristics, the historical node position and the verification chain code in the node position of the tamper-proof verification chain, generate the line verification code corresponding to the target data; Save the data source information, the current timestamp, the target data characteristics, the verification chain code in the node position of the tamper-proof verification chain, the historical node position and the line verification code as index information.
5. The method of claim 3, wherein, The target data and the data source information corresponding to the target data are obtained, including: Monitoring the target data, and obtaining the target data and the data source information corresponding to the target data in the case of monitoring the operation of the target data; Before the target data is registered according to the target data characteristics in the case that the target data characteristics are inconsistent with the record characteristics, further comprising: In the case that the target data characteristics are inconsistent with the record characteristics, at least according to the data source information and the time of obtaining the target data to generate data modification log; Obtain the file feature value of the data modification log, and register the data modification log according to the file feature value.
6. The method of claim 2, further comprising: Obtaining to-be-verified data and verification data source corresponding to the to-be-verified data; Obtain the verification data characteristics of the to-be-verified data; Using the verification data source to search in the index information library, the index information library including index information corresponding to a plurality of registered data; In the case that the index information library searches the verification data source, at least according to the verification data source and the verification data characteristics, generate the calculation verification code corresponding to the to-be-verified data; In the case that the calculation verification code is inconsistent with the line verification code corresponding to the verification data source in the index information library, issue a data tampering warning.
7. The method of claim 1, further comprising: Obtaining the binary stream corresponding to the target data, and storing the binary stream as backup data in a storage medium.
8. The method of claim 1, wherein, The target data is structured data or unstructured data; In the case that the target data is structured data, the method further comprises: Obtain the database administrator permission of the database where the target data is located, and monitor the target data based on the database administrator permission.
9. The method of claim 1, wherein, Obtaining the target feature data of the target data, including: Calculate the hash value of the target data by a hash algorithm, and take the hash value of the target data as the target feature data of the target data.
10. A data processing apparatus, comprising: A data characteristic module for obtaining target data and data source information corresponding to the target data; determining whether the target data is registered according to the data source information; a data registration module, configured to, in a case where the target data is not registered, acquire target data features of the target data, acquire a current timestamp, and calculate a verification chain code corresponding to the target data according to an end chain code, the current timestamp, and the target data features through a pre-set algorithm; the end chain code is an end node of a pre-stored tamper-proof verification chain; and the verification chain code is added and saved as a new end node of the tamper-proof verification chain; an index information module, configured to generate a line verification code corresponding to the target data according to at least the data source information and the target data features, save the data source information, the target data features, and the line verification code as index information, and generate the line verification code corresponding to the target data according to the data source information, the current timestamp, the target data features, and a current node position of the verification chain code in the tamper-proof verification chain, and save the data source information, the current timestamp, the target data features, the current node position, and the line verification code as index information. 11.An electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
12. A non-transitory computer readable storage medium having stored thereon computer instructions, wherein, The computer instructions are used to enable the computer to perform the method according to any one of claims 1-9. 13.A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-9.
Citation Information
Patent Citations
Electronic warrant data storage method and system and electronic warrant data extraction method and system
CN118551420A