Aviation wire harness drawing path searching method, system and equipment based on Dijkstra algorithm and medium

The Dijkstra algorithm extracts and matches the graphic entities in the aviation wiring harness drawings to build an adjacency table diagram structure, which solves the problem that existing CAD software cannot customize the selection of drawing content, and realizes efficient and accurate wiring harness path recognition and highlighting, improving the Design efficiency and accuracy.

CN118965645APending Publication Date: 2024-11-15CHENGDU AIRCRAFT INDUSTRY GROUP
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410980849.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

During the laying of aviation harnesses, existing CAD software cannot select specific graphic content in the drawing based on user-defined input information, resulting in limited design efficiency and accuracy.

Method used

Using the aerial harness drawing path search method based on the Dijkstra algorithm, the graphic entity of the drawing is extracted, the plug code, tooling logo and wiring track layer entities are matched, and the adjacent table diagram structure is constructed. The Dijkstra algorithm is called to calculate the harness path to realize the harness path highlight and identify.

Benefits of technology

It improves the efficiency and accuracy of harness path search in aviation harness drawings, expands the flexibility of CAD drawings, supports user-defined functions, and speeds up the rendering speed of drawings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118965645A_ABST
    Figure CN118965645A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of aviation wire harness manufacturing, in particular to an aviation wire harness drawing path searching method, system and device based on a Dijkstra algorithm and a medium. According to the method, firstly, graphic information in a DWG file of the aviation wire harness is exported into data in a JSON format to be stored, then a wire harness path in an aviation wire harness drawing is searched, line segment objects in the drawing are marked with labels, and searching of the wire harness path in the aviation wire harness drawing is efficiently and accurately achieved. When the aviation wire harness drawing is digitally displayed subsequently, the flexibility of CAD drawing application can be expanded according to the information input by the user and the calculated wire harness path, support is provided for the corresponding wire harness path in the highlighted aviation wire harness drawing, and the wiring efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of aviation wiring harness manufacturing, and in particular to an aviation wiring harness drawing path search method, system, equipment and medium based on Dijkstra algorithm. Background Art

[0002] In the field of aviation manufacturing, drawing aviation wiring harnesses using Computer-Aided Design (CAD) drawing technology is a key task. Aviation wiring harnesses are an important part of the aircraft electrical system, used to connect and transmit power, signals and data. By using CAD to draw aviation wiring harnesses, design efficiency can be improved, precise geometric modeling can be performed, and digital document management can be achieved.

[0003] Although CAD has achieved great success in the application of drawing aviation harnesses, greatly increasing the efficiency and accuracy of aviation harness design, there is no category of commercial CAD software on the market that is specially optimized for aviation harnesses. Therefore, there is no flexible means to process the drawn aviation harness drawings. Especially when displaying digitized drawings on the screen, existing CAD software cannot select specific graphic content in the drawings based on the user's customized input information. For the laying scenario of aviation harnesses, it is necessary to extract the required information from the original aviation harness drawings, and then perform secondary processing to realize the identification of specific harness paths in the aviation harness drawings based on the user's input information. Summary of the invention

[0004] Aiming at the problem that the existing CAD software cannot realize the selection of specific graphic content in the drawing according to the user's customized input information during the laying process of aviation wiring harness, the present invention proposes an aviation wiring harness drawing path search method, system, device and medium based on the Dijkstra algorithm; firstly, the graphic entity of the aviation wiring harness drawing is extracted; secondly, the graphic entities in the obtained plug code layer, tooling identification layer and wiring track layer are matched to obtain "terminal number-Line / PolyLine pair"; then an adjacency table graph structure is constructed to abstract the wiring harness path of the wiring track layer into a wiring harness path graph; finally, the Dijkstra algorithm is called to obtain the wiring harness path between the two terminals, and by calculating the path between the two terminals in the aviation wiring harness DWG drawing, the wiring harness path in the drawing is highlighted according to the input wiring harness number or bundle number, thereby improving the wiring efficiency and accuracy.

[0005] The specific implementation contents of the present invention are as follows:

[0006] A method for searching aviation wiring harness drawing paths based on Dijkstra algorithm specifically comprises the following steps:

[0007] Step S1: extracting graphic entities of the aviation wiring harness drawing DWG file and generating a JSON object; the JSON object is used to store the exported graphic entity information;

[0008] Step S2: According to the graphic entity information, the graphic entities in the obtained plug code layer, tooling identification layer and wiring track layer are matched to obtain a "terminal number-Line / PolyLine pair";

[0009] Step S3: construct an adjacency table graph structure, and abstract the wiring harness path of the wiring track layer into a wiring harness path graph;

[0010] Step S4: according to the "terminal number—Line / PolyLine pair", the Dijkstra algorithm is called to calculate the path between the two terminals in the harness path diagram to obtain the harness path between the two terminals.

[0011] In order to better implement the present invention, further, the step S1 specifically includes the following steps:

[0012] Step S11: Obtaining a block table of the aviation wiring harness drawing DWG file;

[0013] Step S12: obtaining range information according to the block table, and obtaining the graphic entity;

[0014] Step S13: export the graphic entity information of the graphic entity and store it in the generated JSON object.

[0015] In order to better implement the present invention, further, the step S13 specifically includes the following steps:

[0016] Step S131: determine the type of the acquired graphic entity, if the RXClasName of the graphic entity is BlockReference, recursively access the graphic entity in BlockReference, and export the graphic entity information;

[0017] Step S132: storing the exported graphic entity information in the generated JSON object.

[0018] In order to better implement the present invention, further, the step S2 specifically includes the following steps:

[0019] Step S21: according to the graphic entity information, obtaining the Text graphic entity in the plug code layer, the Circle graphic entity in the tooling identification layer, and the Line graphic entity or the Polyline graphic entity in the wiring track layer;

