A file change localization method, system, device and medium

CN122528863APending Publication Date: 2026-08-07CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHONGQING JINKANG NEW ENERGY VEHICLE CO LTD
Filing Date
2026-04-01
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

其技术路径是通过专用解析器提取目标格式的部分结构化信息,再基于预设规则进行内容比对,其架构本质上是封闭的,不同格式需要不同的处理引擎,无法构建统一的跨平台分析能力,如语义分析型方案的技术偏重,通过多模态整合、深度语义分析和知识图谱技术实现标准文件的智能比对

Benefits of technology

本申请提供的该文件变更的定位方法,首先针对进行对比的基准文件集合和待检文件集合中的任一文件,确定文件的文件类型;基于与文件的文件类型对应的节点划分策略,构建文件对应的中间表示树,中间表示树包括基于文件记载的所有文件内容生成的根节点和对应的唯一标识,基于文件的逻辑容器记载的文件内容生成的分支节点和对应的唯一标识,基于文件的最小内容单元记载的文件内容生成的叶子节点和对应的唯一标识;将基准文件集合对应的所有中间表示树中的根节点唯一标识与待检文件集合对应的所有中间表示树中根节点的唯一标识进行匹配;将匹配成功的每对根节点进行是否发生变更的识别;针对匹配成功且存在变更的任一对根节点,基于分支节点的唯一标识,将该对根节点下属分支节点的唯一标识进行匹配;将匹配成功的每对分支节点进行变更识别;针对匹配成功且存在变更的任一对分支节点,基于叶子节点的唯一标识,将该对分支节点下属叶子节点的唯一标识进行匹配;将匹配成功的每对叶子节点进行变更识别,得到对应的第三变更结果,以定位待检文件集合中的最终发生变更的位置。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122528863A_ABST
    Figure CN122528863A_ABST
Patent Text Reader

Abstract

The application provides a file change positioning method, system, device and medium, and relates to the technical field of data processing. The method comprises the following steps: determining the type of files in two file sets for comparison; constructing an intermediate representation tree corresponding to the files based on a node division strategy corresponding to the type of the files; matching the unique identifier of the root node in the intermediate representation tree of the reference file set with the unique identifier of the root node in the intermediate representation tree of the to-be-inspected file set; performing change identification on each pair of root nodes that match successfully; for any pair of root nodes that have changes, matching the unique identifiers of the branch nodes under the pair of root nodes; performing change identification on the branch nodes that match successfully; for any pair of branch nodes that have changes, matching the unique identifiers of the leaf nodes under the pair of branch nodes; and performing change identification on each pair of leaf nodes that match successfully to locate the final changed position in the to-be-inspected file set. The method aims to improve the positioning efficiency of file changes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, specifically to a method, system, device, and medium for locating file changes. Background Technology

[0002] In the field of document processing technology, document difference detection is an important method. However, current document difference detection methods suffer from several shortcomings. For example, format-specific comparison tools have limitations. These solutions typically develop independent tools or plugins for specific file formats (such as Excel-specific comparison plugins and PDF comparison software). Their technical approach involves extracting partial structured information from the target format using a dedicated parser and then comparing content based on preset rules. This architecture is inherently closed; different formats require different processing engines, making it impossible to build a unified cross-platform analysis capability. Semantic analysis-based solutions, on the other hand, are heavily reliant on multimodal integration, deep semantic analysis, and knowledge graph technology to achieve intelligent comparison of standard documents. Their technical focus is entirely on the semantic level, which may lead to insufficient sensitivity to non-semantic but crucial technical details such as format changes and precise numerical adjustments. Secondly, this architecture heavily depends on domain-specific rule engines and knowledge graphs. This strong domain relevance makes the system lack versatility and difficult to extend with a lightweight architecture to support diverse document comparison needs. Therefore, its technical characteristics determine its specific applicability boundaries. Summary of the Invention

[0003] In view of this, this application provides a method, system, device, and medium for locating document changes. It aims to solve or partially solve the problems existing in the prior art.

[0004] The first aspect of this application provides a method for locating document changes, the method comprising: For any file in the set of benchmark files for comparison and the set of files to be inspected, determine the file type of the file; Based on the node partitioning strategy corresponding to the file type of the file, an intermediate representation tree is constructed for the file. The intermediate representation tree includes a root node and a corresponding unique identifier generated based on all file content recorded in the file, a branch node and a corresponding unique identifier generated based on the file content recorded in the logical container of the file, and a leaf node and a corresponding unique identifier generated based on the file content recorded in the smallest content unit of the file. Match the unique identifier of the root node in all intermediate representation trees corresponding to the base file set with the unique identifier of the root node in all intermediate representation trees corresponding to the file set to be tested; For each successfully matched pair of root nodes, identify whether any changes have occurred. For any pair of root nodes that have been successfully matched and have undergone changes, match the unique identifiers of the branch nodes under that pair of root nodes based on the unique identifiers of the branch nodes. Change identification is performed on each successfully matched pair of branch nodes; For any pair of branch nodes that have been successfully matched and have undergone changes, match the unique identifiers of the leaf nodes under that pair of branch nodes based on the unique identifier of the leaf node; For each successfully matched pair of leaf nodes, change identification is performed to obtain the corresponding third change result, in order to locate the final change location in the set of files to be inspected.

[0005] A second aspect of this application provides a document change location system, the system comprising: The file type determination module is used to determine the file type of any file in the set of benchmark files for comparison and the set of files to be inspected. The intermediate representation tree construction module is used to construct an intermediate representation tree corresponding to the file based on the node partitioning strategy corresponding to the file type of the file. The intermediate representation tree includes a root node and a corresponding unique identifier generated based on all the file content recorded in the file, branch nodes and corresponding unique identifiers generated based on the file content recorded in the logical container of the file, and leaf nodes and corresponding unique identifiers generated based on the file content recorded in the smallest content unit of the file. The first matching module is used to match the unique identifier of the root node in all intermediate representation trees corresponding to the base file set with the unique identifier of the root node in all intermediate representation trees corresponding to the file set to be checked. The first change identification module is used to identify whether each successfully matched pair of root nodes has been changed. The second matching module is used to match the unique identifiers of the branch nodes under the root nodes of any pair of root nodes that have been successfully matched and have changed, based on the unique identifiers of the branch nodes. The second change identification module is used to identify changes for each pair of successfully matched branch nodes. The third matching module is used to match the unique identifiers of the leaf nodes under the pair of branch nodes based on the unique identifiers of the leaf nodes for any pair of branch nodes that have been successfully matched and have changed. The third change identification module is used to identify changes in each successfully matched pair of leaf nodes to obtain the corresponding third change result, so as to locate the final change location in the set of files to be inspected.

