Graphic file difference comparison method, server, medium and product

By identifying and matching differential graphic units in solar panel design archives under the same reference coordinate system, calculating the modification amount and marking design changes, the problem of low difference comparison accuracy in the prior art is solved, and higher accuracy and traceability are achieved.

CN119888274APending Publication Date: 2025-04-25KUNSHAN HENGSHENG ELECTRONICS
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411938451.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

When the prior art performs differential comparison of solar panel design files, the recognition accuracy is not high, and misjudgment and misjudgment are prone to occur, resulting in low accuracy of the difference recognition.

Method used

By obtaining the original graphic file and the modified graphic file, identify the difference area under the same reference coordinate system, determine the difference graphic unit, and perform accurate pairing, calculate and compare the modification amount of the graphic pair, and automatically identify and label design changes whose modification amount exceeds the preset threshold.

Benefits of technology

It improves the accuracy of difference recognition, generates standardized graphic file comparison reports, improves the traceability of design changes, and solves the problem of accurate comparison in the management of complex engineering drawings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119888274A_ABST
    Figure CN119888274A_ABST
Patent Text Reader

Abstract

The invention discloses a graphic file difference comparison method, a server, a medium and a product, and relates to the field of graphic comparison, and the method comprises the steps: obtaining an original graphic file and a modified graphic file; determining a difference area between the original graphic file and the modified graphic file under the same reference coordinate system; based on the difference region, determining a plurality of difference original graphic units in the original graphic file and a plurality of difference modified graphic units in the modified graphic file; pairing the difference original graph units and the difference modified graph units in pairs to obtain a plurality of comparison graph pairs; respectively calculating modifications of the plurality of comparison graph pairs; marking the comparison graph pair with the modification amount exceeding a preset modification amount threshold value, and adding corresponding character information; and summarizing all the marked comparison graph pairs and the corresponding text information to obtain a graph file comparison report. By implementing the method, the accuracy of graphic file difference identification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of graphic comparison, and in particular to a graphic file difference comparison method, server, medium and product. Background Art

[0002] With the rapid development of solar power generation technology, the design and improvement of solar panels play a key role in the field of new energy. In the process of solar panel design, designers need to frequently modify the design files, which requires a difference comparison between different versions of the design files in order to accurately grasp the design changes and ensure that the performance indicators of the solar panels meet the requirements.

[0003] At present, the comparison method of solar panel design files is mainly realized through the comparison function provided by the design software, that is, by displaying two design files side by side on the screen, or superimposing them by adjusting the transparency. Designers need to manually adjust the display parameters and visually confirm the differences between the two design files.

[0004] Although the relevant technology can compare the differences between different versions of design files to a certain extent, there is a problem of low recognition accuracy in practical applications. Since solar panel design files usually contain complex geometric structures and a large number of technical parameters, it is easy to make misjudgments and misses by comparing pixel information alone, resulting in low accuracy of difference recognition. Summary of the invention

[0005] The present application provides a graphic file difference comparison method, server, medium and product for improving the accuracy of graphic file difference identification.

[0006] In a first aspect, the present application provides a method for comparing differences in graphic files, which is applied to a server, and the method includes: obtaining an original graphic file and a modified graphic file, wherein the original graphic file includes multiple original graphic units, and the modified graphic file includes multiple modified graphic units; determining a difference area between the original graphic file and the modified graphic file in the same reference coordinate system; based on the difference area, determining multiple difference original graphic units in the original graphic file and multiple difference modified graphic units in the modified graphic file; pairing the difference original graphic units with the difference modified graphic units in pairs to obtain multiple comparison graphic pairs; respectively calculating the modification amounts of the multiple comparison graphic pairs, wherein the modification amounts are used to represent the amount of change from the difference original graphic unit to the difference modified graphic unit; marking the comparison graphic pairs whose modification amounts exceed a preset modification amount threshold, and adding corresponding text information, wherein the text information includes the difference points, position information and size information of the comparison graphic pairs; summarizing all the marked comparison graphic pairs and the corresponding text information to obtain a graphic file comparison report.

[0007] By adopting the above technical solution, in the same reference coordinate system, the server identifies the difference area between the original graphic file and the modified graphic file, and determines the difference original graphic unit and the difference modified graphic unit in the difference area. After that, the server accurately matches the difference original graphic unit and the difference modified graphic unit to obtain a comparison graphic pair. Next, the server calculates the modification amount of the comparison graphic pair, thereby automatically identifying and marking the design changes whose modification amount exceeds the preset modification amount threshold. By introducing a preset modification amount threshold mechanism, subtle differences can be filtered out, focusing on major modifications, and adding detailed text descriptions for each significant change, including the difference points, location information and size information of the comparison graphic pair. Compared with traditional manual visual comparison, this systematic comparison method not only improves the accuracy of difference identification, but also generates standardized graphic file comparison reports to improve the traceability of design changes, effectively solving the problem of accurate comparison in version management of complex engineering drawings such as solar panels.