[0020] Step S22: extracting the Text graphic entity and placing it in the terminals array, extracting the Circle graphic entity and placing it in the circles array, and extracting the Line graphic entity or the Polyline graphic entity and placing it in the lines array;

[0021] Step S23: Calculate the center coordinates of the terminal number according to the Extents attribute of the Text graphic entity; wherein the Extents attribute is used to indicate the size of the rectangular range occupied by the graphic entity;

[0022] Step S24: Calculate the Circle graphic entity closest to the terminal number according to the center coordinates of the terminal number and the center coordinates of the Circle graphic entity to form a "terminal number-Circle pair";

[0023] Step S25: Calculate the Line / PolyLine graphic entity closest to the Circle graphic entity according to the coordinates of the center of the Circle graphic entity and the coordinates of the endpoints of the Line / PolyLine graphic entity to form a "Circle—Line / PolyLine pair";

[0024] Step S26: Generate a "terminal number—Line / PolyLine pair" based on the "terminal number—Circle pair" and the "Circle—Line / PolyLine pair".

[0025] In order to better implement the present invention, further, the step S3 specifically includes the following steps:

[0026] Step S31: Create an adjacency list structure and obtain a line segment object from the lines array; the adjacency list structure is used to store other line segment objects connected to the Line object / PolyLine object in the wiring track layer;

[0027] Step S32: traverse the lines array to determine whether there is a line segment object with the same end point coordinates as the start point coordinates. If so, add the line segment object to the corresponding position in the adjacency list and set the cost to 1.

[0028] Step S33: traverse the lines array to determine whether there is a line segment object with the same starting point coordinates and end point coordinates. If so, add the line segment object to the corresponding position in the adjacency list and set the cost to 1;

[0029] Step S34: abstracting the line segment objects of the wiring trajectory layer into nodes of the wiring harness path diagram.

[0030] In order to better implement the present invention, further, the step S4 specifically includes the following steps:

[0031] Step S41: Obtain a wiring table file, and convert the wiring table in excel format into a wiring table in csv format;

[0032] Step S42: reading the starting terminal number information, the ending terminal number information and the bundle number information contained in each row of the wiring table;

[0033] Step S43: Obtain the graph node corresponding to the terminal number in the wiring table according to the starting terminal number information, the ending terminal number information, and the "terminal number-Line / PolyLine pair" obtained in step S2;

[0034] Step S44: traverse the information in each row of the wiring table, take the line segment object corresponding to the starting terminal number as the starting point of the wiring harness path, take the line segment object corresponding to the ending terminal number as the end point of the wiring harness path, and obtain the corresponding starting node and ending node in the wiring harness path diagram according to the mapping between the line segment object and the graph node in the wiring harness path diagram;

[0035] Step S45: calling the Dijkstra algorithm to calculate the wire harness path between the start node and the end node, and adding corresponding line number information to the line segment object corresponding to the node of the wire harness path diagram.

[0036] In order to better implement the present invention, further, the step S45 specifically includes the following steps:

[0037] Step S451: extract the minimum value from the forward queue Qf and assign it to the variable u, obtain the node u and add it to the forward queue Qf; extract the minimum value from the backward queue Qb and assign it to the variable v, obtain the node v and add it to the backward queue Qb;

[0038] Step S452: traverse the adjacent nodes x of node u. If node x is not in the forward set Sf, and the path length df[x] from node u to node x is greater than df[u]+weight(u,x), then update df[x] to df[u]+weight(u,x);

[0039] Add node x to the forward queue Qf and set the priority to df[x]; if node x is in the backward set Sb, and the path length df[u]+weight(u,x)+db[x] from node u to node x is less than the variable mu, then update mu to df[u]+weight(u,x)+db[x];

[0040] Where, df[x] represents the shortest distance from the starting node to node x, df[u] represents the shortest distance from the starting node to node u, weight(u,x) represents the distance from node u to node x; db[x] represents the shortest distance from the target node to node x, mu represents the shortest distance from the starting node to the target node, and its initial value is infinity;

[0041] Step S453: Traverse the adjacent node x of node v: If node x is not in the forward set Sf, and the path length df[x] from node v to node x is greater than df[u]+weight(u,x), then update df[x] to df[u]+weight(u,x); add node x to the forward queue Qf, and set its priority to df[x]; if node x is in the forward set Sf, and the path length db[v]+weight(v,x)+df[x] from node v to node x is less than the variable mu, then update mu to db[v]+weight(v,x)+df[x]; if df[u]+db[v] is greater than or equal to the variable mu, exit the loop; wherein the variable mu represents the shortest real path length from the start node to the target node.

[0042] Based on the above-mentioned aviation wiring harness drawing path search method based on Dijkstra algorithm, in order to better realize the present invention, further, an aviation wiring harness drawing path search system based on Dijkstra algorithm is proposed, which is used to execute the above-mentioned aviation wiring harness drawing path search method based on Dijkstra algorithm; it includes an extraction unit, a matching unit, an abstraction unit, and a path calculation unit;

[0043] The extraction unit is used to extract the graphic entity of the aviation wiring harness drawing DWG file and generate a JSON object; the JSON object is used to store the exported graphic entity information;

[0044] The matching unit is used to match the obtained graphic entities in the plug code layer, the tooling identification layer and the wiring track layer according to the graphic entity information to obtain a "terminal number-Line / PolyLine pair";

[0045] The abstraction unit is used to construct an adjacency table graph structure to abstract the wire harness path of the wiring track layer into a wire harness path graph;

[0046] The path calculation unit is used to call the Dijkstra algorithm according to the "terminal number-Line / PolyLine pair" to calculate the path between the two terminals in the harness path diagram to obtain the harness path between the two terminals.

[0047] Based on the above-mentioned aviation wiring harness drawing path search method based on Dijkstra algorithm, in order to better realize the present invention, further, an electronic device is proposed, including a memory and a processor; a computer program is stored on the memory; when the computer program is executed on the processor, the above-mentioned aviation wiring harness drawing path search method based on Dijkstra algorithm is implemented.

