Data file verification method, device and equipment and readable storage medium

By selecting the appropriate verification strategy for verification based on the record block type for the complex structure of the new regulations, the problem of file size and legality verification is solved, and the comprehensive integrity and legality verification of the new regulations record files is achieved. Test.

CN118916922APending Publication Date: 2024-11-08DONGFENG AUTOMOBILE ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410936848.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-11-08

AI Technical Summary

Technical Problem

The new GB/T 19056-2021 regulations record the complex structure and large file size of files, making it difficult to realize data file integrity and legality verification.

Method used

Determine the target verification control strategy from the preset verification control strategy set according to the record block type, including file size verification, block length verification, time stamp verification, exclusive OR verification, correspondence verification and signature verification by determining the target verification strategy from the preset verification control strategy set, including file size verification, block length verification, and time stamp verification, and the following Verify, conduct comprehensive verification of the starting recording block, data recording block and verification recording block.

Benefits of technology

The integrity and legality verification of new regulations records documents has been effectively realized to ensure the legality and integrity of documents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118916922A_ABST
    Figure CN118916922A_ABST
Patent Text Reader

Abstract

A data file verification method, apparatus and device, and a readable storage medium, relate to the technical field of data processing, and comprise: when it is detected that a file name of a target driving record file meets a file naming requirement, aiming at each target record block in a target data record file in the target driving record file, performing file naming operation on each target record block in the target data record file; determining a target verification control strategy of the target record block from a preset verification control strategy set according to the record block type of the target record block, the record block type including a starting record block, a data record block and a verification record block, the verification control strategy set comprises a file size verification control strategy, a block length verification control strategy, a timestamp verification control strategy, an XOR verification control strategy, a correspondence verification control strategy and a signature verification control strategy; and on the basis of the target verification control strategy, performing verification control of integrity and / or legality on the target record block corresponding to the target verification control strategy so as to effectively realize verification of integrity and legality of the new regulation record file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data file verification method, device, equipment and readable storage medium. Background Art

[0002] At present, the old GB / T 19056-2012 regulatory standard corresponding to the vehicle driving recorder has been replaced by the new GB / T19056-2021 regulatory standard, and the format of the new regulatory record file has been completely changed compared to the old regulatory record file. Among them, the regulatory file data of GB / T 19056-2012 can be combined according to the corresponding format, and its record file size does not exceed 1M; while in GB / T 19056-2021, each block record not only adds SM3 (a cryptographic hash function standard) signature encryption, but also the generation of encrypted data of the latter block depends on the adjacent previous data block to form a mutually dependent serial structure. In addition, the starting block at the head of the data file also records the information of all blocks, and other data blocks themselves also have timestamp size and other verification information, and the data block record will be overwritten from the first data block after reaching the maximum; it can be seen that the file structure of the new regulatory record file is very complex, so that the generated file size may reach about 40M, which is 40 times that of the old regulatory record file. Therefore, faced with new regulatory record files with such a large amount of data and such a complex file structure, how to effectively verify their integrity and legality is an issue that needs to be addressed urgently. Summary of the invention

[0003] The present application provides a data file verification method, device, equipment and readable storage medium, which can effectively verify the integrity and legality of new regulatory record files.

[0004] In a first aspect, an embodiment of the present application provides a data file verification method, the data file verification method comprising:

[0005] When it is detected that the file name of the target driving record file meets the file naming requirement, for each target record block in the target data record file in the target driving record file, a target verification control strategy of the target record block is determined from a preset verification control strategy set according to the record block type of the target record block, the record block type includes a start record block, a data record block and a verification record block, and the verification control strategy set includes a file size verification control strategy, a block length verification control strategy, a timestamp verification control strategy, an XOR verification control strategy, a correspondence verification control strategy and a signature verification control strategy;

[0006] Based on the target verification control strategy, the integrity and / or legality of the corresponding target record block is verified and controlled.

[0007] In combination with the first aspect, in one implementation, determining a target verification control strategy for the target record block from a preset verification control strategy set according to the record block type of the target record block includes:

[0008] When the record block type of the target record block is a start record block, the target check control strategy includes a file size check control strategy, a block length check control strategy and an XOR check control strategy;

