Data recognition-based drawing format conversion and machine translation method and system

By establishing a unified coordinate baseline and adjacency signature sequence in drawing format conversion, constructing an acyclic candidate set, and using a breathing detection gate to prevent circular references, the problem of paragraph merging in complex drawing scenarios is solved, achieving stable reorganization and efficient translation of drawing text.

CN121502851BActive Publication Date: 2026-03-27SICHUAN YIXUN INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-09
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

In complex drawing scenarios, existing technologies cause circular references due to coordinate overlap in paragraph merging algorithms, leading to memory spikes and task interruptions, preventing proper termination and affecting drawing text parsing and format reorganization.

Method used

By establishing a unified coordinate baseline, generating an adjacency signature sequence, constructing an adjacency chain with consistent direction, setting overlapping fuse lines and difference sets, a loop-free candidate set is realized. Combined with a breathing detection gate and an anti-loop guidance structure, circular references are prevented, ensuring the stability of paragraph merging.

Benefits of technology

It effectively prevents circular references, reduces the risk of text duplication and memory overflow, and improves the stability of drawing format conversion and the fidelity of cross-language drawings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121502851B_ABST
    Figure CN121502851B_ABST
Patent Text Reader

Abstract

The application discloses a drawing format conversion and machine translation method and system based on data recognition, relates to the technical field of computer-aided design file processing, and comprises the following steps: S1, a unified coordinate baseline is established, the absolute position, rotation angle and size ratio of each text object are recorded, and an adjacent signature sequence is generated according to the recording result; S2, the adjacent signature sequence is used to construct an adjacent chain with consistent direction for each text object, a unique chain sequence number is allocated according to the space features of the previous nodes, and a loop-free candidate set is generated. The application generates an adjacent signature sequence by establishing a unified coordinate baseline, constructs an adjacent chain with consistent direction and forms a loop-free candidate set; overlapping fuses are set to eliminate overlapping paths, the text order is rearranged according to a difference set, paragraph splicing is completed, and a width threshold is calculated; and then a breathing detection gate and a reverse loop guide structure are used to dynamically control the detection range, so that the automatic suppression of circular reference and the stable control of paragraph merging are realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer-aided design file processing, in particular to a drawing format conversion and machine translation method and system based on data recognition. BACKGROUND

[0002] The drawing format conversion and machine translation based on data recognition refers to the whole process of extracting, understanding, translating and restoring text information directly from CAD drawing source files (such as DWG) by using data recognition and intelligent analysis technology without the help of manual or intermediate file format conversion. Specifically, the scheme directly parses the DWG file structure through the Libredwg framework, recognizes and extracts data objects such as single-line text, multi-line text, property blocks and reference blocks in the drawing; then reconstructs the absolute position of each piece of text in the drawing by using coordinates, rotation angles and style parameters to form an accurate text positioning model. Next, through the coordinate threshold merging algorithm and NLP natural language processing technology, the scattered short sentences in the layout are recombined into complete paragraphs, and non-translation characters and annotation numbers are excluded to ensure semantic coherence and translation effectiveness. Subsequently, the system calls an AI translation engine and a custom industry term library to perform automatic translation, keeps professional vocabulary consistent, and backfills the translation text under the premise of maintaining the original font and layout style to generate a DWG or PDF file with high restoration degree. This method realizes the integrated process from source data recognition-semantic reorganization-machine translation-format restoration, significantly reduces the distortion and compatibility problems of traditional intermediate file method, and improves the readability and security of cross-language engineering drawings.

[0003] The prior art has the following disadvantages:

[0004] In the prior art, the execution of the paragraph merging algorithm based on the coordinate relationship usually relies on a fixed context detection threshold to determine the logical association between adjacent text elements. However, in complex drawing scenarios, the text distribution density, rotation angle and scaling ratio have dynamic variation characteristics. If the system overlaps the detection threshold when adjusting adaptively, different text nodes will be recognized as sibling nodes in the same merging period. This cross-recognition forms a circular reference in the linked list structure, making the paragraph merging algorithm unable to terminate correctly in the traversal process, resulting in problems such as text repetition backfilling or iteration logic out of control. When the circular linked list continues to expand, the system resource occupation increases rapidly, the memory explodes, causing task interruption, and ultimately leading to the failure of the text analysis and format reorganization process of the whole drawing.

[0005] The above information disclosed in the background section is only used to strengthen the understanding of the background of the present disclosure, and therefore it can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0006] The application aims to provide a drawing format conversion and machine translation method and system based on data recognition to solve the problems in the background art.

[0007] To achieve the above-mentioned purpose, the application provides the following technical solution: a drawing format conversion and machine translation method based on data recognition, comprising the following steps:

[0008] S1, establishing a unified coordinate baseline, recording the absolute position, rotation angle and size proportion of each text object, and generating an adjacent signature sequence containing spatial features according to the recording results;

[0009] S2, using the adjacent signature sequence to construct an adjacent chain with consistent direction for each text object, and assigning a unique chain sequence number according to the spatial features of the predecessor node to generate a loop-free candidate set;

[0010] S3, setting an overlapping fuse line in the loop-free candidate set, and scanning the entry edge and exit edge relationship of the predecessor node and the subsequent node point by point, cutting off the longest path and generating a difference set when detecting coordinate range overlap;

[0011] S4, rearranging the order of the text objects according to the difference set, constructing a continuous merging window, and performing paragraph splicing according to the head-tail docking principle and calculating the paragraph loadable width threshold;

[0012] S5, starting the breath detection gate and anti-loop guide structure according to the width threshold, taking the paragraph chain tail as the anchor point to alternately expand and contract the detection range under the time rhythm, and immediately shifting the threshold and locking the chain tail when detecting the back-reference trend, so as to realize the automatic suppression of circular reference and stable paragraph merging.

[0013] Preferably, step S1 comprises:

[0014] Data level traversal is performed on the drawing source file to extract the absolute position, rotation angle, font proportion and text boundary range of each text object in the two-dimensional plane coordinate system, and all spatial data are mapped to a unified geometric reference point to form a unified coordinate baseline;

[0015] After completing the extraction of absolute position and angle, the horizontal position, vertical position, rotation angle and size proportion obtained by extraction are integrated and processed to make the text objects comparable under a unified data framework;