[0048] Based on the above-mentioned aviation wiring harness drawing path search method based on Dijkstra algorithm, in order to better realize the present invention, further, a computer-readable storage medium is proposed, on which computer instructions are stored; when the computer instructions are executed on the above-mentioned electronic device, the above-mentioned aviation wiring harness drawing path search method based on Dijkstra algorithm is implemented.

[0049] The present invention has the following beneficial effects:

[0050] (1) The present invention can efficiently and accurately search for wiring harness paths in aviation wiring harness drawings. When the aviation wiring harness drawings are subsequently digitized and displayed, the present invention can expand the flexibility of CAD drawing application based on user input information and the calculated wiring harness paths, provide support for highlighting the corresponding wiring harness paths in the aviation wiring harness drawings, and improve the efficiency and accuracy of manual wiring.

[0051] (2) The present invention exports the graphic information in the CAD drawing into data in JSON format, and can redraw the drawing according to the JSON data without being bound by software such as AutoCAD, thereby adding customized functions to the drawing.

[0052] (3) The present invention calculates the wiring harness path in the drawing and saves the calculated wiring harness path information between terminals in data in JSON format. When the subsequent graphics rendering software is rendering the aviation wiring harness drawing, the path data in the JSON data can be directly used to highlight the specified wiring harness, thereby speeding up the rendering speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A schematic flowchart of the aviation wiring harness drawing path search method based on the Dijkstra algorithm provided by the present invention.

[0054] Figure 2 The present invention provides a schematic diagram of the graph structure.

[0055] Figure 3 This is a schematic diagram of the adjacency list structure provided by the present invention. DETAILED DESCRIPTION

[0056] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. It should be understood that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and therefore should not be regarded as limiting the scope of protection. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technical personnel in this field without making creative work are within the scope of protection of the present invention.

[0057] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "disposed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0058] Embodiment 1:

[0059] This embodiment proposes a method for searching aviation wiring harness drawing paths based on the Dijkstra algorithm, which specifically includes the following steps:

[0060] Step S1: extracting graphic entities from the aviation wiring harness drawing DWG file and generating a JSON object; the JSON object is used to store the exported graphic entity information.

[0061] The step S1 specifically includes the following steps:

[0062] Step S11: Obtaining a block table of the aviation wiring harness drawing DWG file;

[0063] Step S12: obtaining range information according to the block table, and obtaining the graphic entity;

[0064] Step S13: export the graphic entity information of the graphic entity and store it in the generated JSON object.

[0065] Furthermore, the step S13 specifically includes the following steps:

[0066] Step S131: determine the type of the acquired graphic entity, if the RXClasName of the graphic entity is BlockReference, recursively access the graphic entity in BlockReference, and export the graphic entity information;

[0067] Step S132: storing the exported graphic entity information in the generated JSON object.

[0068] Step S2: According to the graphic entity information, the graphic entities in the obtained plug code layer, tooling identification layer and wiring track layer are matched to obtain a "terminal number-Line / PolyLine pair".

[0069] Furthermore, the step S2 specifically includes the following steps:

[0070] Step S21: according to the graphic entity information, obtaining the Text graphic entity in the plug code layer, the Circle graphic entity in the tooling identification layer, and the Line graphic entity or the Polyline graphic entity in the wiring track layer;

[0071] Step S22: extracting the Text graphic entity and placing it in the terminals array, extracting the Circle graphic entity and placing it in the circles array, and extracting the Line graphic entity or the Polyline graphic entity and placing it in the lines array;

[0072] Step S23: Calculate the center coordinates of the terminal number according to the Extents attribute of the Text graphic entity; wherein the Extents attribute is used to indicate the size of the rectangular range occupied by the graphic entity;

[0073] Step S24: Calculate the Circle graphic entity closest to the terminal number according to the center coordinates of the terminal number and the center coordinates of the Circle graphic entity to form a "terminal number-Circle pair";

[0074] Step S25: Calculate the Line / PolyLine graphic entity closest to the Circle graphic entity according to the coordinates of the center of the Circle graphic entity and the coordinates of the endpoints of the Line / PolyLine graphic entity to form a "Circle—Line / PolyLine pair";

[0075] Step S26: Generate a "terminal number—Line / PolyLine pair" based on the "terminal number—Circle pair" and the "Circle—Line / PolyLine pair".

[0076] Step S3: construct an adjacency table graph structure, and abstract the wiring harness path of the wiring track layer into a wiring harness path graph.

[0077] Furthermore, the step S3 specifically includes the following steps:

[0078] Step S31: Create an adjacency list structure and obtain a line segment object from the lines array; the adjacency list structure is used to store other line segment objects connected to the Line object / PolyLine object in the wiring track layer;

[0079] Step S32: traverse the lines array to determine whether there is a line segment object with the same end point coordinates as the start point coordinates. If so, add the line segment object to the corresponding position in the adjacency list and set the cost to 1.

[0080] Step S33: traverse the lines array to determine whether there is a line segment object with the same starting point coordinates and end point coordinates. If so, add the line segment object to the corresponding position in the adjacency list and set the cost to 1;

[0081] Step S34: abstracting the line segment objects of the wiring trajectory layer into nodes of the wiring harness path diagram.

[0082] Step S4: According to the "terminal number—Line / PolyLine pair", the bidirectional Dijkstra algorithm is called to calculate the path between the two terminals in the harness path diagram to obtain the harness path between the two terminals.

[0083] Furthermore, the step S4 specifically includes the following steps:

[0084] Step S41: Obtain a wiring table file, and convert the wiring table in excel format into a wiring table in csv format;

[0085] Step S42: reading the starting terminal number information, the ending terminal number information and the bundle number information contained in each row of the wiring table;

[0086] Step S43: Obtain the graph node corresponding to the terminal number in the wiring table according to the starting terminal number information, the ending terminal number information, and the "terminal number-Line / PolyLine pair" obtained in step S2;

