Fingerprint generation method, device and medium of virtual evaluation model based on hash operation

CN121072693BActive Publication Date: 2026-08-18CHINA AUTOMOTIVE ENG RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511253080.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-03
Publication Date
2026-08-18
Estimated Expiration
2045-09-03

AI Technical Summary

Technical Problem

[0005]本发明所解决的技术问题在于提供一种基于哈希运算的虚拟测评模型的指纹生成方法、设备及介质,以解决现有技术中模型指纹生成技术中存在稳定性差、效率低下、生成风险高的问题

Benefits of technology

[0016] The principle and effects of this invention are as follows: This application starts the dependency tree construction and initializes the access record table with the user-specified main model file as the root node, laying the foundation for dependency relationship sorting; by constructing a static keyword protection area with a preset core parameter rule base, the parameter definition is scanned and identified when the user operates on the dynamic file and compared with the rule base to realize parameter legality verification; in the hash operation stage, the original binary data of the current node model file is first normalized and then generated using SHA-256. Then, recursively process the child nodes to obtain hash values, sort them lexicographically, concatenate them, and generate SHA-256. Then, combine the standardized file path concatenation. and Generated with SHA-256 Finally, starting with the root node Starting from the root tree, a DFS-serialized tree structure is created and a global collision salt is added. A globally unique fingerprint is then generated using SHA-256. The entire process relies on dependency tree construction to organize file associations, a parameter rule base to ensure parameter compliance, and layered SHA-256 hash operations to ensure fingerprint uniqueness and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121072693B_ABST
    Figure CN121072693B_ABST
Patent Text Reader

Abstract

The present application belongs to the technical field of data processing, and particularly relates to a virtual evaluation model fingerprint generation method based on hash operation. First, a user-specified main model file is taken as a root node to construct a dependency tree, and an access record table is initialized. Then, a static keyword protection area containing a core parameter rule library is built, and a dynamic file operated by the user is scanned to generate a warning by comparing parameter definitions. Then, binary data of the current node file is read, and a string is generated after normalization by SHA-256. Then, the child nodes are recursively processed to obtain a node tree hash value, the child nodes are sorted and spliced in a fixed format, and a string is generated by SHA-256 operation. Then, the current node standardized path is spliced with, and SHA-256 operation is performed. Finally, the root node is taken as a starting point, DFS is used as a sequential sequence of the tree structure, SHA-256 operation is performed after adding a global collision salt value, and a model global unique fingerprint is output. The present application can solve the problems of poor stability, low efficiency, and high generation risk in the model fingerprint generation technology of the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of data processing technology, and in particular relates to a fingerprint generation method, device and medium for a virtual evaluation model based on hash operation. Background Technology

[0002] Virtual testing technology has become a core tool for automotive safety assessment, especially in the field of crash simulation. With the rapid expansion of the new energy vehicle market and the evolution of intelligent driving technology, automotive safety standards are continuously improving. Virtual testing, with its advantages of repeatability, cost-effectiveness, and scenario coverage, is gradually replacing traditional physical crash testing as the industry mainstream. Modern virtual testing models generally adopt a multi-file architecture, constructing complex dependency networks through instructions (such as *INCLUDE) to achieve high-precision simulation of whole-vehicle crash scenarios. However, as model complexity increases exponentially, ensuring model integrity and version consistency faces unprecedented technical challenges.

[0003] Current model fingerprint generation technology suffers from three structural flaws: First, circular references between files (typically, file A contains file B, and file B contains file A) can cause recursive traversal to fall into an infinite loop, posing a risk of system crashes. Second, when the same file is repeatedly referenced in multiple paths, traditional methods perform redundant calculations, significantly reducing hash generation efficiency. Third, dynamic file modifications lack security mechanisms, potentially overwriting static key parameters (such as material model definitions) and compromising the integrity of the model structure. These problems are particularly prominent in cross-team collaboration scenarios, severely limiting the depth of engineering applications of virtual testing.