[0006] A third aspect of this application provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and running on the processor, wherein when executed by the processor, the computer program implements the steps of a file change location method as described in the first aspect of this application.

[0007] The fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of a file change location method as described in the first aspect of this application.

[0008] The method for locating document changes provided in this application has the following advantages: The method for locating file changes provided in this application first determines the file type of any file in the comparison set of benchmark files and the file set to be inspected. Based on the node partitioning strategy corresponding to the file type, an intermediate representation tree is constructed. This intermediate representation tree includes root nodes generated from all file content recorded in the file and their corresponding unique identifiers, branch nodes generated from the file content recorded in the file's logical containers and their corresponding unique identifiers, and leaf nodes generated from the file content recorded in the smallest content unit of the file and their corresponding unique identifiers. The unique identifiers of the root nodes in all intermediate representation trees corresponding to the benchmark file set are matched with the unique identifiers of the root nodes in all intermediate representation trees corresponding to the file set to be inspected. For each successfully matched pair of root nodes, it is determined whether a change has occurred. For any successfully matched pair of root nodes that has been changed, the unique identifiers of the branch nodes under that pair are matched based on their unique identifiers. Each successfully matched pair of branch nodes is then identified as having been changed. For any successfully matched pair of branch nodes that has been changed, the unique identifiers of the leaf nodes under that pair are matched based on their unique identifiers. Finally, each successfully matched pair of leaf nodes is identified as having been changed, resulting in a third change result to locate the final changed position in the file set to be inspected.

[0009] Therefore, this application constructs a structurally unified intermediate representation tree for different types of files (such as Word documents, PDF documents, Excel spreadsheets, .h code files, and .c code files) within a file set (including a standard baseline file set and a file set to be inspected to determine if content changes have occurred). (This tree constructs a root node, branch nodes, and leaf nodes with unique identifiers for each file type.) Then, during change location, it performs unified node matching at the same level based on the unique identifiers of the nodes. For successfully matched node pairs, it identifies the change to pinpoint the specific location of the change within the file set to be inspected. This method can uniformly locate changes in file sets containing multiple file types, thereby improving the applicability and efficiency of change location. Furthermore, for the node pairs being compared, a hash value calculated from the file content recorded by the node is used to identify whether a change has occurred. This effectively ensures identification accuracy while improving the applicability and efficiency of change location. In addition, for document files (such as Word documents and PDF documents), the full hash value and semantic recognition are used to jointly determine the type of change in the corresponding file content (such as semantic change or change in file content), so as to achieve accurate identification of changes and intelligent classification. Attached Figure Description

[0010] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 A flowchart illustrating a method for locating file changes according to one embodiment of this application; Figure 2 This is another flowchart illustrating a method for locating file changes, as shown in one embodiment of this application; Figure 3 This is a schematic diagram illustrating a document change location system according to one embodiment of this application. Detailed Implementation

[0012] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0013] refer to Figure 1 , Figure 1 This is a flowchart illustrating a method for locating file changes, as shown in one embodiment of this application. Figure 1 As shown, the method includes: Step S01: For any file in the set of benchmark files for comparison and the set of files to be inspected, determine the file type of the file.

[0014] In this embodiment, the file set used in the file change location method of this application includes a standard benchmark file set. This benchmark file set is a set of standard files used to evaluate whether the content of each file in the file set to be inspected has changed. This standard file set includes multiple files. The file set to be inspected is the set of files in the benchmark file set whose content has changed (e.g., a section of content in a file has been modified), or it is the benchmark file set that has not been changed. The content change of the files in the file set to be inspected is relative to the content of the corresponding file in the benchmark file set. For example, the first section of content in file a' in the file set to be inspected has changed relative to the first section of content in file a in the benchmark file set that matches file a'.