[0087] Step S44: traverse the information in each row of the wiring table, take the line segment object corresponding to the starting terminal number as the starting point of the wiring harness path, take the line segment object corresponding to the ending terminal number as the end point of the wiring harness path, and obtain the corresponding starting node and ending node in the wiring harness path diagram according to the mapping between the line segment object and the graph node in the wiring harness path diagram;

[0088] Step S45: calling the Dijkstra algorithm to calculate the wire harness path between the start node and the end node, and adding corresponding line number information to the line segment object corresponding to the node of the wire harness path diagram.

[0089] Furthermore, the step S45 specifically includes the following steps:

[0090] Step S451: extract the minimum value from the forward queue Qf and assign it to the variable u, obtain the node u and add it to the forward queue Qf; extract the minimum value from the backward queue Qb and assign it to the variable v, obtain the node v and add it to the backward queue Qb;

[0091] Step S452: traverse the adjacent nodes x of node u. If node x is not in the forward set Sf, and the path length df[x] from node u to node x is greater than df[u]+weight(u,x), then update df[x] to df[u]+weight(u,x);

[0092] Add node x to the forward queue Qf and set the priority to df[x]; if node x is in the backward set Sb, and the path length df[u]+weight(u,x)+db[x] from node u to node x is less than the variable mu, then update mu to df[u]+weight(u,x)+db[x];

[0093] Where, df[x] represents the shortest distance from the starting node to node x, df[u] represents the shortest distance from the starting node to node u, weight(u,x) represents the distance from node u to node x; db[x] represents the shortest distance from the target node to node x, mu represents the shortest distance from the starting node to the target node, and its initial value is infinity;

[0094] Step S453: Traverse the adjacent node x of node v: If node x is not in the forward set Sf, and the path length df[x] from node v to node x is greater than df[u]+weight(u,x), then update df[x] to df[u]+weight(u,x); add node x to the forward queue Qf, and set its priority to df[x]; if node x is in the forward set Sf, and the path length db[v]+weight(v,x)+df[x] from node v to node x is less than the variable mu, then update mu to db[v]+weight(v,x)+df[x]; if df[u]+db[v] is greater than or equal to the variable mu, exit the loop; wherein the variable mu represents the shortest real path length from the start node to the target node.

[0095] Working principle: This embodiment first extracts the graphic entities of the aviation wiring harness drawing; secondly, matches the graphic entities in the obtained plug code layer, tooling identification layer and wiring track layer to obtain the "terminal number-Line / PolyLine pair"; then constructs an adjacency table graph structure, and abstracts the wiring harness path of the wiring track layer into a wiring harness path graph; finally, calls the Dijkstra algorithm to obtain the wiring harness path between the two terminals, and calculates the path between the two terminals in the aviation wiring harness DWG drawing to highlight the wiring harness path in the drawing according to the input wiring harness number or bundle number, thereby improving the efficiency and accuracy of wiring.

[0096] Embodiment 2:

[0097] This embodiment is based on the above-mentioned embodiment 1 and is described by taking a specific graphic entity type as an example.

[0098] A method for searching aviation wiring harness drawing paths based on Dijkstra algorithm comprises the following steps:

[0099] Step S1, extracting graphic entities from DWG drawings and generating JSON objects to store graphic information in the drawings;

[0100] Step S2, matching the graphic entities in the plug code layer, the tooling identification layer and the wiring track layer;

[0101] Step S3, abstracting the wiring harness path of the wiring track layer into a graph;

[0102] Step S4: Use the bidirectional Dijkstra algorithm to calculate the path between the two terminals, so as to obtain the wiring harness path between the two terminals.

[0103] Specifically, step S1 includes the following steps:

[0104] Step S101, extracting layer information;

[0105] Step S102, extracting line segment type information and font type information;

[0106] Step S103, extracting graphic entity information;

[0107] Step S104: Use JSON object to save drawing information.

[0108] Furthermore, the graphic entity types extracted in step S103 include the following types:

[0109] AcDbAlignedDimension, AcDbArc, AcDbArcDimension, AcDBBlockReference, AcDBBody, AcDbCircle, AcDbPoint, AcDbText, AcDbDiamet ricDimension, AcDbViewport, AcDbEllipse, AcDbFace, AcDbFcf, AcDbHatch, AcDbLeader, AcDbLine, AcDb2LineAngularDimension, AcDb MInsertBlock, AcDbMline, AcDbMText, AcDbOle2Frame, AcDbOrdinateDimension, AcDb3PointAngularDimension, AcDbPolyline, AcDb2d Polyline, AcDb3dPolyline, AcDbRadialDimension, AcDbRay, AcDbShape, AcDbSolid, AcDbSpline, AcDbTrace, AcDbWipeout, AcDbXline.

[0110] Among them, the main graphic entity types used in aviation wiring harness drawings are: AcDbCircle, AcDbText, AcDbHatch, AcDbLeader, AcDbLine, AcDbPolyline, etc.

[0111] Several graphic entity types used to calculate harness paths are AcDbText, AcDbLine, and AcDbPolyline.

[0112] Furthermore, the step S2 comprises the following steps:

[0113] Step S201, extract the Text graphic entity in the plug code layer, the Circle graphic entity in the tooling identification layer, and the Line or Polyline graphic entity in the wiring track layer and place them in the arrays terminals, circles, and lines. Among them, the content of the Text graphic entity in the plug code layer is the terminal number.

[0114] Step S202, calculate the center coordinates of each terminal number according to the Extents attribute of the Text graphic entity; wherein the Extents attribute refers to the size of the rectangular range occupied by the graphic entity, and the content is the coordinates of the lower left and lower right corners of the rectangle in the drawing space.

[0115] Step S203, calculating the Circle graphic entity closest to each terminal number according to the center coordinates of the terminal number and the center coordinates of the Circle, to form a "terminal number-Circle pair";