[0009] When the record block type of the target record block is a data record block, the target check control strategy includes a block length check control strategy, a timestamp check control strategy, an XOR check control strategy and a correspondence check control strategy;

[0010] When the record block type of the target record block is a verification record block, the target check control strategy includes a block length check control strategy, a timestamp check control strategy, an XOR check control strategy and a signature check control strategy.

[0011] In combination with the first aspect, in one implementation, the file size verification control strategy includes comparing whether the total number of file bytes stored in the starting record block is equal to the actual number of file bytes of the data record file. If they are not equal, the legality of the control output is illegal.

[0012] In combination with the first aspect, in one embodiment, the block length check control strategy includes determining the target starting position of the next record block based on the block length of the current record block, and comparing whether the target starting position is the same as the actual starting position of the next record block. If different, the legality of the control output is illegal; the XOR check control strategy includes comparing whether the XOR check value stored in the record block is the same as the actual XOR check value obtained after the XOR check calculation based on the data in the record block. If different, the legality of the control output is illegal.

[0013] In combination with the first aspect, in one embodiment, the timestamp verification control strategy includes: for a data record block, when the data record block is the last data record block in the target data record file, determining whether the timestamp of the data record block is a maximum value, if not, controlling the output integrity to be incomplete; for a verification record block, determining whether the difference between the timestamp of the first data record block corresponding to the verification record block and the timestamp of the verification record block is less than a preset time difference threshold and whether the timestamp of the verification record block is later than the timestamp of the last data record block corresponding to the verification record block, if not, controlling the output legality to be illegal.

[0014] In combination with the first aspect, in one implementation, the correspondence verification control strategy includes determining whether a data record block has a corresponding verification record block, and if not, controlling the output legitimacy to be illegal.

[0015] In combination with the first aspect, in one embodiment, the signature verification control strategy includes comparing whether the signature value stored in the verification record block is equal to the actual signature value. If not, the legality of the control output is illegal. The actual signature value is a signature value obtained after encryption calculation based on the random value stored in the starting record block and the data in all data record blocks corresponding to the verification record block.

[0016] In a second aspect, an embodiment of the present application provides a data file verification device, the data file verification device comprising:

[0017] a processing module, which is used to determine, for each target record block in the target data record file in the target driving record file, a target verification control strategy of the target record block from a preset verification control strategy set according to the record block type of the target record block when it is detected that the file name of the target driving record file meets the file naming requirement, wherein the record block type includes a start record block, a data record block and a verification record block, and the verification control strategy set includes a file size verification control strategy, a block length verification control strategy, a timestamp verification control strategy, an XOR verification control strategy, a correspondence verification control strategy and a signature verification control strategy;

[0018] A verification module is used to perform integrity and / or legality verification control on a corresponding target record block based on the target verification control strategy.

[0019] In conjunction with the second aspect, in one implementation, the processing module is specifically configured to:

[0020] When the record block type of the target record block is a start record block, the target check control strategy includes a file size check control strategy, a block length check control strategy and an XOR check control strategy;

[0021] When the record block type of the target record block is a data record block, the target check control strategy includes a block length check control strategy, a timestamp check control strategy, an XOR check control strategy and a correspondence check control strategy;

[0022] When the record block type of the target record block is a verification record block, the target check control strategy includes a block length check control strategy, a timestamp check control strategy, an XOR check control strategy and a signature check control strategy.

[0023] In combination with the second aspect, in one implementation, the file size verification control strategy includes comparing whether the total number of file bytes stored in the starting record block is equal to the actual number of file bytes of the data record file. If they are not equal, the legality of the control output is illegal.

[0024] In combination with the second aspect, in one embodiment, the block length check control strategy includes determining the target starting position of the next record block based on the block length of the current record block, and comparing whether the target starting position is the same as the actual starting position of the next record block. If different, the legality of the control output is illegal; the XOR check control strategy includes comparing whether the XOR check value stored in the record block is the same as the actual XOR check value obtained after the XOR check calculation based on the data in the record block. If different, the legality of the control output is illegal.