[0008] In combination with some embodiments of the first aspect, in some embodiments, determining the difference area between the original graphic file and the modified graphic file in the same reference coordinate system specifically includes: converting the original graphic file and the modified graphic file to the same reference coordinate system; performing layer separation on the original graphic file and the modified graphic file to obtain multiple original layers of the original graphic file and multiple modified layers of the modified graphic file; superimposing and comparing the multiple original layers with the multiple modified layers layer by layer to obtain a layer difference area; and merging adjacent layer difference areas based on a preset area merging rule to obtain the difference area.

[0009] By adopting the above technical solution, the server converts the original graphic file and the modified graphic file into a unified reference coordinate system and separates the layers, achieving multi-level precise comparison. By comparing layer by layer, the server can accurately locate the difference area on each layer and avoid interference between different layers. At the same time, through the preset area merging rules, the server intelligently merges the spatially adjacent difference areas, which not only ensures the integrity of difference identification, but also avoids excessive fragmentation. This method of layered comparison and area merging greatly improves the accuracy and efficiency of difference area identification, and is particularly suitable for comparison scenarios of complex engineering drawings containing multiple functional layers.

[0010] In combination with some embodiments of the first aspect, in some embodiments, after the step of pairing the difference original graphic units and the difference modified graphic units in pairs to obtain a plurality of comparison graphic pairs, the method further includes: calculating the similarity between the difference original graphic units and the difference modified graphic units in the comparison graphic pairs; if the similarity is lower than a preset similarity threshold, marking the comparison graphic pair as an invalid pairing; and re-pairing and matching the invalidly paired difference original graphic units.

[0011] By adopting the above technical solution, the server introduces a similarity evaluation and re-matching mechanism. By calculating the similarity between paired graphic units and setting a preset similarity threshold to determine whether the pairing is valid, it can effectively avoid incorrect pairing of graphic units. When the server finds an invalid pairing, it automatically triggers the re-matching process to ensure that each difference graphic unit can find the most suitable match. This intelligent pairing mechanism greatly improves the accuracy of graphic comparison and reduces misjudgment. At the same time, through the automated re-matching process, it improves the comparison efficiency and reduces the need for manual intervention.

[0012] In combination with some embodiments of the first aspect, in some embodiments, the modification amounts of the multiple comparison graphic pairs are respectively calculated, and the modification amounts are used to represent the amount of change from the difference original graphic unit to the difference modified graphic unit, specifically including: extracting the shape features, size features and position features of the comparison graphic pair; calculating the amount of change of the shape feature, the amount of change of the size feature and the amount of change of the position feature; based on preset feature weights, performing weighted summation of the amount of change of the shape feature, the amount of change of the size feature and the amount of change of the position feature to obtain a comprehensive modification amount as the amount of modification of the comparison graphic pair.

[0013] By adopting the above technical solution, first, the server extracts the features of the shape, size and position of the comparison graphic pair, and calculates the change in each dimension respectively. Then, the server performs weighted summation of the change in shape features, the change in size features and the change in position features by presetting feature weights to obtain a comprehensive modification index. This multi-dimensional feature analysis and weighted calculation method can comprehensively and accurately measure the degree of change of the difference graphic units, provide a reliable quantitative basis for subsequent difference judgment, and significantly improve the scientificity and accuracy of graphic comparison.

[0014] In combination with some embodiments of the first aspect, in some embodiments, after the step of pairing the difference original graphic unit and the difference modified graphic unit in pairs to obtain a plurality of comparison graphic pairs, the method further includes: based on the area of ​​the difference area, sorting the plurality of comparison graphic pairs from high to low to obtain a comparison graphic pair sequence; based on the comparison graphic pair sequence, determining the processing priority order of the comparison graphic pairs.

[0015] By adopting the above technical solution, the server prioritizes the graphic pairs based on the area comparison of the difference area and establishes a scientific difference processing order. Prioritizing the difference areas with larger areas not only complies with the principle of giving priority to the review of major changes in engineering design, but also improves the efficiency of comparison. This area-based priority mechanism enables important design changes to be discovered and processed in a timely manner, avoiding the problem of important modifications being submerged in a large number of minor changes. At the same time, the orderly processing order also makes it easier for designers to review and confirm changes, improving the work efficiency and quality control level of design review.