[0015] In this embodiment, when performing change location, multiple sets of files to be inspected can be compared with a standard set of files. For any file in the benchmark set, an intermediate representation tree corresponding to that file is constructed. Similarly, for any file in the set of files to be inspected, an intermediate representation tree corresponding to that file is also constructed. Since the implementation method for constructing the intermediate representation tree for each file is the same, a single file is used as an example for explanation. First, the magic number of the file is analyzed using relevant tools to determine its file type. File types include at least document files (such as PDF documents and Word documents), table files (such as Excel spreadsheets), and code files (such as .c and .h code files). Since code files do not have a special magic number, the file type can be determined by checking the file extension (such as .c / .h). For greater accuracy, heuristic rules can also be used (e.g., checking whether the .h file contains a large number of #ifndef, #define, and other preprocessor directives) to determine the file type. Through the same implementation method, the file type of each file in the benchmark set and the set of files to be inspected can be determined.

[0016] Step S02: Based on the node partitioning strategy corresponding to the file type of the file, construct the intermediate representation tree corresponding to the file. The intermediate representation tree includes a root node and a corresponding unique identifier generated based on all the file content recorded in the file, branch nodes and corresponding unique identifiers generated based on the file content recorded in the logical container of the file, and leaf nodes and corresponding unique identifiers generated based on the file content recorded in the smallest content unit of the file.

[0017] In this embodiment, the internal data structure and organization of a file vary depending on its file type. This application employs a node partitioning strategy corresponding to the file type to construct the intermediate representation tree for that file. Although the node partitioning strategy differs depending on the file type, the final structure of the intermediate representation tree remains the same regardless of the file type. The structure of the intermediate representation tree for a file includes: a root node generated based on all the file content recorded in the file, which has a unique identifier in its respective file set. This unique identifier is used to match other root nodes, and a pair of successfully matched root nodes is used for change identification. Additionally, branch nodes generated based on the file content recorded in the file's logical containers, each branch node having a unique identifier in its respective file set. This unique identifier is used to match other branch nodes, and a pair of successfully matched branch nodes is used for change identification. Finally, leaf nodes generated based on the file content recorded in the smallest content unit of the file, each leaf node having a unique identifier in its respective file set. This unique identifier is used to match other leaf nodes, and a pair of successfully matched leaf nodes is used for change identification. Specifically, when the file is a text file, the logical container is the file's chapters; when the file is a table file, the logical container is the file's worksheets; and when the file is a code file, the logical container is functions and code blocks (delimited by {}), etc. Using the same implementation method, each file in the baseline file set and the file set to be tested can have its corresponding intermediate representation tree constructed.

[0018] In this embodiment, an optional implementation method for generating nodes based on the corresponding file content is as follows: the hash value calculated based on the file content corresponding to the node is used as the attribute value of the node. During change identification, the attribute values ​​of two successfully matched nodes are compared. If the attribute values ​​of the two nodes are the same, it is determined that the file content corresponding to the two nodes has not changed; if the attribute values ​​of the two nodes are different, it is determined that the file content corresponding to the two nodes has changed.

[0019] Step S03: Match the unique identifier of the root node in all intermediate representation trees corresponding to the base file set with the unique identifier of the root node in all intermediate representation trees corresponding to the file set to be inspected.

[0020] In this embodiment, after the processing of steps S01 to S02 described above, each file in the reference file set has its own corresponding intermediate representation tree, and each file in the file set to be inspected also has its own corresponding intermediate representation tree. Then, the unique identifier of the root node in all the intermediate representation trees corresponding to the reference file set is matched with the unique identifier of the root node in all the intermediate representation trees corresponding to the file set to be inspected. If the unique identifier of a first root node in all the intermediate representation trees corresponding to the reference file set matches the unique identifier of a second root node in all the intermediate representation trees corresponding to the file set to be inspected, then it is determined that the first root node in the reference file set and the second root node in the file set to be inspected are successfully matched. This successful match indicates that the file corresponding to the second root node in the file set to be inspected originated from the file corresponding to the first root node in the reference file set; that is, the file corresponding to the second root node in the file set to be inspected was obtained by modifying the file corresponding to the first root node in the reference file set, or the file corresponding to the second root node in the file set to be inspected is the same file as the file corresponding to the first root node in the reference file set. Whether it was obtained through modifications or is simply the file corresponding to the first root node in the baseline file set, further modification identification of the first and second root nodes is needed.

[0021] Step S04: Identify whether each successfully matched pair of root nodes has been changed.

[0022] In this embodiment, as Figure 2 As shown, for any pair of root nodes that successfully match through the matching process in step S03, one root node comes from the baseline file set, and the other root node comes from the file set to be checked. For any pair of root nodes that successfully match through the matching process in step S03, change identification is performed on the pair of root nodes. If the attribute values ​​of the pair of root nodes are consistent, it is determined that the file corresponding to the root node from the file set to be checked has not changed, and further change identification of the branch nodes and leaf nodes under that root node is unnecessary. If the attribute values ​​of the pair of root nodes are inconsistent, it is determined that the file corresponding to the root node from the file set to be checked has changed, and further change identification of the branch nodes and leaf nodes under that root node will be performed. Here, change identification for a pair of root nodes refers to identifying whether the contents of the two files corresponding to the pair of root nodes are consistent and whether content changes have occurred.

[0023] Step S05: For any pair of root nodes that have been successfully matched and have undergone changes, match the unique identifiers of the branch nodes under the pair of root nodes based on the unique identifiers of the branch nodes.

[0024] In this embodiment, the unique identifier of a branch node records the unique identifier of its parent node; that is, the unique identifier of a branch node records the unique identifier of the root node to which it belongs. For any pair of root nodes that have successfully matched and undergone content changes (i.e., root node pairs with inconsistent attribute values) obtained through step S04, all branch nodes originating from that pair of root nodes are determined based on the unique identifiers of all branch nodes in the baseline file set and the file set to be inspected. Then, the branch nodes from the baseline file set among all the branch nodes are matched with the branch nodes from the file set to be inspected among all the branch nodes. If the unique identifier of a first branch node from the baseline file set matches the unique identifier of a second branch node from the file set to be inspected, then the first branch node in the baseline file set and the second branch node in the file set to be inspected are considered a successful match. This successful match indicates that the file segment corresponding to the second branch node in the file set to be inspected originated from the file segment corresponding to the first branch node in the baseline file set. In other words, the content of a file segment corresponding to the second branch node in the file set to be inspected is derived from the content of the file segment corresponding to the first branch node in the baseline file set after modification. Alternatively, the content of a file segment corresponding to the second branch node in the file set to be inspected is the content of the file segment corresponding to the first branch node in the baseline file set (file content refers to the data recorded within a file, such as characters in a Word document or characters recorded in a cell in an Excel spreadsheet). Whether it was derived from modification or is simply the content of the file segment corresponding to the first branch node in the baseline file set requires further modification identification of the first and second branch nodes.

[0025] Step S06: Perform change identification on each successfully matched pair of branch nodes.

[0026] In this embodiment, for any pair of successfully matched branch nodes obtained through the matching process in step S05, one branch node comes from the baseline file set, and the other branch node comes from the file set to be checked. For any pair of successfully matched branch nodes obtained through the matching process in step S05, change identification is performed on the pair of branch nodes. If the attribute values ​​of the pair of branch nodes are consistent, it is determined that the file content corresponding to the branch node from the file set to be checked has not changed, and there is no need to perform further change identification on the leaf nodes under that branch node. If the attribute values ​​of the pair of branch nodes are inconsistent, it is determined that the file content corresponding to the branch node from the file set to be checked has changed, and further change identification will be performed on the leaf nodes under that branch node.

[0027] Step S07: For any pair of branch nodes that have been successfully matched and have undergone changes, match the unique identifiers of the leaf nodes under the pair of branch nodes based on the unique identifiers of the leaf nodes.

[0028] In this embodiment, the unique identifier of a leaf node records the unique identifier of its parent node; that is, the unique identifier of a leaf node records the unique identifier of the branch node to which it belongs. For any pair of branch nodes that have successfully matched and have undergone content changes (i.e., the attribute values ​​of a pair of branch nodes are inconsistent), based on the unique identifiers of all leaf nodes in the base file set and the file set to be checked, all leaf nodes originating from that pair of branch nodes are determined. Then, the leaf nodes from the base file set among all the leaf nodes are matched with the leaf nodes from the file set to be checked among all the leaf nodes. If the unique identifier of a first leaf node from the leaf nodes of the baseline file set matches the unique identifier of a second leaf node from the leaf nodes of the file set to be inspected, then it is determined that the first leaf node in the baseline file set and the second leaf node in the file set to be inspected are successfully matched. This successful match indicates that the smallest content unit corresponding to the second leaf node in the file set to be inspected (such as a sentence in a Word document, a row of cell data in an Excel spreadsheet, or a line of code in a code file) originates from the smallest content unit corresponding to the first leaf node in the baseline file set. In other words, the smallest content unit corresponding to the second leaf node in the file set to be inspected is obtained by modifying the smallest content unit corresponding to the first leaf node in the baseline file set, or the smallest content unit corresponding to the second leaf node in the file set to be inspected is the same as the smallest content unit corresponding to the first leaf node in the baseline file set. Further modification identification of the first and second leaf nodes is needed to determine whether a modification was made or whether it is the same as the smallest content unit corresponding to the first leaf node in the baseline file set.

[0029] Step S08: Perform change identification on each successfully matched pair of leaf nodes to obtain the corresponding third change result, so as to locate the final change position in the set of files to be inspected.

[0030] In this embodiment, for any pair of leaf nodes that are successfully matched through the matching process in step S07, one leaf node comes from the baseline file set, and the other leaf node comes from the file set to be inspected. For any pair of leaf nodes that are successfully matched through the matching process in step S07, change identification is performed on the pair of leaf nodes. If the attribute values ​​of the pair of leaf nodes are consistent, it is determined that the smallest content unit corresponding to the leaf node from the file set to be inspected has not changed. If the attribute values ​​of the pair of leaf nodes are inconsistent, it is determined that the smallest content unit corresponding to the leaf node from the file set to be inspected has changed, thereby locating which files in the file set to be inspected have had their smallest content units changed.

[0031] The method for locating file changes provided in this application constructs a unified intermediate representation tree for different types of files (such as Word documents, PDF documents, Excel spreadsheets, .h code files, and .c code files) in a file set (including a standard baseline file set and a file set to be inspected to determine if there are any content changes). (That is, for each type of file, a root node, branch nodes, and leaf nodes with unique identifiers are constructed.) Then, when locating changes, nodes at the same level are matched uniformly based on the unique identifiers of the nodes, and changes are identified for successfully matched node pairs to locate the specific location where the change occurred in the file in the file set to be inspected. This method can uniformly locate changes for file sets including multiple file types, thereby improving the applicability and efficiency of change location.

[0032] In conjunction with the above embodiments, in one implementation, this application also provides a method for locating file changes. In this method for locating file changes, when the file type is a document file, step S02 may include steps S02_1a to S02_5a: Step S02_1a: Construct the root node in the intermediate representation tree corresponding to the file based on the hash value calculated from the file content recorded in the file, and generate a unique identifier for the root node based on the file name, file type and storage path.

[0033] In this embodiment, as Figure 2As shown, when the file type is a document file, the root node in the intermediate representation tree corresponding to the file is constructed based on the hash value calculated from all the file content recorded in the file (i.e., all the data recorded inside the file). This hash value is used as the attribute value of the root node, which is used to identify whether the file has been modified. Simultaneously, a unique identifier for the root node is generated based on the file name, file type, and file storage path. The unique identifier of the root node is used to match two files for comparison. To avoid unique identifier conflicts among multiple files with different file types but the same file name stored in the same folder, this application incorporates the file type into the generation of the unique identifier for the root node. Furthermore, to avoid unique identifier conflicts among multiple files with the same file type and the same file name but different extensions stored in the same folder, this application includes the file extension in the file name used to generate the unique identifier, such as the .doc and .docx extensions for Word files. To avoid unique identifier conflicts between multiple files of the same type, name, and extension stored in different folders, this application incorporates the file's storage path into the process of generating the unique identifier for the root node. The file's storage path is the path from the project root folder of the file set (e.g., the baseline file set, the file set to be inspected) to the folder containing the file. This storage path does not include the file name or any directory levels above the root folder. For example, if the project root folder of the file set (e.g., the baseline file set, the file set to be inspected) is docs, and this root folder docs is stored in the user folder under the home folder, and this root folder can have subfolders, when generating a unique identifier for a file in this root folder (i.e., a file in a corresponding file set), the storage path of the file is determined using the project root folder docs as the starting point. For instance, if the storage path of the file "Product Specifications.docx" is home / user / docs / document a1 / document b2 / Product Specifications.docx, then the storage path of the file "Product Specifications.docx" is determined to be "docs / document a1 / document b2". Document files include Word files and PDF files.

[0034] Step S02_2a: Divide the file content recorded in the file into file segments by chapter.

[0035] In this embodiment, the file is parsed to extract all the file content recorded in the file, and all the extracted file content is divided into file segments by chapter. Each file segment will generate a corresponding branch node.

[0036] Step S02_3a: Construct a branch node in the intermediate representation tree corresponding to the file based on the hash value calculated from the file content recorded in the file fragment, and generate a unique identifier for the branch node based on the unique identifier of the root node where the file fragment is located, the chapter name of the file fragment, and the order of the file fragment in the file.

[0037] In this embodiment, for any file segment, the file content within that segment is calculated to obtain a corresponding hash value. A branch node is generated under the root node of the file containing that file segment, and the calculated hash value is used as the attribute value of the branch node for subsequent change identification. Simultaneously, based on the unique identifier of the root node containing the file segment, the chapter name of the file segment, and the sequence number of the file segment within its own file (e.g., if file segment a belongs to the 3rd chapter in its own file, the sequence number is 3), a unique identifier for the branch node is generated. This unique identifier is used to match two file segments for comparison. The file change location method provided in this application is applicable to scenarios where the content of the smallest content unit within a file segment changes; it is not applicable to scenarios where the entire smallest content unit is deleted or added within a file segment; nor is it applicable to scenarios where the entire file segment is deleted or added. Through the same implementation method, each file segment in a file will generate its own corresponding branch node and a unique identifier.

[0038] Step S02_4a: Divide the file content recorded in the file fragment into the smallest content unit by code line.

[0039] In this embodiment, for any file segment obtained by segmentation, the file content recorded in the file segment is divided into the smallest content unit by sentence, and a corresponding leaf node is generated for each smallest content unit.

[0040] Step S02_5a: Construct the leaf node in the intermediate representation tree corresponding to the file based on the hash value calculated based on the file content recorded in the smallest content unit, and generate the unique identifier of the leaf node based on the unique identifier of the branch node where the smallest content unit is located and the sorting of the smallest content unit in the corresponding file segment, so as to construct and generate the intermediate representation tree corresponding to the file.

[0041] In this embodiment, for any smallest content unit, the file content within that smallest content unit is calculated to obtain a corresponding hash value. A leaf node is then generated under the branch node corresponding to the file segment containing that smallest content unit. The calculated hash value is used as the attribute value of the leaf node, which is used for subsequent change identification. Simultaneously, based on the unique identifier of the branch node containing the smallest content unit and the sorting of the smallest content unit within the corresponding file segment (e.g., if the smallest content unit 'a' is the 3rd sentence in its own file segment, then the sorting value is 3), a unique identifier for the leaf node is generated. This unique identifier is used to match two smaller content units for comparison.

[0042] In conjunction with the above embodiments, in one implementation, this application also provides a method for locating file changes. In this method for locating file changes, when the file type is a table-type file, step S02 may include steps S02_1b to S02_5b: Step S02_1b: Construct the root node in the intermediate representation tree corresponding to the file based on the hash value calculated from the file content recorded in the file, and generate a unique identifier for the root node based on the file name, file type and storage path.

[0043] In this embodiment, when the file type is a spreadsheet (such as an Excel spreadsheet), the root node in the intermediate representation tree corresponding to the file is constructed based on the hash value calculated from all the file content (i.e., all the data recorded within the file). This hash value is used as the attribute value of the root node, which is used to identify whether the file has been modified. Simultaneously, a unique identifier for the root node is generated based on the file name, file type, and file storage path. The unique identifier of the root node is used to match two files for comparison.

[0044] Step S02_2b: Divide the file into file segments, using worksheets as the unit.

[0045] In this embodiment, the file is parsed and divided into file segments based on worksheets, with each file segment generating a corresponding branch node.

[0046] Step S02_3b: Construct a branch node in the intermediate representation tree corresponding to the file based on the hash value calculated from the file content recorded in the file fragment, and generate a unique identifier for the branch node based on the unique identifier of the root node where the file fragment is located, the worksheet name of the file fragment, and the order of the file fragment in the file.

[0047] In this embodiment, for any given file segment, a hash value is calculated on the file content within that segment, specifically on all file content within the worksheet corresponding to that segment. This hash value is then used to generate a branch node subordinate to the root node of the file containing that file segment. The calculated hash value is then used as the attribute value of this branch node for subsequent change identification. Simultaneously, based on the unique identifier of the root node containing the file segment, the worksheet name of the file segment, and the sort order of the file segment within its own file (e.g., if file segment 'a' is in the 3rd worksheet, the sort order is 3), a unique identifier for the branch node is generated. This unique identifier is used to match two file segments for comparison. Through the same implementation, each file segment within a file will generate its own corresponding branch node and a unique identifier.

[0048] Step S02_4b: Divide the file content recorded in the file fragment into the smallest content unit based on line data.

[0049] In this embodiment, for any file segment obtained by segmentation, the file content recorded in the file segment is divided into the smallest content unit by line data, and a corresponding leaf node is generated for each smallest content unit.

[0050] Step S02_5b: Construct the leaf node in the intermediate representation tree corresponding to the file based on the hash value calculated based on the file content recorded in the smallest content unit, and generate the unique identifier of the leaf node based on the unique identifier of the branch node where the smallest content unit is located and the file content recorded in the first cell of the smallest content unit, so as to construct and generate the intermediate representation tree corresponding to the file.

[0051] In this embodiment, for any smallest content unit, the file content within that smallest content unit is calculated to obtain a corresponding hash value. A leaf node is then generated under the branch node corresponding to the file segment containing that smallest content unit. The calculated hash value is used as the attribute value of the leaf node, which is used for subsequent change identification. Simultaneously, based on the unique identifier of the branch node containing the smallest content unit and the file content recorded in the first cell of that smallest content unit, a unique identifier for the leaf node is generated. This unique identifier is used to match two smaller content units for comparison.

[0052] In conjunction with the above embodiments, in one implementation, this application also provides a method for locating file changes. In this method for locating file changes, when the file type is a code file, step S02 may include steps S02_1c to S02_5c: Step S02_1c: Construct the root node in the intermediate representation tree corresponding to the file based on the hash value calculated from the file content recorded in the file, and generate a unique identifier for the root node based on the file name, file type and storage path.

[0053] In this embodiment, when the file type is a code file (such as .c code files and .h code files), the root node in the intermediate representation tree corresponding to the file is constructed based on the hash value calculated from all the file content recorded in the file (i.e., all the data recorded inside the file). This hash value is used as the attribute value of the root node, which is used to identify whether the file has been modified. Simultaneously, a unique identifier for the root node is generated based on the file name, file type, and file storage path. The unique identifier of the root node is used to match two files for comparison.

[0054] Step S02_2c: Divide the file content recorded in the file into file segments, with code segments as the unit.

[0055] In this embodiment, the file is parsed and divided into file segments based on code sections. Each file segment generates a corresponding branch node. Code segments include class definition segments, function / method definition segments, interface / protocol definition segments, and structure / enumeration definition segments, etc.

[0056] Step S02_3c: Construct a branch node in the intermediate representation tree corresponding to the file based on the hash value calculated from the file content recorded in the file fragment, and generate a unique identifier for the branch node based on the unique identifier of the root node where the file fragment is located, the code segment signature of the file fragment, and the order of the file fragment in the file.

[0057] In this embodiment, for any file segment, the file content within that segment is calculated, that is, all file content within the corresponding code segment is calculated to obtain a corresponding hash value. A branch node is then generated under the root node of the file containing that file segment. The calculated hash value is used as the attribute value of this branch node, which is used for subsequent change identification. Simultaneously, based on the unique identifier of the root node containing the file segment, the code segment signature of the file segment, and the order of the file segment within its own file, a unique identifier for the branch node is generated. This unique identifier is used to match two file segments for comparison. Through the same implementation, each file segment in a file will generate its own corresponding branch node and a unique identifier. Specifically, the code segment signature for a class definition segment (Class) is the class name; the code segment signature for a function / Method definition segment (Function / Method) is the function name; the code segment signature for an interface definition segment is the interface name; the code segment signature for a protocol definition segment is the protocol name; the code segment signature for a structure definition segment is the structure name; and the code segment signature for an enumeration definition segment is the enumeration name.

[0058] Step S02_4c: Divide the file content recorded in the file fragment into the smallest content unit by code line.

[0059] In this embodiment, for any file segment obtained by segmentation, the file content recorded in the file segment is divided into the smallest content unit by code line, and a corresponding leaf node is generated for each smallest content unit.

[0060] Step S02_5c: Construct the leaf node in the intermediate representation tree corresponding to the file based on the hash value calculated based on the file content recorded in the smallest content unit, and generate the unique identifier of the leaf node based on the unique identifier of the branch node where the smallest content unit is located and the sorting of the smallest content unit in the corresponding file segment, so as to construct and generate the intermediate representation tree corresponding to the file.

[0061] In this embodiment, for any smallest content unit, the file content within that smallest content unit is calculated to obtain a corresponding hash value. A leaf node is then generated under the branch node corresponding to the file segment containing that smallest content unit. The calculated hash value is used as the attribute value of this leaf node, which is used for subsequent change identification. Simultaneously, based on the unique identifier of the branch node containing the smallest content unit and the line number of the smallest content unit within the corresponding code segment, a unique identifier for the leaf node is generated. This unique identifier is used to match two smaller content units for comparison.

[0062] In conjunction with the above embodiments, in one implementation, this application also provides a method for locating file changes. This method further includes: if a root node in the baseline file set cannot be matched with a root node in the file set to be inspected, determining that the file corresponding to that root node in the file set to be inspected is deleted; and if a root node in the file set to be inspected cannot be matched with a root node in the baseline file set, determining that the file corresponding to that root node in the file set to be inspected is a newly added file.

[0063] In this embodiment, if a unique identifier for a root node exists in the baseline file set, and no unique identifier for a root node in the file set to be inspected matches the unique identifier of that root node in the baseline file set, then it is determined that the file corresponding to that root node in the baseline file set is missing from the file set to be inspected; that is, the file in the file set to be inspected is in a deleted state. For example, if a unique identifier for root node 1 exists in the baseline file set, and no unique identifier for any root node in the file set to be inspected matches the unique identifier of root node 1 in the baseline file set, then it is determined that file a corresponding to root node 1 is missing from the file set to be inspected, indicating that file a has been deleted from the file set to be inspected.

[0064] In this embodiment, if a unique identifier for a root node exists in the set of files to be inspected, and no unique identifier for a root node in the baseline file set matches the unique identifier of that root node in the set of files to be inspected, then it is determined that the baseline file set is missing the file corresponding to that root node in the set of files to be inspected; that is, the file in the set of files to be inspected is in a newly added state. For example, if a unique identifier for root node 2 exists in the set of files to be inspected, but no unique identifier for any root node in the baseline file set matches the unique identifier of root node 2 in the set of files to be inspected, then it is determined that the baseline file set is missing the file b corresponding to root node 2, indicating that the file b has been newly added to the set of files to be inspected.

[0065] In conjunction with the above embodiments, in one implementation, this application also provides a method for locating file changes. In this method for locating file changes, if the file type of the matched leaf node is a document file, step S08 may include: Step S08_1: Compare the hash values ​​of each successfully matched pair of leaf nodes to obtain their respective comparison results.

[0066] In this embodiment, to accurately locate change points and assess their semantic impact, this application employs attribute value comparison and semantic similarity at the smallest content unit level of the file to locate change points and assess their semantic impact. Specifically, for any pair of leaf nodes that successfully match through the matching process in step S07, the hash values ​​of the pair of leaf nodes are compared to obtain a comparison result indicating whether they are consistent. Through the same implementation method, each pair of leaf nodes that successfully match through the matching process in step S07 can obtain a corresponding comparison result indicating whether their hash values ​​are consistent.

[0067] Step S08_2: For any pair of leaf nodes whose hash values ​​match, determine that the file content corresponding to that pair of leaf nodes in the set of files to be inspected has not changed.

[0068] In this embodiment, if the comparison results of a pair of leaf nodes are consistent with the hash values, it is determined that the file content corresponding to the pair of leaf nodes in the set of files to be inspected has not changed.

[0069] Step S08_3: For any pair of leaf nodes whose hash values ​​are inconsistent in the comparison results, perform semantic similarity detection on the pair of leaf nodes using the semantic similarity detection model to obtain the corresponding third change result, so as to locate the final change position in the set of files to be inspected.

[0070] In this embodiment, if the comparison results for a pair of leaf nodes show inconsistent hash values, it is determined that the file content corresponding to that pair of leaf nodes in the file set to be inspected has been changed. Then, a pre-trained semantic similarity detection model is used to further perform semantic similarity detection on the file content corresponding to that pair of leaf nodes to obtain the corresponding third change result. Through the same implementation method, each pair of leaf nodes whose comparison results show inconsistent hash values ​​will obtain a corresponding third change result.

[0071] In conjunction with the above embodiments, in one implementation, this application also provides a method for locating file changes. In this method for locating file changes, step S08_3 may include: Step S08_3a: For any pair of leaf nodes with a semantic similarity greater than or equal to the first threshold, determine that the file content corresponding to the pair of leaf nodes in the set of files to be inspected has not changed.

[0072] In this embodiment, if the semantic similarity of the file content corresponding to the pair of leaf nodes is detected by a pre-trained semantic similarity detection model, and the obtained semantic similarity is greater than or equal to the first threshold, then it is determined that the file content corresponding to the pair of leaf nodes in the file set to be inspected has hardly changed. In this case, it is determined that the file content corresponding to the pair of leaf nodes in the file set to be inspected has not changed.

[0073] Step S08_3b: For any pair of leaf nodes whose semantic similarity is less than the first threshold and greater than or equal to the second threshold, determine that the file content corresponding to the pair of leaf nodes in the set of files to be inspected has undergone a first-level change.

[0074] In this embodiment, if a pre-trained semantic similarity detection model is used to perform semantic similarity detection on the file content corresponding to a pair of leaf nodes, and the obtained semantic similarity is less than a first threshold and greater than or equal to a second threshold, then it is determined that the file content corresponding to the pair of leaf nodes in the file set to be inspected has undergone a first-level change. This first-level change is a non-substantial change, that is, the content has changed, but the changed content is semantically similar to the previous content, and no substantial content change has occurred. The first threshold is greater than the second threshold.

[0075] Step S08_3c: For any pair of leaf nodes whose semantic similarity is less than the second threshold, determine that the file content corresponding to the pair of leaf nodes in the file set to be inspected has undergone a second-level change. The second-level change is greater than the first-level change, and the higher the level of change, the greater the degree of change.

[0076] In this embodiment, if a semantic similarity detection model is used to perform semantic similarity detection on the file content corresponding to a pair of leaf nodes, and the obtained semantic similarity is less than a second threshold, then it is determined that the file content corresponding to the pair of leaf nodes in the file set to be inspected has undergone a second-level change. The second-level change is greater than the first-level change, with higher levels corresponding to a greater degree of change. A second-level change indicates a substantial change, meaning that not only has the content changed, but the semantics of the content has also changed.

[0077] Based on the same inventive concept, this application provides a document change location system, such as... Figure 3 As shown, the system 300 includes: The file type determination module 301 is used to determine the file type of any file in the set of benchmark files for comparison and the set of files to be inspected. The intermediate representation tree construction module 302 is used to construct an intermediate representation tree corresponding to the file based on the node partitioning strategy corresponding to the file type of the file. The intermediate representation tree includes a root node and a corresponding unique identifier generated based on all file content recorded in the file, branch nodes and corresponding unique identifiers generated based on the file content recorded in the logical container of the file, and leaf nodes and corresponding unique identifiers generated based on the file content recorded in the smallest content unit of the file. The first matching module 303 is used to match the unique identifier of the root node in all intermediate representation trees corresponding to the base file set with the unique identifier of the root node in all intermediate representation trees corresponding to the file set to be inspected. The first change identification module 304 is used to identify whether each successfully matched pair of root nodes has been changed. The second matching module 305 is used to match the unique identifiers of the subordinate branch nodes of any pair of root nodes that have been successfully matched and have changed, based on the unique identifiers of the branch nodes. The second change identification module 306 is used to identify changes for each pair of successfully matched branch nodes. The third matching module 307 is used to match the unique identifiers of the leaf nodes under the pair of branch nodes based on the unique identifiers of the leaf nodes for any pair of branch nodes that have been successfully matched and have changed. The third change identification module 308 is used to identify the change of each successfully matched pair of leaf nodes and obtain the corresponding third change result in order to locate the final change location in the set of files to be inspected.

[0078] Based on the same inventive concept, this application provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and running on the processor, wherein when the computer program is executed by the processor, it implements the steps in a file change location method as described in the first aspect of this application.

[0079] Based on the same inventive concept, this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of a file change location method as described in the first aspect of this application.

[0080] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily necessary for the embodiments of this application. As for the system embodiments, since they are basically similar to the method embodiments, the description is relatively simple; relevant details can be found in the descriptions of the method embodiments.

[0081] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.

[0082] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0083] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0084] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0085] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0086] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.