[0025] In combination with the second aspect, in one embodiment, the timestamp verification control strategy includes: for a data record block, when the data record block is the last data record block in the target data record file, determining whether the timestamp of the data record block is a maximum value, if not, controlling the output integrity to be incomplete; for a verification record block, determining whether the difference between the timestamp of the first data record block corresponding to the verification record block and the timestamp of the verification record block is less than a preset time difference threshold and whether the timestamp of the verification record block is later than the timestamp of the last data record block corresponding to the verification record block, if not, controlling the output legality to be illegal.

[0026] In combination with the second aspect, in one implementation, the correspondence verification control strategy includes determining whether a data record block has a corresponding verification record block, and if not, controlling the output legitimacy to be illegal.

[0027] In combination with the second aspect, in one embodiment, the signature verification control strategy includes comparing whether the signature value stored in the verification record block is equal to the actual signature value. If not, the legality of the control output is illegal. The actual signature value is a signature value obtained after encryption calculation based on the random value stored in the starting record block and the data in all data record blocks corresponding to the verification record block.

[0028] In a third aspect, an embodiment of the present application provides a data file verification device, which includes a processor, a memory, and a data file verification program stored in the memory and executable by the processor, wherein when the data file verification program is executed by the processor, the steps of the data file verification method as described above are implemented.

[0029] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a data file verification program is stored, wherein when the data file verification program is executed by a processor, the steps of the aforementioned data file verification method are implemented.

[0030] The beneficial effects brought by the technical solution provided in the embodiments of the present application include:

[0031] For the target driving record file whose file name meets the file naming requirements, multiple strategies including file size verification control strategy, block length verification control strategy, timestamp verification control strategy, XOR verification control strategy, correspondence verification control strategy and signature verification control strategy are combined according to the record block type to form different verification control strategies to perform comprehensive integrity and / or legality verification control on each target record block in the target data record file in the target driving record file, thereby effectively realizing the verification of the integrity and legality of the new regulatory record file. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] Figure 1 This is a flow chart of an embodiment of a data file verification method of the present application;

[0033] Figure 2 This is a schematic diagram of the data recording file structure involved in the embodiment of the present application;

[0034] Figure 3 This is a schematic diagram of the target data block structure involved in the embodiment of the present application;

[0035] Figure 4 A schematic diagram of a specific process of verifying a data file involved in an embodiment of the present application;

[0036] Figure 5 This is a schematic diagram of the hardware structure of the data file verification device involved in the embodiment of the present application. DETAILED DESCRIPTION

[0037] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0039] In a first aspect, an embodiment of the present application provides a data file verification method.

[0040] In one embodiment, referring to Figure 1 , Figure 1 This is a flow chart of an embodiment of the data file verification method of this application. Figure 1 As shown, the data file verification method includes:

[0041] Step S10: when it is detected that the file name of the target driving record file meets the file naming requirement, for each target record block in the target data record file in the target driving record file, a target verification control strategy of the target record block is determined from a preset verification control strategy set according to the record block type of the target record block, the record block type includes a start record block, a data record block and a verification record block, and the verification control strategy set includes a file size verification control strategy, a block length verification control strategy, a timestamp verification control strategy, an XOR verification control strategy, a correspondence verification control strategy and a signature verification control strategy;

[0042] Exemplarily, it can be understood that the recorder stores driving record data through the file system to generate a driving record file; wherein the name of the driving record file is unique, and the driving record file includes two types: data record file and audio and video record file. For the data record file, it includes: a) driving status record file; b) accident suspicious record file; c) overtime driving record file; d) driver information record file; e) log record file.

[0043] See also Figure 2 As shown, each data record file includes a starting record block and several data record blocks and verification record blocks, so the record block types in the data record file include starting record blocks, data record blocks and verification record blocks; wherein the record block type can be identified by a preset block mark. It should be noted that the starting record block refers to the header information part of the data record file, which stores the total number of bytes of the file, the random value used to generate the signature (i.e., the salt value), and the XOR check value obtained based on the XOR check calculation; the data record block is a key part of the vehicle driving recorder for storing vehicle driving data, that is, it is responsible for recording vehicle driving speed, time, location and other data; the verification record block is used to verify the data in the data record block to ensure that the recorded data has not been tampered with or damaged during transmission, storage and processing.