[0116] Step S204, according to the coordinates of the center of the Circle and the coordinates of the endpoints of the Line / PolyLine, i.e., the starting coordinates and the ending coordinates, the Line / PolyLine graphic entity closest to each Circle graphic entity is calculated to form a "Circle—Line / PolyLine pair";

[0117] Step S205, generate a "terminal number-Line / PolyLine pair" according to the "terminal number-Circle pair" in step S203 and the "Circle-Line / PolyLine pair" in step S204.

[0118] Furthermore, the step S3 is specifically as follows:

[0119] Initialize the size of the adjacency list according to the size of the lines array.

[0120] For each line segment in the lines array, calculate the other line segments connected to it. The specific process is that for each line segment object, it has two coordinates: the starting point and the end point. For its starting point coordinate, traverse the lines array to find the line segment whose end point coordinate is the same as its starting point coordinate. If found, add the line segment object to the corresponding position in the adjacency list and set the cost to 1. For its starting point coordinate, traverse the lines array to find the line segment whose end point coordinate is the same as its starting point coordinate. If found, add the line segment object to the corresponding position in the adjacency list and set the cost to 1. In the graph formed in this way, the connection between nodes must be a bidirectional connection, which is convenient for the subsequent use of the bidirectional Dijkstra algorithm to calculate the path between the two terminals.

[0121] The adjacency list is a data structure for storing graphs. Each element in the array is a linked list head node, representing a node in the graph. The subsequent nodes in the linked list represent the end points of the edges starting from it. The structure of the adjacency list is shown as follows: Figure 2 , Figure 3 As shown in the figure. Cost refers to the cost required to go from one node to another in the graph. Setting the cost from each line segment to another line segment to 1 can ensure that the path between the two terminals calculated by the bidirectional Dijkstra algorithm is the shortest path.

[0122] Further, step S4 comprises the following steps:

[0123] Step S401, converting the wiring table in excel format into the wiring table in csv format;

[0124] Step S402, reading the information such as the starting terminal number, the ending terminal number and the bundle number contained in each row of the wiring table;

[0125] Step S403, for each row of wiring table records, according to the starting terminal number, the ending terminal number, and the "terminal number-Line / PolyLine pair" obtained in step S2, obtain the node in the graph corresponding to each terminal number in the wiring table. Traverse the information in each row of the wiring table, use the line segment object corresponding to the starting terminal number as the starting point of the path, and use the line segment object corresponding to the ending terminal number as the end point of the path, and find the corresponding starting node and ending node in the graph based on the mapping between the line segment object and the nodes in the graph. Use the bidirectional Dijkstra algorithm to calculate the wiring harness path between the starting node and the ending node;

[0126] Step S404, traverse the path calculated in step S403, and add the line number information corresponding to the line path to the line segment object corresponding to each node in the graph.

[0127] Working principle: This embodiment extracts the graphic information from the CAD drawing, abstracts the line segment objects of the wiring trajectory layer into nodes in the graph, connects the nodes in the graph according to the endpoint coordinates of the line segment, and sets the cost of all edges in the graph to 1. After the harness path is abstracted into a graph, the bidirectional Dijkstra algorithm is used to calculate the harness path between terminals. After the path calculation is completed, each segment object is labeled with its corresponding harness number and terminal number.

[0128] After extracting the graphic information from the CAD drawing, the line segment objects of the wiring track layer are abstracted into nodes in the graph, and the nodes in the graph are connected according to the endpoint coordinates of the line segment, and the cost of all edges in the graph is set to 1. After the harness path is abstracted into a graph, the bidirectional Dijkstra algorithm is used to calculate the harness path between terminals. After completing the path calculation, each line segment object is labeled with its corresponding harness number and terminal number.

[0129] This embodiment can efficiently and accurately search for harness paths in aviation harness drawings, so that when the aviation harness drawings are subsequently digitized and displayed, it can expand the flexibility of CAD drawing application based on user input information and calculated harness paths, and provide support for highlighting corresponding harness paths in aviation harness drawings, thereby improving the efficiency and accuracy of workers' wiring.

[0130] This embodiment first exports the graphic information in the DWG file of the aviation harness to data in JSON format for storage, and then searches for the harness path in the aviation harness drawing and marks the line segment objects in the drawing with tags. Compared with the existing method of redeveloping CAD drawings, this method exports the graphic information in the CAD drawing to data in JSON format, and can redraw the drawing according to JSON data without the scope of software such as AutoCAD, adding customized functions to the drawing.

[0131] In addition, this embodiment calculates the wiring harness path in the drawing and saves the calculated wiring harness path information between terminals in data in JSON format. When the subsequent graphics rendering software renders the aviation wiring harness drawing, it can directly use the path data in the JSON data to highlight the specified wiring harness, thereby increasing the rendering speed.

[0132] The other parts of this embodiment are the same as those of the above-mentioned embodiment 1, and thus will not be described in detail.

[0133] Embodiment 3:

[0134] This embodiment is based on any one of the above embodiments 1 to 2. Figure 1 , Figure 2 , Figure 3 As shown, a specific embodiment is described in detail in conjunction with the accompanying drawings.

[0135] This embodiment proposes an aviation wiring harness drawing path search method based on the Dijkstra algorithm, which aims to extract the graphic information in the DWG file of the aviation wiring harness drawing as JSON format data, and calculate the wiring harness path in the aviation wiring harness drawing according to the wiring harness information in the wiring table, so as to prepare for highlighting the wiring harness according to the user's input information when rendering the subsequent drawings.

[0136] First, parse the DWG file of the aviation harness drawing, and extract the LayerTable, Linetypes and TextStyles in the DWG file. They represent the layer information, line type of the line segment and text format information in the drawing. Then extract the BlockTable. The BlockTable contains the most important information in the drawing, that is, the graphic entity information.

[0137] The main process of extracting graphic entity information is as follows:

[0138] (1) Get all BlockTables in the DWG file;