[0016] After obtaining the integrated spatial parameter set, a combined feature vector containing spatial direction, distance interval and angle offset is constructed according to the absolute position, rotation angle and size proportion, so that the text objects have spatial recognition features;

[0017] The spatial recognition features are sequentially processed according to the relative position order of the unified coordinate baseline to generate an adjacent signature sequence carrying absolute coordinates, rotation angles and size proportion information, which is used to form a spatial basic framework for paragraph merging.

[0018] Preferably, the step S2 comprises:

[0019] Based on the generated adjacent signature sequence, the dominant direction of the text object in the spatial distribution is determined according to the arrangement direction of the text object in the drawing plane, and the spatial coordinates and rotation angles of the text object are jointly sorted with reference to the unified coordinate baseline to form an arrangement sequence with continuous direction;

[0020] On the basis of direction normalization, the adjacent relationship is established according to the dominant direction of the text object, and the adjacent relationship is determined by the spatial coordinates, angle offset and size proportion difference, and the adjacent text objects are constructed into a continuous chain structure;

[0021] After obtaining the adjacent chain with consistent direction, a unique chain sequence number is assigned to each text object according to the spatial position, rotation angle and size proportion of the previous node, so that the numbering has spatial continuity and direction consistency;

[0022] By integrating the adjacent chain with consistent direction, a loop-free candidate set is generated according to the chain sequence number constraint relationship, so that the spatial connection relationship of the text object remains unidirectional and hierarchical.

[0023] Preferably, in the process of generating the loop-free candidate set, the chain sequence number is used as the only constraint basis, and when the node numbers of different adjacent chains are repeated, the connection relationship in the main chain direction is retained and the cross reference is eliminated, so that the internal nodes of each adjacent chain remain unidirectional extension and do not form a back-reference link, thereby ensuring the continuity of the loop-free candidate set in spatial distribution and the stability of logical connection.

[0024] Preferably, the step S3 comprises:

[0025] On the basis of the obtained loop-free candidate set, a spatial scanning reference is established according to the unified coordinate baseline, the boundary coordinate values of each text object are extracted and a boundary distribution map is formed, which is used to describe the spatial occupation relationship between nodes;

[0026] After establishing the spatial scanning reference, an overlapping fuse line is set for each previous node and subsequent node, and a spatial separation interface is dynamically generated according to the coordinate distribution density and adjacent distance of the node, which is used to divide independent connection domains and limit the acceptable overlap threshold;

[0027] After setting the overlapping fuse line, the in-edge and out-edge relationship of the previous node and the subsequent node is scanned point by point, and when it is detected that the out-edge region and the in-edge region exist overlap, the longest path is cut along the overlapping fuse line and temporarily stored in the to-be-processed set.

[0028] After the path cutting is completed, difference calculation is performed on the truncated node set, and a difference set containing spatial difference features is generated according to coordinate difference, angle difference and size ratio difference, so as to maintain the unidirectionality and stability of the acyclic candidate set.

[0029] Preferably, after the path cutting is completed, when performing difference calculation on the truncated node set, the spatial displacement direction is determined by comparing the coordinate difference, angle difference and size ratio difference of the previous node and the subsequent node, and the association order of the text object is re-established according to the displacement direction, so that the difference set and the remaining nodes of the original adjacency chain remain continuous connection, thereby realizing accurate positioning and logical recovery of the truncated node in the subsequent paragraph reorganization stage.

[0030] Preferably, step S4 comprises:

[0031] After obtaining the difference set, the cut path and the related text objects are re-ordered according to the spatial displacement information recorded in the difference set, so that the text objects re-obtain the position relationship conforming to the spatial distribution law in the new order sequence;

[0032] On the basis of reordering the text object order, a continuous merging window is constructed according to the spatial distance, angle consistency and size proportion continuity between the text objects, so that each window is independent in spatial range and has continuity;

[0033] After the continuous merging window is established, the paragraphs are spliced according to the head-tail connection principle, and the connection distance is dynamically adjusted according to the window boundary coordinates, so that the text interval after splicing is consistent with the overall arrangement and a complete paragraph chain is formed;

[0034] After the paragraph splicing is completed, the loadable width threshold of the paragraph is calculated, the maximum extension range of the paragraph is limited by counting the coordinate span, rotation offset and font size of the text objects in the paragraph, so as to ensure the stability and structural integrity of the paragraph arrangement.

[0035] Preferably, when calculating the loadable width threshold of the paragraph, the unified coordinate baseline is taken as a reference, the spatial span, rotation angle and font size of the text objects in the paragraph are comprehensively analyzed to determine the maximum arrangement width of the paragraph, and when the width exceeds the threshold, local segmentation processing is performed, so that the paragraph maintains the continuity and visual balance of spatial layout under different language length and typesetting conditions.

[0036] Preferably, step S5 comprises:

[0037] After completing paragraph concatenation and obtaining the loadable width threshold, an initial detection range is established according to the width threshold, an envelope structure is formed based on the spatial span between the start point and the end point of the paragraph chain, and a time sequence control node is established with the paragraph chain tail as a fixed anchor point;

[0038] After establishing the initial detection range, a breathing detection gate is started, the detection range is alternately expanded and contracted under the time rhythm, and the expansion and contraction of the detection area are controlled based on the width threshold, so as to realize continuous monitoring of the back-reference trend;

[0039] During the dynamic expansion and contraction process of the breathing detection gate, the change direction of the detection range is guided with reference to the paragraph chain tail, and when the expansion direction of the detection boundary and the chain tail position have a back-reference trend, an offset operation is performed and the chain tail is fixed;

[0040] After detecting the back-reference trend, a threshold locking mechanism is triggered, the coordinate position of the paragraph chain tail and the spatial parameters of the adjacent nodes are fixed in the current detection state, so as to maintain the spatial stability and logical continuity of the paragraph merging process.

[0041] The drawing format conversion and machine translation system based on data recognition includes a coordinate normalization module, an adjacent chain construction module, an overlap detection and fusing module, a paragraph reorganization module, and a dynamic stability control module:

[0042] The coordinate normalization module establishes a unified coordinate baseline, records the absolute position, rotation angle and size ratio of each text object, and generates an adjacent signature sequence containing spatial features according to the recorded results;