[0044] For a verification record block, the number of data record blocks to be verified should be no less than 1, for example, see Figure 3As shown, the record blocks verified by the verification record block 2 include the verification record block 1 and the data record blocks 1 to the data record blocks N; wherein, the verification record block 1 and the data record blocks 1 to the data record blocks N are also referred to as the target data blocks verified by the verification record block 2. It should be understood that the target data blocks corresponding to the verification record block include the previous verification record block (or the starting record block) and the data record blocks thereafter; specifically, since the verification record block 2 is not the first verification record block, the target data blocks corresponding to it include the verification record block 1 and the data record blocks 1 to the data record blocks N; and since the verification record block 1 is the first verification record block, the target data blocks corresponding to it include the starting record block and the data record blocks between the starting record block and the verification record block 1.

[0045] In this embodiment, the file naming requirement is that the file name must consist of the driving recorder number + license plate number + file number; for the target driving record file corresponding to the new regulations, when performing integrity and legality verification, refer to Figure 4 As shown, first, the legality of the file name of the target driving record file needs to be judged according to the file naming requirements. If the file name of the target driving record file does not meet the file naming requirements, the naming of the target driving record file is determined to be illegal, and an error message is output; if the file name of the target driving record file meets the file naming requirements, the naming of the target driving record file is determined to be legal, and then the integrity and / or legality of the target record block in the target data record file in the target driving record file is checked.

[0046] Among them, this embodiment will verify the file size, block length, timestamp, XOR check value, correspondence between data record block and verification record block, and signature of the record block to realize the verification of data record file integrity and legality. It can be understood that for different verification objects, corresponding verification control strategies can be generated according to their corresponding verification rules to construct a verification control strategy set, and the verification control strategy set includes a file size verification control strategy corresponding to the file size, a block length verification control strategy corresponding to the block length, a timestamp verification control strategy corresponding to the timestamp, an XOR verification control strategy corresponding to the XOR check value, a correspondence verification control strategy corresponding to the correspondence, and a signature verification control strategy corresponding to the signature.

[0047] Since the objects required to be checked for different types of record blocks are not exactly the same, this embodiment selects corresponding check control strategies from a preset check control strategy set according to the record block type of the target record block and combines them to obtain a target check control strategy for the target record block.

[0048] Step S20: Based on the target verification control strategy, the integrity and / or legality of the corresponding target record block is verified and controlled.

[0049] Exemplarily, in this embodiment, for the target record block, its integrity and / or legality will be checked and controlled according to its corresponding target verification control strategy to output the verification result, thereby effectively achieving comprehensive verification of the integrity and legality of the new regulatory record file.

[0050] Furthermore, in one embodiment, the file size verification control strategy includes comparing whether the total number of file bytes stored in the starting record block is equal to the actual number of file bytes of the data record file. If they are not equal, the legality of the control output is illegal.

[0051] Exemplarily, in this embodiment, for the starting record block, it is necessary to verify the file size; specifically, the actual file byte number of the data record file can be determined based on the byte number of each record block in the data record file, and then it is determined whether the actual file byte number of the data record file is equal to the total file byte number stored in the starting record block. If they are not equal, the control output legitimacy is illegal, and the verification of subsequent other record blocks is stopped; if they are equal, other legitimacy checks are continued on the starting record block and other record blocks.

[0052] Furthermore, in one embodiment, the block length check control strategy includes determining the target starting position of the next record block based on the block length of the current record block, and comparing whether the target starting position is the same as the actual starting position of the next record block. If they are different, the legality of the control output is illegal; the XOR check control strategy includes comparing whether the XOR check value stored in the record block is the same as the actual XOR check value obtained after the XOR check calculation based on the data in the record block. If they are different, the legality of the control output is illegal.

[0053] Exemplarily, in this embodiment, for all record blocks, the verification objects include block length and XOR check value; wherein, for the block length verification control strategy, it is necessary to obtain the actual starting position of the next record block, and determine the target starting position of the next record block according to the block length of the current record block, and then compare whether the target starting position is the same as the actual starting position of the next record block. If different, the control output legality is illegal, and the verification of subsequent other record blocks is stopped; if the same, continue to perform other legality checks on the record block and other record blocks.