[0087] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.

[0088] The above provides a detailed description of the document change location method, system, device, and medium provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for locating file changes, characterized in that, The method includes: For any file in the set of benchmark files for comparison and the set of files to be inspected, determine the file type of the file; Based on the node partitioning strategy corresponding to the file type of the file, an intermediate representation tree is constructed for the file. The intermediate representation tree includes a root node and a corresponding unique identifier generated based on all file content recorded in the file, a branch node and a corresponding unique identifier generated based on the file content recorded in the logical container of the file, and a leaf node and a corresponding unique identifier generated based on the file content recorded in the smallest content unit of the file. Match the unique identifier of the root node in all intermediate representation trees corresponding to the base file set with the unique identifier of the root node in all intermediate representation trees corresponding to the file set to be tested; For each successfully matched pair of root nodes, identify whether any changes have occurred. For any pair of root nodes that have been successfully matched and have undergone changes, match the unique identifiers of the branch nodes under that pair of root nodes based on the unique identifiers of the branch nodes. Change identification is performed on each successfully matched pair of branch nodes; For any pair of branch nodes that have been successfully matched and have undergone changes, match the unique identifiers of the leaf nodes under that pair of branch nodes based on the unique identifier of the leaf node; For each successfully matched pair of leaf nodes, change identification is performed to obtain the corresponding third change result, in order to locate the final change location in the set of files to be inspected.