[0043] The adjacent chain construction module uses the adjacent signature sequence to construct an adjacent chain with consistent direction for each text object, and assigns a unique chain sequence number according to the spatial features of the previous node to generate a loop-free candidate set;

[0044] The overlap detection and fusing module sets an overlap fusing line in the loop-free candidate set, and scans the entry and exit edges of the previous node and the subsequent node point by point, and when the coordinate range overlaps, the longest path is cut off and a difference set is generated;

[0045] The paragraph reorganization module rearranges the order of the text objects according to the difference set, constructs a continuous merging window, performs paragraph concatenation according to the head-tail docking principle, and calculates the paragraph loadable width threshold;

[0046] The dynamic stability control module starts the breathing detection gate and the anti-loop guide structure according to the width threshold, and alternately expands and contracts the detection range under the time rhythm with the paragraph chain tail as an anchor point, and when the back-reference trend is detected, the threshold is immediately offset and the chain tail is locked, so as to realize the automatic suppression of circular reference and stable paragraph merging.

[0047] In the above technical solution, the present application provides technical effects and advantages:

[0048] The present application unifies the position, angle and scale information of the text object in the drawing by establishing a unified coordinate baseline and generating an adjacent signature sequence containing spatial features, thereby fundamentally ensuring the consistency of the text in spatial positioning. Through the generation of a non-cyclic candidate set and the construction of a direction-consistent adjacent chain, the logical connection between texts is realized in a one-way and controllable manner, avoiding the cyclic linking caused by coordinate overlap in the merging process. This method enables the text structure to maintain a stable extension relationship under complex layout, thereby improving the continuity and accuracy of the text reorganization of the drawing.

[0049] The present application realizes dynamic self-adjustment and anti-loop control of the text chain by introducing a difference set and a breathing detection gate in the paragraph splicing stage, so that the system can automatically adjust the detection range and threshold offset according to the time rhythm when performing paragraph merging. When there is a back-reference trend, the threshold locking can be triggered immediately to prevent the paragraph chain from being circularly referenced. This mechanism effectively reduces the risk of text duplication, memory overflow and structure misplacement, so that the drawing format conversion process can still run stably in a high-load environment, improving the restoration degree and automated processing reliability of cross-language drawings. BRIEF DESCRIPTION OF DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments will be briefly introduced. Obviously, the drawings in the following description are only some embodiments described in the present application, and other drawings can also be obtained by those skilled in the art based on these drawings.

[0051] Figure 1 The method flowchart of the drawing format conversion and machine translation method based on data recognition of the present application.

[0052] Figure 2 The module schematic diagram of the drawing format conversion and machine translation system based on data recognition of the present application. DETAILED DESCRIPTION

[0053] Example implementations will now be described more fully with reference to the accompanying drawings. Example implementations may, however, be implemented in many different forms and should not be construed as limited to the examples set forth herein; rather, these example implementations are provided so that this disclosure will be thorough and complete, and will fully convey the inventive aspects of the example implementations to those skilled in the art. Like reference numerals may refer to like elements throughout the description of the figures.

[0054] The present application provides a drawing format conversion and machine translation method based on data recognition as shown in Figure 1 The method comprises the following steps:

[0055] S1, establish a unified coordinate baseline, record the absolute position, rotation angle and size ratio of each text object, and generate an adjacent signature sequence containing spatial features according to the recorded results;

[0056] In the process of establishing a unified coordinate baseline, the spatial features of the text elements in the global coordinate system are realized by comprehensively analyzing and recording the text objects in the drawing source file. This step includes the following steps:

[0057] The spatial parameter information of each text object in the original drawing data structure is extracted by performing data level traversal on the drawing source file. In this process, all identifiable text elements in the drawing are analyzed one by one, and their absolute position coordinates in the two-dimensional plane coordinate system are extracted, including horizontal coordinate value and vertical coordinate value. At the same time, the rotation angle, font proportion and text boundary range applied during drawing are recorded. In order to avoid position errors under different layers and different scaling ratios, a unified geometric reference point is used as the coordinate origin, and the spatial data of all texts in the drawing are mapped to this reference coordinate plane, so that the absolute position of each text has consistent reference significance in the overall coordinate system. In this way, the extraction of text spatial basic data is completed, and a unified coordinate baseline is provided for the subsequent spatial feature association.

[0058] After the absolute position and angle are extracted, the spatial parameters are integrated and processed. At this time, the horizontal position, vertical position, rotation angle and size ratio of each text object are standardized and stored in a fixed order, and the spatial parameter set is generated by associating with font height, text spacing, character number and other features. Through this process, text objects of different sizes, orientations and scaling ratios can be compared under a unified data framework. This processing not only ensures the relative accuracy of the position data, but also enables the rotation angle and size ratio information to be expressed in the same proportion system, so that these normalized feature parameters can be directly used to judge and reference the spatial relationship when establishing the adjacent relationship. Through this sub-step, the geometric properties of the text objects in space are structurally described, providing data support for the next step of generating adjacent features.

[0059] After obtaining the normalized spatial parameter set, the feature expression of the proximity relationship of each character object is started. Based on the absolute position, rotation angle and size ratio of each character, the relative distribution relationship thereof on the coordinate plane is taken as the basis to construct a combined feature vector containing spatial direction, distance interval and angle offset, and the vector is taken as the spatial recognition feature of the character to represent the spatial feature state thereof in the drawing. In this way, each character object not only has a static geometric position attribute, but also has a feature description that can reflect the spatial relationship with the surrounding characters. In this process, the boundary interval of each character is also continuously calculated to ensure that the spatial relationship between characters can be accurately expressed under a unified coordinate baseline. This step realizes the conversion from the geometric parameters of a single character object to the overall spatial relationship description, and provides a complete data basis for generating the adjacency signature sequence.