[0054] For the XOR check control strategy, it is necessary to perform XOR check calculation on the data in the record block through the XOR check algorithm to obtain the actual XOR check value, and then compare the XOR check value stored in the record block to be checked with the actual XOR check value to see if they are the same. If they are different, the control output legality is illegal and the subsequent verification of other record blocks is stopped; if they are the same, other legality checks are continued for this record block and other record blocks. It should be noted that the method and principle of performing XOR check calculation on data through the XOR check algorithm is common knowledge in the art, and for the sake of brevity of description, it will not be repeated here.

[0055] Furthermore, in one embodiment, the timestamp verification control strategy includes: for a data record block, when the data record block is the last data record block in the target data record file, determining whether the timestamp of the data record block is a maximum value, if not, controlling the output integrity to be incomplete; for a verification record block, determining whether the difference between the timestamp of the first data record block corresponding to the verification record block and the timestamp of the verification record block is less than a preset time difference threshold and whether the timestamp of the verification record block is later than the timestamp of the last data record block corresponding to the verification record block, if not, controlling the output legality to be illegal.

[0056] Exemplarily, in this embodiment, different types of record blocks have different verification contents based on timestamps, so different types of record blocks will adopt different timestamp verification control strategies. Specifically, for a data record block, a preset block mark can be used to confirm whether the data record block is the last data record block (i.e., the end record block) in the target data record file; if it is not the end record block, no integrity determination is required; and if it is the end record block, an integrity determination is required, i.e., determining whether the timestamp of the data record block is the maximum value, if not, the integrity of the output is controlled to be incomplete, if so, the integrity of the output is controlled to be complete, and the verification of the data record block is terminated.

[0057] For each verification record block, the difference between its timestamp and the timestamp of its first verified data record block cannot be greater than the time difference threshold (for example, 60 seconds), and cannot be earlier than the timestamp of its last verified data record block; therefore, it is necessary to determine whether the difference between the timestamp of the first data record block corresponding to the verification record block and the timestamp of the verification record block is less than the time difference threshold and whether the timestamp of the verification record block is later than the timestamp of the last data record block corresponding to the verification record block. If not, the control output legitimacy is illegal. If so, continue to perform other legitimacy checks on this record block and other record blocks. For example, see Figure 3As shown, the difference between the timestamp of verification record block 2 and the timestamp of data record block 1 cannot be greater than 60 seconds, and the timestamp of verification record block 2 cannot be earlier than the timestamp of data record block N.

[0058] In addition, it should be noted that for all data record files, the end of the file needs to be a verification record block as the end record block; wherein, the command word SFmt in the definition segment of the last verification record block in the data record file is usually set to FEH (i.e., SFmt=FEH), while the command word SFmt in the definition segment of other verification record blocks is set to FCH (i.e., SFmt=FCH). Therefore, when verifying the verification record block, the setting value corresponding to the command word SFmt can be used to determine whether it is the last verification record block. If the command word SFmt corresponding to a verification record block is FEH, it means that the verification record block is the last verification record block in the data record file. If the setting value of the command word SFmt of all verification record blocks in the entire data record file is FCH, the control output legality is illegal.

[0059] Furthermore, in one embodiment, the correspondence verification control strategy includes determining whether a data record block has a corresponding verification record block, and if not, controlling the output legitimacy to be illegal.

[0060] Exemplarily, it should be understood that each data record block in the target data record file must have a corresponding verification record block, such as see Figure 3 As shown, the verification record block corresponding to data record block 1 is verification record block 2, and similarly, the verification record blocks corresponding to data record blocks 2 to data record blocks N are all verification record blocks 2. Therefore, in this embodiment, it is necessary to determine whether each data record block has a corresponding verification record block. If not, the control output legitimacy is illegal; if so, other legitimacy checks are continued for the record block and other record blocks.

[0061] Furthermore, in one embodiment, the signature verification control strategy includes comparing whether the signature value stored in the verification record block is equal to the actual signature value. If not, the legality of the control output is illegal. The actual signature value is a signature value obtained after encryption calculation based on the random value stored in the starting record block and the data in all data record blocks corresponding to the verification record block.

[0062] Exemplarily, in this embodiment, whether the SM3 encryption of the verification record block is correct will also be verified, that is, the actual signature value obtained after SM3 encryption calculation is performed based on the salt value stored in the starting record block and the data in all data record blocks corresponding to the verification record block, and it is determined whether the actual signature value is the same as the signature value stored in the verification record block. If not, it means that the data may have been tampered with or damaged, and the legitimacy of the control output is illegal; if so, other legitimacy checks are continued for the record block and other record blocks.