2. The method for locating file changes according to claim 1, characterized in that, When the file type of the file is a document file, the step of constructing the intermediate representation tree corresponding to the file based on the node partitioning strategy corresponding to the file type includes: The root node in the intermediate representation tree corresponding to the file is constructed from the hash value calculated based on the file content recorded in the file, and a unique identifier for the root node is generated based on the file name, file type and storage path; The document content recorded in the document is divided into document segments by chapter; The branch node in the intermediate representation tree corresponding to the file is constructed based on the hash value calculated from the file content recorded in the file fragment, and the unique identifier of the branch node is generated based on the unique identifier of the root node where the file fragment is located, the chapter name of the file fragment, and the order of the file fragment in the file; The file content recorded in the file fragment is divided into the smallest content unit by code lines; The leaf nodes in the intermediate representation tree corresponding to the file are constructed from the hash value calculated based on the file content recorded in the smallest content unit. The unique identifier of the leaf node is generated based on the unique identifier of the branch node where the smallest content unit is located and the sorting of the smallest content unit in the corresponding file segment, so as to construct the intermediate representation tree corresponding to the file.

3. The method for locating file changes according to claim 1, characterized in that, When the file type is a table-type file, the step of constructing the intermediate representation tree corresponding to the file based on the node partitioning strategy corresponding to the file type includes: The root node in the intermediate representation tree corresponding to the file is constructed from the hash value calculated based on the file content recorded in the file, and a unique identifier for the root node is generated based on the file name, file type and storage path; Divide the file into file segments, using worksheets as units; The branch node in the intermediate representation tree corresponding to the file is constructed based on the hash value calculated from the file content recorded in the file fragment, and the unique identifier of the branch node is generated based on the unique identifier of the root node where the file fragment is located, the worksheet name of the file fragment, and the order of the file fragment in the file; The file content recorded in the file fragment is divided into the smallest content unit by line data; The leaf node in the intermediate representation tree corresponding to the file is constructed by using the hash value calculated based on the file content recorded in the smallest content unit. The unique identifier of the leaf node is generated based on the unique identifier of the branch node where the smallest content unit is located and the file content recorded in the first cell of the smallest content unit, so as to construct and generate the intermediate representation tree corresponding to the file.