[0139] (2) For each BlockTable, obtain information such as the range it occupies, and also obtain the graphic entities therein;

[0140] (3) for each graphic entity, determine the type of graphic entity it belongs to;

[0141] (4) Export the RXClassaName of the graphic entity, its coordinate position in the drawing, and other information;

[0142] (5) If the RXClasName of the graphic entity is BlockReference, recursively access the graphic entity in BlockReference and derive the graphic entity information therein;

[0143] (6) Use JSON object to save the exported graphics information.

[0144] After completing the JSON format conversion of the DWG information, it is necessary to calculate the harness path in the drawing based on the information in the wiring table.

[0145] First, we need to extract the graphic entities in the plug code layer, tooling identification layer, and wiring track layer from the JSON data. The extracted entities are the Text graphic entity representing the plug code, the Circle graphic entity representing the tooling identification, and the Line / PolyLine graphic entity representing the wiring track.

[0146] First, generate a "plug code-circle pair", the steps are as follows:

[0147] (1) According to the two attributes of the plug code, minExtent(x1,y1) and maxExtent(x2,y2), the center point coordinates x0 = (x1 + x2) / 2 and y0 = (y1 + y2) / 2 are calculated;

[0148] (2) For each plug code object, find the Circle object closest to it to form a "plug code-Circle pair". The distance calculation formula is:

[0149]

[0150] Among them, (x1, y1) is the center coordinate of the plug code, and (x2, y2) is the center coordinate of the Circle graphic entity.

[0151] Generate "Circle-line segment pair" again, the steps are as follows:

[0152] (1) For each Circle graphic entity, calculate the distance between its center coordinates and the start and end coordinates of each line segment entity. The calculation formula is the same as d above.

[0153] (2) Find the line segment object closest to the Circle entity to form a "Circle-line segment pair".

[0154] Then combine the "plug code—Circle pair" and the "Circle—line segment pair" and generate the "plug code—line segment pair" based on the relationship between the "plug code—Circle—line segment".

[0155] Finally, the graphic entity of the wiring track layer is abstracted into a graph. The main process is as follows:

[0156] (1) Create an adjacency list structure to store other line segment objects connected to the Line / PolyLine objects in the routing track layer;

[0157] (2) Traverse each line segment object and search for line segment objects whose end point coordinates are used as the start point coordinates among all other line segment objects, add them to the corresponding positions in the adjacency list, and set the cost to 1;

[0158] (3) Traverse each line segment object and search for line segment objects whose starting point coordinates are used as end point coordinates among all other line segment objects. Add them to the corresponding positions in the adjacency list and set the cost to 1.

[0159] Next, read the wiring table excel file, convert it to a CSV file, and then read each row of records.

[0160] In each record, each harness number Seq corresponds to a starting terminal number and an ending terminal number.

[0161] For each record in the wiring table, calculate the corresponding harness path.

[0162] Based on the starting terminal number, ending terminal number and the "plug code-line segment pair" generated previously, you can find the starting line segment A corresponding to the actual terminal number and the ending line segment B corresponding to the ending terminal number.

[0163] The bidirectional Dijkstra algorithm used in this embodiment is described below:

[0164] The bidirectional Dijkstra algorithm is an improvement on the ordinary Dijkstra algorithm. It is more efficient for searching paths with a certain start and end point. Assuming that each node in the graph has m adjacent nodes, the weights of each node are the same, and the distance from the start point to the end point is n edges, then the number of iterations required from start to end is m. n When using the bidirectional Dijkstra algorithm, this embodiment starts from both the start and the end, and the order of magnitude of the path search can be reduced to 2m n / 2For complex graphs this can significantly improve path finding performance.

[0165] In this embodiment, the distance from node s to any node v in the forward search is assumed to be d f [v], the distance from node t to any node v in the backward search is d b [v], except d f [s] = d b Except [t]=0, all other nodes are initialized to infinity∞; set a forward priority queue Q f and a backward priority queue Q b , each initially contains only node s and node t; set the set S f and S b The nodes that have been traversed are stored separately. The elements stored in the priority queue are the d corresponding to each node. f or b At the same time, a value μ is set to represent the shortest length of the path s→t, and its initial value is infinity ∞.

[0166] The following is a description of the algorithm:

[0167] 1. Initialize variables and data structures:

[0168] Qf: represents the forward queue, which is used to store the nodes to be processed in the forward traversal.

[0169] Qb: represents the backward queue, which is used to store the nodes to be processed in the backward traversal.

[0170] Sf: represents the forward set, which is used to store the nodes that have been processed by the forward traversal.

[0171] Sb: represents the backward set, which is used to store the nodes that have been processed by the backward traversal.

[0172] df: represents the forward distance array, which is used to store the shortest distance from the starting node to each node.

[0173] db: represents the backward distance array, which is used to store the shortest distance from the target node to each node.

[0174] weight(u,x): function, representing the weight from node u to node x.

[0175] Loop until both the forward queue Qf and the backward queue Qb are empty:

[0176] Extract the minimum value from the forward queue Qf and assign it to the variable u.

[0177] Extract the minimum value from the backward queue Qb and assign it to variable v.

[0178] Add node u to the forward set Sf.

[0179] Add node v to the backward set Sb.

[0180] 2. Traverse the adjacent nodes x of node u:

[0181] If node x is not in the forward set Sf, and the path length df[x] from node u to node x is greater than df[u]+weight(u,x), then update df[x] to df[u]+weight(u,x).

[0182] Among them, df[x] represents the shortest distance from the starting node to node x, df[u] represents the shortest distance from the starting node to node u, and weight(u,x) represents the distance from node u to node x.

[0183] Add node x to the forward queue Qf and set its priority to df[x].

[0184] If node x is in the backward set Sb, and the path length df[u]+weight(u,x)+db[x] from node u to node x is less than the variable mu, then update mu to df[u]+weight(u,x)+db[x].