[0004] While existing technologies employ file concatenation hashing (concatenating the contents of all files to calculate the overall hash value), they have fundamental limitations: 1. This method cannot distinguish between dynamic components that are allowed to be modified and static components that are prohibited from being modified, resulting in local parameter adjustments triggering global identifier changes; it lacks a circular reference detection mechanism, leading to poor system stability when encountering complex dependencies. 2. The lack of early warning for parameter conflicts significantly increases the risk of model failure. 3. With the new Euro NCAP 2025 regulations requiring the full implementation of virtual testing, global CAE software has still failed to overcome the challenge of reliable model fingerprinting technology. Existing solutions are inefficient when processing large models (in actual tests, a 500-file model took more than 10 minutes), which seriously hinders the industry's digital transformation process. Summary of the Invention

[0005] The technical problem solved by this invention is to provide a fingerprint generation method, device and medium for a virtual evaluation model based on hash operation, so as to solve the problems of poor stability, low efficiency and high generation risk in the existing model fingerprint generation technology.

[0006] The basic solution provided by this invention is a fingerprint generation method for a virtual evaluation model based on hash operations, comprising: S1: Start dependency tree construction based on the user-specified main model file as the root node, and initialize the access record table; S2: Construct a static keyword protection zone with a pre-set core parameter rule base, scan and identify user operations on dynamic files, read parameter definitions in dynamic files, compare them with the pre-set core parameter rule base in the static keyword protection zone, and generate early warning information; S3: Read the raw binary data of the model file corresponding to the current node, perform data normalization processing, and then perform SHA-256 hash operation to generate a string. ; S4: Recursively process all child nodes of the current node, obtain the node tree hash value, sort the child nodes in ascending lexicographical order according to file path, then concatenate the sorted child node information according to a fixed format, perform SHA-256 hash operation, and generate a string. ; S5: Obtain the normalized file path of the current node, and process the string according to the normalized path. and strings The strings are concatenated, and a SHA-256 hash operation is performed on the concatenated strings to generate the ultimate identifier of the current node. ; S6: The ultimate identifier of the root node Starting from this point, the tree structure is serialized in the order of DFS, a global collision salt is added, and then a SHA-256 hash operation is performed to output the globally unique fingerprint of the virtual evaluation model.

[0007] Furthermore, S1 includes: S1-1: Based on the user-specified main model file as the root node of the dependency tree, create an empty access record table, write the root node path into the access record table and mark it in the access record table; and initialize the audit log; S1-2: Read the file content of the current node, scanning line by line. The instruction extracts all sub-file paths and performs path normalization on each sub-file path; S1-3: Create a copy of the access record table for each sub-file, and check and parse whether the sub-file path already exists in the copy of the access record table. After all child nodes have been parsed, backtrack to the parent node to continue traversing.

[0008] Furthermore, both the access record table and the copy of the access record table include The processing status is recorded, including unprocessed, processing, and processed; The specific steps in S1-3, namely checking and parsing whether the sub-file path already exists in the access record table copy, are as follows: If the sub-file path already exists in the access record table copy and the status is "processing", it is determined to be a circular reference, triggering an abnormal state. The abnormal state is written to the audit log, and the parsing process of the current sub-node is terminated. If the subfile path does not exist in the access record table copy, then write the subfile path into the access record table copy, mark it as being processed, recursively execute step S1-2, and update the subfile status to processed when the recursion ends.

[0009] Furthermore, S2 includes: S2-1: Predefined core parameter rule base, store the core parameter rule base in a read-only directory, and generate a static keyword protection area; S2-2: Obtain the dynamic file uploaded and modified by the user, activate the parameter scanning mechanism to read the parameter definition in the dynamic file line by line, extract the parameter name and compare it with the predefined core parameter rule base in the static keyword protection area to determine whether it conforms to the core parameter rule; S2-3: If a violation of the core parameter rules is detected, an early warning operation will be performed.

[0010] Furthermore, if a violation of the core parameter rules is detected in S2-3, the warning operation is specifically performed as follows: Results that do not conform to the core parameter rules are classified into fatal violations and warning violations. If the detection result is a fatal violation, the loading and processing of the current model file will be terminated, a prompt message will be displayed, and the timestamp, the path of the violating file, parameter information, and blocking type will be written to the audit log. If the detection result is a warning-level violation, the process will not be terminated, a warning log will be generated, and a warning prompt will pop up on the user interface for the user to confirm whether to continue.