4. The method for locating file changes according to claim 1, characterized in that, When the file type of the file is a code file, the step of constructing the intermediate representation tree corresponding to the file based on the node partitioning strategy corresponding to the file type includes: The root node in the intermediate representation tree corresponding to the file is constructed from the hash value calculated based on the file content recorded in the file, and a unique identifier for the root node is generated based on the file name, file type and storage path; The file content recorded in the file is divided into file segments, with code segments as the unit; The branch node in the intermediate representation tree corresponding to the file is constructed by the hash value calculated based on the file content recorded in the file fragment, and the unique identifier of the branch node is generated based on the unique identifier of the root node where the file fragment is located, the code segment signature of the file fragment, and the order of the file fragment in the file; The file content recorded in the file fragment is divided into the smallest content unit by code lines; The leaf nodes in the intermediate representation tree corresponding to the file are constructed from the hash value calculated based on the file content recorded in the smallest content unit. The unique identifier of the leaf node is generated based on the unique identifier of the branch node where the smallest content unit is located and the sorting of the smallest content unit in the corresponding file segment, so as to construct the intermediate representation tree corresponding to the file.

5. The method for locating file changes according to claim 1, characterized in that, The method further includes: If a root node in the baseline file set cannot be matched with a root node in the file set to be inspected, the file corresponding to that root node in the file set to be inspected is determined to be deleted. If a root node in the set of files to be inspected cannot be matched with a root node in the set of reference files, the file corresponding to that root node in the set of files to be inspected is determined to be a newly added file.