[0185] Among them, db[x] represents the shortest distance from the target node to node x, mu represents the shortest distance from the starting node to the target node, and its initial value is infinity ∞.

[0186] 3. Traverse the adjacent nodes x of node v:

[0187] If node x is not in the forward set Sf, and the path length df[x] from node v to node x is greater than df[u]+weight(u,x), then update df[x] to df[u]+weight(u,x).

[0188] Add node x to the forward queue Qf and set its priority to df[x].

[0189] If node x is in the forward set Sf, and the path length db[v]+weight(v,x)+df[x] from node v to node x is less than the variable mu, then update mu to db[v]+weight(v,x)+df[x].

[0190] If df[u]+db[v] is greater than or equal to mu, then the loop is exited. At this time, the variable mu represents the actual shortest path length from the starting node to the target node.

[0191] The above can get the shortest path between two nodes in the graph.

[0192] The starting line segment and the ending line segment obtained by the starting terminal number and the ending terminal number are the starting node and the ending node in the graph (the path line segment has been converted into a graph in the previous article), and they are regarded as s and t in the above algorithm. Substituting the graph, s and t converted from the wire harness into the above algorithm can obtain the nodes passed by the shortest path between the two nodes.

[0193] By traversing the nodes in the path, all line segment objects passing from the starting terminal number to the ending terminal number can be obtained.

[0194] Get the line segment object in the path, add an array property named Labels to the JSON object corresponding to the line segment object, and add the Seq numbers represented by the start terminal and the end terminal to the Labels array.

[0195] The test shows that this embodiment can efficiently, quickly and accurately calculate the wiring harness path in the aviation wiring harness drawing by reading the DWG file, abstracting the wiring harness path in the drawing as a graph and using the bidirectional Dijkstra algorithm, meeting the subsequent demand for highlighting the wiring harness when rendering the drawing. It expands the flexibility of CAD drawing application.

[0196] The other parts of this embodiment are the same as any one of the above-mentioned embodiments 1-2, so they will not be repeated here.

[0197] Embodiment 4:

[0198] This embodiment, based on any one of the above-mentioned embodiments 1 to 3, proposes an aviation wiring harness drawing path search system based on the Dijkstra algorithm, which is used to execute the above-mentioned aviation wiring harness drawing path search method based on the Dijkstra algorithm; it includes an extraction unit, a matching unit, an abstraction unit, and a path calculation unit;

[0199] The extraction unit is used to extract the graphic entity of the aviation wiring harness drawing DWG file and generate a JSON object; the JSON object is used to store the exported graphic entity information;

[0200] The matching unit is used to match the obtained graphic entities in the plug code layer, the tooling identification layer and the wiring track layer according to the graphic entity information to obtain a "terminal number-Line / PolyLine pair";

[0201] The abstraction unit is used to construct an adjacency table graph structure to abstract the wire harness path of the wiring track layer into a wire harness path graph;

[0202] The path calculation unit is used to call the Dijkstra algorithm according to the "terminal number-Line / PolyLine pair" to calculate the path between the two terminals in the harness path diagram to obtain the harness path between the two terminals.

[0203] This embodiment also proposes an electronic device, including a memory and a processor; a computer program is stored on the memory; when the computer program is executed on the processor, the above-mentioned aviation wiring harness drawing path search method based on the Dijkstra algorithm is implemented.

[0204] This embodiment also proposes a computer-readable storage medium, on which computer instructions are stored; when the computer instructions are executed on the above-mentioned electronic device, the above-mentioned aviation wiring harness drawing path search method based on the Dijkstra algorithm is implemented.

[0205] The other parts of this embodiment are the same as any one of the above-mentioned embodiments 1 to 3, so they will not be repeated here.

[0206] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification or equivalent change made to the above embodiment based on the technical essence of the present invention shall fall within the protection scope of the present invention.

Claims

1. A method for searching aviation wiring harness drawing paths based on Dijkstra algorithm, characterized in that: The specific steps include: Step S1: extracting graphic entities of the aviation wiring harness drawing DWG file and generating a JSON object; the JSON object is used to store the exported graphic entity information; Step S2: According to the graphic entity information, the graphic entities in the obtained plug code layer, tooling identification layer and wiring track layer are matched to obtain "terminal number-Line / PolyLine pair"; Step S3: construct an adjacency table graph structure, and abstract the wiring harness path of the wiring track layer into a wiring harness path graph; Step S4: according to the "terminal number—Line / PolyLine pair", the Dijkstra algorithm is called to calculate the path between the two terminals in the harness path diagram to obtain the harness path between the two terminals.

2. The aviation wiring harness drawing path search method based on Dijkstra algorithm according to claim 1, characterized in that: The step S1 specifically includes the following steps: Step S11: Obtaining a block table of the aviation wiring harness drawing DWG file; Step S12: obtaining range information according to the block table, and obtaining the graphic entity; Step S13: export the graphic entity information of the graphic entity and store it in the generated JSON object.

3. The aviation wiring harness drawing path search method based on Dijkstra algorithm according to claim 2 is characterized in that: The step S13 specifically includes the following steps: Step S131: determine the type of the acquired graphic entity, if the RXClasName of the graphic entity is BlockReference, recursively access the graphic entity in BlockReference, and export the graphic entity information; Step S132: storing the exported graphic entity information in the generated JSON object.