[0016] In combination with some embodiments of the first aspect, in some embodiments, after the step of summarizing all the marked comparison graphic pairs and corresponding text information to obtain a graphic file comparison report, the method also includes: based on preset graphic classification rules, identifying the modification type corresponding to the comparison graphic pair; adding the modification number corresponding to the modification type to the graphic file comparison report.

[0017] By adopting the above technical solution, the server introduces preset graphic classification rules, performs intelligent classification and statistical analysis on the comparison results, determines the number of modifications corresponding to the modification type and adds it to the graphic file comparison report, greatly enhancing the visualization effect and analysis depth of the graphic comparison report. This visual statistical analysis method can help designers quickly grasp the overall situation of design changes and understand the number of modifications corresponding to various modification types.

[0018] In combination with some embodiments of the first aspect, in some embodiments, after the step of summarizing all the marked comparison graphic pairs and corresponding text information to obtain a graphic file comparison report, the method also includes: generating a unique identifier for each comparison graphic pair in the graphic file comparison report; and searching for the comparison graphic pair based on the unique identifier.

[0019] By adopting the above technical solution, the server generates a unique identifier for each comparison graphic pair, establishing an efficient retrieval mechanism. This identifier system allows designers to quickly locate and track specific design changes, greatly improving the efficiency of using graphic file comparison reports. When it is necessary to trace back a specific modification detail, you can directly use the unique identifier for accurate search, avoiding the trouble of repeatedly searching through a large amount of comparison information.

[0020] In a second aspect, an embodiment of the present application provides a server, comprising: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the server to execute the method described in the first aspect and any possible implementation method of the first aspect.

[0021] In a third aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a server, enables the server to execute the method described in the first aspect and any possible implementation of the first aspect.

[0022] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, which, when executed on a server, enable the server to execute the method described in the first aspect and any possible implementation of the first aspect.

[0023] It is understandable that the server provided in the second aspect, the computer program product provided in the third aspect, and the computer storage medium provided in the fourth aspect are all used to execute the method provided in the embodiment of the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, which will not be repeated here.

[0024] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: 1. By adopting the above technical solution, in the same reference coordinate system, the server identifies the difference area between the original graphic file and the modified graphic file, and determines the difference original graphic unit and the difference modified graphic unit in the difference area. After that, the server accurately matches the difference original graphic unit and the difference modified graphic unit to obtain a comparison graphic pair. Next, the server calculates the modification amount of the comparison graphic pair, thereby automatically identifying and marking the design changes whose modification amount exceeds the preset modification amount threshold. By introducing a preset modification amount threshold mechanism, subtle differences can be filtered out, focusing on major modifications, and adding detailed text descriptions for each significant change, including the difference points, location information, and size information of the comparison graphic pair. Compared with traditional manual visual comparison, this systematic comparison method not only improves the accuracy of difference identification, but also generates standardized graphic file comparison reports to improve the traceability of design changes, effectively solving the problem of accurate comparison in version management of complex engineering drawings such as solar panels.

[0025] 2. By adopting the above technical solution, the server introduces a similarity evaluation and re-matching mechanism. By calculating the similarity between paired graphic units and setting a preset similarity threshold to determine whether the pairing is valid, it can effectively avoid incorrect pairing of graphic units. When the server finds an invalid pairing, it will automatically trigger the re-matching process to ensure that each difference graphic unit can find the most suitable match. This intelligent pairing mechanism greatly improves the accuracy of graphic comparison and reduces misjudgment. At the same time, through the automated re-matching process, it improves the comparison efficiency and reduces the need for manual intervention.

[0026] 3. By adopting the above technical solution, the server prioritizes the graphic pairs based on the area comparison of the difference area and establishes a scientific difference processing order. Prioritizing the difference areas with larger areas not only complies with the principle of priority review of major changes in engineering design, but also improves the efficiency of comparison. This area-based priority mechanism enables important design changes to be discovered and processed in a timely manner, avoiding the problem of important modifications being submerged in a large number of minor changes. At the same time, the orderly processing order also makes it easier for designers to review and confirm changes, improving the work efficiency and quality control level of design review. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a flow chart of a method for comparing differences in graphic files in an embodiment of the present application; Figure 2 is another flow chart of the method for comparing differences in graphic files in an embodiment of the present application; Figure 3 It is a schematic diagram of a physical device structure of a server in an embodiment of the present application. DETAILED DESCRIPTION

[0028] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations to the present application. As used in the specification of the present application, the singular expressions "one", "a kind of", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the present application refers to any or all possible combinations comprising one or more of the listed items.

[0029] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0030] The following is a description of the process of the method provided by this implementation. Figure 1 , is a flow chart of a method for comparing differences in graphic files in an embodiment of the present application.