[0060] In the phase of generating the adjacency signature sequence containing the spatial features, the spatial recognition features formed in the previous sub-step are sequentially processed. According to the relative position order of each character object in the drawing on the unified coordinate baseline, the feature vectors are linearly arranged to form an adjacency sequence with directionality and traceability. Each character occupies a unique serial number position in the sequence and carries its corresponding absolute coordinates, rotation angle and size ratio information. In order to ensure the consistency of the sequence in the overall spatial distribution, the coordinate relationship of the character objects is maintained during the arrangement process to avoid sequence breakage or position disorder. When there are slight position differences among multiple character objects in the same area, the character with the smallest coordinate difference is prioritized for ordering, thereby ensuring that the spatial extension direction of the sequence is consistent with the layout direction of the drawing. The generated adjacency signature sequence completely records the spatial distribution features, position relationship and direction extension information of the character objects in the drawing, and constitutes a spatial basic framework for subsequent paragraph merging and semantic reorganization. Through this process, the original character object data is transformed into structured sequence information with spatial feature correlation, so that the character elements in the entire drawing are realized spatial mapping that can be described, positioned and referenced under a unified coordinate baseline.

[0061] S2, constructing a direction-consistent adjacency chain for each character object using the adjacency signature sequence, and assigning a unique chain serial number according to the spatial features of the previous node to generate a loop-free candidate set;

[0062] After the establishment of the unified coordinate baseline and the obtaining of the adjacency signature sequence containing the spatial features, a direction-consistent adjacency chain is further constructed for each character object using the adjacency signature sequence, and a unique chain serial number is assigned according to the spatial features of the previous node, thereby generating a loop-free candidate set. The entire process realizes the structured extension and hierarchical mapping of characters in the drawing plane through the ordered connection and serialization of spatial relationships. This step includes the following steps:

[0063] Based on the generated adjacent signature sequence, the dominant direction of each character object in the spatial distribution is determined according to the arrangement direction of the character object in the drawing plane. The determination of the dominant direction is based on the unified coordinate baseline, and comprehensively considers the horizontal displacement, vertical displacement and rotation angle of the character object, so that each character object has a clear directional attribution. For example, in the character objects arranged in the same row, the horizontal extension direction of the character is taken as the dominant direction, and for the character objects with rotation, the extension direction after rotation is taken as the connection reference direction. On this basis, the spatial coordinates and rotation angle of the character object are jointly sorted to form an arrangement sequence with directional continuity, so that the spatial position and directional attribute of each character object are associated with each other, thereby laying a foundation for the subsequent construction of the adjacent chain with consistent direction.

[0064] On the basis of direction normalization, the spatial feature information contained in the adjacent signature sequence is used to establish the adjacent relationship of each character object consistent with its direction. At this time, taking each character object as the center, the previous node and the subsequent node adjacent to it are determined according to its dominant direction, and by comparing the coordinate distance, angle offset and size proportion difference between each character object, the close relationship in the same extension direction is determined. When two character objects have relatively continuous spatial positions in the dominant direction, the two are established as an adjacent pair of mutual connection, so that the entire character sequence forms a continuous chain structure composed of multiple adjacent pairs. In this process, each character object is only allowed to form a single directional connection relationship, so as to avoid the occurrence of cross-linking or bidirectional pointing, thereby maintaining the directional consistency of the logical link in the spatial structure. Through this sub-step, the originally independently distributed character objects are sequentially linked into a linearized spatial structure, providing a continuous spatial carrier for the logical grouping and semantic splicing between characters.

[0065] In order to ensure the uniqueness and traceability of the position of each character object in the adjacent chain, a unique chain sequence number is assigned to each node according to the spatial characteristics of the previous node. In this process, the spatial position, rotation angle and size ratio of the previous node under the unified coordinate baseline are used as a reference, and a continuous number is assigned to each character object in sequence according to the direction of the chain. This number not only represents the logical order of the character object in the adjacent chain, but also reflects its physical extension relationship in the drawing coordinate system. By passing the number through the spatial characteristics of the previous node, the assignment of the chain sequence number can ensure spatial continuity and consistency in direction, thereby avoiding overlapping or jumping numbers. When the character object is located in different levels or different angle areas, it can still be independently numbered according to the direction and extension trend of the chain it belongs to, so that the entire chain sequence numbering system maintains a consistent logical structure throughout the drawing. This process realizes the conversion from the adjacent chain structure to the serialized numbering system, providing a unique identification basis for subsequent collection generation.

[0066] After completing the assignment of the chain sequence number, the candidate collection with no loop characteristics is generated by integrating all the adjacent chains with consistent direction. The formation of this collection is subject to the constraint of the chain sequence number, and the logical analysis of the start and end point relationship between the adjacent chains is carried out to ensure that any two adjacent chains will not form a back reference or cross reference during connection. When detecting the same number of nodes between different adjacent chains, the connection relationship in the main chain direction is retained, and the redundant cross reference is removed, thereby constructing a one-way and loop-free collection system in the overall structure. The collection is logically composed of multiple adjacent chains with consistent direction, and the nodes within each adjacent chain are connected in sequence, while the different adjacent chains are sequentially connected through the direction extension, avoiding the occurrence of circular connection or repeated chain. Through this sub-step, the transition from the adjacent chain with consistent direction to the loop-free candidate collection is completed, and the spatial connection relationship of the character objects in the entire drawing has one-way, hierarchical and stable characteristics.

[0067] S3, in the loop-free candidate collection, set the overlapping fuse line, and scan the entry and exit edge relationship of the previous node and the subsequent node point by point, and when detecting the overlapping coordinate range, cut off the longest path and generate a difference set;

[0068] After completing the construction of the adjacent chain with consistent direction and generating the loop-free candidate collection, in order to prevent the circular connection or path conflict caused by the overlapping of node coordinate ranges in complex drawing scenarios, the overlapping fuse line needs to be set in the loop-free candidate collection, and the entry and exit edge relationship of the previous node and the subsequent node is scanned point by point to realize the detection and truncation of the overlapping range, thereby generating a difference set with spatial difference characteristics. This process ensures that the connection relationship between the character objects remains one-way stable in the global range through dynamic identification and structured cutting of spatial relationship. The entire step includes the following steps:

[0069] On the basis of the obtained acyclic candidate set, a spatial scanning reference is established according to a unified coordinate baseline, which is used to identify the spatial coverage range of each node in the set. In this process, the boundary coordinate values of each text object in the coordinate plane are extracted with reference to its position in the adjacency chain, including the upper boundary, lower boundary, left boundary and right boundary, and the boundary range is spatially mapped with the boundary range of adjacent nodes. In this way, a boundary distribution map composed of multiple nodes can be formed within the full map range to describe the spatial occupation between nodes. At this time, the boundary information of each node not only reflects the geometric extension area of the text in the plane, but also reflects the spatial distance and mutual influence interval between the node and the adjacent node. Through this sub-step, a spatial boundary framework is formed for subsequent detection, so that the acyclic candidate set has a basic data structure that can be scanned point by point.