4. The aviation wiring harness drawing path search method based on Dijkstra algorithm according to claim 2, characterized in that: The step S2 specifically includes the following steps: Step S21: according to the graphic entity information, obtaining the Text graphic entity in the plug code layer, the Circle graphic entity in the tooling identification layer, and the Line graphic entity or the Polyline graphic entity in the wiring track layer; Step S22: extracting the Text graphic entity and placing it in the terminals array, extracting the Circle graphic entity and placing it in the circles array, and extracting the Line graphic entity or the Polyline graphic entity and placing it in the lines array; Step S23: Calculate the center coordinates of the terminal number according to the Extents attribute of the Text graphic entity; wherein the Extents attribute is used to indicate the size of the rectangular range occupied by the graphic entity; Step S24: Calculate the Circle graphic entity closest to the terminal number according to the center coordinates of the terminal number and the center coordinates of the Circle graphic entity to form a "terminal number-Circle pair"; Step S25: Calculate the Line / PolyLine graphic entity closest to the Circle graphic entity according to the coordinates of the center of the Circle graphic entity and the coordinates of the endpoints of the Line / PolyLine graphic entity to form a "Circle—Line / PolyLine pair"; Step S26: Generate "terminal number—Line / PolyLine pair" according to "terminal number—Circle pair" and "Circle—Line / PolyLine pair".

5. The aviation wiring harness drawing path search method based on Dijkstra algorithm according to claim 4 is characterized in that: The step S3 specifically includes the following steps: Step S31: Create an adjacency list structure and obtain a line segment object from the lines array; the adjacency list structure is used to store other line segment objects connected to the Line object / PolyLine object in the wiring track layer; Step S32: traverse the lines array to determine whether there is a line segment object with the same end point coordinates as the start point coordinates. If so, add the line segment object to the corresponding position in the adjacency list and set the cost to 1. Step S33: traverse the lines array to determine whether there is a line segment object with the same starting point coordinates and end point coordinates. If so, add the line segment object to the corresponding position in the adjacency list and set the cost to 1; Step S34: According to the adjacency list structure, the line segment objects of the wiring trajectory layer are abstracted into nodes of the wiring harness path graph.

6. The aviation wiring harness drawing path search method based on Dijkstra algorithm according to claim 4, characterized in that: The step S4 specifically comprises the following steps: Step S41: Obtain a wiring table file, and convert the wiring table in excel format into a wiring table in csv format; Step S42: reading the starting terminal number information, the ending terminal number information and the bundle number information contained in each row of the wiring table; Step S43: Obtain the graph node corresponding to the terminal number in the wiring table according to the starting terminal number information, the ending terminal number information, and the "terminal number-Line / PolyLine pair" obtained in step S2; Step S44: traverse the information in each row of the wiring table, take the line segment object corresponding to the starting terminal number as the starting point of the wiring harness path, take the line segment object corresponding to the ending terminal number as the end point of the wiring harness path, and obtain the corresponding starting node and ending node in the wiring harness path diagram according to the mapping between the line segment object and the graph node in the wiring harness path diagram; Step S45: calling the Dijkstra algorithm to calculate the wire harness path between the start node and the end node, and adding corresponding line number information to the line segment object corresponding to the node of the wire harness path diagram.

7. The aviation wiring harness drawing path search method based on Dijkstra algorithm according to claim 6, characterized in that: The step S45 specifically includes the following steps: Step S451: extract the minimum value from the forward queue Qf and assign it to the variable u, obtain the node u and add it to the forward queue Qf; extract the minimum value from the backward queue Qb and assign it to the variable v, obtain the node v and add it to the backward queue Qb; Step S452: traverse the adjacent nodes x of node u. If node x is not in the forward set Sf, and the path length df[x] from node u to node x is greater than df[u]+weight(u,x), then update df[x] to df[u]+weight(u,x); Add node x to the forward queue Qf and set the priority to df[x]; if node x is in the backward set Sb, and the path length df[u]+weight(u,x)+db[x] from node u to node x is less than the variable mu, then update mu to df[u]+weight(u,x)+db[x]; Where, df[x] represents the shortest distance from the starting node to node x, df[u] represents the shortest distance from the starting node to node u, weight(u,x) represents the distance from node u to node x; db[x] represents the shortest distance from the target node to node x, mu represents the shortest distance from the starting node to the target node, and its initial value is infinity; Step S453: Traverse the adjacent node x of node v: If node x is not in the forward set Sf, and the path length df[x] from node v to node x is greater than df[u]+weight(u,x), then update df[x] to df[u]+weight(u,x); add node x to the forward queue Qf, and set its priority to df[x]; if node x is in the forward set Sf, and the path length db[v]+weight(v,x)+df[x] from node v to node x is less than the variable mu, then update mu to db[v]+weight(v,x)+df[x]; if df[u]+db[v] is greater than or equal to the variable mu, exit the loop; wherein the variable mu represents the shortest real path length from the start node to the target node.

8. An aviation wiring harness drawing path search system based on Dijkstra algorithm, used to execute the aviation wiring harness drawing path search method based on Dijkstra algorithm as claimed in claim 1; characterized in that, It includes extraction unit, matching unit, abstraction unit and path calculation unit; The extraction unit is used to extract the graphic entity of the aviation wiring harness drawing DWG file and generate a JSON object; the JSON object is used to store the exported graphic entity information; The matching unit is used to match the obtained graphic entities in the plug code layer, the tooling identification layer and the wiring track layer according to the graphic entity information to obtain the "terminal number-Line / PolyLine pair"; The abstraction unit is used to construct an adjacency table graph structure to abstract the wiring harness path of the wiring track layer into a wiring harness path graph; the path calculation unit is used to call the Dijkstra algorithm according to the "terminal number-Line / PolyLine pair" to calculate the path between the two terminals in the wiring harness path graph to obtain the wiring harness path between the two terminals.

9. An electronic device, characterized in that: It comprises a memory and a processor; a computer program is stored in the memory; when the computer program is executed on the processor, the aviation wiring harness drawing path search method based on the Dijkstra algorithm as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions; when the computer instructions are executed on the electronic device as described in claim 9, the aviation wiring harness drawing path search method based on the Dijkstra algorithm as described in any one of claims 1-7 is implemented.

Citation Information

Cited By

  • Method and system for generating header

    CN119203959A

  • Wire harness wiring quality control system and wiring control method based on images

    CN120633104A

  • An image-based wire harness wiring quality control system and wiring control method

    CN120633104B