Visual comparison method of graphic model file and computer readable storage medium
By using the visual comparison method in the graphic model file, the graphic model file is loaded and structured restored, visual rendering and differentiated display of the difference model objects, the problem of difficulty in comparing the differences in the graphic model file in the existing technology is solved, and more efficient modeling and problem investigation is achieved.
Patent Information
- Application Number
- CN202411614774.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-21
AI Technical Summary
It is difficult to effectively compare differences in graphical model files in prior art, especially because these files contain complex three-dimensional data structures, and it is difficult to identify differences through simple text comparisons.
The visual comparison method of the graphical model file is used to load and structure the graphical model file to obtain the model data, and visually render it in the graphical view to display the difference model objects.
It provides a more intuitive visual comparison method for graphic model files, which improves modeling efficiency and significantly reduces the time required for problem investigation and resolution.
Smart Images

Figure CN119669538A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial simulation, and in particular to a visualization comparison method for graphic model files and a computer-readable storage medium. Background Art
[0002] In traditional file comparison, the focus is usually on the differences in the text content of the files, such as using the diff tool in the version control system to compare the differences in code files. However, for graphic model files, this text content-based comparison method is not applicable because graphic model files usually contain complex three-dimensional data structures, such as vertices, faces, coordinates, material information, etc. These data structures are difficult to identify differences through simple text comparison. Summary of the invention
[0003] The technical problem to be solved by the present invention is that, in view of the complex structure of the graphic model files in the prior art, the comparison of text contents cannot meet the actual application requirements, and a visual comparison method and a computer-readable storage medium for graphic model files are provided.
[0004] The technical solution adopted by the present invention to solve the technical problem is: constructing a visual comparison method of a graphic model file, the method is applied to simulator simulation software, and comprises:
[0005] Loading a graphic model file to be compared, and structurally restoring the graphic model file to obtain model data;
[0006] Comparing the model data, searching for model objects with differences in the graphic model files to be compared, and storing them in a list of difference model objects;
[0007] The model data of the graphic model files to be compared are respectively visually rendered in a graphic view, and the difference model objects selected in the difference model object list are distinguishably displayed in the graphic view.
[0008] In some embodiments, storing the difference model object list further comprises: classifying the stored difference model objects;
[0009] The differential model object selected in the differential model object list is displayed in the graphic view in a distinctive manner, including:
[0010] According to the classification category, the difference model objects selected in the difference model object list are displayed in a differentiated manner in the graphic view.
[0011] In some embodiments, the classification categories include:
[0012] A first category, the first category is model objects that exist in the graphic model files to be compared and whose attributes have been changed;
[0013] A second category, the second category is model objects deleted in the graphic model file that need to be compared; and
[0014] The third category is the model objects newly added to the graphic model file that need to be compared.
[0015] In some embodiments, the stored difference model objects are classified, including:
[0016] Classification is performed based on the stored identification code of the model object; or, classification is performed based on the stored identification code and attributes of the model object.
[0017] In some embodiments, the graphic model file is structurally restored to obtain model data, including:
[0018] The content of the graphic model file is parsed by a defined parsing algorithm to obtain model data of the graphic model file, and a data structure is constructed to store the model data in the data structure.
[0019] In some embodiments, the model data of the graphic model files to be compared are respectively visually rendered in a graphic view, which also includes: creating the graphic view using a graphic view framework.
[0020] In some embodiments, visually rendering the model data of the graphic model files to be compared in the graphic view respectively includes:
[0021] The data structure is mapped into the graphic view framework, a graphic item is created to represent the model object in the graphic model file, and the attributes of the graphic item are set to reflect the attributes of the model object to be compared, so as to obtain the graphic item to be compared.
[0022] In some embodiments, the visual comparison method of the graphic model file further includes:
[0023] For the difference model objects selected in the difference model object list, the attribute differences are listed in the attribute comparison panel.
[0024] In some embodiments, the model data includes: identification codes of model objects, attributes of model objects, and connection relationships between model objects;
[0025] The attributes of the model object include: the location of the model object, geometric information of the model object, the name of the model object, the description of the model object and the parameter value of the model object.
[0026] The present invention provides a computer-readable storage medium on which a computer program is stored, comprising: when the computer program is executed by a processor, the visual comparison method of the graphic model file described above is implemented.
[0027] By implementing the present invention, the following beneficial effects are achieved:
[0028] The present invention provides a visual comparison method for graphic model files and a computer-readable storage medium. The visual comparison method for graphic model files includes: loading the graphic model files to be compared, structurally restoring the graphic model files to obtain model data; comparing the model data, searching for model objects with differences in the graphic model files to be compared, and storing them in a difference model object list; respectively visually rendering the model data of the graphic model files to be compared in a graphic view, and distinguishing and displaying the difference model objects selected in the difference model object list in the graphic view. Compared with the traditional comparison method based on text content, the present invention provides a more intuitive means of visual comparison of graphic model files, which not only improves the efficiency of modeling, but also significantly reduces the time required for problem troubleshooting and resolution. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The present invention will be further described below with reference to the accompanying drawings and embodiments, in which:
[0030] Figure 1 A schematic diagram showing a flow chart of an embodiment of a method for visually comparing graphic model files of the present invention;
[0031] Figure 2 A comparison diagram of a first graphic view and a second graphic view in an embodiment of a method for visually comparing graphic model files of the present invention is shown. DETAILED DESCRIPTION
[0032] In order to have a clearer understanding of the technical features, purposes and effects of the present invention, specific embodiments of the present invention are now described in detail with reference to the accompanying drawings.
[0033] It should be noted that the flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor do they have to be executed in the order described. For example, some operations / steps can be decomposed, while some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0034] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0035] The present invention belongs to the field of industrial simulation technology, and in particular to the field of full-range simulation and graphical modeling technology of nuclear power plant operation systems.
[0036] like Figure 1 As shown, some embodiments of the present invention disclose a method for visually comparing a graphic model file, the method comprising the following steps:
[0037] Step S1: loading the graphic model file to be compared, structurally restoring the graphic model file, and obtaining model data;
[0038] Step S2: Compare the model data, find the model objects with differences in the graphic model files to be compared, and store them in a list of different model objects;
[0039] Step S3: Visually render the model data of the graphic model files to be compared in the graphic view respectively, and distinguish and display the difference model objects selected in the difference model object list in the graphic view.
[0040] In some embodiments, graphic model files refer to files containing model data, which are used to describe and store identification codes of three-dimensional or two-dimensional graphic model objects, attributes of model objects, and connection relationships between model objects.
[0041] The graphic model files that need to be compared: refer to the old and new versions of the same graphic model file, or completely different graphic model files.
[0042] Model object: refers to the smallest graphic element in a graphic model file. When a model object is created, an identification code of the model object is automatically generated.
[0043] In some embodiments, step S1 includes: loading the graphic model file to be compared into the memory, and structurally restoring the graphic model file to obtain model data.
[0044] For example: load the first graphic model file and the second graphic model file into the memory, perform structural restoration on the first graphic model file and the second graphic model file, and obtain model data of the first graphic model file and the second graphic model file. The first and second graphic model files here are only examples and are not intended to limit the present application. They may also be the third and fourth graphic model files.
[0045] In some embodiments, the graphic model file is structurally restored to obtain model data, including: parsing the content of the graphic model file through a defined parsing algorithm to obtain model data of the graphic model file, and constructing a data structure to store the model data in the data structure.
[0046] In some embodiments, the model data includes: identification codes of model objects, attributes of model objects, and connection relationships between model objects;
[0047] The attributes of the model object include: the location of the model object, the geometric information of the model object, the name of the model object, the description of the model object and the parameter value of the model object.
[0048] In some embodiments, data structure refers to a specific method for organizing and storing data in a graphic model file in a computer memory. These data structures are used to effectively represent identification codes of model objects, attributes of model objects, and connection relationships between model objects.
[0049] In some embodiments, step S2 includes: comparing the model data, searching for model objects with differences in the graphic model files to be compared, storing them in a list of difference model objects, and classifying the stored difference model objects.
[0050] For example, the model data of the first graphic model file and the second graphic model file are compared, and the model objects with differences between the first graphic model file and the second graphic model file are searched according to the identification code, and the model objects are stored in the difference model object list according to the identification code, and the stored difference model objects are classified. The first and second graphic model files here are only examples and are not intended to limit the present application. The third and fourth graphic model files may also be used.
[0051] In some embodiments, the stored difference model objects are classified, including: classification according to the identification code of the stored model object; or classification according to the identification code and attribute of the stored model object. The subsequent steps will display the difference model objects of different categories according to the classification categories of the difference model objects.
[0052] For example: among the stored difference model objects, the difference model objects with the same identification code but different attributes are classified into the first category; the difference model objects whose identification code exists in the first graphic model file but not in the second graphic model file are classified into the second category; the difference model objects whose identification code does not exist in the first graphic model file but exists in the second graphic model file are classified into the third category. These are merely examples and are not intended to be limitations of the present application.
[0053] In some embodiments, the model objects that exist in the graphic model files that need to be compared are specifically: model objects with the same identification codes in the graphic model files that need to be compared. The identification codes can be in any existing manner, such as snowflake ID, UUID. The ID and UUID here are only examples and are not intended to be a limitation on the present application.
[0054] In some embodiments, step S3 includes: visually rendering the model data of the graphic model files to be compared in the graphic view respectively, and displaying the difference model objects selected in the difference model object list in the graphic view according to the classification categories.
[0055] For example, Figure 2 As shown, the model data of the first graphic model file is visually rendered in the first graphic view, and the model data of the second graphic model file is visually rendered in the second graphic view. According to the classification category, the difference model objects selected in the difference model object list are distinguished and displayed in the first graphic view and the second graphic view. The first and second graphic model files and the first and second graphic views here are only examples and are not intended to limit the present application. It can also be a third and fourth graphic model files and a third and fourth graphic views.
[0056] In some embodiments, the difference display can be performed in any existing manner, such as highlight display, covering the selected difference model object with a highlight color or border to make it more conspicuous in the view; shadow effect, adding a shadow to the selected difference model object; transparency adjustment, adjusting the transparency of the selected difference model object to make it translucent in the view. These are only examples and are not intended to be limitations of the present application.
[0057] In some embodiments, the classification categories include: a first category, a second category, and a third category. The first category is model objects that exist in the graphic model files that need to be compared and whose attributes have changed; the second category is model objects that have been deleted in the graphic model files that need to be compared; and the third category is model objects that have been newly added to the graphic model files that need to be compared.
[0058] For example, the first category is: model objects that exist in both the first graphic model file and the second graphic model file and have the same identification code, but whose attributes have changed, that is, model objects that exist in both graphic model files to be compared and whose attributes have changed.
[0059] The second category is: model objects that exist in the first graphic model file but do not exist in the second graphic model file, that is, model objects that are deleted in the graphic model files that need to be compared.
[0060] The third category is: model objects that do not exist in the first graphic model file but exist in the second graphic model file, that is, model objects newly added to the graphic model files that need to be compared.
[0061] It should be noted that the first and second graphic model files here are only examples and are not intended to limit the present application. The third and fourth graphic model files may also be used.
[0062] In some embodiments, the selected first category, second category, and third category difference model objects are displayed using different difference display methods, respectively, so as to improve the distinguishability of the difference display.
[0063] For example: the selected first category difference model object is distinguished and displayed with a red border, the selected second category difference model object is distinguished and displayed with a blue border, and the selected third category difference model object is distinguished and displayed with a yellow border. The red border, blue border and yellow border here are only examples and are not intended to limit the present application.
[0064] In some embodiments, step S3 includes: creating a graphic view using a graphic view framework, visually rendering the model data of the graphic model files to be compared in the graphic view respectively, and displaying the difference model objects selected in the difference model object list in the graphic view according to the classification categories.
[0065] For example, Figure 2 As shown, a first graphic view and a second graphic view are created using a graphic view framework, model data of a first graphic model file are visually rendered in the first graphic view, and model data of a second graphic model file are visually rendered in the second graphic view, and the difference model objects selected in the difference model object list are displayed differently in the first graphic view and the second graphic view according to the classification category. The first and second graphic model files and the first and second graphic views here are only examples and are not intended to limit the present application; third and fourth graphic model files and third and fourth graphic views may also be used.
[0066] In some embodiments, the graphics view framework refers to a set of tools in Qt (Qt Application Framework) for managing and interacting with customized two-dimensional graphics items, while also providing view widgets for visualizing these items and supporting scaling and rotation.
[0067] In some embodiments, the model data of the graphic model files that need to be compared are visually rendered in the graphic view, including: mapping the data structure to the graphic view framework, creating graphic items to represent the model objects in the graphic model files, and setting the properties of the graphic items to reflect the properties of the model objects that need to be compared, so as to obtain the graphic items that need to be compared.
[0068] In some embodiments, a difference model object is selected in the difference model object list, and a related key can be triggered by the user. The related key can be triggered in any existing way, such as pressing a key, clicking a mouse, double-clicking a mouse, swiping a mouse, etc. This is only an example and is not intended to be a limitation of the present application.
[0069] In some embodiments, the visual comparison method of the graphic model file further includes:
[0070] Step S4: For the difference model object selected in the difference model object list, the attribute differences are listed in the attribute comparison panel.
[0071] For example, for the difference model object selected in the difference model object list, the property comparison panel lists the differences in at least one of the model object's position, the model object's geometric information, the model object's name, the model object's description and the model object's parameter value. It can be understood that the at least one can be one, two, three or any number.
[0072] For example: Figure 2 As shown, the selected first category difference model objects are distinguished and displayed with a red border, and the attribute differences are listed in the attribute comparison panel.
[0073] The present invention provides a computer-readable storage medium having a computer program stored thereon, including: when the computer program is executed by a processor, the method for visually comparing graphic model files disclosed in an embodiment of the present invention is implemented, which will not be described in detail herein.
[0074] By implementing the present invention, the following beneficial effects are achieved: the present invention provides a visual comparison method for graphic model files and a computer-readable storage medium, and the visual comparison method for graphic model files includes: loading the graphic model files to be compared, structurally restoring the graphic model files, and obtaining model data; comparing the model data, searching for model objects with differences in the graphic model files to be compared, and storing them in a difference model object list; respectively visually rendering the model data of the graphic model files to be compared in the graphic view, and distinguishing and displaying the difference model objects selected in the difference model object list in the graphic view. Compared with the traditional comparison method based on text content, the present invention provides a more intuitive means of visual comparison of graphic model files, which not only improves the efficiency of modeling, but also significantly reduces the time required for problem troubleshooting and resolution.
[0075] The present invention has successfully realized the full range simulation of nuclear power plant operation system in a cross-platform environment through in-depth research and design of graphical interface development. The system not only provides core functions such as model development, integration, operation, and testing, but also covers key simulation links such as visualization and analysis and comparison. More importantly, the present invention solves the application problem of nuclear power simulation software in Linux environment, and provides strong technical support for the safe management and efficient operation of nuclear power plants.
[0076] It is understandable that the above embodiments only express some implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present invention, the above embodiments or technical features can be freely combined, and several deformations and improvements can be made, which all belong to the protection scope of the present invention, that is, the embodiments described in "some embodiments" can be freely combined with any of the above and below embodiments. Therefore, all equivalent changes and modifications made to the scope of the claims of the present invention should belong to the scope of the claims of the present invention.
Claims
1. A visual comparison method for graphic model files, the method being applied to simulator simulation software, characterized in that: The following steps are involved: Loading a graphic model file to be compared, and structurally restoring the graphic model file to obtain model data; Comparing the model data, searching for model objects with differences in the graphic model files to be compared, and storing them in a list of difference model objects; The model data of the graphic model files to be compared are respectively visually rendered in a graphic view, and the difference model objects selected in the difference model object list are distinguishably displayed in the graphic view.
2. The visual comparison method of graphic model files according to claim 1, characterized in that: The difference model object list is stored, and then the difference model objects are classified; The differential model object selected in the differential model object list is displayed in the graphic view in a distinctive manner, including: According to the classification category, the difference model objects selected in the difference model object list are displayed in a differentiated manner in the graphic view.
3. The visual comparison method of graphic model files according to claim 2, characterized in that: The classification categories include: A first category, the first category is model objects that exist in the graphic model files to be compared and whose attributes have been changed; A second category, the second category is model objects deleted in the graphic model file that need to be compared; and The third category is the model objects newly added to the graphic model file that need to be compared.
4. The visual comparison method of graphic model files according to claim 2, characterized in that: The stored difference model objects are classified into categories, including: Classification is performed based on the stored identification code of the model object; or, classification is performed based on the stored identification code and attributes of the model object.
5. The visual comparison method of graphic model files according to claim 1, characterized in that: The graphic model file is structurally restored to obtain model data, including: The content of the graphic model file is parsed by a defined parsing algorithm to obtain model data of the graphic model file, and a data structure is constructed to store the model data in the data structure.
6. The visual comparison method of graphic model files according to claim 5, characterized in that: The model data of the graphic model files to be compared are respectively visually rendered in the graphic views, which also includes: creating the graphic views using a graphic view framework.
7. The visual comparison method of graphic model files according to claim 6, characterized in that: The model data of the graphic model files to be compared are respectively visually rendered in the graphic view, including: The data structure is mapped into the graphic view framework, a graphic item is created to represent the model object in the graphic model file, and the attributes of the graphic item are set to reflect the attributes of the model object to be compared, so as to obtain the graphic item to be compared.
8. The visual comparison method of graphic model files according to claim 1, characterized in that: The visual comparison method of the graphic model file also includes: For the difference model objects selected in the difference model object list, the attribute differences are listed in the attribute comparison panel.
9. The visual comparison method of graphic model files according to claim 1, characterized in that: The model data includes: identification codes of model objects, attributes of model objects and connection relationships between model objects; The attributes of the model object include: the location of the model object, geometric information of the model object, the name of the model object, the description of the model object and the parameter value of the model object.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for visually comparing the graphic model files as described in any one of claims 1 to 9 is implemented.