6. The method for locating file changes according to claim 2, characterized in that, When the file type of the successfully matched leaf node is a document file, the step of identifying the change in each successfully matched pair of leaf nodes to obtain the corresponding third change result, in order to locate the final change location in the set of files to be inspected, includes: The hash values ​​of each successfully matched pair of leaf nodes are compared to obtain their respective comparison results; For any pair of leaf nodes whose hash values ​​match, it is determined that the file content corresponding to that pair of leaf nodes in the set of files to be inspected has not changed. For any pair of leaf nodes whose hash values ​​are inconsistent, a semantic similarity detection model is used to perform semantic similarity detection on the pair of leaf nodes to obtain the corresponding third change result, so as to locate the final change position in the set of files to be inspected.

7. The method for locating file changes according to claim 6, characterized in that, For any pair of leaf nodes whose hash values ​​are inconsistent, a semantic similarity detection model is used to perform semantic similarity detection on the pair of leaf nodes to obtain the corresponding third change result, which is used to locate the final change location in the set of files to be inspected, including: For any pair of leaf nodes whose semantic similarity is greater than or equal to the first threshold, it is determined that the content of the file corresponding to the pair of leaf nodes in the set of files to be inspected has not changed; For any pair of leaf nodes whose semantic similarity is less than the first threshold and greater than or equal to the second threshold, it is determined that the file content corresponding to the pair of leaf nodes in the set of files to be inspected has undergone a first-level change. For any pair of leaf nodes whose semantic similarity is less than the second threshold, it is determined that the file content corresponding to the pair of leaf nodes in the set of files to be inspected has undergone a second-level change. The second-level change is greater than the first-level change, and the higher the level of change, the greater the degree of change.