[0063] Further, in one embodiment, the step of determining a target verification control strategy for the target record block from a preset verification control strategy set according to the record block type of the target record block includes:

[0064] When the record block type of the target record block is a start record block, the target check control strategy includes a file size check control strategy, a block length check control strategy and an XOR check control strategy;

[0065] When the record block type of the target record block is a data record block, the target check control strategy includes a block length check control strategy, a timestamp check control strategy, an XOR check control strategy and a correspondence check control strategy;

[0066] When the record block type of the target record block is a verification record block, the target check control strategy includes a block length check control strategy, a timestamp check control strategy, an XOR check control strategy and a signature check control strategy.

[0067] Exemplarily, in this embodiment, for the starting record block, it is necessary to verify its file size, block length and XOR check value, so the corresponding target verification control strategy includes file size verification control strategy, block length verification control strategy and XOR verification control strategy; for the data record block, it is necessary to verify its block length, timestamp, XOR check value, and the correspondence between the data record block and the verification record block, so the corresponding target verification control strategy includes block length verification control strategy, timestamp verification control strategy, XOR check control strategy and correspondence verification control strategy; for the verification record block, it is necessary to verify its block length, timestamp, XOR check value and signature, so the corresponding target verification control strategy includes block length verification control strategy, timestamp verification control strategy, XOR check control strategy and signature verification control strategy.

[0068] The following combination Figure 4 The verification process of the data file is described.

[0069] First, verify the legality of the name of the target driving record file. If it is illegal, an error message will be given and the verification will end. If it is legal, the total file size, file type and other file-related information can be obtained, and the first record block in the target data record file in the target driving record file can be read.

[0070] Then, based on the block mark, determine whether the first record block is the starting record block. If not, give an error message and end the verification. If so, perform a validity check on the file size, block length, and XOR check value and obtain the salt value, etc. If the validity check fails, give an error message and end the verification. If the validity check passes, continue to read the next record block and determine whether the XOR check value of the record block is correct. If not, give an error message and end the verification. If correct, determine whether the type of the record block is a data record block or a verification record block.

[0071] If the record block is a data record block, determine whether the data record block is an end record block based on the block mark. If not, check the block length and correspondence of the data record block. If the check result is legal, continue to read the next record block for verification. If the check result is illegal, give an error message and end the verification. If the data record block is an end record block, determine whether the timestamp of the data record block is the maximum value. If it is the maximum value, the output integrity is normal. If it is not the maximum value, give an error message and end the verification.

[0072] If the record block is a verification record block, the block length, timestamp and signature of the verification record block are verified. If the verification result is illegal, an error message is given and the verification is terminated; if the verification result is legal, the legality is output and the verification is terminated.

[0073] In a second aspect, an embodiment of the present application also provides a data file verification device.

[0074] In one embodiment, the data file verification device includes:

[0075] a processing module, which is used to determine, for each target record block in the target data record file in the target driving record file, a target verification control strategy of the target record block from a preset verification control strategy set according to the record block type of the target record block when it is detected that the file name of the target driving record file meets the file naming requirement, wherein the record block type includes a start record block, a data record block and a verification record block, and the verification control strategy set includes a file size verification control strategy, a block length verification control strategy, a timestamp verification control strategy, an XOR verification control strategy, a correspondence verification control strategy and a signature verification control strategy;

[0076] A verification module is used to perform integrity and / or legality verification control on a corresponding target record block based on the target verification control strategy.

[0077] Furthermore, in one embodiment, the processing module is specifically used for:

[0078] When the record block type of the target record block is a start record block, the target check control strategy includes a file size check control strategy, a block length check control strategy and an XOR check control strategy;

[0079] When the record block type of the target record block is a data record block, the target check control strategy includes a block length check control strategy, a timestamp check control strategy, an XOR check control strategy and a correspondence check control strategy;

[0080] When the record block type of the target record block is a verification record block, the target check control strategy includes a block length check control strategy, a timestamp check control strategy, an XOR check control strategy and a signature check control strategy.

