A verification method, system, device and readable storage medium for a TF card
By obtaining and comparing the MD5 values in the TF card, the problem of low verification efficiency caused by changes in the content of the TF card is solved, and fast and efficient integrity verification is achieved, saving time and labor costs.
Patent Information
- Application Number
- CN202111164921.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-30
- Publication Date
- 2025-07-08
- Estimated Expiration
- 2041-09-30
AI Technical Summary
The integrity verification method of TF cards in the prior art cannot adapt to changes in the content in the card, resulting in wasted time and labor costs.
By obtaining the mirror file to be checked in the TF card, using the verification script to determine its MD5 value, and comparing it with the MD5 file stored in the TF card to determine the integrity of the mirror file.
Fast and efficient TF card integrity verification is achieved, which shortens the verification time, reduces manual intervention and improves verification efficiency.
Smart Images

Figure CN114021128B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of on-board TF cards, and particularly to a verification method, system, device and readable storage medium for a TF card. Background Art
[0002] TF (Trans-flash Card) is an extremely small flash memory unit card that can be directly configured on the main board, enabling the host to run updated and expanded software programs burned on the TF card. When the server is being produced and assembled, the TF card needs to be integrity-verified to ensure that the data of the TF card leaving the factory is complete and functionally available. However, since the content of the TF card changes each time, when the content in the card changes, the original integrity verification method is no longer applicable, and it is only possible to manually start the changed file and observe whether the file runs properly to determine the data integrity of the TF card, resulting in a huge waste of time and labor costs.
[0003] Therefore, how to provide a solution to the above technical problems is an issue that those skilled in the art need to solve currently. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide a fast and efficient verification method, system, device and readable storage medium for a TF card. The specific solutions are as follows:
[0005] A verification method for a TF card includes:
[0006] Obtain the mirror file to be verified in the TF card;
[0007] Determine the MD5 value of the mirror file to be verified through a verification script;
[0008] Obtain the MD5 file corresponding to the mirror file to be verified in the TF card;
[0009] Compare whether the MD value corresponds to the MD5 file;
[0010] If so, determine that the mirror file to be verified in the TF card is complete;
[0011] If not, determine that the mirror file to be verified in the TF card is incomplete.
[0012] Preferably, the process of determining the MD5 value of the mirror file to be verified through a verification script includes:
[0013] Partition the mirror file to be verified to obtain a header verification file, a middle file, and a tail verification file;
[0014] Determine the MD5 values of the header verification file and the tail verification file respectively through a verification script;
[0015] Correspondingly, the process of comparing the MD value with the MD5 file includes:
[0016] Comparing whether the MD5 values of the head check file and the tail check file correspond to the MD5 file;
[0017] If so, it is determined that the mirror file to be verified in the TF card is complete;
[0018] If not, it is determined that the mirror file to be verified in the TF card is incomplete, and the damaged file is located according to the comparison result.
[0019] Preferably, the process of partitioning the mirror file to be verified to obtain a head check file, a middle file, and a tail check file specifically includes:
[0020] Obtaining the damage probability curve of the mirror file to be verified;
[0021] According to the damage probability curve, the part of the mirror file to be verified below the preset probability value is determined as the middle file, the part of the first half of the mirror file to be verified except the middle file is determined as the head check file, and the part of the second half of the mirror file to be verified except the middle file is determined as the tail check file.
[0022] Preferably, the verification method further includes:
[0023] Updating the damage probability curve according to the verification result of the mirror file to be verified.
[0024] Preferably, the verification method is applied to the memory operating system distributed to the server by PXE.
[0025] Preferably, the mirror file to be verified is specifically:
[0026] The ISO image file of the customized file burned on the TF card by the ISO burning tool.
[0027] Preferably, the MD5 file is specifically stored in the root directory of the TF card.
[0028] Correspondingly, the present application also discloses a verification system for a TF card, including:
[0029] A first acquisition module, configured to acquire the mirror file to be verified in the TF card;
[0030] A calculation module, configured to determine the MD5 value of the mirror file to be verified through a verification script;
[0031] A second acquisition module, configured to acquire the MD5 file corresponding to the mirror file to be verified in the TF card;
[0032] A comparison module, configured to compare whether the MD value corresponds to the MD5 file; if so, it is determined that the mirror file to be verified in the TF card is complete; if not, it is determined that the mirror file to be verified in the TF card is incomplete.
[0033] Correspondingly, the present application also discloses a verification device for a TF card, including:
[0034] A memory, configured to store a computer program;
[0035] A processor, configured to implement the steps of the TF card verification method as described in any one of the above when executing the computer program.
[0036] Correspondingly, the present application also discloses a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the TF card verification method as described in any one of the above are implemented.
[0037] The present application discloses a verification method for a TF card, including: acquiring a mirror file to be verified in the TF card; determining the MD5 value of the mirror file to be verified through a verification script; acquiring the MD5 file corresponding to the mirror file to be verified in the TF card; comparing whether the MD value corresponds to the MD5 file; if so, it is determined that the mirror file to be verified in the TF card is complete; if not, it is determined that the mirror file to be verified in the TF card is incomplete. The present application compares the MD5 value determined by the verification script with the MD5 file originally stored inside the TF card to determine whether the mirror file to be verified is the version corresponding to the MD5 file, and further can determine whether the mirror file to be verified in the current TF card is complete. Regardless of the specific content and version order of the mirror file to be verified, the present application can implement integrity verification, has a wide application range, no longer requires manual start and observation, and greatly improves the verification efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention, and for those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts.
[0039] Figure 1 It is a step flowchart of a verification method for a TF card in an embodiment of the present invention;
[0040] Figure 2It is the structural distribution diagram of a verification system for a TF card in an embodiment of the present invention. Specific implementation manners
[0041] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0042] When a TF card is produced and assembled in a server, integrity verification is required to ensure that the data of the TF card leaving the factory is complete and the functions are available. However, since the content of each TF card is not fixed, when the content in the card changes, the original integrity verification method is no longer applicable, and only by manually starting the changed file and observing whether the file runs normally can the data integrity of the TF card be judged, resulting in a great waste of time cost and labor cost.
[0043] This application can implement integrity verification regardless of the specific content and version order of the mirror file to be verified, has a wide application range, no longer requires manual start and observation, and the verification efficiency is greatly improved.
[0044] An embodiment of the present invention discloses a verification method for a TF card. See Figure 1 As shown, it includes:
[0045] S1: Obtain the mirror file to be verified in the TF card;
[0046] S2: Determine the MD5 value of the mirror file to be verified through a verification script;
[0047] S3: Obtain the MD5 file corresponding to the mirror file to be verified in the TF card;
[0048] S4: Compare whether the MD value corresponds to the MD5 file;
[0049] S5: If so, it is determined that the mirror file to be verified in the TF card is complete;
[0050] S6: If not, it is determined that the mirror file to be verified in the TF card is incomplete.
[0051] It can be understood that the verification method in this embodiment is usually applied to the memory operating system distributed by PXE (Preboot eXecution Environment) to the server. When the assembled server enters the detection line, the server enters the PXE network, boots the PXE, and thus obtains the memory OS (Operating System) distributed by PXE and boots it. Then, the memory OS executes the verification method of the TF card in this embodiment.
[0052] It can be understood that the mirror file to be verified in this embodiment is specifically:
[0053] The ISO image file of the customized file burned on the TF card by the ISO burning tool.
[0054] Specifically, the mirror file to be verified is usually a new module file for update or addition, such as some customized software, which is burned on the TF card on the TF card production line.
[0055] Furthermore, the MD5 file is specifically stored in the root directory of the TF card.
[0056] It can be understood that the MD5 (Message-Digest Algorithm) file is usually in txt format and is written into the root directory of the TF card while the mirror file to be verified is burned onto the TF card.
[0057] Furthermore, when the determination result of step S5 or S6 is obtained, the determination result can be obtained by the out-of-band management system from the memory OS provided by the BMC (Baseboard Management Controller) through IPMI (Intelligent Platform Management Interface) as in-band monitoring information, and is visually displayed to the user through an image.
[0058] The present application discloses a verification method for a TF card, including: obtaining a mirror file to be verified in the TF card; determining the MD5 value of the mirror file to be verified through a verification script; obtaining the MD5 file corresponding to the mirror file to be verified in the TF card; comparing whether the MD value corresponds to the MD5 file; if so, determining that the mirror file to be verified in the TF card is complete; if not, determining that the mirror file to be verified in the TF card is incomplete. The present application compares the MD5 value determined by the verification script with the MD5 file originally stored inside the TF card to determine whether the mirror file to be verified is the version corresponding to the MD5 file, and further can determine whether the mirror file to be verified in the current TF card is complete. Regardless of the specific content and version order of the mirror file to be verified, the present application can achieve integrity verification, has a wide application range, no longer requires manual start and observation, and greatly improves the verification efficiency.
[0059] An embodiment of the present invention discloses a specific verification method for a TF card. Compared with the previous embodiment, this embodiment further describes and optimizes the technical solution.
[0060] Specifically, the process of determining the MD5 value of the mirror file to be verified through the verification script in step S2 includes:
[0061] Partition the mirror file to be verified to obtain a header verification file, a middle file, and a tail verification file;
[0062] Determine the MD5 values of the header verification file and the tail verification file respectively through the verification script;
[0063] Correspondingly, the process of comparing whether the MD value corresponds to the MD5 file in step S4 includes:
[0064] Compare whether the MD5 values of the header verification file and the tail verification file correspond to the MD5 file;
[0065] If so, determine that the mirror file to be verified in the TF card is complete;
[0066] If not, determine that the mirror file to be verified in the TF card is incomplete, and locate the damaged file according to the comparison result.
[0067] It can be understood that for the data of the entire mirror file to be verified, there is a certain correlation between its possible damage probability and the data storage location. For a single file, the closer the data is to the beginning and end of the file, the greater the probability of data incompleteness. Therefore, in order to save the verification cost, some data with a lower damage probability can be ignored, and some data with a higher damage probability can be selected for verification. In this way, the verification data range is reduced, and the damaged data can be accurately located.
[0068] Further, the process of partitioning the mirror file to be verified to obtain a header verification file, a middle file, and a tail verification file specifically includes:
[0069] Obtain the damage probability curve of the mirror file to be verified;
[0070] According to the damage probability curve, determine the part of the mirror file to be verified that is lower than the preset probability value as the middle file, determine the part of the first half of the mirror file to be verified except the middle file as the header verification file, and determine the part of the second half of the mirror file to be verified except the middle file as the tail verification file.
[0071] It can be understood that, in addition to the above idea of dividing the entire mirror file to be verified into three parts: a middle file, a header verification file, and a tail verification file using the damage probability curve, the mirror file to be verified can also be grouped using other values, and whether to perform verification can be determined based on the damage probability of each group of data. Specific grouping methods and verification details are not limited in this embodiment.
[0072] Further, the verification method further includes:
[0073] Update the damage probability curve according to the verification result of the mirror file to be verified.
[0074] It can be understood that the same batch of TF cards needs to be batch-verified, and the more accurate the damage probability curve is, the better. Using the updated damage probability curve based on the verification result can further improve the verification accuracy and efficiency of other TF cards in the same batch.
[0075] Correspondingly, an embodiment of the present application also discloses a verification system for a TF card. Refer to Figure 2 as shown, including:
[0076] A first acquisition module 1 for acquiring the mirror file to be verified in the TF card;
[0077] A calculation module 2 for determining the MD5 value of the mirror file to be verified through a verification script;
[0078] A second acquisition module 3 for acquiring the MD5 file corresponding to the mirror file to be verified in the TF card;
[0079] A comparison module 4 for comparing whether the MD value corresponds to the MD5 file; if so, it is determined that the mirror file to be verified in the TF card is complete; if not, it is determined that the mirror file to be verified in the TF card is incomplete.
[0080] In the embodiment of the present application, the MD5 value determined by the verification script is compared with the MD5 file originally stored inside the TF card to determine whether the image file to be verified is the version corresponding to the MD5 file, and further, it can be determined whether the image file to be verified in the current TF card is complete. Regardless of the specific content and version order of the image file to be verified, the embodiment of the present application can achieve integrity verification, has a wide application range, no longer requires manual start and observation, and the verification efficiency is greatly improved.
[0081] In some specific embodiments, the calculation module 2 includes:
[0082] A partitioning unit, configured to partition the image file to be verified to obtain a header verification file, a middle file, and a tail verification file;
[0083] A calculation unit, configured to respectively determine the MD5 values of the header verification file and the tail verification file through a verification script;
[0084] Correspondingly, the alarm module 4 is configured to:
[0085] Compare whether the MD5 values of the header verification file and the tail verification file correspond to the MD5 file;
[0086] If so, it is determined that the image file to be verified in the TF card is complete;
[0087] If not, it is determined that the image file to be verified in the TF card is incomplete, and the damaged file is located according to the comparison result.
[0088] In some specific embodiments, the partitioning unit is specifically configured to:
[0089] Obtain the damage probability curve of the image file to be verified;
[0090] According to the damage probability curve, the part of the image file to be verified below the preset probability value is determined as the middle file, the part of the first half of the image file to be verified except the middle file is determined as the header verification file, and the part of the second half of the image file to be verified except the middle file is determined as the tail verification file.
[0091] In some specific embodiments, the verification system further includes:
[0092] An update module, configured to update the damage probability curve according to the verification result of the image file to be verified.
[0093] In some specific embodiments, the verification system is applied to the memory operating system distributed to the server by PXE.
[0094] In some specific embodiments, the mirror file to be verified is specifically:
[0095] The ISO image file of the customized file burned on the TF card through an ISO burning tool.
[0096] In some specific embodiments, the MD5 file is specifically stored in the root directory of the TF card.
[0097] Correspondingly, the embodiment of the present application also discloses a verification device for a TF card, including:
[0098] A memory for storing a computer program;
[0099] A processor for implementing the steps of the TF card verification method as described in any one of the above when executing the computer program.
[0100] Correspondingly, the embodiment of the present application also discloses a readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the TF card verification method as described in any one of the above are implemented.
[0101] Among them, the specific details of the TF card verification method can be referred to the relevant descriptions in the above embodiments, and will not be elaborated here.
[0102] Among them, the TF card verification device and the readable storage medium in this embodiment have the same technical effects as the TF card verification method in the above embodiments, and will not be elaborated here.
[0103] Finally, it should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0104] The above has introduced in detail a verification method, system, device and readable storage medium of a TF card provided by the present invention. Specific examples are used in this article to expound the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.
Claims
1. A verification method for a TF card, characterized in that, The memory operating system applied to PXE distribution to the server includes: Obtain the mirror file to be verified in the TF card; Partition the mirror file to be verified to obtain a header verification file, a middle file, and a tail verification file; Determine the MD5 values of the header verification file and the tail verification file respectively through a verification script; Obtain the MD5 file corresponding to the mirror file to be verified in the TF card; wherein, the MD5 file is stored in the root directory of the TF card in txt format; Compare whether the MD5 values of the header verification file and the tail verification file correspond to the MD5 file; If so, determine that the mirror file to be verified in the TF card is complete; If not, determine that the mirror file to be verified in the TF card is incomplete, and locate the damaged file according to the comparison result; Among them, the process of partitioning the mirror file to be verified to obtain a header verification file, a middle file, and a tail verification file specifically includes: Obtain the damage probability curve of the mirror file to be verified; According to the damage probability curve, determine the part of the mirror file to be verified below the preset probability value as the middle file, determine the part of the first half of the mirror file to be verified except the middle file as the header verification file, and determine the part of the second half of the mirror file to be verified except the middle file as the tail verification file.
2. The verification method according to claim 1, wherein It also includes: Update the damage probability curve according to the verification result of the mirror file to be verified.
3. The verification method according to claim 1, characterized in that, The mirror file to be verified is specifically: The ISO mirror file of the customized file burned on the TF card through an ISO burning tool.
4. A verification system for a TF card, characterized in that, The memory operating system applied to PXE distribution to the server includes: A first acquisition module for acquiring the mirror file to be verified in the TF card; A calculation module for partitioning the mirror file to be verified to obtain a header verification file, a middle file, and a tail verification file; determining the MD5 values of the header verification file and the tail verification file respectively through a verification script; wherein, the MD5 file is stored in the root directory of the TF card in txt format; A second acquisition module for acquiring the MD5 file corresponding to the mirror file to be verified in the TF card; A comparison module for comparing whether the MD5 values of the header verification file and the tail verification file correspond to the MD5 file; if so, determining that the mirror file to be verified in the TF card is complete; if not, determining that the mirror file to be verified in the TF card is incomplete, and locating the damaged file according to the comparison result; Among them, the calculation module specifically includes: obtaining the damage probability curve of the mirror file to be verified; according to the damage probability curve, determining the part of the mirror file to be verified below the preset probability value as the middle file, determining the part of the first half of the mirror file to be verified except the middle file as the header verification file, and determining the part of the second half of the mirror file to be verified except the middle file as the tail verification file.
5. A verification device for a TF card, characterized in that, It includes: A memory for storing computer programs; A processor, which is configured to implement the steps of the TF card verification method according to any one of claims 1 to 3 when executing the computer program.
6. A readable storage medium, characterized in that, A computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the steps of the TF card verification method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Burning mirror image manufacturing method
CN111158697A
Live broadcast data verification method and system, electronic equipment and storage medium
CN113434561A