[0070] After establishing the spatial scanning reference, an overlapping fuse line is set between each predecessor node and successor node to limit the acceptable spatial overlap threshold. The overlapping fuse line, as a kind of spatial separation interface, is dynamically generated according to the coordinate distribution density and adjacent distance of the node, and is used to judge whether there is an overlap between adjacent nodes that exceeds a reasonable range. When the spatial ranges of adjacent nodes intersect, the fuse line will be generated at the midpoint of the intersection area, thereby dividing the mutually overlapping spatial area into two independent connection domains on both sides. In this process, each fuse line has a one-to-one correspondence with the corresponding predecessor node and successor node, and automatically adjusts its position as the node spacing changes. In this way, a series of breakpoint lines distributed along the text arrangement direction can be formed in the drawing space as a cutting basis for spatial connection relationship, so that the internal structure of the acyclic candidate set has divisibility and reconfigurability.

[0071] After setting the overlapping fuse line, the in-edge and out-edge relationships of the predecessor node and the successor node are scanned point by point based on the structural relationship of the acyclic candidate set. In this scanning process, the connection relationship of the nodes is read in sequence along the direction of the adjacency chain, and the spatial overlap of the out-edge region of each node and the in-edge region of the adjacent node is detected. When it is detected that the out-edge region and the in-edge region exist in the same coordinate plane or have an overlapping range, it is determined that there is a conflict in the connection path. At this time, by comparing the connection length between adjacent nodes, the longest path in the current chain is determined, and the path is cut along the position of the overlapping fuse line. The nodes corresponding to the cut path will no longer participate in the subsequent main chain connection, but will be temporarily stored in the to-be-processed set for difference calculation in the subsequent steps. Through this point-by-point scanning and path cutting process, the circular link caused by coordinate overlap can be effectively eliminated, ensuring that the connection relationship within the acyclic candidate set remains unidirectional and hierarchical, thereby avoiding the repetition of links or circular references of the drawing text in subsequent reorganization.

[0072] After the path cutting, the difference set containing the spatial difference features is generated by calculating the difference of the truncated node set. The spatial displacement features of the difference set are determined by comparing the coordinate difference, angle difference and size ratio difference of the nodes at both ends of the cut path. By associating these difference information with the remaining nodes in the original adjacency chain, a set of spatial parameters reflecting the distribution difference of the text on the drawing can be obtained. This parameter set not only records the spatial displacement of the cut path, but also describes the displacement trend and direction change corresponding to the path in the overall structure. According to the displacement information in the difference set, the cut nodes can be repositioned and connected in the subsequent paragraph reorganization stage, so as to restore the logical continuity between texts without destroying the overall structure. Through this sub-step, the whole process from overlap detection to path cutting and then to difference generation is completed, so that the spatial structure of the acyclic candidate set can adaptively maintain stability and integrity when dealing with complex drawings.

[0073] S4, rearrange the order of text objects according to the difference set, build a continuous merging window, perform paragraph splicing according to the head-to-tail joint principle and calculate the paragraph loadable width threshold;

[0074] After the cutting of overlapping paths in the acyclic candidate set and the generation of the difference set, in order to realize the reorganization of text objects in the spatial dimension and the continuous splicing of logical paragraphs, it is necessary to rearrange the order of text objects according to the difference set, build a continuous merging window, and complete the paragraph splicing according to the head-to-tail joint principle, while calculating the loadable width threshold of the paragraph to ensure the consistency and integrity of the paragraph in spatial layout and semantic connection. The whole process realizes the transition of the arrangement of text objects in the drawing from discrete state to continuous state through the synergistic effect of spatial rearrangement, logical splicing and width control, thereby laying a stable structural foundation for subsequent format restoration and translation mapping. The process includes the following steps:

[0075] After obtaining the difference set, the cut path and its related text objects are reordered according to the spatial displacement information recorded in the difference set. At this time, the displacement direction, coordinate offset and size ratio difference of each node in the difference set are taken as the basis for sorting, and the text objects are arranged and adjusted according to the direction of the adjacency chain. In this way, the spatial continuity between the cut path and the original adjacency chain can be restored, and the text objects can regain the positional relationship conforming to the spatial distribution law in the new order sequence. In order to ensure that the overall arrangement direction is consistent with the original reading logic of the drawing, the extension direction of the unified coordinate baseline is taken as the reference, so that the arrangement direction of all text objects remains consistent with the original reading logic of the drawing. In this way, the spatial distribution of the text objects in the drawing can be restored to the original state, and the subsequent format restoration and translation mapping can be realized on the basis of the stable structure. Figure 1The spatial trend of the text objects is determined. Through this sub-step, the originally dispersed text objects due to the cutting of the fuse wire are re-integrated and form a new text sequence with direction continuity under the premise of maintaining the acyclic property, providing a basic sequence for subsequent paragraph construction.

[0076] On the basis of rearranging the order of the text objects, continuous merging windows are started to be constructed. At this time, the rearranged text sequence is taken as the input, and the text set capable of forming a continuous paragraph is determined according to the spatial distance, angle consistency and size proportion continuity between the text objects. Each merging window takes a group of text objects with adjacent spatial distribution and consistent logical direction as the core, and sets the window boundary according to the distance and angle difference between the text objects. When the spatial distance between the text objects is lower than the preset connection threshold, and the rotation direction change is within the continuous interval, these text objects are classified into the same merging window, thereby forming a text group with spatial continuity. In this process, the boundaries between adjacent merging windows do not overlap, ensuring that each window is independently identifiable in the spatial range. Through this sub-step, the originally dispersed text objects are aggregated into several continuous windows, each of which represents a spatial unit that can be regarded as a complete sentence, laying a structural foundation for subsequent paragraph splicing.