[0081] Furthermore, in one embodiment, the file size verification control strategy includes comparing whether the total number of file bytes stored in the starting record block is equal to the actual number of file bytes of the data record file. If they are not equal, the legality of the control output is illegal.

[0082] Furthermore, in one embodiment, the block length check control strategy includes determining the target starting position of the next record block based on the block length of the current record block, and comparing whether the target starting position is the same as the actual starting position of the next record block. If they are different, the legality of the control output is illegal; the XOR check control strategy includes comparing whether the XOR check value stored in the record block is the same as the actual XOR check value obtained after the XOR check calculation based on the data in the record block. If they are different, the legality of the control output is illegal.

[0083] Furthermore, in one embodiment, the timestamp verification control strategy includes: for a data record block, when the data record block is the last data record block in the target data record file, determining whether the timestamp of the data record block is a maximum value, if not, controlling the output integrity to be incomplete; for a verification record block, determining whether the difference between the timestamp of the first data record block corresponding to the verification record block and the timestamp of the verification record block is less than a preset time difference threshold and whether the timestamp of the verification record block is later than the timestamp of the last data record block corresponding to the verification record block, if not, controlling the output legality to be illegal.

[0084] Furthermore, in one embodiment, the correspondence verification control strategy includes determining whether a data record block has a corresponding verification record block, and if not, controlling the output legitimacy to be illegal.

[0085] Furthermore, in one embodiment, the signature verification control strategy includes comparing whether the signature value stored in the verification record block is equal to the actual signature value. If not, the legality of the control output is illegal. The actual signature value is a signature value obtained after encryption calculation based on the random value stored in the starting record block and the data in all data record blocks corresponding to the verification record block.

[0086] Among them, the functional implementation of each module in the above-mentioned data file verification device corresponds to the various steps in the above-mentioned data file verification method embodiment, and its functions and implementation processes are no longer repeated here one by one.

[0087] In a third aspect, an embodiment of the present application provides a data file verification device, which may be a personal computer (PC), a laptop computer, a server, or other device with data processing capabilities.

[0088] Reference Figure 5 , Figure 5 Schematic diagram of the hardware structure of the data file verification device involved in the embodiment of the present application. In the embodiment of the present application, the data file verification device may include a processor, a memory, a communication interface and a communication bus.

[0089] The communication bus may be of any type and is used to interconnect the processor, the memory, and the communication interface.

[0090] The communication interface includes input / output (I / O) interface, physical interface and logical interface, etc., which are used to realize the interconnection of devices inside the data file verification device, and the interface used to realize the interconnection of the data file verification device with other devices (such as other computing devices or user devices). The physical interface can be an Ethernet interface, a fiber optic interface, an ATM interface, etc.; the user device can be a display, a keyboard, etc.

[0091] The memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0092] The processor may be a general-purpose processor, and the general-purpose processor may call the data file verification program stored in the memory and execute the data file verification method provided by the embodiment of the present application. For example, the general-purpose processor may be a central processing unit (CPU). The method executed when the data file verification program is called may refer to the various embodiments of the data file verification method of the present application, which will not be repeated here.

[0093] Those skilled in the art will understand that Figure 5 The hardware structure shown in the figure does not constitute a limitation on the present application, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0094] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium.

[0095] A data file verification program is stored on the readable storage medium of the present application, wherein when the data file verification program is executed by the processor, the steps of the data file verification method as described above are implemented.

[0096] Among them, the method implemented when the data file verification program is executed can refer to the various embodiments of the data file verification method of the present application, and will not be repeated here.

[0097] It should be noted that the serial numbers of the above-mentioned embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.

[0098] The terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices. The terms "first", "second" and "third" are used to distinguish different objects, etc., and do not represent a sequence, nor do they limit "first", "second" and "third" to different types.

[0099] In the description of the embodiments of the present application, "exemplary", "for example" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary", "for example" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary", "for example" or "for example" is intended to present related concepts in a specific way.

[0100] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or, for example, A / B can mean A or B; the “and / or” in the text is merely a description of the association relationship of associated objects, indicating that three relationships may exist, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, “multiple” refers to two or more than two.

[0101] In some processes described in the embodiments of the present application, multiple operations or steps that appear in a specific order are included, but it should be understood that these operations or steps may not be executed in the order in which they appear in the embodiments of the present application or in parallel, and the sequence number of the operation is only used to distinguish the different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed in sequence or in parallel, and these operations or steps may be combined.