[0031] S101, obtaining an original graphic file and a modified graphic file, wherein the original graphic file includes a plurality of original graphic units, and the modified graphic file includes a plurality of modified graphic units; Among them, the original graphic file refers to the initial design file before modification, which usually contains complete design information, such as CAD drawings, engineering drawings, etc.; the modified graphic file refers to the new version of the design file that has been modified, adjusted or optimized on the basis of the original graphic file; the graphic unit refers to the basic component of the graphic file, including straight line segments, curve segments, geometric figures, annotation symbols and other independently identifiable minimum graphic elements; the original graphic unit refers to the graphic unit in the original graphic file; the modified graphic unit refers to the graphic unit in the modified graphic file.

[0032] Specifically, first, the server receives the original graphic file through a file interface or network transmission, and at the same time receives the modified design file corresponding to the original graphic file. The server loads the received original graphic file and the modified graphic file into the memory, and verifies the file format to ensure that the file can be parsed correctly. Subsequently, the server parses the contents of the two graphic files respectively, identifies and extracts all the graphic units contained therein, and establishes the data structure of the graphic units to prepare for subsequent comparison and analysis. During the extraction process, the server retains the attribute information of each graphic unit, such as position coordinates, geometric features, association relationships, etc.

[0033] S102, determining a difference area between the original graphic file and the modified graphic file in the same reference coordinate system; Among them, the reference coordinate system refers to a reference system used for unified positioning and measurement, which can be a two-dimensional rectangular coordinate system or other types of coordinate systems; the same reference coordinate system means unifying the original graphic file and the modified graphic file to the same spatial positioning reference; the difference area refers to the inconsistent spatial range of two graphic files when they are superimposed and compared.

[0034] Specifically, first, the server checks the coordinate systems used by the two graphic files. If it is found that the coordinate systems used by the two graphic files are inconsistent, the server will perform coordinate conversion processing to ensure that the graphic information of the two graphic files is in the same reference coordinate system. Then, the server scans and compares the two graphic files layer by layer through methods such as pixel comparison or vector analysis. During the comparison process, the server will identify the areas in the two graphic files that do not completely match as difference areas. These difference areas may be caused by operations such as adding, deleting, moving or modifying the graphics. The server will record the boundary coordinates and range information of these difference areas, and may merge adjacent small-scale difference areas according to preset rules to form a more meaningful set of difference areas.

[0035] Optionally, in general, determining the difference area between the original graphic file and the modified graphic file in the same reference coordinate system can be achieved in the following manner, which is not limited here: converting the original graphic file and the modified graphic file to the same reference coordinate system; performing layer separation on the original graphic file and the modified graphic file to obtain multiple original layers of the original graphic file and multiple modified layers of the modified graphic file; superimposing and comparing the multiple original layers with the multiple modified layers layer by layer to obtain a layer difference area; and merging adjacent layer difference areas based on a preset area merging rule to obtain the difference area.

[0036] S103, based on the difference area, determining a plurality of difference original graphic units in the original graphic file and a plurality of difference modified graphic units in the modified graphic file; The difference original graphic unit refers to the original graphic unit located in the difference area in the original graphic file; the difference modified graphic unit refers to the modified graphic unit located in the difference area in the modified graphic file.

[0037] Specifically, first, the server traverses all the original graphic units in the original graphic file, and determines which original graphic units have intersections with the difference area by calculating the spatial relationship between the original graphic units and the identified difference area. For each original graphic unit that intersects with the difference area, the server calculates the degree of overlap with the difference area. If the degree of overlap exceeds the preset overlap threshold, the server marks the original graphic unit as a difference original graphic unit. The same process is also applied to the modified graphic file to determine the difference modified graphic unit. In this process, the server will consider the integrity of the graphic unit, that is, if a graphic unit partially falls into the difference area, the server will decide whether to mark the entire graphic unit as a difference graphic unit based on the specific situation. In addition, the server will also record the association relationship between each difference graphic unit and the difference area to provide a basis for subsequent pairing analysis.

[0038] S104, pairing the difference original graphic unit and the difference modified graphic unit in pairs to obtain a plurality of comparison graphic pairs; Among them, pairing refers to the process of matching the difference original graphic unit with the difference modified graphic unit one by one; and the comparison graphic pair refers to the pairing relationship consisting of a difference original graphic unit and a difference modified graphic unit.