[0011] Furthermore, S4 includes: S4-1: Recursively process all child nodes of the current node and obtain the node tree hash value of the child nodes; S4-2: Sort all child nodes in lexicographical order of file path; S4-3: According to a fixed format " "Concatenate and sort the child node information; S4-4: Perform a SHA-256 hash operation on the concatenated string to generate a new string. .

[0012] Furthermore, S5 includes: S5-1: Get the normalized file path of the current node; S5-2: According to " "Format string concatenation; S5-3: Perform a SHA-256 hash operation on the concatenated string to generate the ultimate identifier of the current node. .

[0013] Furthermore, S6 includes: S6-1: After completing a full depth-first traversal of the dependency tree, use the ultimate identifier of the root node. Starting from the first line, serialize the entire dependency tree in DFS order; S6-2: Generate a global collision avoidance salt value, bind the global collision avoidance salt value to the model, and store it in the model metadata; S6-3: Concatenate strings in the format of "serialized tree structure + global anti-collision salt value", perform SHA-256 hash operation, and output the globally unique fingerprint of the virtual evaluation model.

[0014] An electronic device includes a processor and a memory, wherein the memory stores programs or instructions, and the processor executes the fingerprint generation method of the virtual evaluation model based on hash operation described above by calling the programs or instructions stored in the memory.

[0015] A computer-readable storage medium storing a program or instructions that causes a computer to execute the fingerprint generation method of the virtual evaluation model based on hash operation as described above.

[0016] The principle and effects of this invention are as follows: This application starts the dependency tree construction and initializes the access record table with the user-specified main model file as the root node, laying the foundation for dependency relationship sorting; by constructing a static keyword protection area with a preset core parameter rule base, the parameter definition is scanned and identified when the user operates on the dynamic file and compared with the rule base to realize parameter legality verification; in the hash operation stage, the original binary data of the current node model file is first normalized and then generated using SHA-256. Then, recursively process the child nodes to obtain hash values, sort them lexicographically, concatenate them, and generate SHA-256. Then, combine the standardized file path concatenation. and Generated with SHA-256 Finally, starting with the root node Starting from the root tree, a DFS-serialized tree structure is created and a global collision salt is added. A globally unique fingerprint is then generated using SHA-256. The entire process relies on dependency tree construction to organize file associations, a parameter rule base to ensure parameter compliance, and layered SHA-256 hash operations to ensure fingerprint uniqueness and security.

[0017] Technical Effects: Addressing the issue of poor stability in fingerprint generation in existing technologies, this application constructs a dependency tree to clearly define file dependencies. Combined with parameter and rule base comparisons, it reduces interference from parameter anomalies in fingerprint generation. Furthermore, the normalization and fixed-format concatenation in hierarchical hash operations prevent fingerprint fluctuations caused by data differences, significantly improving stability. Regarding efficiency, the dependency tree construction and recursive processing of child nodes efficiently organize file relationships, while SHA-256 hash operations quickly process data to generate hash values ​​at each stage, eliminating complex and redundant operations and greatly improving fingerprint generation efficiency. In terms of high generation risk, parameter verification in the static keyword protection zone intercepts illegal parameters, reducing the risk of fingerprint generation due to parameter errors. The addition of a global collision salt reduces the risk of fingerprints being cracked or tampered with, effectively solving the problem of high generation risk in existing technologies. Attached Figure Description

[0018] Figure 1 This is a flowchart of an embodiment of the present invention; Figure 2 This is a schematic diagram of the fingerprint generation process in an embodiment of the present invention; Figure 3 This is a flowchart illustrating parameter conflict in an embodiment of the present invention. Figure 4 This is a schematic diagram of the electronic device structure of the present invention. Detailed Implementation

[0019] The following detailed description illustrates the specific implementation method: The reference numerals in the accompanying drawings include: electronic device 400, processor 401, memory 402, input device 403, and output device 404.