[0077] After the establishment of the continuous merging windows, the paragraph splicing is performed on the windows according to the head-tail connection principle. The splicing process connects the last text of the adjacent window with the first text of the next window according to the spatial direction based on the boundary coordinates of the merging window. In the splicing, the displacement information in the previous difference set is used to dynamically adjust the connection distance between the windows, so that the interval between the spliced texts is consistent with the overall arrangement, thereby eliminating the text discontinuity caused by path truncation. The head-tail connection principle requires that the tail text of the previous window and the head text of the next window maintain the minimum spatial difference in the coordinate direction, and maintain the continuity in the vertical direction and the rotation angle, so that the spliced paragraph presents a smooth and extended arrangement form in the visual aspect. By performing the connection operation pair by pair, the multiple continuous windows can be connected into a complete paragraph chain, so that the text realizes continuous connection in the logical order and spatial arrangement. This sub-step realizes the structural synthesis from the local window to the whole paragraph, making the text sequence have complete readability and spatial consistency.

[0078] After the paragraph splicing is completed, in order to ensure the overall coordination of the paragraph in the space layout, the loadable width threshold of the paragraph needs to be calculated. The threshold is used to limit the maximum extension range of the paragraph in the drawing space, so as to prevent the text from being stretched too much or the line spacing from being uneven in subsequent format reorganization. Specifically, by counting the coordinate span, rotation offset and font size of each text object in each paragraph after splicing, the effective width range of the paragraph under the current coordinate system is determined. When the extension width of the paragraph exceeds the set loadable threshold, local segmentation processing is performed on it, and the exceeding part is reclassified into a new paragraph chain, so as to maintain the overall spatial stability. The loadable width threshold not only defines the maximum layout width of the paragraph in space, but also provides a layout boundary for the subsequent automatic backfilling of the translated text. Through this sub-step, the paragraph realizes self-adaptive constraint in space layout, so that the distribution of the text can still maintain the structural integrity and visual balance of the drawing format under different language lengths and translation layout conditions.

[0079] S5, according to the width threshold, starting the breathing detection gate and the anti-loop guide structure, taking the tail of the paragraph chain as an anchor point, alternatingly expanding and contracting the detection range under the time rhythm, and when the back-reference trend is detected, immediately offsetting the threshold and locking the tail, so as to realize automatic suppression of circular reference and stable paragraph merging;

[0080] After the paragraph splicing is completed and the loadable width threshold of the paragraph is calculated, in order to prevent the circular connection and logic out of control caused by coordinate drift, space back-reference or node overlap in the paragraph merging process, the breathing detection gate and the anti-loop guide structure need to be started according to the width threshold. Through the dynamic adjustment mechanism of the structure, taking the tail of the paragraph chain as an anchor point, alternatingly expanding and contracting the detection range under the time rhythm, so as to immediately offset the threshold and lock the tail when the back-reference trend is detected, realize automatic suppression of circular reference and stable continuation of the paragraph merging process. Through the coordinated action of time sequence control and space constraint, the text structure maintains a balanced state in the merging stage, and prevents the paragraph chain structure from producing closed loop or misplacement due to dynamic extension. This step includes the following steps:

[0081] After completing paragraph splicing and obtaining the loadable width threshold, an initial detection range is established according to the threshold, which is used to define the dynamic observation interval of the text chain in space. The detection range is based on the spatial span between the starting point and the ending point of the paragraph chain, combined with the rotation direction and width distribution of the paragraph, to form an envelope structure. The envelope structure matches the effective width threshold of the paragraph in the initial state, ensuring that the detection range can completely cover the spatial distribution area of the paragraph. In this process, the coordinate position of the tail of the paragraph chain is marked as a fixed anchor point, and the time sequence control node is established with the anchor point as the reference, which is used for periodic expansion and contraction of the subsequent detection range. In this way, the spatial detection area of the paragraph is clearly defined in the initial stage, and has the basic conditions for dynamic adjustment according to time and space changes, providing a starting framework for the expansion of the breathing detection.

[0082] After establishing the initial detection range, the breathing detection gate is started to make the detection range realize orderly expansion and contraction cycle under the control of time rhythm. The breathing detection gate is based on the loadable width threshold of the paragraph to control the expansion and contraction of the detection area through time sequence rhythm, so that the detection process has periodicity and self-adjusting property. When the detection range is in the expansion stage, the detection boundary is extended outward to capture potential anaphora trend or spatial drift phenomenon; when the detection range is in the contraction stage, the detection boundary gradually recovers to the core area of the paragraph to maintain the stability of the local space. Through this alternating expansion and contraction dynamic process, the spatial change state of the text chain can be continuously observed without disturbing the overall structure of the paragraph, so that the detection activity presents regular fluctuation in time dimension, thereby realizing continuous monitoring of the anaphora trend. This sub-step makes the detection range form a breathable dynamic mechanism in space and time, laying a foundation for the immediate response of the anti-loop guide.

[0083] During the dynamic expansion and contraction process of the breathing detection gate, the anchor point of the paragraph chain tail guides and limits the change trend of the detection range. At this time, the anti-loop guide structure takes the tail of the paragraph chain as a fixed reference point to continuously monitor the movement direction and boundary state of the detection range. By recording the expansion track and contraction path of the detection range, the anti-loop guide structure can judge the relative motion relationship between the detection boundary and the tail of the paragraph chain. When the expansion direction of the detection boundary and the spatial position of the chain tail show a reverse trend, it means that the paragraph chain has a possible cycle risk. At this time, the anti-loop guide structure immediately deviates the expansion direction of the detection range, so that the detection boundary avoids the chain tail area in space, thereby preventing the formation of anaphora path. At the same time, the chain tail anchor point remains fixed to ensure the stability and consistency of the paragraph structure. Through this process, the paragraph chain realizes self-guiding and self-constraining in the dynamic expansion process, prevents the generation of circular reference, and ensures that the logical direction of the text chain always remains unidirectional extension.