[0039] Specifically, first, the server extracts features from all difference graphic units and establishes a feature index. Then, for each difference original graphic unit, the server searches for difference modified graphic units within a certain range around it, and the server establishes a preliminary pairing candidate set based on the spatial position relationship between the difference original graphic unit and the difference modified graphic unit. Next, the server calculates the feature similarity between the pairing candidate sets, including multiple dimensions such as shape similarity, size ratio, and direction consistency. Based on these feature similarities, the server uses an optimization algorithm (such as the Hungarian algorithm) to determine the optimal pairing scheme to maximize the overall matching degree, thereby obtaining multiple comparison graphic pairs. For some special cases, such as one-to-many and many-to-one, the server will perform appropriate splitting or merging processing according to preset processing rules.

[0040] S105, respectively calculating the modification amounts of the plurality of compared graphic pairs, the modification amounts being used to represent the amount of change from the original difference graphic unit to the modified difference graphic unit; Specifically, the server performs a multi-dimensional change analysis on each pair of compared graphics. In the shape dimension, it calculates contour differences, angle changes, etc.; in the size dimension, it calculates the relative change rate of features such as length, area, and volume; in the position dimension, it calculates translation distance, rotation angle, etc. The server normalizes these original calculation results so that different types of changes can be compared and integrated. Then, according to a pre-defined weight system, the changes in each dimension are weighted and summed to obtain the final modification amount, where the modification amount is an indicator used to quantitatively describe the degree of change of the graphic unit.

[0041] Optionally, in general, the modification amounts of the multiple comparison graphic pairs are calculated separately, and the modification amounts are used to represent the amount of change from the difference original graphic unit to the difference modified graphic unit. This can be achieved in the following manner, which is not limited here: extracting the shape features, size features and position features of the comparison graphic pair; calculating the amount of change of the shape feature, the amount of change of the size feature and the amount of change of the position feature; based on preset feature weights, performing weighted summation of the amount of change of the shape feature, the amount of change of the size feature and the amount of change of the position feature to obtain a comprehensive modification amount as the amount of modification of the comparison graphic pair.

[0042] The change in shape features refers to the degree of change in contour or geometric features; the change in size features refers to the magnitude of change in metric features such as size and length; the change in position features refers to the degree of offset in spatial position; and the preset feature weight refers to the importance of each type of pre-set change in the calculation of the total modification amount.

[0043] S106, marking the comparison graphic pair whose modification amount exceeds the preset modification amount threshold, and adding corresponding text information, the text information including the difference point, position information and size information of the comparison graphic pair; Among them, the preset modification threshold is a quantitative standard for determining whether annotation is needed; annotation refers to the visual prompt information added to the comparison graphics; text information refers to the text description of the modification content; the difference point is used to indicate the key change location and features; the position information is used to indicate the spatial coordinates and range of the change; the size information is used to indicate the specific measurement data involved in the change.

[0044] Specifically, first, the server compares the modification amount of each comparison graphic pair with the preset modification amount threshold. For the comparison graphic pairs whose modification amount exceeds the preset modification amount threshold, the server will add eye-catching visual marks to the comparison graphic pairs, such as highlighting, special color marking or graphic symbols. At the same time, the server will automatically generate standardized text descriptions, including: description of the change type (such as shape change, size adjustment, etc.), specific change values ​​(such as size from A to B), position change information (such as translation distance, rotation angle, etc.).

[0045] S107, summarizing all the marked comparison graphic pairs and the corresponding text information to obtain a graphic file comparison report.

[0046] Among them, the graphic file comparison report refers to the document that records all change information; the summary refers to the statistics of all change information.

[0047] Specifically, first, the server organizes all the marked comparison graphic pairs in the modified design graphic file according to a preset format, which can be displayed in the form of hollow boxes or other forms, which will not be repeated here. Then, the server can connect the hollow boxes and text information corresponding to the comparison graphic pairs through line segments. Finally, the server exports the graphic file comparison report into a standard format (such as PDF), and can also provide an interactive electronic version to support dynamic viewing and retrieval.

[0048] By adopting the above technical solution, in the same reference coordinate system, the server identifies the difference area between the original graphic file and the modified graphic file, and determines the difference original graphic unit and the difference modified graphic unit in the difference area. After that, the server accurately matches the difference original graphic unit and the difference modified graphic unit to obtain a comparison graphic pair. Next, the server calculates the modification amount of the comparison graphic pair, thereby automatically identifying and marking the design changes whose modification amount exceeds the preset modification amount threshold. By introducing a preset modification amount threshold mechanism, subtle differences can be filtered out, focusing on major modifications, and adding detailed text descriptions for each significant change, including the difference points, location information and size information of the comparison graphic pair. Compared with traditional manual visual comparison, this systematic comparison method not only improves the accuracy of difference identification, but also generates standardized graphic file comparison reports to improve the traceability of design changes, effectively solving the problem of accurate comparison in version management of complex engineering drawings such as solar panels.