[0020] The basic implementation examples are as follows: Figure 1 and Figure 2 As shown: A fingerprint generation method for a virtual evaluation model based on hash operations, including: S1: Start dependency tree construction based on the user-specified main model file as the root node, and initialize the access record table; where S1 includes: S1-1: Based on the user-specified main model file as the root node of the dependency tree, create an empty access record table, write the root node path into the access record table and mark it in the access record table; and initialize the audit log; S1-2: Read the file content of the current node, scanning line by line. The instruction extracts all sub-file paths and performs path normalization on each sub-file path; S1-3: Create a copy of the access record table for each sub-file, and check and parse whether the sub-file path already exists in the copy of the access record table. After all child nodes have been parsed, backtrack to the parent node to continue traversing.

[0021] In this embodiment, the virtual assessment model uses... Instructions referencing subfiles form dependencies. If circular references exist, such as file A containing file B, and file B containing file A, this can lead to infinite loops or logical errors in system parsing. Therefore, this application designs a depth-first traversal + access record table copy propagation mechanism to ensure the complete construction of the dependency tree, and avoids interference from sibling nodes through state isolation, thus blocking the risk of circular references in real time. The implementation process is as follows: 1. Initialization Configuration: Starting from the root node (main model file), using the user-specified main model file, such as main.k, as the root node of the dependency tree, create an empty "Access Record Table". The format of this record table is as follows: Then, the root node path is written to the record table and marked as "processing"; then the "audit log" is initialized. The fields in the audit log include timestamp, operation node, event type, and detailed information, which are used to record circular reference exceptions and file processing. 2. Depth-first traversal and subfile parsing: Read the file content of the current node (e.g., the root node main.k) and scan line by line. The instruction, in the format of Extract all sub-file paths; then perform path normalization on each sub-file path, for example, converting Windows format paths (such as D:) to normalized paths. Convert the file to UNIX format (e.g., / model / a.inc) and remove directory crossing characters such as .. / to ensure path uniqueness; 3. Circular Reference Detection and State Isolation: Create an "access record table copy" for each sub-file. The access record table copy directly replicates the access record table of the current node without affecting the original content of the access record table. Check whether the sub-file path already exists in the access record table copy. If the sub-file path already exists in the access record table copy and the status is "processing", it is determined to be a circular reference, triggering an abnormal state. The abnormal state is written to the audit log, and the parsing process of the current sub-node is terminated. If the sub-file path does not exist in the access record table copy, the sub-file path is written to the access record table copy, marked as "processing", and steps S1-2 are executed recursively. When the recursion ends, the sub-file status is updated to "processed". After all child nodes have been parsed, update the current node's state to "processed" and backtrack to the parent node to continue traversing.

[0022] S2: Construct a static keyword protection zone with a pre-defined core parameter rule base, scan and identify user operations on dynamic files, read parameter definitions from the dynamic files, compare them with the pre-defined core parameter rule base in the static keyword protection zone, and generate warning information; wherein, S2 includes: S2-1: Predefined core parameter rule base, store the core parameter rule base in a read-only directory, and generate a static keyword protection area; S2-2: Obtain the dynamic file uploaded and modified by the user, activate the parameter scanning mechanism to read the parameter definition in the dynamic file line by line, extract the parameter name and compare it with the predefined core parameter rule base in the static keyword protection area to determine whether it conforms to the core parameter rule; S2-3: If a violation of the core parameter rules is detected, an early warning operation will be performed.

[0023] like Figure 3 As shown, in this embodiment, if a user tampers with core parameters when modifying dynamic files, it will directly lead to distortion of simulation results. Therefore, this application establishes a static keyword protection zone as a parameter verification benchmark and initiates a scanning mechanism at the modification entry point. Through a graded blocking strategy of "key tampering termination process + boundary violation warning log", illegal operations are intercepted before execution, ensuring the validity of parameters. The specific implementation process is as follows: 1. Static Keyword Protection Area Construction: A predefined core parameter rule base is used. An example of the core parameter rule base is shown in Table 1 below: Table 1

[0024] The generated core parameter rule base is stored in a read-only directory of the system, which prohibits users from modifying it, thus ensuring the security of the verification benchmark.