[0084] After detecting the back-reference trend and performing the offset operation, a threshold locking mechanism is triggered immediately to stabilize the tail structure of the paragraph chain. This locking mechanism takes the current offset width threshold as a reference, fixes the coordinate position of the paragraph chain tail and the spatial parameters of its adjacent nodes in the current detection state, preventing the detection range from expanding again in the tail area in subsequent time rhythms. When the threshold is locked, the expansion and contraction rhythm of the detection range will be re-established based on the new offset, thus achieving adaptive adjustment. Through this locking and re-initialization mechanism, the spatial position of the paragraph chain tail is continuously maintained stable and is not affected by external text expansion or detection fluctuations. This process ensures that the paragraph chain always maintains a controllable spatial form and logical direction during the overall merging process, enabling the text structure to have self-regulating ability and anti-cyclic interference ability during continuous expansion. Through this sub-step, the whole process from dynamic detection to threshold offset and then to stable locking is completed, enabling the paragraph merging process to maintain a stable expansion order in a complex spatial environment.

[0085] The present application unifies the position, angle and scale information of the text object in the drawing by establishing a unified coordinate baseline and generating an adjacent signature sequence containing spatial features, thereby fundamentally ensuring the consistency of the text in spatial positioning. Through the construction of the direction-consistent adjacent chain and the generation of the acyclic candidate set, the one-way and controllable logical connection between texts is realized, avoiding the cyclic linkage caused by coordinate overlap during the merging process. This method enables the text structure to maintain a stable extension relationship under complex layout, thereby improving the continuity and accuracy of the drawing text reorganization.

[0086] The present application realizes dynamic self-regulation and anti-loop control of the text chain by introducing a difference set and a breathing detection gate in the paragraph splicing stage, enabling the system to automatically adjust the detection range and threshold offset during paragraph merging according to the time rhythm. When a back-reference trend occurs, the threshold locking can be triggered immediately to prevent the paragraph chain from being cyclically referenced. This mechanism effectively reduces the risk of text duplication, memory overflow and structure misplacement, enabling the drawing format conversion process to run stably in a high-load environment, thereby improving the restoration degree and automated processing reliability of cross-language drawings.

[0087] The present application provides a drawing format conversion and machine translation system based on data recognition as shown in Figure 2 The system includes a coordinate normalization module, an adjacent chain construction module, an overlap detection and fusing module, a paragraph reorganization module, and a dynamic stability control module.

[0088] The coordinate normalization module establishes a unified coordinate baseline, records the absolute position, rotation angle and size scale of each text object, and generates an adjacent signature sequence containing spatial features based on the recorded results.

[0089] An adjacency chain construction module constructs a consistent direction adjacency chain for each literal object using the adjacency signature sequence, and assigns a unique chain sequence number according to the spatial features of the predecessor node, to generate a loop-free candidate set;

[0090] An overlap detection and fusing module sets an overlap fusing line in the loop-free candidate set, and scans the entry and exit edge relationship of the predecessor node and the successor node point by point, cuts off the longest path and generates a difference set when the coordinate range overlap is detected;

[0091] A paragraph reorganization module rearranges the order of the literal objects according to the difference set, constructs a continuous merging window, performs paragraph splicing according to the head-tail docking principle, and calculates a paragraph loadable width threshold;

[0092] A dynamic stability control module starts a breathing detection gate and a reverse loop guide structure according to the width threshold, alternately expands and contracts the detection range under the time rhythm with the paragraph chain tail as an anchor point, and offsets the threshold and locks the chain tail when a back-reference trend is detected, so as to realize automatic suppression of circular references and stable paragraph merging.

[0093] The data recognition-based drawing format conversion and machine translation method provided in the embodiments of the present application is implemented through the data recognition-based drawing format conversion and machine translation system described above, and the specific method and process of the data recognition-based drawing format conversion and machine translation system are described in the embodiments of the data recognition-based drawing format conversion and machine translation method described above, and will not be repeated here.

[0094] The above only describes some exemplary embodiments of the present application in a descriptive manner, and it is needless to say that those skilled in the art can modify the described embodiments in various ways without departing from the spirit and scope of the present application. Therefore, the above drawings and descriptions are illustrative in nature and should not be understood as limiting the scope of protection of the claims of the present application.

Claims

1. A method for format conversion and machine translation of drawings based on data recognition, characterized in that, Includes the following steps: S1. Establish a unified coordinate baseline, record the absolute position, rotation angle and size ratio of each text object, and generate an adjacency signature sequence based on the recording results; S2, using the adjacency signature sequence to construct an adjacency chain with consistent direction for each text object, and assigning a unique chain order number according to the spatial characteristics of the preceding node to generate an acyclic candidate set; S3, set overlapping fuse lines in the acyclic candidate set, scan the inbound and outbound edge relationships between the preceding and subsequent nodes point by point, and cut off the longest path and generate a difference set when the coordinate range overlap is detected. Step S3 includes: Based on the obtained acyclic candidate set, a spatial scanning baseline is established according to a unified coordinate baseline, and the boundary coordinate values ​​of each text object are extracted to form a boundary distribution map. After establishing the spatial scanning baseline, an overlapping fuse line is set for each preceding node and subsequent node, and a spatial separation interface is dynamically generated based on the coordinate distribution density and adjacent distance of the nodes. After setting the overlapping fuse line, the incoming and outgoing edge relationships between the preceding and subsequent nodes are scanned point by point. When an overlap between the outgoing and incoming edge regions is detected, the longest path is cut off along the overlapping fuse line and temporarily stored in the set to be processed. After the path cutting is completed, the difference is calculated on the set of truncated nodes, and a difference set is generated based on the coordinate difference, angle difference and size ratio difference. S4: Rearrange the text objects according to the difference set, construct a continuous merge window, perform paragraph splicing according to the principle of first and last connection, and calculate the paragraph width threshold. S5, based on the width threshold, activate the breathing detection gate and the anti-loop guide structure, and alternately expand and contract the detection range under the time rhythm with the end of the segment chain as the anchor point. When the retracement trend is detected, immediately shift the threshold and lock the end of the chain. Step S5 includes: After completing the segment splicing and obtaining the bearable width threshold, an initial detection range is established based on the width threshold. An envelope structure is formed based on the spatial span between the start and end points of the segment chain, and a time series control node is established with the end of the segment chain as a fixed anchor point. After establishing the initial detection range, the breathing detection gate is activated, causing the detection range to alternately expand and contract in a time rhythm. The expansion and contraction of the detection area are controlled based on the width threshold, thereby achieving continuous monitoring of the retracement trend. During the dynamic opening and closing of the breathing detection gate, the direction of change of the detection range is guided by the end of the segment chain. When the expansion direction of the detection boundary and the position of the chain end show a tendency to return, an offset operation is performed and the chain end is kept fixed. Upon detecting a backfinding trend, a threshold locking mechanism is triggered to fix the coordinate position of the end of the paragraph chain and the spatial parameters of adjacent nodes in the current detection state, so as to maintain the spatial stability and logical continuity of the paragraph merging process.