[0049] The following is a more detailed description of the process of the method provided by this implementation. Figure 2 , is another flow chart of the method for comparing differences in graphic files in an embodiment of the present application.

[0050] S201, obtaining an original graphic file and a modified graphic file, wherein the original graphic file includes a plurality of original graphic units, and the modified graphic file includes a plurality of modified graphic units; For details, please refer to step S101, which will not be described in detail here.

[0051] S202, determining a difference area between the original graphic file and the modified graphic file in the same reference coordinate system; For details, please refer to step S102, which will not be described in detail here.

[0052] S203, based on the difference area, determining a plurality of difference original graphic units in the original graphic file and a plurality of difference modified graphic units in the modified graphic file; For details, please refer to step S103, which will not be described in detail here.

[0053] S204, pairing the difference original graphic unit and the difference modified graphic unit in pairs to obtain a plurality of comparison graphic pairs; For details, please refer to step S104, which will not be described in detail here.

[0054] S205, calculating the similarity between the original graphic unit with difference and the modified graphic unit with difference in the compared graphic pair; The similarity is used to indicate the matching degree between the original graphic unit and the modified graphic unit in the comparison graphic pair in terms of shape, size, position and other features, and is usually represented by a value between 0 and 1.

[0055] Specifically, first, the server extracts the feature vectors of the two difference graphic units in the comparison graphic pair, including shape features (such as Fourier descriptors, moment features, etc.), size features (such as perimeter, area ratio, etc.) and position features (such as centroid coordinates, direction angle, etc.). Feature vector refers to a numerical sequence used to describe the features of the difference graphic unit; shape features are used to represent the geometric shape features of the difference graphic unit, such as contours, angles, etc.; size features are used to represent quantitative indicators such as size, length, and area of ​​the difference graphic unit; and position features are used to represent the spatial position information of the difference graphic unit in the coordinate system. Then, the server uses a multi-dimensional feature comparison algorithm to calculate the similarity of each feature dimension respectively. For shape features, a contour matching algorithm may be used; for size features, a relative difference rate may be calculated; for position features, spatial distance and angle differences may be calculated. Finally, the server weights the similarities of each dimension according to the preset feature weights to obtain the final similarity, where the feature weights are used to represent the importance of different features in the similarity calculation.

[0056] S206, when the similarity is lower than a preset similarity threshold, marking the compared graphic pair as an invalid pair; Among them, the preset similarity threshold is a standard value used to determine whether the pairing is valid, which is usually determined according to specific application scenarios and requirements; invalid pairing refers to the matching relationship of difference graphic units whose similarity is lower than the preset similarity threshold.

[0057] Specifically, the server compares the calculated similarity with the preset similarity threshold. If the similarity value is lower than the preset similarity threshold, the server will mark the comparison graphic pair as "invalid pairing". At the same time, the server records the specific reasons for the invalid pairing (such as excessive shape difference, significant position offset, etc.).

[0058] S207, re-pairing and matching the invalid paired difference original graphic units; Specifically, re-pairing and matching refers to a new round of matching attempts for the difference original graphic units that have been marked as invalid pairs. The method of re-pairing and matching can be referred to step S104, which will not be described in detail here. If a pairing whose similarity meets the preset similarity threshold cannot be found after multiple attempts, the server will mark the difference original graphic unit as "failed to pair successfully" and specifically indicate it in the final graphic file comparison report. The process of re-pairing and matching may be iterative until all invalid pairs are processed or the preset maximum number of iterations is reached.

[0059] S208, sorting the plurality of alignment graphic pairs from high to low based on the area of ​​the difference region to obtain an alignment graphic pair sequence; The area of ​​the difference region refers to the size of the impact range of the graphic change; the comparison graphic pair sequence refers to a sequence obtained by sorting the areas of the difference regions associated with the comparison graphic pairs from high to low.

[0060] Specifically, first, the server calculates the area of ​​the difference area associated with each comparison graphic pair. For regular graphics, the server can directly use geometric formulas for calculation; for irregular graphics, the server may use methods such as pixel statistics or polygon decomposition. During the calculation process, the server will consider the integrity of the difference area and reasonably merge or split adjacent or overlapping difference areas. Then, the server sorts all the comparison graphic pairs from large to small according to the area of ​​their corresponding difference areas, and generates an ordered sequence, namely the comparison graphic pair sequence. For the case where the area of ​​the difference areas is the same, the server may introduce secondary sorting criteria, such as the complexity of the modification, the importance of the difference graphic unit, etc.