[0025] 2. Dynamic File Parameter Scanning: When a user uploads or modifies a dynamic file, the system automatically activates the parameter scanning mechanism, reading the parameter definitions in the file line by line, such as *MATERIAL,NAME=Steel,TYPE=Elastic; then extracting the parameter name and parameter value, such as parameter name TYPE and parameter value Elastic, and comparing them with the rules of the static keyword protection zone to determine whether they comply with the legal rules. 3. Tiered blocking execution: If a "fatal violation" is detected, the loading and processing of the current model file will be terminated, a prompt message will be displayed, and the timestamp, the path of the violating file, parameter information, and blocking type will be written to the audit log; if the detection result is a warning violation, the process will not be terminated, a warning log will be generated, and a warning prompt will be displayed on the user interface for the user to confirm whether to continue.

[0026] S3: Read the raw binary data of the model file corresponding to the current node, perform data normalization processing, and then perform SHA-256 hash operation to generate a string. ; In this embodiment, step S3 is the first layer of the hierarchical hash operation, which is a file content hash operation. Specifically, it involves: reading the original binary data of the file corresponding to the current node; performing data normalization processing, such as removing blank lines, comments, and spaces from the file to ensure that files with the same content generate consistent processed data; then performing a SHA-256 hash operation on the normalized binary data to generate a 64-bit hexadecimal string, denoted as... .

[0027] S4: Recursively process all child nodes of the current node, obtain the node tree hash value, sort the child nodes in ascending lexicographical order according to file path, then concatenate the sorted child node information according to a fixed format, perform SHA-256 hash operation, and generate a string. S4 includes: S4-1: Recursively process all child nodes of the current node and obtain the node tree hash value of the child nodes; S4-2: Sort all child nodes in lexicographical order of file path; S4-3: According to a fixed format " "Concatenate and sort the child node information; S4-4: Perform a SHA-256 hash operation on the concatenated string to generate a new string. .

[0028] In this embodiment, step S4 is the second-level hash operation of the hierarchical hash operation, namely the joint hash calculation of child nodes. The specific process is as follows: First, all child nodes of the current node are processed recursively to obtain the hash value of each child node. Then, all child nodes are sorted according to the lexicographical order of their file paths. For example, a.inc is placed before b.inc, and model1 / c.inc is placed before model2 / d.inc. Then, according to a fixed format... Concatenate and sort the child node information, for example Finally, perform a SHA-256 hash operation on the concatenated string to generate a 64-bit hexadecimal string, denoted as . .

[0029] S5: Obtain the normalized file path of the current node, and process the string according to the normalized path. and strings The strings are concatenated, and a SHA-256 hash operation is performed on the concatenated strings to generate the ultimate identifier of the current node. S5 includes: S5-1: Get the normalized file path of the current node; S5-2: According to " "Format string concatenation; S5-3: Perform a SHA-256 hash operation on the concatenated string to generate the ultimate identifier of the current node. .

[0030] In this embodiment, step S5 is the third-level hash operation in the hierarchical hash operation, which aims to calculate the node's ultimate identifier. The specific process is as follows: obtain the normalized file path of the current node; the file exists in the aforementioned UNIX format; then press " "format string concatenation, where The delimiter is fixed. Finally, a SHA-256 hash operation is performed on the concatenated string to generate a 64-bit hexadecimal string, which serves as the ultimate identifier of the current node. .

[0031] S6: The ultimate identifier of the root node Starting from this point, the tree structure is serialized according to the DFS order. After adding a global collision salt, a SHA-256 hash operation is performed to output the globally unique fingerprint of the virtual evaluation model; where S6 includes: S6-1: After completing a full depth-first traversal of the dependency tree, use the ultimate identifier of the root node. Starting from the first line, serialize the entire dependency tree in DFS order; S6-2: Generate a global collision avoidance salt value, bind the global collision avoidance salt value to the model, and store it in the model metadata; S6-3: Concatenate strings in the format of "serialized tree structure + global anti-collision salt value", perform SHA-256 hash operation, and output the globally unique fingerprint of the virtual evaluation model.