8. A file change location system, characterized in that, The system includes: The file type determination module is used to determine the file type of any file in the set of benchmark files for comparison and the set of files to be inspected. The intermediate representation tree construction module is used to construct an intermediate representation tree corresponding to the file based on the node partitioning strategy corresponding to the file type of the file. The intermediate representation tree includes a root node and a corresponding unique identifier generated based on all the file content recorded in the file, branch nodes and corresponding unique identifiers generated based on the file content recorded in the logical container of the file, and leaf nodes and corresponding unique identifiers generated based on the file content recorded in the smallest content unit of the file. The first matching module is used to match the unique identifier of the root node in all intermediate representation trees corresponding to the base file set with the unique identifier of the root node in all intermediate representation trees corresponding to the file set to be checked. The first change identification module is used to identify whether each successfully matched pair of root nodes has been changed. The second matching module is used to match the unique identifiers of the branch nodes under the root nodes of any pair of root nodes that have been successfully matched and have changed, based on the unique identifiers of the branch nodes. The second change identification module is used to identify changes for each pair of successfully matched branch nodes. The third matching module is used to match the unique identifiers of the leaf nodes under the pair of branch nodes based on the unique identifiers of the leaf nodes for any pair of branch nodes that have been successfully matched and have changed. The third change identification module is used to identify changes in each successfully matched pair of leaf nodes to obtain the corresponding third change result, so as to locate the final change location in the set of files to be inspected.

9. An electronic device, characterized in that, include: A processor, a memory, and a computer program stored in the memory and running on the processor, wherein the computer program, when executed by the processor, implements the steps of a file change location method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of a file change location method as described in any one of claims 1 to 7.