[0061] S209, determining a processing priority order of the compared graphic pairs based on the compared graphic pair sequence; Specifically, the server determines the processing priority order of the comparison graphic pairs according to the arrangement in the comparison graphic pair sequence, wherein the processing priority order refers to the order in which the server processes the comparison graphic pairs.

[0062] It should be noted that when determining the processing priority order, the server may consider other factors such as graphic complexity, modification type, business importance, etc. in addition to the area of ​​the difference area. The server can also perform a multi-dimensional evaluation on each comparison graphic pair in the comparison graphic pair sequence to determine the comprehensive processing priority order. In addition, the server will also analyze the spatial correlation and processing dependency between the comparison graphic pairs to ensure that the interrelated comparison graphic pairs can be processed in a reasonable order.

[0063] S210, respectively calculating the modification amounts of the plurality of compared graphic pairs, the modification amounts being used to represent the amount of change from the difference original graphic unit to the difference modified graphic unit; For details, please refer to step S105, which will not be described in detail here.

[0064] S211, marking the comparison graphic pair whose modification amount exceeds the preset modification amount threshold, and adding corresponding text information, the text information including the difference point, position information and size information of the comparison graphic pair; For details, please refer to step S106, which will not be described in detail here.

[0065] S212, summarizing all the marked comparison graphic pairs and the corresponding text information to obtain a graphic file comparison report; For details, please refer to step S107, which will not be described in detail here.

[0066] S213, generating a unique identifier for each compared graphic pair in the graphic file comparison report; Specifically, the server can use a multi-level encoding mechanism to generate a unique identifier for each comparison graphic pair in the graphic file comparison report, where the unique identifier is a unique code used to distinguish and retrieve different comparison graphic pairs, usually containing project code, file version number, timestamp, serial number and other information. The format of the unique identifier may be a structured string such as "PRJ_20241105_V1_001". To ensure the uniqueness of the unique identifier, the server will maintain an identifier index library for duplicate verification.

[0067] S214, searching the comparison graphic pair based on the unique identifier; Specifically, the server can build an efficient retrieval index, which refers to a data structure used to speed up searches, and may use data structures such as B-trees and hash tables. The server's search process for comparison graph pairs is divided into multiple levels: First, the server quickly matches in the memory cache, and if there is a miss, it accesses persistent storage. At the same time, the server supports fuzzy queries and conditional combination queries, and can be retrieved through unique identifiers. For frequently accessed comparison graph pairs, the server will establish a preloading mechanism to improve response speed. The search results will contain complete information about the comparison graph pair, including graph data, modification information, related data, etc.

[0068] S215, identifying the modification type corresponding to the comparison graphic pair based on a preset graphic classification rule; Among them, the preset graphic classification rules are a set of standards used to distinguish different modification types; the modification type refers to the classification of the nature of the changes in the difference graphic units.

[0069] Specifically, first, the server loads the preset graphic classification rules, which contain the criteria for determining various types of modifications. Then, the server performs feature analysis on the graphic pairs and extracts feature parameters such as shape changes, size adjustments, and position shifts. The server evaluates the feature parameters through the rule engine and matches them with the preset graphic classification rules. During the processing, multiple levels of judgment may be involved, such as first determining the main modification type and then subdividing it into specific subtypes. For complex modifications, the server will consider the combined effects of multiple feature parameters and may mark them as composite modification types.

[0070] S216. Add the modification quantity corresponding to the modification type to the graphic file comparison report.

[0071] Specifically, first, the server standardizes the statistical data to ensure the consistency of the data format. Then, the server creates a special statistical chapter in the graphic file comparison report to display the number of modifications corresponding to the modification type in various forms, that is, the server creates a statistical summary table of modification types, listing the specific number, proportion and cumulative value of each modification type.

[0072] The following describes the server in the embodiment of the present invention from the perspective of hardware processing. Figure 3 , is a schematic diagram of a physical device structure of a server in an embodiment of the present application.

[0073] It should be noted that Figure 3 The structure of the server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0074] like Figure 3 As shown, the server includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method described in the above embodiment. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through bus 304. Input / output (I / O) interface 305 is also connected to bus 304.

[0075] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, a button switch, etc.; an output section 307 including a liquid crystal display (LCD) and an audio output device, an indicator light, etc.; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.

[0076] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 309, and / or installed from a removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, various functions defined in the present invention are performed.

[0077] It should be noted that specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, apparatus, or device.

[0078] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. Each box in the flowchart or block diagram may represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings.

[0079] Specifically, the server of this embodiment includes a processor and a memory. The memory stores a computer program. When the computer program is executed by the processor, the graphic file difference comparison method provided in the above embodiment is implemented.