[0102] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, disk, CD) as described above, and includes a number of instructions for a terminal device to execute the methods described in each embodiment of the present application.

[0103] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims

1. A data file verification method, characterized in that: The data file verification method comprises: When it is detected that the file name of the target driving record file meets the file naming requirement, for each target record block in the target data record file in the target driving record file, a target verification control strategy of the target record block is determined from a preset verification control strategy set according to the record block type of the target record block, the record block type includes a start record block, a data record block and a verification record block, and the verification control strategy set includes a file size verification control strategy, a block length verification control strategy, a timestamp verification control strategy, an XOR verification control strategy, a correspondence verification control strategy and a signature verification control strategy; Based on the target verification control strategy, the integrity and / or legality of the corresponding target record block is verified and controlled.

2. The data file verification method according to claim 1, characterized in that: The step of determining a target verification control strategy for the target record block from a preset verification control strategy set according to the record block type of the target record block includes: When the record block type of the target record block is a start record block, the target check control strategy includes a file size check control strategy, a block length check control strategy and an XOR check control strategy; When the record block type of the target record block is a data record block, the target check control strategy includes a block length check control strategy, a timestamp check control strategy, an XOR check control strategy and a correspondence check control strategy; When the record block type of the target record block is a verification record block, the target check control strategy includes a block length check control strategy, a timestamp check control strategy, an XOR check control strategy and a signature check control strategy.

3. The data file verification method according to claim 1, characterized in that: The file size verification control strategy includes comparing whether the total number of file bytes stored in the starting record block is equal to the actual number of file bytes of the data record file. If they are not equal, the legality of the control output is illegal.

4. The data file verification method according to claim 1, characterized in that: The block length check control strategy includes determining the target starting position of the next record block based on the block length of the current record block, comparing whether the target starting position is the same as the actual starting position of the next record block, and if they are different, controlling the output legality to be illegal; The XOR check control strategy includes comparing the XOR check value stored in the record block with the actual XOR check value obtained after XOR check calculation based on the data in the record block to see if they are the same. If they are different, the legality of the control output is illegal.

5. The data file verification method according to claim 1, characterized in that: The timestamp verification control strategy includes: For a data record block, when the data record block is the last data record block in the target data record file, it is determined whether the timestamp of the data record block is a maximum value, if not, the output integrity is controlled to be incomplete; For the verification record block, determine whether the difference between the timestamp of the first data record block corresponding to the verification record block and the timestamp of the verification record block is less than a preset time difference threshold and whether the timestamp of the verification record block is later than the timestamp of the last data record block corresponding to the verification record block; if not, the control output legality is illegal.

6. The data file verification method according to claim 1, characterized in that: The correspondence verification control strategy includes determining whether a data record block has a corresponding verification record block, and if not, controlling the output legality to be illegal.

7. The data file verification method according to claim 1, characterized in that: The signature verification control strategy includes comparing whether the signature value stored in the verification record block is equal to the actual signature value. If not, the legality of the control output is illegal. The actual signature value is a signature value obtained after encryption calculation based on the random value stored in the starting record block and the data in all data record blocks corresponding to the verification record block.

8. A data file verification device, characterized in that: The data file verification device comprises: a processing module, which is used to determine, for each target record block in the target data record file in the target driving record file, a target verification control strategy of the target record block from a preset verification control strategy set according to the record block type of the target record block when it is detected that the file name of the target driving record file meets the file naming requirement, wherein the record block type includes a start record block, a data record block and a verification record block, and the verification control strategy set includes a file size verification control strategy, a block length verification control strategy, a timestamp verification control strategy, an XOR verification control strategy, a correspondence verification control strategy and a signature verification control strategy; A verification module is used to perform integrity and / or legality verification control on a corresponding target record block based on the target verification control strategy.

9. A data file verification device, characterized in that: The data file verification device includes a processor, a memory, and a data file verification program stored in the memory and executable by the processor, wherein when the data file verification program is executed by the processor, the steps of the data file verification method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a data file verification program, wherein when the data file verification program is executed by a processor, the steps of the data file verification method according to any one of claims 1 to 7 are implemented.