[0032] In this embodiment, step S6 is the fourth level hash operation in the hierarchical hash operation, which aims to generate the global model fingerprint. Specifically, after completing the global depth-first traversal of the dependency tree, the root node's... Starting from the root node, serialize the entire dependency tree in DFS order, with the following format: root node Child node 1 ...; Child node 2 Next, a global anti-collision salt value is generated. The global anti-collision salt value is a 32-bit hexadecimal string randomly generated by the system. This salt value is bound to the model and permanently stored in the model metadata. Finally, the string is concatenated according to the serialized tree structure + global anti-collision salt value format, and SHA-256 hash operation is performed to generate a 64-bit hexadecimal string, which is the globally unique fingerprint of the virtual evaluation model.

[0033] Therefore, the core value of the technical solution in this application is reflected in three major dimensions of innovation. First, it accurately maps file dependencies through a tree-like topology structure and uses a deep copying mechanism of the access record table to block circular references and reduce the risk of infinite loops. At the same time, it completely captures multi-level nested dependencies to ensure lossless recording of file levels.

[0034] Secondly, an innovative dynamic protection system is constructed: on the one hand, hash value reuse technology is used to avoid repeated calculations, and on the other hand, a dual protection system of static protection zone and dynamic scanning is established to effectively prevent parameter conflicts.

[0035] Finally, at the engineering implementation level, three leaps were achieved: the positioning accuracy was improved to achieve precise traceability of the modification points; and a zero-knowledge verification mechanism based on Merkle trees was used to complete model consistency certification while protecting intellectual property rights.

[0036] like Figure 4 As shown, in another embodiment of this embodiment, an electronic device is also included, the electronic device 400 including one or more processors 401 and memory 402.

[0037] The processor 401 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 400 to perform desired functions.

[0038] The memory 402 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 401 may execute the program instructions to implement the fingerprint generation method of the virtual evaluation model based on hash operation in any embodiment of the present invention described above, and / or other desired functions. Various contents such as initial extrinsic parameters and thresholds may also be stored in the computer-readable storage medium.

[0039] In one example, the electronic device 400 may further include an input device 403 and an output device 404, these components being interconnected via a bus system and / or other forms of connection mechanisms (not shown). The input device 403 may include, for example, a keyboard, a mouse, etc. The output device 404 may output various information to the outside, including warning messages, braking force, etc. The output device 404 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0040] Of course, for the sake of simplicity, Figure 4 Only some of the components of the electronic device 400 relevant to the present invention are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 400 may include any other suitable components depending on the specific application.

[0041] In addition to the methods and devices described above, embodiments of the present invention may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps of the fingerprint generation method based on a hash-based virtual evaluation model provided in any embodiment of the present invention.

[0042] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of the present invention. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0043] Furthermore, embodiments of the present invention may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps of the fingerprint generation method based on a hash-based virtual evaluation model provided in any embodiment of the present invention.

[0044] The above are merely embodiments of the present invention. Commonly known structures and characteristics are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are aware of all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.

Claims

1. A fingerprint generation method for a virtual evaluation model based on hash operations, characterized in that: include: S1: Start dependency tree construction based on the user-specified main model file as the root node, and initialize the access record table; S2: Construct a static keyword protection zone with a pre-set core parameter rule base, scan and identify user operations on dynamic files, read parameter definitions in dynamic files, compare them with the pre-set core parameter rule base in the static keyword protection zone, and generate early warning information; S3: Read the raw binary data of the model file corresponding to the current node, perform data normalization processing, and then perform SHA-256 hash operation to generate a string. ; S4: Recursively process all child nodes of the current node, obtain the node tree hash value, sort the child nodes in ascending lexicographical order according to file path, then concatenate the sorted child node information according to a fixed format, perform SHA-256 hash operation, and generate a string. ; S5: Obtain the normalized file path of the current node, and process the string according to the normalized path. and strings The strings are concatenated, and a SHA-256 hash operation is performed on the concatenated strings to generate the ultimate identifier of the current node. ; S6: The ultimate identifier of the root node Starting from this point, the tree structure is serialized in the order of DFS, a global collision salt is added, and then a SHA-256 hash operation is performed to output the globally unique fingerprint of the virtual evaluation model.