[0080] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the server described in the above embodiment; or may exist independently without being assembled into the server. The above storage medium carries one or more computer programs, and when the above one or more computer programs are executed by a processor of the server, the server implements the graphic file difference comparison method provided in the above embodiment.

[0081] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0082] As used in the above embodiments, the term "when..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrases "upon determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "upon detecting (the stated condition or event)" or "in response to detecting (the stated condition or event)", depending on the context.

[0083] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.

Claims

1. A method for comparing differences in graphic files, characterized in that: Applied to a server, the method comprises: Acquire an original graphic file and a modified graphic file, wherein the original graphic file includes a plurality of original graphic units, and the modified graphic file includes a plurality of modified graphic units; Determine the difference area between the original graphic file and the modified graphic file in the same reference coordinate system; Based on the difference area, determining a plurality of difference original graphic units in the original graphic file and a plurality of difference modified graphic units in the modified graphic file; Pairing the difference original graphic units with the difference modified graphic units in pairs to obtain a plurality of comparison graphic pairs; Calculating modification amounts of the plurality of compared graphic pairs respectively, the modification amounts being used to represent the amount of change from the difference original graphic unit to the difference modified graphic unit; Marking the comparison graphic pairs whose modification amounts exceed the preset modification amount threshold, and adding corresponding text information, wherein the text information includes the difference points, position information and size information of the comparison graphic pairs; All the marked comparison graphic pairs and the corresponding text information are summarized to obtain a graphic file comparison report.

2. The method according to claim 1, characterized in that: The determining of the difference area between the original graphic file and the modified graphic file in the same reference coordinate system specifically includes: Converting the original graphic file and the modified graphic file to the same reference coordinate system; Separating the layers of the original graphic file and the modified graphic file to obtain a plurality of original layers of the original graphic file and a plurality of modified layers of the modified graphic file; The multiple original layers are stacked and compared with the multiple modified layers layer by layer to obtain layer difference areas; Based on a preset region merging rule, adjacent layer difference regions are merged to obtain the difference region.

3. The method according to claim 1, characterized in that After the step of pairing the difference original graphic units with the difference modified graphic units in pairs to obtain a plurality of comparison graphic pairs, the method further includes: Calculating the similarity between the difference original graphic unit and the difference modified graphic unit in the comparison graphic pair; When the similarity is lower than a preset similarity threshold, marking the comparison graphic pair as an invalid pair; The invalid paired difference original graphic units are re-paired and matched.

4. The method according to claim 1, characterized in that: The respectively calculating the modification amounts of the plurality of comparison graphic pairs, wherein the modification amounts are used to represent the change amount from the difference original graphic unit to the difference modified graphic unit, specifically includes: Extracting shape features, size features and position features of the comparison graphic pair; Calculating the change amount of the shape feature, the change amount of the size feature and the change amount of the position feature; Based on the preset feature weights, a weighted sum is taken for the change amount of the shape feature, the change amount of the size feature and the change amount of the position feature to obtain a comprehensive modification amount as the modification amount of the comparison graphic pair.

5. The method according to claim 1, characterized in that After the step of pairing the difference original graphic units with the difference modified graphic units in pairs to obtain a plurality of comparison graphic pairs, the method further includes: Based on the areas of the difference regions, the plurality of alignment graphic pairs are sorted from high to low to obtain an alignment graphic pair sequence; Based on the comparison graphic pair sequence, a processing priority order of the comparison graphic pairs is determined.

6. The method according to claim 1, characterized in that After the step of aggregating all the annotated comparison graphic pairs and the corresponding text information to obtain a graphic file comparison report, the method further includes: Based on a preset graphic classification rule, identifying the modification type corresponding to the comparison graphic pair; The modification quantity corresponding to the modification type is added to the graphic file comparison report.

7. The method according to claim 1, characterized in that After the step of aggregating all the annotated comparison graphic pairs and the corresponding text information to obtain a graphic file comparison report, the method further includes: generating a unique identifier for each compared graphic pair in the graphic file comparison report; Based on the unique identifier, the comparison pattern pair is searched.

8. A server, characterized in that: The server includes: one or more processors and a memory; the memory is coupled to the one or more processors, the memory is used to store computer program code, the computer program code includes computer instructions, and the one or more processors call the computer instructions to enable the server to execute the method described in any one of claims 1-7.

9. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on a server, the server is caused to execute the method according to any one of claims 1 to 7.

10. A computer program product, characterized in that When the computer program product is run on a server, the server is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Engineering drawing content difference identification method and device, equipment and storage medium

    CN120748002A

  • Image-text coordinate linkage multi-version review result self-verification method, device and equipment

    CN121118875A