Incremental storage method and system for design drawings
The incremental storage method for design drawings addresses storage inefficiencies and collaboration challenges by identifying and storing only changed parts, managing versions efficiently, and enabling real-time multi-user editing with conflict resolution.
Patent Information
- Application Number
- CN202411439130.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2024-12-24
AI Technical Summary
Traditional design drawing storage methods result in waste of storage space, inefficient updates, complex version control, and difficulty in data synchronization, especially in collaborative environments.
An incremental storage method and system that uses a hash comparison algorithm to identify and store only changed parts of design drawings, associates version numbers with changes, and enables multi-user synchronous editing through a synchronization protocol.
Reduces storage waste, speeds up updates, simplifies version management, and enhances collaboration efficiency by ensuring all users see the latest drawing status while handling conflicts effectively.
Smart Images

Figure CN119179680A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of design drawings, and in particular to an incremental storage method and system for design drawings. Background Art
[0002] In traditional design drawing storage and management, full storage is usually adopted, that is, each time a drawing is updated, a new version of the entire drawing needs to be stored. This method has the following problems: Waste of storage space: Full storage leads to the storage of a large amount of duplicate data, wasting valuable storage space.
[0003] Inefficient updates: Each update requires processing and storing the entire drawing, increasing processing time and storage burden.
[0004] Complex version control: Managing multiple versions of drawings and tracking change history is a complex and time-consuming task.
[0005] Difficulty in data synchronization: In a multi-person collaborative environment, maintaining data consistency and synchronization is a challenge. Therefore, there is an urgent need for an incremental storage method and system for design drawings. Summary of the invention
[0006] In order to solve the above-mentioned problems, the present invention provides a method and system for incremental storage of design drawings.
[0007] In a first aspect, the present invention provides an incremental storage method for design drawings, which adopts the following technical solution: An incremental storage method for design drawings, comprising: Get design drawings; Identify the changed parts of the design drawings based on the hash comparison algorithm; Store the changed parts of the design drawings separately; Create a version number for the stored changed design drawings and associate it with the changed data; Based on the synchronization protocol, the design drawings can be edited synchronously by multiple users.
[0008] Furthermore, the obtaining of the design drawings includes obtaining the design drawings in real time and monitoring changes of the design drawings in real time based on an API interface.
[0009] Furthermore, the method of identifying the changed parts of the design drawings based on the hash comparison algorithm includes generating a hash value for each primitive, block and layer in the design drawings, and storing the hash values of the primitives, blocks and layers together when storing the initial version of the design drawings. When the design drawings are modified, the changed parts of the drawings are identified by judging the changes in the hash values one by one.
[0010] Furthermore, storing the changed part of the design drawing includes separating the changed part from the original design drawing and storing it separately, wherein the separation is achieved by parsing the file format and extracting the changed area.
[0011] Furthermore, the segmentation is achieved by parsing the file format and extracting the changed area, including selecting a suitable parsing library according to the design drawings, obtaining the changed area through comparative analysis, and determining the objects that need to be extracted in the changed area according to the judgment result of the hash value.
[0012] Furthermore, the stored changed design drawings are created with version numbers and associated with the changed data, including creating a unique version number for the changed design drawings by automatically incrementing the version number, and when storing the changed design drawings, associating the version number with the corresponding changed object.
[0013] Furthermore, based on the synchronization protocol, the design drawings are edited synchronously by multiple users, including establishing a persistent two-way connection between users and design drawings based on WebSocket to ensure that each user sees the latest drawing status, and judging whether the current version of the design drawings is consistent with the version when the user obtains it based on a conflict detection mechanism. When a conflict is determined, the modification is rejected, and a new design drawing is generated according to the conflict merging strategy.
[0014] In a second aspect, an incremental storage system for design drawings includes: The data acquisition module is configured to acquire the design drawings; The identification module is configured to identify the changed part of the design drawing based on a hash comparison algorithm; The storage module is configured to separately store the changed part of the design drawing; The association module is configured to create a version number for the stored changed design drawing and associate it with the changed data; The synchronization module is configured to perform multi-user synchronous editing of the design drawings based on the synchronization protocol.
[0015] In a third aspect, the present invention provides a computer-readable storage medium storing a plurality of instructions, wherein the instructions are suitable for being loaded and executed by a processor of a terminal device.
[0016] In a fourth aspect, the present invention provides a terminal device comprising a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded by the processor and executing the incremental storage method of a design drawing.
[0017] In summary, the present invention has the following beneficial technical effects: The present invention can quickly identify the changed parts based on the hash comparison algorithm and store them separately, which greatly shortens the update processing time and improves the update efficiency. By creating a version number for the changed design drawings and associating it with the change data, the version management is clearer and more efficient. By automatically increasing the version number, different versions of drawings can be quickly and accurately located, which is convenient for backtracking and viewing the change history.
[0018] Based on the synchronization protocol, multi-user synchronous editing is realized, and a persistent two-way connection is established through WebSocket to ensure that each user can see the latest drawing status. At the same time, the conflict detection mechanism and conflict merging strategy are adopted to effectively handle possible conflicts and improve the efficiency and accuracy of multi-person collaboration. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a schematic diagram of an incremental storage method for design drawings according to Example 1 of the present invention. DETAILED DESCRIPTION
[0020] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0021] Example 1 Reference Figure 1 , a method for incremental storage of design drawings in this embodiment includes: Get design drawings; Identify the changed parts of the design drawings based on the hash comparison algorithm; Store the changed parts of the design drawings separately; Create a version number for the stored changed design drawings and associate it with the changed data; Based on the synchronization protocol, the design drawings can be edited synchronously by multiple users.
[0022] Specifically, the following steps are included: S1. Obtain design drawings; S2. Identify the changed parts of the design drawings based on the hash comparison algorithm; Among them, the principle of hash algorithm A hash algorithm is an algorithm that maps data of any size to a fixed-size hash value (also called a hash value). For the same data input, the hash algorithm always generates the same hash value, but for different data input, the hash value will change significantly even if there are only slight differences. This feature makes hash algorithms very suitable for quickly comparing the differences between two data blocks.
[0023] In the incremental storage of design drawings, each primitive, block or layer can be regarded as a data unit. By calculating their hash values, it is possible to quickly determine whether the unit has changed.
[0024] Application of Hash Algorithm in Identifying Drawing Changes To identify the changed parts of the design drawings, the process based on the hash comparison algorithm is as follows: (1) Generate a hash value for each design unit The system generates a hash value for each element, block, and layer in the design drawing. The process of generating the hash value is based on the content of the unit, such as the type, position, size, color, attributes, etc. of the element.
[0025] For a straight line: its starting point, end point, line width and other information are used as input to generate a hash value.
[0026] For a layer: the information of all the primitives and tiles it contains is combined to generate a hash value of the layer.
[0027] (2) Hash value storage When storing the initial version of the design drawing, the hash value of each primitive, block and layer is stored together.
[0028] These hash values will be saved in the incremental storage module as the drawing versions are stored and updated, serving as the basis for version comparison.
[0029] (3) Compare hash values to identify changes When the design drawing is modified, the system will recalculate the hash values of the modified primitives, blocks, and layers.
[0030] The system quickly determines which design units’ hash values have changed by comparing them one by one with the hash values saved in the previous version.
[0031] If the hash values are the same, it means that the unit has not changed.
[0032] If the hash values are different, it means that the unit has been modified and the system marks the unit as a changed part.
[0033] (4) Marking and storing incremental data For design units marked as changed (such as entities, blocks, or layers), the system stores its incremental part as a new version node.
[0034] For unmodified cells, the system only needs to keep a reference to the existing stored data without re-storing it, thus reducing redundant data.
[0035] (5) Generate differential data and version nodes The system generates differential data based on the results of hash comparison. The differential data only contains the modified units as incremental updates. Each modified version is stored as a new version node, and the system manages these version nodes through the structure of differential tree or version graph.
[0036] S3. Storing the changed part of the design drawing, including separating the changed part from the original design drawing and storing it separately, wherein the separation is achieved by parsing the file format and extracting the changed area.
[0037] During the design drawing modification process, the system needs to be able to extract the specific changed area by parsing the file format. The following are the steps to achieve this function: (1) Analyze the design drawing file format First, you need to identify and parse the file format of the design drawing (such as DWG, DXF, SVG, etc.). Different file formats may have different parsing methods and structures. You can use existing libraries or tools to help parse these file formats.
[0038] Select parsing library: Select the parsing library suitable for the drawing format used. For example, for DXF format, you can use the ezdxf library.
[0039] Read files: Use functions in the library to read design drawing files and parse their contents.
[0040] (2) Extract the changed area By comparing the parsed original design drawing with the modified design drawing, the changed area can be extracted. The comparison result between the original hash value and the new hash value can be used to determine which objects need to be extracted.
[0041] Traverse the parsed objects: Traverse all entities, blocks, and layers in the original and new drawings.
[0042] Compare object properties: Filter out the changed areas that need to be extracted based on the hash comparison results.
[0043] Extract changed areas: Extract changed objects and their related information (such as location, attributes, etc.) and store them as new drawings or incremental data.
[0044] (3) Storage changes The extracted changed areas are stored separately. This can be achieved by storing the changed areas as a new file or creating a new change record in the existing file.
[0045] Create New File: Write the extracted changed area into a new design drawing file.
[0046] Update the storage structure: record the changed information in the system's incremental storage structure.
[0047] S4. Create a version number for the stored changed design drawing and associate it with the changed data, including through automatically incrementing the version number.
[0048] In the incremental storage method, in order to effectively manage and track each change of the design drawing, it is necessary to create a unique version number for each changed design drawing and associate it with the change data. The following are the specific steps and principles for implementing this process: (1) Definition of version number Version numbers are usually in an incremental format, which can be a simple integer, a date and time stamp, or a more complex form (such as major.minor.patch format). In order to achieve automatic increment of version numbers, it is recommended to use a simple integer form for easy understanding and management.
[0049] Example version number format: Initial version: 1 First change version: 2 Second change version: 3 (2) Version number generation mechanism The version number generation mechanism can be implemented in the following ways: Initialize version number: When the initial design drawing is created, set the version number to 1.
[0050] Version number storage: Maintain a version number counter in the database or persistent storage to record the current highest version number.
[0051] Version number auto-increment: Whenever a new design drawing is saved, the system increments the current version number by 1 and assigns this version number to the new drawing.
[0052] 3. Association between version number and change data When storing the changed design drawings, the version number needs to be associated with the corresponding change data. This ensures that when viewing or backtracking the version, the specific changes in the version drawing can be clearly identified.
[0053] Implementation steps: Create a change record: When storing change data, create a change record structure that includes version number, change content, timestamp, user information, etc.
[0054] Associate change data with version number: Associate the version number in the change record with the specific change data for subsequent query and management.
[0055] 4. Save the changed design drawings Each modified design drawing should be stored separately and saved together with the version record, so that the system can quickly trace back to the specified version when needed in the future.
[0056] File naming or storage structure: In the file system, you can use the version number as part of the file name (such as design_v2.dxf), or store it by version number in the database.
[0057] Version information update: Every time a new design drawing is stored, the status of the version manager is updated to ensure the continuity of the version number.
[0058] S5. Based on the synchronization protocol, the design drawings are edited synchronously by multiple users, including in the incremental storage system of the design drawings. The realization of multi-user synchronous editing is the key to ensure efficient collaboration of the design team. In order to support this function, appropriate technologies and mechanisms need to be adopted to ensure data consistency and effectively handle possible conflicts. The following are the specific implementation steps and principles: 1. Basic principles of multi-user simultaneous editing Real-time: Allows multiple users to access and edit the same design drawing at the same time.
[0059] Data consistency: Ensure that modifications made by different users do not result in data inconsistency.
[0060] User-friendliness: Provide a clear user interface and feedback so that users understand the current editing status and conflicts.
[0061] 2. Real-time collaboration technology To achieve multi-user simultaneous editing, the following techniques can be used: WebSocket: Establish a persistent two-way connection through WebSocket and push update information to all connected users in real time, ensuring that each user can see the latest drawing status.
[0062] Version control system: Use a version control mechanism similar to Git to record each user's modification history and perform version management through incremental storage.
[0063] 3. Conflict Detection Mechanism When multiple users are editing a design drawing at the same time, it is possible that multiple users modify the same part, resulting in conflicts. In order to effectively detect and handle conflicts, the following methods can be used: 3.1 Optimistic Locking Mechanism Optimistic locking is a common way to handle concurrency conflicts. Before each modification, the system records the version number or hash value of the current object. When the user submits the modification, the system compares the current version with the version when the user obtained it. If the versions are consistent, the submission is allowed; if they are inconsistent, it indicates a conflict.
[0064] step: 1. Get the version number: The user gets the version number of the current drawing from the server before editing.
[0065] 2. Modify and submit: The user makes modifications locally and submits the changes with the current version number.
[0066] 3. Version verification: When processing a modification request, the server checks whether the submitted version number is consistent with the current version.
[0067] 1. If they match, apply the changes and update the version number.
[0068] 2. If they are inconsistent, reject the modification and notify the user of the conflict.
[0069] 3.2 Conflicting Merges In some cases, even if there is a conflict, the system can try to automatically merge the user's changes. To do this, you can use a merge strategy, such as keeping a certain user's changes first or combining the changes of both users to generate a new drawing.
[0070] 1. Detect conflicts: After detecting conflicts through version numbers or hash values, record the modifications made by each user.
[0071] 2. Merge logic: Automatically generate a new drawing version based on the preset merge rules.
[0072] 1. For example, if two users make changes to different elements of the same layer, their changes can be merged instead of completely replacing them.
[0073] 3.3 User Notification and Feedback When a conflict is detected, the system should promptly notify the user and provide options for conflict resolution.
[0074] step: 1. Send notification: Send a conflict warning message to the user to inform them that their changes have not been applied.
[0075] 2. Provide solutions: You can provide a preview of the merged version, allowing users to choose which part of the changes to keep, or provide a complete modification history for users to refer to.
[0076] Example 2 This embodiment provides an incremental storage system for design drawings, including: The data acquisition module is configured to acquire the design drawings; The identification module is configured to identify the changed part of the design drawing based on a hash comparison algorithm; The storage module is configured to separately store the changed part of the design drawing; The association module is configured to create a version number for the stored changed design drawing and associate it with the changed data; The synchronization module is configured to perform multi-user synchronous editing of the design drawings based on the synchronization protocol.
[0077] A computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor of a terminal device and executing the method described.
[0078] A terminal device includes a processor and a computer-readable storage medium, wherein the processor is used to implement various instructions; and the computer-readable storage medium is used to store multiple instructions, wherein the instructions are suitable for being loaded by the processor and executing the described method.
[0079] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for incremental storage of design drawings, characterized in that: include: Get design drawings; Identify the changed parts of the design drawings based on the hash comparison algorithm; Store the changed parts of the design drawings separately; Create a version number for the stored changed design drawings and associate it with the changed data; Based on the synchronization protocol, the design drawings can be edited synchronously by multiple users.
2. The incremental storage method of a design drawing according to claim 1, characterized in that: The obtaining of the design drawings includes obtaining the design drawings in real time and monitoring the changes of the design drawings in real time based on an API interface.
3. The incremental storage method of a design drawing according to claim 2, characterized in that: The method for identifying the changed parts of the design drawings based on a hash comparison algorithm includes generating a hash value for each primitive, block and layer in the design drawings. When storing the initial version of the design drawings, the hash values of the primitives, blocks and layers are stored together. When the design drawings are modified, the changed parts of the drawings are identified by judging the changes in the hash values one by one.
4. The incremental storage method of a design drawing according to claim 3, characterized in that: The storing of the changed part of the design drawing includes separating the changed part from the original design drawing and storing it separately, wherein the separation is achieved by parsing the file format and extracting the changed area.
5. The incremental storage method of a design drawing according to claim 4, characterized in that: The segmentation is achieved by parsing the file format and extracting the changed area, including selecting an applicable parsing library according to the design drawings, obtaining the changed area through comparative analysis, and determining the object to be extracted in the changed area according to the judgment result of the hash value.
6. The incremental storage method of design drawings according to claim 5, characterized in that: The method of creating a version number for the stored changed design drawing and associating it with the changed data includes creating a unique version number for the changed design drawing by automatically incrementing the version number, and associating the version number with the corresponding changed object when storing the changed design drawing.
7. The incremental storage method of design drawings according to claim 6, characterized in that: Based on the synchronization protocol, the design drawings are edited synchronously by multiple users, including establishing a persistent two-way connection between users and design drawings based on WebSocket to ensure that each user sees the latest drawing status, and judging whether the current version of the design drawings is consistent with the version obtained by the user based on the conflict detection mechanism. When a conflict is determined, the modification is refused, and a new design drawing is generated according to the conflict merging strategy.
8. An incremental storage system for design drawings, characterized in that: include: The data acquisition module is configured to acquire the design drawings; The identification module is configured to identify the changed part of the design drawing based on a hash comparison algorithm; The storage module is configured to separately store the changed part of the design drawing; An association module is configured to create a version number for the stored changed design drawing and associate it with the changed data; The synchronization module is configured to perform multi-user synchronous editing of the design drawings based on the synchronization protocol.
9. A computer-readable storage medium storing a plurality of instructions, characterized in that: The instructions are suitable for being loaded by a processor of a terminal device and executing the method according to claim 1 .
10. A terminal device, comprising a processor and a computer-readable storage medium, wherein the processor is used to implement each instruction; and the computer-readable storage medium is used to store multiple instructions, characterized in that: The instructions are suitable for being loaded by a processor and executing the method as claimed in claim 1 .
Citation Information
Patent Citations
Dynamic collaborative management method for building information model
CN110147579A
Multi-person collaborative graph configuration method, electronic equipment and server
CN110442334A
Database design method and device and related equipment
CN113806325A
Multi-person collaborative online drawing operation method and system
CN115460302A
Graph data processing and incremental storage method and device and computer equipment
CN115982414A
Cited By
Design data processing method and device based on hierarchical hash cache, equipment and storage medium
CN121502608A
Drawing life cycle evidence storage method and system based on alliance chain
CN121682798A
A blueprint life cycle evidence method and system based on a consortium chain
CN121682798B
Method and system for extracting and structurally storing data from CAD drawing
CN121833704A
Multi-participant cloud collaboration management method and system for construction project
CN122264743A