2. The fingerprint generation method for a virtual evaluation model based on hash operation according to claim 1, characterized in that: S1 includes: S1-1: Based on the user-specified main model file as the root node of the dependency tree, create an empty access record table, write the root node path into the access record table and mark it in the access record table; and initialize the audit log; S1-2: Read the file content of the current node, scanning line by line. The instruction extracts all sub-file paths and performs path normalization on each sub-file path; S1-3: Create a copy of the access record table for each sub-file, and check and parse whether the sub-file path already exists in the copy of the access record table. After all child nodes have been parsed, backtrack to the parent node to continue traversing.

3. The fingerprint generation method for the virtual evaluation model based on hash operation according to claim 2, characterized in that: Both the access record table and its copy include The processing status is recorded, including unprocessed, processing, and processed; The specific steps in S1-3, namely checking and parsing whether the sub-file path already exists in the access record table copy, are as follows: If the sub-file path already exists in the access record table copy and the status is "processing", it is determined to be a circular reference, triggering an abnormal state. The abnormal state is written to the audit log, and the parsing process of the current sub-node is terminated. If the subfile path does not exist in the access record table copy, then write the subfile path into the access record table copy, mark it as being processed, recursively execute step S1-2, and update the subfile status to processed when the recursion ends.

4. The fingerprint generation method for the virtual evaluation model based on hash operation according to claim 3, characterized in that: S2 includes: S2-1: Predefined core parameter rule base, store the core parameter rule base in a read-only directory, and generate a static keyword protection area; S2-2: Obtain the dynamic file uploaded and modified by the user, activate the parameter scanning mechanism to read the parameter definition in the dynamic file line by line, extract the parameter name and compare it with the predefined core parameter rule base in the static keyword protection area to determine whether it conforms to the core parameter rule; S2-3: If a violation of the core parameter rules is detected, an early warning operation will be performed.

5. The fingerprint generation method for a virtual evaluation model based on hash operation according to claim 4, characterized in that: If a violation of the core parameter rules is detected in S2-3, the warning operation is specifically performed as follows: Results that do not conform to the core parameter rules are classified into fatal violations and warning violations. If the detection result is a fatal violation, the loading and processing of the current model file will be terminated, a prompt message will be displayed, and the timestamp, the path of the violating file, parameter information, and blocking type will be written to the audit log. If the detection result is a warning-level violation, the process will not be terminated, a warning log will be generated, and a warning prompt will pop up on the user interface for the user to confirm whether to continue.

6. The fingerprint generation method for a virtual evaluation model based on hash operation according to claim 5, characterized in that: S4 includes: S4-1: Recursively process all child nodes of the current node and obtain the node tree hash value of the child nodes; S4-2: Sort all child nodes in lexicographical order of file path; S4-3: Follow a fixed format "Concatenate and sort the child node information; S4-4: Perform a SHA-256 hash operation on the concatenated string to generate a new string. .

7. The fingerprint generation method for a virtual evaluation model based on hash operation according to claim 6, characterized in that: S5 includes: S5-1: Get the normalized file path of the current node; S5-2: According to " "Format string concatenation; S5-3: Perform a SHA-256 hash operation on the concatenated string to generate the ultimate identifier of the current node. .

8. The fingerprint generation method for a virtual evaluation model based on hash operation according to claim 7, characterized in that: S6 includes: S6-1: After completing a full depth-first traversal of the dependency tree, use the ultimate identifier of the root node. Starting from the first line, serialize the entire dependency tree in DFS order; S6-2: Generate a global collision avoidance salt value, bind the global collision avoidance salt value to the model, and store it in the model metadata; S6-3: Concatenate strings in the format of "serialized tree structure + global anti-collision salt value", perform SHA-256 hash operation, and output the globally unique fingerprint of the virtual evaluation model.

9. An electronic device, characterized in that: The system includes a processor and a memory, wherein the memory stores programs or instructions, and the processor executes the fingerprint generation method of the virtual evaluation model based on hash operation as described in any one of claims 1-8 by calling the programs or instructions stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instructions that cause a computer to execute the fingerprint generation method of the virtual evaluation model based on hash operation as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Application program updating method and device, equipment and storage medium

    CN114035827A

  • Digital archive system based on block chain

    CN118350047A