2. The method of claim 1, wherein the data recognition-based drawing format conversion and machine translation method is characterized by, Step S1 includes: The source drawing file is traversed hierarchically to extract the absolute position, rotation angle, font ratio, and text boundary range of each text object in the two-dimensional plane coordinate system, and all spatial data are mapped to a unified geometric reference point to form a unified coordinate baseline. After the absolute position and angle extraction is completed, the horizontal position, vertical position, rotation angle and size proportion obtained by extraction are integrated and adjusted, so that the text objects have comparability under a unified data framework; After obtaining the adjusted spatial parameter set, a combination feature vector is constructed according to the absolute position, rotation angle and size proportion, so that the text objects have spatial recognition features; The spatial recognition features are sequentially processed according to the relative position order of the unified coordinate baseline, and an adjacency signature sequence is generated. 3.The data recognition based drawing format conversion and machine translation method of claim 2, wherein, Step S2 includes: Based on the generated adjacency signature sequence, the dominant direction of the text objects in the spatial distribution is determined according to the arrangement direction of the text objects in the drawing plane, and the spatial coordinates and rotation angles of the text objects are jointly sorted with reference to the unified coordinate baseline, forming an arrangement sequence with continuous direction; On the basis of direction normalization, the adjacency relationship is established according to the dominant direction of the text objects, and the spatial coordinates, angle offset and size proportion difference are used to determine the adjacent relationship, and the adjacent text objects are constructed into a continuous chain structure; After obtaining the adjacency chain with consistent direction, a unique chain sequence number is assigned to each text object according to the spatial position, rotation angle and size proportion of the previous node, so that the numbering has spatial continuity and direction consistency; By integrating the adjacency chain with consistent direction, a loop-free candidate set is generated according to the chain sequence number constraint relationship, so that the spatial connection relationship of the text objects remains unidirectional and hierarchical.

4. The method of claim 3, wherein the data recognition-based drawing format conversion and machine translation method is characterized by, In the process of generating the loop-free candidate set, the chain sequence number is used as the only constraint basis. When the node numbers of different adjacency chains are repeated, the connection relationship in the main chain direction is retained and the cross reference is eliminated, so that the internal nodes of each adjacency chain remain unidirectional extension and do not form a backlink, thereby ensuring the continuity and stability of the loop-free candidate set in the spatial distribution and the logical connection.

5. The method of claim 1, wherein the data recognition-based drawing format conversion and machine translation method is characterized by, After performing path cutting, when calculating the difference value of the truncated node set, the spatial displacement direction is determined by comparing the coordinate difference, angle difference and size proportion difference of the previous node and the subsequent node, and the association order of the text objects is re-established according to the displacement direction, so that the difference value set and the remaining nodes of the original adjacency chain remain continuous connection, thereby realizing the accurate positioning and logical recovery of the truncated nodes in the subsequent paragraph reorganization stage.

6. The data recognition based drawing format conversion and machine translation method according to claim 1, wherein, Step S4 includes: After obtaining the difference value set, the space displacement information recorded in the difference value set is used to reorder the cut path and related text objects, so that the text objects regain the positional relationship conforming to the spatial distribution rule in the new ordering sequence; On the basis of rearranging the order of the text objects, a continuous merging window is constructed according to the spatial distance, angle consistency and size proportion continuity between the text objects, so that each window remains independent in spatial range and has continuity; After establishing the continuous merging window, the paragraphs are spliced according to the head-tail docking principle, and the connection distance is dynamically adjusted based on the window boundary coordinates, so that the interval between the spliced text and the overall arrangement remains consistent and a complete paragraph chain is formed; After the paragraph splicing is completed, the paragraph loadable width threshold is calculated, the maximum extension range of the paragraph is limited by counting the coordinate span, rotation offset and font size of the text objects in the paragraph, so as to ensure the stability and structural integrity of the paragraph arrangement.

7. The method of claim 6, wherein the data recognition-based drawing format conversion and machine translation method is characterized by, In the calculation of the paragraph loadable width threshold, the unified coordinate baseline is taken as the reference, the spatial span, rotation angle and font size of the text objects in the paragraph are comprehensively analyzed to determine the maximum arrangement width of the paragraph, and local segmentation processing is performed when the width exceeds the threshold, so that the paragraph maintains the continuity and visual balance of the space layout under different language length and typesetting conditions.

8. A data recognition based drawing format conversion and machine translation system for implementing the data recognition based drawing format conversion and machine translation method according to any one of claims 1 to 7, characterized by, The method comprises a coordinate normalization module, an adjacent chain construction module, an overlapping detection and fusing module, a paragraph recombination module and a dynamic stability control module. The coordinate normalization module establishes a unified coordinate baseline, records the absolute position, rotation angle and size ratio of each text object, and generates an adjacent signature sequence according to the recorded results; The adjacent chain construction module constructs an adjacent chain with consistent direction for each text object using the adjacent signature sequence, and assigns a unique chain sequence number according to the spatial characteristics of the previous node to generate a loop-free candidate set; The overlapping detection and fusing module sets an overlapping fusing line in the loop-free candidate set, scans the entry and exit edge relationship of the previous node and the subsequent node point by point, and when the coordinate range overlaps, the longest path is cut off and a difference set is generated; The paragraph recombination module rearranges the order of the text objects according to the difference set, constructs a continuous merging window, performs paragraph splicing according to the head-tail docking principle, and calculates the paragraph loadable width threshold; The dynamic stability control module starts the breathing detection gate and the anti-loop guide structure according to the width threshold, takes the paragraph chain tail as the anchor point, and alternately expands and contracts the detection range under the time rhythm, and when the back-reference trend is detected, the threshold is immediately offset and the chain tail is locked.

Citation Information

Patent Citations

  • Circuit board processing control method and system applied to industrial Internet of Things

    CN120178768A

  • Engineering drawing intelligent identification method and system based on deep learning

    CN120748003A