Data security detection method and device, terminal equipment and readable storage medium
By reading business data and backup data from the database in the power SCADA system, using a hash algorithm to detect its consistency, output early warning information and perform data recovery, the problem of low data security in the existing system is solved and the data is improved Security and system stability.
Patent Information
- Application Number
- CN202411198456.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-28
- Publication Date
- 2024-12-06
AI Technical Summary
The existing power SCADA system has defects in data security detection, resulting in low security of service data and lack of effective detection methods.
By reading service data from the first database and reading corresponding backup data from the second database based on the data identification, the hash algorithm is used to determine the matching situation of the verification code and the verification code. If it does not match, the warning information is output, and Data recovery is performed through data recovery queues and update queues.
It realizes security detection of business data, timely discovers tampering and recovers, improves data security and ensures the stable operation of the business system.
Smart Images

Figure CN119088642A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of substation systems, and in particular, relates to a data security detection method, apparatus, terminal equipment, and readable storage medium. Background Art
[0002] In modern substation systems, the power data acquisition and supervisory control (SCADA) system plays a vital role. It can monitor the data of key components such as primary equipment, secondary equipment and auxiliary equipment in the power station in real time to ensure the stable operation of the power system. However, with the rapid development of information technology, data security issues have become increasingly prominent.
[0003] Current power SCADA systems often store business data, such as key model information (such as remote control information, user information, interlocking logic rules, etc.) in relational databases, without effective data security detection methods, resulting in low business data security in power SCADA systems.
[0004] Therefore, how to implement security detection of business data to improve data security has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The embodiments of the present application provide a data security detection method, an apparatus, a terminal device, and a readable storage medium, which can solve the problem of how to implement security detection of business data to improve data security.
[0006] In a first aspect, an embodiment of the present application provides a data security detection method, including:
[0007] Reading first business data from the first database and reading first backup data associated with the data identifier from the second database according to the data identifier of the first business data;
[0008] Determine a first verification code of the first business data and a second verification code of the first backup data respectively by using a hash algorithm;
[0009] If the first verification code does not match the second verification code, a warning message is output, where the warning message is used to prompt that the first business data has been tampered with.
[0010] In some embodiments, the method further comprises:
[0011] Obtain a data recovery queue, in which backup data corresponding to one or more tampered business data is recorded;
[0012] For any backup data in the data recovery queue, determine the data recovery method corresponding to any backup data based on the tampering recovery strategy;
[0013] Acquire a data update queue corresponding to any backup data from the first database, wherein the data update queue records one or more data of business data corresponding to any backup data that have changed compared with any backup data;
[0014] Based on the data recovery method and the data update queue, the tampered business data corresponding to any backup data is restored to obtain the restored business data;
[0015] The restored business data is stored in the first database as the business data at the current moment.
[0016] In some embodiments, the data recovery method includes a data recovery time point, and based on the data recovery method and the data update queue, the tampered business data corresponding to any backup data is restored to obtain the restored business data, including:
[0017] Based on the data update queue corresponding to the second backup data, at the data recovery time point, determine the data bits and data values added and / or deleted in the second business data corresponding to the second backup data compared with the second backup data; the second backup data is any backup data in the data recovery queue;
[0018] Based on the data recovery method corresponding to the second backup data, the added data bits and data values are deleted and / or the deleted data bits and data values are restored in the second backup data to obtain the restored business data.
[0019] In some embodiments, the data update queue includes a data addition queue and a data deletion queue, wherein the data addition queue records one or more data added to the business data corresponding to any backup data at the same time compared to any backup data, and the data deletion queue records one or more data deleted from the business data corresponding to any backup data at different times compared to any backup data;
[0020] Based on the data update queue corresponding to the second backup data, at the data recovery time point, determining the data bits and data values of the second business data corresponding to the second backup data that are added and / or deleted compared to the second backup data, includes:
[0021] At the data recovery time point, the data bits and data values added and / or deleted from the second business data compared to the second backup data are determined according to the data addition queue and the data deletion queue.
[0022] In some embodiments, determining the second verification code of the first backup data by using a hash algorithm includes:
[0023] Decrypting the first backup data to obtain reference business data of the first business data;
[0024] The check code of the reference business data is determined by a hash algorithm, and the check code of the reference business data is used as the second check code of the first backup data.
[0025] In some embodiments, the method further comprises:
[0026] Receive a data encryption backup instruction, where the data encryption backup instruction is used to indicate the business data to be backed up;
[0027] Reading the third business data at the first moment; the third business data is any business data among the business data to be backed up;
[0028] Querying whether backup data corresponding to the third business data is stored in the second database;
[0029] If the second database does not store backup data corresponding to the third business data, a target encryption algorithm for the third business data is determined according to the encryption copy configuration;
[0030] Encrypt the third business data according to the target encryption algorithm to obtain third backup data corresponding to the third business data;
[0031] The third backup data is stored in the second database.
[0032] In some embodiments, the second database stores backup data corresponding to the third business data, and the method further includes:
[0033] Reading third backup data corresponding to the third business data from the second database;
[0034] Parsing the third backup data to obtain at least one piece of business sub-data;
[0035] According to the third business data and each piece of business sub-data parsed, at a first moment, determining at least one piece of third business sub-data that is changed in the third business data compared with the third backup data;
[0036] For each piece of the third business sub-data, encrypt the third business sub-data according to a target encryption algorithm;
[0037] Based on the encrypted third business sub-data, the third backup data in the second database is updated.
[0038] In a second aspect, an embodiment of the present application provides a data security detection device, the device comprising:
[0039] A reading module, used to read the first business data from the first database and read the first backup data associated with the data identifier from the second database according to the data identifier of the first business data;
[0040] A determination module, used to determine a first verification code of the first business data and a second verification code of the first backup data respectively through a hash algorithm;
[0041] The output module is used to output warning information when the first verification code does not match the second verification code, and the warning information is used to prompt that the first business data has been tampered with.
[0042] As an example, the data security detection device may be a functional circuit, controller, or chip used in a terminal device, or the terminal device may be the data security detection device, for example, a processor in the terminal device may be the data security detection device. This embodiment of the application does not limit this.
[0043] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the data security detection method as described in any embodiment of the first aspect above is implemented.
[0044] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the data security detection method as described in any embodiment of the first aspect.
[0045] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes the data security detection method described in any embodiment of the first aspect above.
[0046] Compared with the prior art, the embodiments of the present application have the following beneficial effects: when judging whether the first business data has been tampered with, the first business data is read from the first database and the first backup data corresponding to the first business data is read from the second database, and the backup data is the first business data that has not been tampered with and is securely stored. In this way, the second check code of the first backup data determined based on the hash algorithm is the check code when the first business data has not been tampered with, and the first check code of the first business data is determined by the hash algorithm. By judging whether the first check code and the second check code match, it can be determined whether the first business data at the first moment has been tampered with. If the first check code and the second check code are different, it means that the data has been tampered with. Therefore, this scheme can realize the security detection of business data. In the case where the business data has been tampered with, a prompt message is output to prompt that the business data has been tampered with, which is beneficial for users to restore the tampered business data in time, thereby improving data security.
[0047] It can be understood that the beneficial effects of the second, third and fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0049] Figure 1 It is a structural diagram of an electric power SCADA system applicable to the data security detection method of the present application;
[0050] Figure 2 It is a flowchart of a data security detection method according to an embodiment of the present application;
[0051] Figure 3 It is a schematic diagram of the software architecture of a data security detection method in an application scenario provided by an embodiment of the present application;
[0052] Figure 4 This is a schematic diagram of an application scenario provided by an embodiment of the present application;
[0053] Figure 5 It is a flowchart of another data security detection method according to an embodiment of the present application;
[0054] Figure 6 It is a schematic diagram of a process for determining a verification code in an application scenario of an embodiment of the present application;
[0055] Figure 7 It is a flowchart of another data security detection method according to an embodiment of the present application;
[0056] Figure 8 This is another application scenario schematic diagram provided by an embodiment of the present application;
[0057] Fig. 9 is a schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0058] Fig.10 It is a structural schematic diagram of a data security detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0060] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0061] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0062] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0063] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0064] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0065] Figure 1It is a structural diagram of a business system applicable to the data security detection method of the present application, and the business system includes a first database, a second database and a terminal device.
[0066] The first database is used to store business data. The business data can be, for example, business data in the power SCADA system. For example, the business data may include key model data of the power SCADA system such as remote control data, sequence control data, authority data, and error prevention data. The key model data of the power SCADA system refers to the core data required for building, monitoring and controlling the performance of the entire system in the power SCADA system. These data usually include primary system model data and secondary system model data, which together constitute the basis of the power SCADA system. The business data can also be business data of an industrial automation system. In some embodiments, the first database can be a relational database.
[0067] The second database is used to store the backup data corresponding to the business data. As an example, the backup data corresponding to the business data can be stored in the second database in an encrypted manner, which can improve the security of the data.
[0068] The terminal device is used to detect whether the business data has been tampered with based on the business data read from the first database and the backup data corresponding to the business data read from the second database. Optionally, the terminal device is also used to restore the tampered business data in the first database based on the backup data read from the second numerical control library when the business data in the first database has been tampered with.
[0069] As an example, the terminal device may be a mobile phone, a desktop computer, an ultra-mobile personal computer (UMPC), a server, etc. The embodiment of the present application does not impose any limitation on the specific type of the terminal device.
[0070] In some embodiments, Figure 1 As shown, the business system also includes an information storage device, which is used to store configuration information. The configuration information includes tampering detection strategy, tampering recovery strategy, tampering detection parameters and encrypted copy configuration.
[0071] The terminal device is also used to read configuration information from the information storage device to perform initial configuration. The initial configuration includes at least one of determining the business data to be monitored, the detection period of the business data to be monitored, loading the hash algorithm, loading the random value, loading the algorithm parameters of the hash algorithm, determining the data recovery method, loading the encryption algorithm, and determining the storage location of the backup data.
[0072] The data security detection method of the embodiment of the present application is explained in detail below.
[0073] Figure 2 is a flow chart of a data security detection method according to an embodiment of the present application, which can be executed by a terminal device, such as Figure 2 As shown, the method comprises the following steps:
[0074] Step S201: The terminal device reads first service data from a first database and reads first backup data associated with a data identifier from a second database according to a data identifier of the first service data.
[0075] The first business data may be any business data to be monitored in the electric power SCADA system, such as remote control data, sequence control data, authority data or error prevention data.
[0076] The terminal device can determine at least one business data to be monitored and the detection period of each business data to be monitored based on the tampering detection strategy, and the first business data is any one of the at least one business data to be monitored. When the terminal device determines that the first business data has reached its own detection period, it will enter the security detection period of the first business data, read the first business data from the first database, and read the first backup data corresponding to the data identifier from the second database based on the data identifier of the first business data. As an example, the data identifier may include at least one of the serial number or source or data type of the business data.
[0077] As an example, the terminal device may receive a first operation instruction, and start executing step S201 in response to the first operation instruction.
[0078] For example, the first operation instruction may indicate the business data to be monitored, then the first business data may also be the required business data indicated by the first operation instruction, or indicate the range of business data to be monitored, and the first business data is within the range of business data to be monitored. Optionally, for the terminal device, it may mark each business data in the first database. For example, if the terminal device determines that a certain business data has been security checked and has not been tampered with, it may mark the business data. Then the first business data may be a business data that is not marked within the range of business data to be monitored.
[0079] Optionally, if the terminal device determines that there is unmarked business data in the business data to be monitored, it enters the data security detection cycle of any business data to be monitored; if there is no unmarked business data in the business data to be monitored, it determines that all the business data to be monitored have been detected, and deletes the mark of the business data to be monitored to facilitate the next data security detection.
[0080] Step S202: The terminal device determines a first verification code of the first business data and a second verification code of the first backup data respectively through a hash algorithm.
[0081] The terminal device can use a hash algorithm to convert the first service data into a first check code of a fixed length and convert the first backup data into a second check code of a fixed length. A hash algorithm is also called a hash algorithm, which is a compression mapping function that converts an input of any length into an output of a fixed length.
[0082] Step S203: If the first verification code does not match the second verification code, the terminal device outputs a warning message.
[0083] The warning information is used to indicate that the first service data has been tampered with. The terminal device can compare the first verification code and the second verification code. If it is determined that the first verification code does not match the second verification code, for example, the first verification code is inconsistent with the second verification code, the terminal device determines that the first service data has been tampered with and sends a warning information.
[0084] If the terminal device determines that the first verification code matches the second verification code, the terminal device determines that the first service data has not been tampered with, and the terminal device can mark the first service data. Optionally, if the first service data has not been tampered with, the terminal device can also output prompt information to indicate that the first service data has not been tampered with.
[0085] As an example, after the terminal device determines that the first service data has been tampered with, the terminal device will also store the first backup data in a data recovery queue to facilitate subsequent recovery of the tampered first backup data.
[0086] In one application scenario, such as Figure 3 as well as Figure 4 As shown, the tamper-proof and recoverable module is running in the terminal device, and the encrypted data copy is the backup data. The terminal device can use the tamper-proof and recoverable module to read any service data to be monitored (an example of the first service data) from its own first database. Figure 4 The key model data in the second database is read from the second database, and the corresponding backup data in the business data is then input into the corresponding hash algorithm to generate the verification code of the business data, that is, Figure 4 The backup data corresponding to the business data is input into the hash algorithm to generate the verification code of the backup data, that is, Figure 4 The second tamper-proof verification code in.
[0087] The terminal device can also use the tamper-proof and recoverable module to compare the verification code of the business data and the verification code of the backup data to determine whether the business data has been tampered with, that is, to obtain the detection result, thereby achieving Figure 3When the terminal device determines that the first service data has been tampered with using the tamper-proof and recoverable module, the terminal device can record the result of this data security detection in a log in addition to sending an early warning message, so as to provide a log management service.
[0088] In the embodiment of the present application, when judging whether the first business data has been tampered with, the first business data is read from the first database and the first backup data corresponding to the first business data is read from the second database. The backup data is the first business data that has not been tampered with and is securely stored. In this way, the second check code of the first backup data determined based on the hash algorithm is the check code when the first business data has not been tampered with, and the first check code of the first business data is determined by the hash algorithm. By judging whether the first check code and the second check code match, it can be clear whether the first business data at the first moment has been tampered with. If the first check code and the second check code are different, it means that the data has been tampered with. Therefore, this scheme can realize the security detection of business data. In the case that the business data has been tampered with, a prompt message is output to prompt that the business data has been tampered with. This is beneficial for users to restore the tampered business data in time, thereby improving data security.
[0089] Figure 5 is a flow chart of another data security detection method in an embodiment of the present application, which can be executed by a terminal device, such as Figure 5 As shown, the method comprises the following steps:
[0090] Step S501. For details of step S501, see Figure 2 Step S201 in the illustrated embodiment is not described in detail here.
[0091] In some embodiments, before reading the first business data from the first database and reading the first backup data associated with the data identifier from the second database according to the data identifier of the first business data, the method further includes:
[0092] The terminal device reads configuration information from the information storage device; the terminal device performs initialization configuration according to the configuration information. The initialization configuration includes determining the business data to be monitored, the detection period of the business data to be monitored, loading the hash algorithm, loading the random value, loading the algorithm parameters of the hash algorithm, determining the data recovery method, loading the encryption algorithm, and determining at least one of the storage location of the backup data. The configuration information includes tampering detection strategy, tampering recovery strategy, tampering detection parameters, and encrypted copy configuration.
[0093] The terminal device is initialized and configured, and the business data to be monitored and the required hash algorithm and other information to be clearly specified during each operation of the data security detection can be clearly specified. The user does not need to repeat the device each time. When the user needs to modify the algorithm parameters or the business data to be monitored, the user only needs to modify the configuration information to implement modification operations such as tampering detection strategies for batch business data, providing users with a friendly user experience.
[0094] In some embodiments, the terminal device may also receive a configuration information modification instruction, which is used to indicate a target policy to be modified in the configuration information and a modification operation for the policy to be modified; in response to the configuration information modification instruction, the modification operation is performed on the target policy to obtain the modified configuration information. The target policy may be any one of a tampering detection policy, a tampering recovery policy, a tampering detection parameter, and an encrypted copy configuration.
[0095] exist Figure 3 In the application scenario shown, the configuration information includes tamper detection strategy, tamper recovery strategy and key business data configuration, and the key business data configuration may include encrypted copy configuration. The terminal device can use the tamper-proof and recoverable module to read the configuration information to complete the initialization configuration, that is, the initialization configuration reading. The tamper-proof and recoverable module can also be used to modify the policy in the configuration information to provide policy management services to users.
[0096] It is understandable that in order to improve the working stability of the business system, it is necessary to back up the business data of the business system. In some embodiments, the method provided in the embodiment of the present application further includes the following steps:
[0097] Step (1), the terminal device receives a data encryption backup instruction.
[0098] The data encryption backup instruction is used to indicate the business data to be backed up. The terminal device can receive the data encryption backup instruction for the business data to be backed up input by the user, or, during the initial configuration, the terminal device determines at least one business data to be backed up and the backup time period of each business data to be backed up based on the encrypted copy configuration. After the initial configuration, the terminal device is set to determine that the data encryption backup instruction has been received when it detects that any business data to be backed up has reached the backup time period.
[0099] Step (2), read the third business data at the first moment.
[0100] Among them, the third business data is any business data among the business data that need to be encrypted; the terminal device reads the third business data at the first moment from the first database, and the first moment can be the current moment when the terminal device receives the data encryption backup instruction or a historical moment. The embodiment of the present application takes the first moment as the current moment when the terminal device receives the data encryption backup instruction as an example.
[0101] Step (3), query whether backup data corresponding to the third business data is stored in the second database.
[0102] The terminal device queries the data identifier of the third business data in the data identifiers corresponding to each backup data in the second database. If the data identifier is found in the second database, it is determined that the backup data corresponding to the third business data is stored in the second database. Otherwise, it is determined that the backup data corresponding to the third business data is not stored in the second database.
[0103] Step (4): if the backup data corresponding to the third business data is not stored in the second database, a target encryption algorithm for the third business data is determined according to the encryption copy configuration.
[0104] The encrypted copy configuration includes one or more data types and an encryption algorithm corresponding to each data type. The terminal device can query the target encryption algorithm corresponding to the data type of the third business data in the encrypted copy configuration. As an example, the target encryption algorithm can be a national encryption algorithm.
[0105] Step (5), encrypt the third business data according to the target encryption algorithm to obtain third backup data corresponding to the third business data.
[0106] Step (6), storing the third backup data in the second database.
[0107] In the above embodiment, when a data encryption backup instruction is received, the third business data to be backed up can be obtained, and the target encryption algorithm corresponding to the third business data can be determined based on the encrypted copy configuration. When the backup data corresponding to the third business data does not exist in the preset storage location, it means that this backup is the first backup of the third business data. For the first backup, the target encryption algorithm of the third business data is directly determined based on the encrypted copy configuration to encrypt the third business data, thereby storing the encrypted business data in the second numerical control library. Personalized encrypted backup for different business data is achieved, the privacy and integrity of business data are guaranteed, and the security of data backup is improved. It is also convenient to detect whether the business data has been tampered with based on the backup data in the future, and when the business data has been tampered with, data recovery is performed based on the backup data in the second database, which can improve the stability and reliability of the business system.
[0108] In some embodiments, if the second database stores backup data corresponding to the third business data, the method further includes the following steps:
[0109] Step (1), the terminal device reads the third backup data corresponding to the third business data from the second database.
[0110] Step (2), the terminal device parses the third backup data to obtain at least one piece of business sub-data.
[0111] The terminal device can parse out each business sub-data in the third backup data.
[0112] In step (3), the terminal device determines, based on the third business data and each piece of business sub-data parsed, at a first moment, at least one piece of third business sub-data that is changed in the third business data compared to the third backup data.
[0113] The terminal device can compare each business sub-data of the third business data with the each business sub-data of the parsed third backup data, so as to determine the business sub-data that has increased and decreased in the third business data relative to the third backup data at the first moment, thereby obtaining at least one third business sub-data that has changed in the third business data compared to the third backup data.
[0114] Step (4): for each piece of the third service sub-data, the terminal device encrypts the third service sub-data according to a target encryption algorithm.
[0115] Step (5), updating the third backup data in the second database based on the encrypted third business sub-data.
[0116] When the terminal device determines that at least one third business sub-data has changed in the third business data relative to the third backup data, it will determine the position of each third business sub-data in the third backup data, and the terminal device will add the encrypted third business sub-data at the corresponding position of the third backup data in the second database.
[0117] As an example, when the terminal device determines that third backup data corresponding to the third business sub-data exists in the second database, it can first decrypt the third backup data and add the third business sub-data to the corresponding position of the decrypted third backup data to obtain the data to be backed up; encrypt the data to be backed up based on the target algorithm, and use the encrypted data to be backed up to overwrite the third backup data in the second database, thereby updating the third backup data in the second database.
[0118] As an example, the first database stores one or more data addition queues and data deletion queues for business data. The terminal device can add the data added in the third business data relative to the third backup data to the data addition queue of the third business data in the first database, and add the data reduced in the third business data relative to the third backup data to the data deletion queue of the third business data in the first database. It can be understood that the third business data can be the first business data at the first moment. The data addition queue and data deletion queue of the business data are recorded when backing up the business data, and after it is determined that the business data has been tampered with later, the business data can be restored based on the backup data, the data addition queue and the data deletion queue.
[0119] In the above embodiment, if the backup data corresponding to the third business data exists in the preset storage location, each third business sub-data that is changed in the third business data compared with the third backup data at the first moment is determined. Based on the target encryption algorithm corresponding to the third business data, each third business sub-data is encrypted and stored one by one in the data update queue corresponding to the third backup data, so as to realize personalized encrypted backup of different business data and differentiated backup of business data, avoid full backup every time, improve the efficiency of encrypted backup and save storage space of the storage location of backup data.
[0120] Continue to combine Figure 3 In the application scenario shown, the terminal device can use the tamper-proof and recoverable module to read at least one business data, such as remote control data, sequence control data and / or authority data, and encrypt and back up the read business data to a second database to obtain an encrypted copy corresponding to the business data, that is, the backup data corresponding to the business data, so as to provide business data management services to users.
[0121] In some embodiments, in order to improve the security of data backup, the business data will be encrypted and backed up, that is, the backup data is encrypted data. Figure 5 As shown, the terminal device determines the second verification code of the first backup data by using a hash algorithm, including steps S502 to S503:
[0122] Step S502: The terminal device decrypts the first backup data to obtain reference business data of the first business data.
[0123] The terminal device can query the encryption algorithm corresponding to the data type of the first business data in the encrypted copy configuration, and decrypt the first backup data based on the queried encryption algorithm to obtain the decrypted first backup data, and use the decrypted first backup data as the reference business data of the first business data. The encrypted copy configuration includes one or more data types, and the encryption algorithm corresponding to each data type.
[0124] Step S503: The terminal device determines the verification code of the reference business data through a hash algorithm, and uses the verification code of the reference business data as the second verification code of the first backup data.
[0125] The terminal device inputs the obtained reference service data into a hash algorithm, and uses the hash algorithm to convert the parameter service data into a check code of a fixed length, thereby obtaining a second check code.
[0126] Step S504: The terminal device determines a first verification code of the first service data through a hash algorithm.
[0127] Step S504 can be found in Figure 2 The process of determining the first verification code in step S202 in the illustrated embodiment will not be described in detail here.
[0128] As an example, the terminal device may also determine the tampering detection parameters corresponding to the first business data according to the tampering detection strategy and the data type of the first business data; the tampering detection strategy includes one or more data types, and the tampering detection parameters corresponding to each data type; the tampering detection parameters include a random value and the number of iterations; the terminal device determines the first verification code and the second verification code according to the tampering detection parameters corresponding to the first business data and the hash algorithm. The random value is a random number salt value, which is a randomly generated string that may include random uppercase and lowercase letters, numbers, characters, etc., and is usually used to enhance data security. The random value can be generated based on the random number generator of the business system.
[0129] When the terminal device generates a verification code through a hash algorithm, a random value and a number of iterations are introduced, and the random value and the first business data are used as inputs of the hash algorithm to convert the random value and the first business data into a first verification code, and to convert the random value and the first backup data (or reference business data) into a second verification code, thereby increasing the randomness of the verification code to further improve the security of the verification code and thereby improving the security of data security detection.
[0130] And / or, when generating a check code through a hash algorithm, the number of iterations is increased to improve the security of the check code. Taking reference business data as an example, the second check code currently output by the hash algorithm can be used as the input of the hash algorithm again, so that the hash algorithm can convert the input second check code and the reference business data into a first check code of a fixed length again, and this cycle is repeated until the specified number of iterations is reached.
[0131] Based on the tampering detection strategy and the data type of the first business data, the tampering detection parameters corresponding to the first business data are determined, and a first verification code and a second verification code are generated respectively, thereby realizing personalized configuration of verification codes for different business data and their corresponding backup data. This can meet the different security detection requirements of different business data, realize security detection of business data, increase the difficulty of data theft during data security detection, and improve the reliability of data security detection.
[0132] Combination Figure 4 as well as Figure 6 , the first business data and the first backup data (or parameter business data) are respectively input into the hash algorithm, and the specific process of the terminal device determining the first verification code and the second verification code respectively based on the tampering detection parameter and the hash algorithm is introduced: the terminal device preprocesses the first business data, and the preprocessing includes padding, truncation and / or blocking to process the first business data into business data composed of sub-data of fixed length. Figure 6 The first business data is divided into m sub-data from X1 to Xm.
[0133] The terminal device first inputs the sub-data X1 to Xm and the random number salt value into the hash algorithm, so that the hash algorithm converts the sub-data X1 to Xm and the random number salt value into a fixed-length output based on its own mapping function, that is, Figure 6 The terminal device then inputs the output Y1 to Yg into the hash algorithm again, so that the hash algorithm converts the input Y1 to Yg, sub-data X1 to Xm and random number salt value into a fixed-length output based on its own mapping function. This sequence is repeated N times to obtain the final tamper-proof verification code Y1 to Yg, that is, the first verification code.
[0134] The terminal device performs the first backup data (or parameter service data, i.e. Figure 4 The encrypted data copy in the first backup data (or parameter business data) performs a similar process. The terminal device will perform multiple iterations, use the last calculated check code as the input of the hash algorithm, and calculate a new check code in combination with the random value and the first backup data (or parameter business data), until the number of iterations N is reached, and the last calculated check code is used as the second check code of the first backup data.
[0135] Step S505. For details of step S505, see Figure 2 Step S203 in the illustrated embodiment is not described in detail here.
[0136] In the embodiment of the present application, the first backup data is decrypted to obtain the reference business data corresponding to the complete and untampered first business data, thereby obtaining the complete and untampered first business data. The check code of the reference business data determined by the hash algorithm is used as the second check code, so that the second check code can indicate the complete and untampered first business data, thereby judging whether the first check code and the second check code match, and accurately judging whether the first business data has been tampered with, and realizing the security detection of business data with high accuracy, and outputting warning information when it is determined that the business data has been tampered with, and timely reminding to perform data recovery can improve the security of the data.
[0137] After the business data is tampered, timely data recovery can ensure the continuity of the business, so that the business system, such as the power SCADA system, can operate normally and avoid power grid accidents. Figure 7 The embodiment of the present application also provides another data security detection method, such as Figure 7 The flowchart of another data security detection method of the embodiment of the present application is shown in FIG. 1 , which can be executed by a terminal device and includes the following steps:
[0138] Step S701: The terminal device obtains a data recovery queue.
[0139] The data recovery queue records one or more backup data corresponding to the tampered business data.
[0140] The terminal device detects a data recovery instruction, and in response to the data recovery instruction, obtains a data recovery queue and at least one data update queue from the first database. The data recovery instruction can be an instruction implemented by a user to the terminal device, or it can be an instruction triggered by the terminal device after determining that one or more business data have been tampered with.
[0141] Step S702: for any backup data in the data recovery queue, the terminal device determines a data recovery method corresponding to any backup data based on a tampering recovery strategy.
[0142] The tampering recovery strategy includes one or more data types and a data recovery method corresponding to each data type. For any backup data in the data recovery queue, the terminal device can query the data recovery method corresponding to the data type of the backup data in the tampering recovery strategy.
[0143] As an example, the data recovery method includes a data recovery time point, baseline data at the time of data recovery (the embodiment of the present application takes the baseline data as backup data as an example), and a storage location of the recovered data.
[0144] Step S703: the terminal device obtains a data update queue corresponding to any backup data from the first database.
[0145] Among them. The data update queue records one or more data that have changed in the business data corresponding to any backup data compared to any backup data. The terminal device obtains the data identifier of the business data corresponding to any backup data in the second database, and based on the obtained data identifier, queries the data update queue that has the data identifier from the first database, thereby obtaining the data update queue corresponding to any backup data.
[0146] Step S704: The terminal device restores the tampered business data corresponding to any backup data based on the data recovery method and the data update queue to obtain the restored business data.
[0147] For any backup data, the terminal device can obtain the data values of the business data corresponding to the backup data that have changed at different times from the data update queue corresponding to the backup data. The data bits of the backup data are parsed, and the business data corresponding to the backup data and the data bits of the backup data are compared. In combination with the data values that have changed at different times, the data bits and data values of the business data corresponding to the backup data that have changed at different times can be determined. The data recovery method specifies the processing object during data recovery. The embodiment of the present application takes the tampered business data as an example. After the terminal device determines the data bits and data values of the business data corresponding to the backup data that have changed at different times, the terminal device will restore the corresponding data bits and data values in the business data corresponding to the backup data.
[0148] In some embodiments, based on the data recovery method and the data update queue, restoring the tampered business data corresponding to any backup data to obtain the restored business data includes the following steps (1) to (2):
[0149] Step (1), based on the data update queue corresponding to the second backup data, at the data recovery time point, determine the data bits and data values of the second business data corresponding to the second backup data that are added and / or deleted compared to the second backup data.
[0150] The data recovery method includes a data recovery time point; the second backup data is any backup data in the data recovery queue. The terminal device can find out the data bits and data values added and / or deleted in the second business data compared with the second backup data at the current time point in the data update queue corresponding to the second backup data after the data recovery time point.
[0151] In some embodiments, based on the data update queue corresponding to the second backup data, at the data recovery time point, the data bits and data values that are added and / or deleted in the second business data corresponding to the second backup data compared to the second backup data are determined, including, at the data recovery time point, according to the data addition queue and the data deletion queue, determining the data bits and data values that are added and / or deleted in the second business data compared to the second backup data.
[0152] Among them, the data update queue includes a data addition queue and a data deletion queue. The data addition queue records one or more data added to the business data corresponding to any backup data at the same time compared with any backup data. The data deletion queue records one or more data deleted from the business data corresponding to any backup data at different times compared with any backup data.
[0153] The terminal device can determine the different moments when the second business data changes compared to the backup data from the data addition queue and the data deletion queue, and then select at least one moment after the data recovery time point from these moments. For each moment after the data recovery time point, the terminal device determines the data recorded in the data addition queue as the data bits and data values added to the second business data at that moment compared to the previous backup data in chronological order. Similarly, the terminal device determines the data recorded in the data deletion queue as the data bits and data values deleted from the second business data at that moment compared to the previous backup data in chronological order, thereby obtaining the data bits and data values added and / or deleted from the second business data compared to the second backup data.
[0154] For example, the data addition queue corresponding to the second service data is shown in Table 1 below.
[0155] Table 1
[0156] time Added data Moment 1 G4 Moment 2 G5 Moment 3 G6 Moment 4 G7
[0157] The data deletion queue corresponding to the second business data is shown in Table 2 below.
[0158] Table 2
[0159] time Deleted data Moment 2 G4 Moment 3 G2 Moment 4 G1
[0160] The second backup data is shown in Table 3 below.
[0161] Table 3
[0162] Data bits 1 2 3 4 5 6 Data Value Null Value Null Value G3 G5 G6 G7
[0163] If the data recovery time point is after moment 1 and before moment 2, the terminal device can clearly know through the data addition queue, the data deletion queue and the second backup data that the data bits and data values of the second business data that have changed between moment 2 and moment 4 compared to the second backup data are data bit 4 adding data value G5, data bit 4 deleting data value G4, data bit 5 adding data value G6, data bit 2 deleting data value G2, data bit 6 adding data value G7 and data bit 1 deleting data G1.
[0164] In the above embodiment, by combining the data in the data addition queue and the data deletion queue, the data bits and data values of the tampered business data that are added and / or deleted compared to the corresponding backup data at the data recovery time can be quickly determined, thereby achieving rapid data recovery.
[0165] Step (2), based on the data recovery method corresponding to the second backup data, the terminal device deletes the added data bits and data values and / or restores the deleted data bits and data values in the second backup data to obtain restored business data.
[0166] Continuing with the above example, the tampered second business data is shown in Table 4 below.
[0167] Table 4
[0168] Data bits 1 2 3 4 5 6 7 Data Value G8 G9 G3 G4 G6 G7 G1
[0169] After the terminal device determines the data bits and data values that have changed in the second business data compared to the second backup data between time 2 and time 4, it will delete the data values G5, G6 and G7 added in data bits 4, 5 and 6 in the second backup data, and restore the data values G1, G2 and G4 deleted in data bits 1, 2 and 4, and the restored second business data is shown in Table 5 below.
[0170] Table 5
[0171] Data bits 1 2 3 4 5 6 Data Value G1 G2 G3 G4 Null Value Null Value
[0172] In the above embodiment, when performing data recovery, the data bits and data values that are added and / or deleted in the second business data compared to the second backup data are determined at the data recovery time point. In this way, data that has changed in the business data that has been tampered with after the data recovery time point compared to the backup data can be obtained, and then based on the data recovery method corresponding to the backup data, the added data bits and data values are deleted and / or the deleted data bits and data values are restored in the tampered business data, and safe business data that has not been tampered with can be obtained, so that the business system can continue to run the business based on the restored business data, thereby ensuring the continuity of the business and enabling the business system, such as the power SCADA system, to operate normally and avoid causing power grid accidents.
[0173] Step S705: The terminal device stores the restored business data as the business data at the current moment in the first database.
[0174] The terminal device stores the restored business data as the business data at the current moment in the first database, thereby completing the data recovery operation on the tampered business data.
[0175] In one application scenario, combined with Figure 3 as well as Figure 8 Taking the power SCADA system as an example, the core of the terminal equipment to realize data security detection is the anti-tampering and recoverable module. The input information of this module includes remote control data, sequential control data, and Figure 7 The sequence control data, authority data, anti-error data, tampering detection strategy, tampering recovery strategy, monitoring business data range and encrypted copy configuration, the monitoring business data range specifies at least one business data to be monitored, which can also be set by the tampering detection strategy.
[0176] The process of the terminal device using the tamper-proof and recoverable module to perform data security detection including data recovery on the business data in the first database of the power SCADA system based on the hash algorithm may include the following steps:
[0177] Step 1: Read the configuration information to initialize the configuration.
[0178] Step 2: Read the key business data table data of the database, that is, the business data, load and parse the encrypted data copy, obtain the corresponding table data, and determine if there are any added entries, that is, added data, and add (the added data) to the data addition queue; if there are any deleted entries, that is, deleted data, (the deleted data) is added to the data deletion queue.
[0179] Step 3: When performing data security detection, decrypt each data item of the backup data corresponding to the business data, that is, decrypt the backup data, and update the decrypted backup data according to the data update queue to obtain the reference business data; use the hash algorithm to determine whether the data is complete or abnormal, that is, use the hash algorithm to determine the checksums of the business data and the reference business data respectively, and determine whether the checksums of the two match to determine whether the business data has been tampered with. If tampered with, send an early warning message to notify the operation and maintenance personnel, and add the backup data to the data recovery queue.
[0180] Step 4: Read other key business data table data in the first database, that is, obtain other business data that needs to be monitored, and repeat the above Step 1-Step 3 until all business data that needs to be monitored are processed.
[0181] Step 5: Process the data items in the data adding queue, the data deleting queue, and the data recovery queue in sequence to perform data recovery, that is, perform data recovery based on the data recovery queue and the data updating queue.
[0182] Or, if Figure 8 As shown, when it is determined that a certain business data has been tampered with, the backup data corresponding to the business data, i.e. Figure 8 The encrypted data copy in the , restores the business data, and detects the next business data.
[0183] In the embodiment of the present application, the backup data corresponding to the tampered business data is recorded in the data recovery queue, and the data update queue corresponding to any backup data records one or more data of one or more business data that have changed compared to the corresponding backup data. Then, based on the data update queue and the data recovery method corresponding to any backup data, the personalized restoration of different tampered business data can be realized, and the different security detection requirements of different business data can be met while the tampered business data can be restored in time, which can ensure the continuity of the business. In addition, when restoring data, it is restored based on the safe and complete backup data, which ensures the privacy and integrity of the restored business data, and stores the restored business data as the business data at the current moment in the first database, which improves the security of data storage, thereby ensuring that the business system, such as the power SCADA system, runs reliably and stably.
[0184] Fig. 9 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application. Figure 8 As shown, the terminal device 9 of this embodiment includes: at least one processor 90 ( Fig. 9 Only one is shown in the figure) a processor, a memory 91, and a computer program 92 stored in the memory 91 and executable on the at least one processor 90, and when the processor 90 executes the computer program 92, the steps in any of the above-mentioned data case detection method embodiments are implemented.
[0185] The terminal device 9 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device may include, but is not limited to, a processor 90 and a memory 91. Those skilled in the art will appreciate that Fig. 9 It is only an example of the terminal device 9 and does not constitute a limitation on the terminal device 9. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0186] The processor 90 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0187] In some embodiments, the memory 91 may be an internal storage unit of the terminal device 9, such as a hard disk or memory of the terminal device 9. In other embodiments, the memory 91 may also be an external storage device of the terminal device 9, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card (FlashCard), etc. equipped on the terminal device 9. Further, the memory 91 may also include both an internal storage unit of the terminal device 9 and an external storage device. The memory 91 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program. The memory 91 may also be used to temporarily store data that has been output or is to be output.
[0188] Corresponding to the data security detection method described in the above embodiment, Fig.10 A structural block diagram of a data security detection device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.
[0189] Reference Fig.10 , the device comprises:
[0190] A reading module 1010, configured to read first business data from a first database and read first backup data associated with a data identifier from a second database according to a data identifier of the first business data;
[0191] A determination module 1020, configured to determine a first verification code of the first business data and a second verification code of the first backup data respectively by using a hash algorithm;
[0192] In the case that the first verification code does not match the second verification code, the output module 1030 is used to output warning information, where the warning information is used to indicate that the first business data has been tampered with.
[0193] In some embodiments, the apparatus further comprises:
[0194] An acquisition module, used for acquiring a data recovery queue, in which one or more backup data corresponding to tampered business data are recorded;
[0195] The determination module is further used to determine, for any backup data in the data recovery queue, a data recovery method corresponding to any backup data based on the tampering recovery strategy;
[0196] The acquisition module is further used to acquire a data update queue corresponding to any backup data from the first database, wherein the data update queue records one or more data of business data corresponding to any backup data that have changed compared to any backup data;
[0197] A restoration module, used to restore the tampered business data corresponding to any backup data based on the data recovery method and the data update queue, to obtain the restored business data;
[0198] The storage module is used to store the restored business data as the business data at the current moment in the first database.
[0199] In some embodiments, the data recovery method includes a data recovery time point, and the restoration module is further used to:
[0200] Based on the second backup data, in some embodiments, according to the corresponding data update queue, at the data recovery time point, the data bits and data values of the second business data corresponding to the second backup data are determined to be added and / or deleted compared to the second backup data; the second backup data is any backup data in the data recovery queue;
[0201] Based on the data recovery method corresponding to the second backup data, the added data bits and data values are deleted and / or the deleted data bits and data values are restored in the second backup data to obtain the restored business data.
[0202] In some embodiments, the data update queue includes a data addition queue and a data deletion queue, the data addition queue records one or more data added by the business data corresponding to any backup data at the same time compared with any backup data, and the data deletion queue records one or more data deleted by the business data corresponding to any backup data at different times compared with any backup data; the determination module is further used to:
[0203] At the data recovery time point, the data bits and data values added and / or deleted from the second business data compared to the second backup data are determined according to the data addition queue and the data deletion queue.
[0204] In some embodiments, the determination module is further configured to:
[0205] Decrypting the first backup data to obtain reference business data of the first business data;
[0206] The check code of the reference business data is determined by a hash algorithm, and the check code of the reference business data is used as the second check code of the first backup data.
[0207] In some embodiments, the apparatus further comprises:
[0208] A receiving module, used for receiving a data encryption backup instruction, where the data encryption backup instruction is used for indicating the business data to be backed up;
[0209] The reading module is further used to read the third business data at the first moment; the third business data is any business data among the business data to be backed up;
[0210] A query module, used for querying whether the second database stores backup data corresponding to the third business data;
[0211] The second database does not store backup data corresponding to the third business data, and the determination module is further used to determine the target encryption algorithm of the third business data according to the encryption copy configuration;
[0212] An encryption module, used for encrypting the third business data according to a target encryption algorithm to obtain third backup data corresponding to the third business data;
[0213] The storage module is further used to store the third backup data in the second database.
[0214] In some embodiments, the second database stores backup data corresponding to the third business data, and the device further includes:
[0215] The reading module is further used to read the third backup data corresponding to the third business data from the second database;
[0216] The parsing module is further used to parse the third backup data to obtain at least one piece of business sub-data;
[0217] The determination module is further used to determine, at a first moment, at least one third business sub-data that is changed in the third business data compared to the third backup data based on the third business data and each piece of business sub-data parsed;
[0218] The encryption module is further used to encrypt the third business sub-data according to the target encryption algorithm for each piece of the third business sub-data;
[0219] The updating module is used to update the third backup data in the second database based on the encrypted third business sub-data.
[0220] Each of the above modules can be integrated into the above terminal device. It should be noted that the information interaction, execution process and other contents between the above devices / units are based on the same concept as the method embodiment of the present application, and their specific functions and technical effects can be found in the method embodiment section, which will not be repeated here.
[0221] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0222] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0223] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0224] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0225] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0226] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0227] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0228] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0229] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A data security detection method, characterized in that: The method comprises: Reading first business data from a first database and, according to a data identifier of the first business data, reading first backup data associated with the data identifier from a second database; Determine a first verification code of the first business data and a second verification code of the first backup data respectively by using a hash algorithm; If the first verification code does not match the second verification code, a warning message is output, where the warning message is used to prompt that the first business data has been tampered with.
2. The method according to claim 1, characterized in that The method further comprises: Acquire a data recovery queue, wherein the data recovery queue records backup data corresponding to one or more tampered business data; For any backup data in the data recovery queue, based on the tampering recovery strategy, determine a data recovery method corresponding to any backup data; Acquire a data update queue corresponding to any backup data from the first database, wherein the data update queue records one or more data of business data corresponding to any backup data that has changed compared with any backup data; Based on the data recovery method and the data update queue, restore the tampered business data corresponding to any of the backup data to obtain the restored business data; The restored business data is stored in the first database as the business data at the current moment.
3. The method according to claim 2, characterized in that The data recovery method includes a data recovery time point, and based on the data recovery method and the data update queue, restoring the tampered business data corresponding to any backup data to obtain the restored business data includes: Based on the data update queue corresponding to the second backup data, determining, at the data recovery time point, data bits and data values of the second business data corresponding to the second backup data that are added and / or deleted compared to the second backup data; the second backup data is any backup data in the data recovery queue; Based on the data recovery mode corresponding to the second backup data, the added data bits and data values are deleted and / or the deleted data bits and data values are restored in the second backup data to obtain the restored business data.
4. The method according to claim 3, characterized in that The data update queue includes a data addition queue and a data deletion queue, wherein the data addition queue records one or more data added to the business data corresponding to any of the backup data at the same time compared to any of the backup data, and the data deletion queue records one or more data deleted from the business data corresponding to any of the backup data at different times compared to any of the backup data; The determining, based on the data update queue corresponding to the second backup data, at the data recovery time point, data bits and data values of the second business data corresponding to the second backup data that are added and / or deleted compared to the second backup data includes: At the data recovery time point, data bits and data values added and / or deleted from the second business data compared to the second backup data are determined according to the data addition queue and the data deletion queue.
5. The method according to any one of claims 1 to 4, characterized in that: Determining a second verification code of the first backup data by using a hash algorithm includes: decrypting the first backup data to obtain reference business data of the first business data; The verification code of the reference business data is determined by a hash algorithm, and the verification code of the reference business data is used as a second verification code of the first backup data.
6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: Receiving a data encryption backup instruction, wherein the data encryption backup instruction is used to indicate the business data to be backed up; Reading the third business data at the first moment; the third business data is any business data among the business data to be backed up; Querying whether the second database stores backup data corresponding to the third business data; If the second database does not store backup data corresponding to the third business data, determining a target encryption algorithm for the third business data according to the encryption copy configuration; Encrypt the third business data according to the target encryption algorithm to obtain third backup data corresponding to the third business data; The third backup data is stored in the second database.
7. The method according to claim 6, characterized in that The second database stores backup data corresponding to the third business data, and the method further includes: Reading third backup data corresponding to the third business data from the second database; Parsing the third backup data to obtain at least one piece of business sub-data; According to the third business data and each piece of business sub-data parsed out, at the first moment, determining at least one piece of third business sub-data that is changed in the third business data compared with the third backup data; For each piece of third business sub-data, encrypt the third business sub-data according to the target encryption algorithm; Based on the encrypted third business sub-data, the third backup data in the second database is updated.
8. A data security detection device, characterized in that: The device comprises: A reading module, configured to read first business data from a first database and, according to a data identifier of the first business data, obtain first backup data associated with the data identifier from a second database; A determination module, used to determine a first verification code of the first business data and a second verification code of the first backup data respectively through a hash algorithm; The first verification code does not match the second verification code, and the output module is used to output warning information, where the warning information is used to prompt that the first business data has been tampered with.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
