Data verification method and system suitable for embedded software platform
By using dynamic data link lists and data verification codes on the embedded software platform, the problem of data tampering is solved, data protection efficiency and security are improved, and the risk of failure of relay protection devices is reduced.
Patent Information
- Application Number
- CN202311132381.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-01
- Publication Date
- 2025-03-04
AI Technical Summary
In the prior art, data on the embedded software platform is easily tampered, resulting in the failure of the relay protection device and the risk of power accidents and safety hazards.
A dynamic data link list is used to uniformly manage the data blocks that need to be verified, generate data verification codes and store them in the verification data blocks, and detect tampering of the data blocks by comparing the verification codes.
It improves the protection efficiency of data blocks, enhances data security, reduces the risk of failure of relay protection devices, and ensures the safety of power grid operation.
Smart Images

Figure CN119557924A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of relay protection operation and maintenance and intelligent management, and in particular relates to a data verification method and system suitable for an embedded software platform. Background Art
[0002] During the operation of the embedded software platform related to relay protection, there are some global variables or data blocks whose data do not change or change very rarely, such as the input threshold setting and output self-check mask in the intelligent input and output plug-in program. When the above data is maliciously tampered with, the relay protection device may fail. Failure of several protection points can easily lead to major power accidents, which will not only cause economic losses, but also pose safety risks to the operation of the power grid. Summary of the invention
[0003] The purpose of the present invention is to provide a data verification method and system suitable for an embedded software platform, so as to solve the technical problem in the prior art that data is tampered with, which easily causes the risk of failure of a relay protection device.
[0004] To achieve the above purpose, the present invention provides a data verification method and system for an embedded software platform. The technical solution is:
[0005] A data verification method suitable for an embedded software platform comprises the following steps: establishing a dynamic data linked list, inserting a data block to be verified into the dynamic data linked list, generating a data verification code of the corresponding data block for each data block inserted into the dynamic data linked list, and storing the data verification code in a verification data block; setting a verification mode for the inserted data block, and starting data verification for the data block according to the verification mode; when starting data verification for the data block, generating a verification code for the data block, and comparing the verification code with the data verification code of the data block stored in the verification data block; when the two data verification codes are the same, the data block has not been tampered with, and when the two data verification codes are different, the data block has been tampered with.
[0006] The beneficial effect is: the data blocks that need to be protected are uniformly protected through the dynamic data linked list, thereby improving the efficiency of data block protection. The data blocks that need to be verified are inserted into the dynamic data linked list, and a data verification code of the corresponding data block is generated for each data block inserted into the dynamic data linked list, which is used to verify whether the data block has been tampered with. For each inserted data block, a data verification code of the corresponding data block needs to be generated, and it is stored in the verification data block to improve the data basis for subsequent verification. When the data block needs data verification, the data verification code in the verification data block is compared with the data verification code generated in the corresponding data block. When the data verification codes of the two data blocks are the same, the data block has not been tampered with. When the data verification codes of the two data blocks are different, the data block has been tampered with.
[0007] Since the dynamic data chain is a dynamic data structure, the dynamic data chain table does not need an initial size. The chain table can dynamically adjust the size according to the amount of stored data, which ensures that the dynamic data chain table can adapt to any size of data that needs to be verified; secondly, the chain table has the advantage of easy insertion of data, ensuring that the data block can be quickly inserted into the chain table, quickly completing the storage of the verification data block, and improving the efficiency of the verification system. The chain table also has the advantage of high memory utilization, avoiding the data verification system from wasting memory and saving memory resources. The reliability of tampering inspection is improved through the data verification code, ensuring the security of the data block data, and thus improving the security of the corresponding relay protection device system.
[0008] As a further improvement, the above verification mode includes automatically starting data verification according to a set period and actively starting data verification according to a received start instruction.
[0009] As a further improvement, when the data block size is greater than a set threshold, a check code is calculated based on the data block data, and the calculated check code is used as the data check code of the data block; when the data block size is less than or equal to the set threshold, the data of the data block itself is used as the data check code of the data block.
[0010] The beneficial effect is that the calculated check code has a large calculation overhead and a low storage overhead compared to the original data of the data block. Therefore, when the data block size is large, the calculated check code is used as the data check code to reduce the storage overhead. When the data block size is small, the original data of the data block is used as the data check code to reduce the calculation overhead.
[0011] As a further improvement, when the data of a data block changes, it is necessary to perform a data update operation on the corresponding data block. After the data block in the dynamic data linked list is updated, the data check code of the corresponding data block is regenerated and stored in the check data block.
[0012] The beneficial effect is that after each update operation on a data block, it is necessary to re-acquire the data verification code of the corresponding data block to provide a data basis for verifying the corresponding data block.
[0013] As a further improvement, the dynamic data linked list also includes a data block operation lock, which is used to lock the data block that is being inserted or updated, and prohibit starting data verification for the data block in the locked state.
[0014] The beneficial effect is: the conflict between the insertion or update operation and the data verification is resolved by the operation lock, thereby ensuring the reliability of the data verification.
[0015] As a further improvement, the check data block is stored in the first node of the dynamic data linked list.
[0016] The beneficial effect is that storing the verification data block in the first node of the dynamic data linked list facilitates querying related data from the verification data block, thereby improving the efficiency of verification.
[0017] As a further improvement, each data block inserted into the dynamic data linked list is stored in the last node of the current dynamic linked list.
[0018] As a further improvement, when it is verified that a data block has been tampered with, the data stored in the data block after the last update operation is assigned to the data block.
[0019] The beneficial effect is: by reassigning data blocks, malicious tampering is eliminated, thereby eliminating the security risks caused by malicious tampering.
[0020] The present invention also discloses a data verification system applicable to an embedded software platform. The system comprises a processor, and the processor is used for processing any one embodiment of the above-mentioned data verification method applicable to an embedded software platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 It is a structural schematic diagram of a data verification method applicable to an embedded software platform of the present invention;
[0022] Figure 2 The figure is a flow chart of a data verification method applicable to an embedded software platform according to the present invention. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical scheme and advantages of the present invention clearer, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention, that is, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0024] Data verification method embodiment applicable to embedded software platform:
[0025] like Figure 1 , 2 The data verification method applicable to the embedded software platform shown includes the following steps:
[0026] 1) Establish a dynamic data linked list, insert the data blocks to be verified into the dynamic data linked list, generate a data verification code for each data block inserted into the dynamic data linked list, and store the data verification code in the verification data block.
[0027] The data structure of the dynamic data linked list includes the number of nodes in the data linked list, the first and last addresses of the data linked list, the pointer of the current check node and the data linked list operation lock. One data block corresponds to one node, and the data structure of the data block includes the first and last addresses of the data block, the length of the data block, the description of the data block, the module to which the data block belongs and the data check code.
[0028] Each data block inserted into the dynamic data linked list is stored in the last node of the current dynamic linked list, and the check data block is stored in the first node of the dynamic data linked list.
[0029] When the data block size is greater than the set threshold, the check code is calculated based on the data block data, and the check code is used as the data check code of the data block; when the data block is less than or equal to the set threshold, the data of the data block itself is used as the data check code of the data block. The data check code calculated here is calculated using the CRC algorithm, and other check code algorithms can also be used.
[0030] Then there are two types of data check codes, one is the CRC check code, and the other is the data of the data block itself; when the data block size is greater than the set threshold, the CRC check code is calculated based on the data block data, and the CRC check code is used as the data check code of the data block; when the data block is less than or equal to the set threshold, the data of the data block itself is used as the data check code of the data block. The CRC check code has a large calculation overhead and a low storage overhead compared to the original data of the data block. Therefore, when the data block size is large, the CRC check code is used as the data check code to reduce the storage overhead, and when the data block size is small, the original data of the data block is used as the data check code to reduce the calculation overhead. Here, the CRC check code is calculated using the CRC16 algorithm to improve the reliability of the check, and the corresponding set threshold is four bytes.
[0031] The dynamic data linked list also includes a data block operation lock, which is used to lock the data block that is being inserted or updated. When starting data verification for a data block in a locked state, the data verification will fail. The data block operation lock can solve the problem of operation conflicts under multi-tasking. The conflict refers to the conflict between the insertion or update operation and the data verification, ensuring the reliability of the data verification.
[0032] 2) Set a verification mode for the inserted data block and start data verification for the data block according to the verification mode. The verification mode includes automatically starting data verification according to the set cycle and actively starting data verification according to the received start instruction. When the current time meets the preset cycle requirements or receives the user verification start instruction, start data verification to verify whether the corresponding data block has been tampered with.
[0033] 3) When starting data verification for a data block, obtain the data verification code of the data block from the verification data block and compare it with the data verification code generated in the corresponding data block. When the data verification codes of the two data blocks are the same, the data block has not been tampered with. When the data verification codes of the two data blocks are different, the data block has been tampered with.
[0034] 4) When the data of a data block changes, it is necessary to perform a data update operation on the corresponding data block. After the data block in the dynamic data linked list is updated, the data check code of the corresponding data block is regenerated and stored in the check data block.
[0035] When updating a data block, the data of the user input data block generally includes information such as the address, length, description and module of the data block, and the corresponding data block is locked through this information; or a unique identifier can be set for the data block to identify the corresponding data block through the unique identifier.
[0036] 5) When it is verified that a data block has been tampered with, the data after the last update operation stored in the data block is assigned to the data block.
[0037] In addition, it is forbidden to delete data blocks in the dynamic data chain. If the data blocks in the dynamic data chain can be deleted, then the person who tampers with the data can directly delete the data block in the dynamic data chain, and the system will think that the data block does not need to be verified, and then the system will not monitor whether the data block has been tampered with. Therefore, the data block in the dynamic data chain cannot be deleted to improve the security of the system.
[0038] The present invention firstly manages the data blocks that need to be verified in a unified manner through a dynamic storage linked list, thereby improving the speed of data verification; secondly, the data blocks storing the data verification codes are stored in the dynamic linked list, so as to facilitate and quickly find the corresponding data verification codes to complete the verification; next, different data verification codes are selected according to the size of the data block to complete the data verification, thereby reducing the overhead of data calculation and storage; finally, the problem of operation conflict under multi-tasking can be solved through the data block operation lock.
[0039] Data verification system embodiment applicable to embedded software platform:
[0040] The data verification system applicable to the embedded software platform includes a processor, which is used to process the embodiment of the data verification method applicable to the embedded software platform. This embodiment refers to the embodiment of the data verification method applicable to the embedded software platform, and will not be repeated here.
[0041] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention is described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions recorded in the aforementioned embodiments without creative work, or replace some of the technical features therein with equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention shall be included in the protection scope of the present invention.
Claims
1. A data verification method suitable for an embedded software platform, characterized in that: The method comprises the following steps: establishing a dynamic data linked list, inserting a data block to be verified into the dynamic data linked list, generating a data verification code of a corresponding data block for each data block inserted into the dynamic data linked list, and storing the data verification code in a verification data block; Set the verification mode for the inserted data block, and start data verification for the data block according to the verification mode; When data verification is started for a data block, a verification code for the data block is generated, and the verification code is compared with the data verification code of the data block stored in the verification data block. When the two data verification codes are the same, the data block has not been tampered with. When the two data verification codes are different, the data block has been tampered with.
2. The data verification method applicable to an embedded software platform according to claim 1, characterized in that: The verification mode includes automatically starting data verification according to a set period and actively starting data verification according to a received starting instruction.
3. The data verification method applicable to an embedded software platform according to claim 1, characterized in that: When the size of a data block is greater than a set threshold, a check code is calculated based on the data block data and used as the data check code for the data block; when the size of a data block is less than or equal to the set threshold, the data block data itself is used as the data check code for the data block.
4. The data verification method applicable to an embedded software platform according to claim 3, characterized in that: When the data of a data block changes, it is necessary to perform a data update operation on the corresponding data block. After the data block in the dynamic data linked list is updated, the data check code of the corresponding data block is regenerated and stored in the check data block.
5. The data verification method applicable to an embedded software platform according to claim 4, characterized in that: The dynamic data linked list also includes a data block operation lock, which is used to lock the data block that is being inserted or updated, and prohibit starting data verification for the data block in the locked state.
6. The data verification method applicable to an embedded software platform according to claim 2, characterized in that: The verification data block is stored in the first node of the dynamic data linked list.
7. The data verification method applicable to an embedded software platform according to claim 6, characterized in that: Each data block inserted into the dynamic data linked list is stored in the last node of the current dynamic linked list.
8. The data verification method applicable to an embedded software platform according to any one of claims 1 to 7, characterized in that: When it is verified that a data block has been tampered with, the data after the last update operation stored in the data block is assigned to the data block.
9. A data verification system suitable for an embedded software platform, characterized in that: The system includes a processor, which is used to process any one of the data verification methods described in claims 1-8 that is applicable to an embedded software platform.