Electric connector end face model display and linkage method
By using image recognition technology and Qt framework in the end-face diagram recognition of electrical connectors, rapid identification and accurate modeling of end-face diagrams of electrical connectors are realized, and display efficiency is improved through linkage interaction, solving the problems of low recognition efficiency and low accuracy in traditional methods, and providing an intuitive and efficient model display and linkage solution.
Patent Information
- Application Number
- CN202510141362.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-06-17
AI Technical Summary
The traditional electrical connector end-face diagram recognition method relies on manual operation, has low recognition efficiency, low degree of automation, is prone to errors, and lacks effective image processing and recognition algorithms, resulting in low recognition accuracy, low model file parsing efficiency, poor display performance, poor user interaction experience, and a lack of an effective linkage mechanism between the model and data.
Using an image recognition technology and Qt framework method, we use the model file in XML format to extract key information of the electrical connector end-face diagram, automatically generate model files, and use the QGraphicsScene and QGraphicsView controls in the Qt framework to realize the graphical display of the model. Combining XML parsing library and image recognition algorithms, such as the Adaboost algorithm of Haar features and the MESR algorithm, we can identify and display contacts and contour profiles. At the same time, the linkage interaction between model points and tables is achieved through QTableWidget.
It realizes rapid identification, accurate modeling and efficient display and linkage of electrical connector end-face diagrams, improves design and production efficiency, and provides an intuitive and efficient electrical connector end-face model display and linkage solution.
Smart Images

Figure CN120162846A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of display and linkage of the end face model of an electrical connector, and particularly relates to a method for displaying and linking the end face model of an electrical connector based on image recognition technology and the Qt framework. Background Art
[0002] In the design of aviation electrical engineering, electrical connectors are key electronic components. Modeling the end face diagram of an electrical connector is to facilitate users to allocate and modify the energy and signals transmitted by each pin in EDA software. Therefore, the accurate recognition and modeling of the end face diagram are crucial for the energy transmission and signal distribution of the system. However, the traditional methods for recognizing the end face diagram of an electrical connector have the following limitations: relying on manual operation, with low recognition efficiency; low degree of automation, prone to errors; lack of effective image processing and recognition algorithms, resulting in low recognition accuracy; low efficiency in parsing model files, poor display performance, poor user interaction experience, and lack of an effective linkage mechanism between the model and data. Summary of the Invention
[0003] In view of this, in the first aspect, a method for displaying and linking the end face model of an electrical connector is provided. The method includes the following steps: Define a model file, which is an XML format file and includes the shape and contour information of the connector contacts and the position distribution information of the contacts and the contour. Recognize the end face diagram of the connector, extract key information, and automatically generate the model file. Use the QGraphicsScene and QGraphicsView controls in the Qt framework to implement the graphical display of the model, including the overall interface, the function interface for building the sample library, and the function interface for accurate recognition. Read the model file through an XML parsing library, extract the shape definition information and the position distribution information, create a QGraphicsItem object, and add it to the QGraphicsScene. Combine QTableWidget to achieve the linkage interaction between the model points and the table. When the user selects a certain row in the table, the corresponding contact graphic item in the model scene is highlighted, and vice versa.
[0004] On the basis of the above solution, the model file is divided into <diagram>Label and <collection>Label, wherein, <collection>The label records the shape and profile outline information of the contact member, <diagram>The label records the position distribution information of the contact and the profile shape.
[0005] Based on the above solution, an image recognition technology that combines the Adaboost algorithm based on Haar features and the MESR algorithm with the Tesseract engine is used to recognize the end face diagram of the connector.
[0006] Based on the above solution, the steps further include: highlighting the selected table rows and the contact graphic items in the model by setting different colors or styles to enhance visual feedback.
[0007] Based on the above solution, the steps further include: generating a data file that can be called by EDA software with one key to simplify the process of building the electrical connector database.
[0008] Based on the above solution, the method further includes: The method further includes: a. Implementing basic interaction functions, such as zooming, panning, selecting, and editing model elements; b. Providing toolbar or menu options to allow users to adjust display settings and model parameters; c. Capturing and handling possible errors and exceptions during the parsing and display process; d. Recording log information for subsequent debugging and problem troubleshooting; e. Including a sample library building function that allows users to create a sample library for the current pin types to improve the model recognition accuracy.
[0009] In a second aspect, an electrical connector end face model display and linkage system is provided. The system executes the method described in the above solution, and the system composition includes: A data parsing and storage module, a table display module, a model display module, a linkage control module, and a user interface module; The data parsing and storage module is used to parse the XML model file, extract the contact information, and store it; The table display module uses QTableWidget to display the contact information and realizes the linkage with the model points; The model display module uses QGraphicsScene and QGraphicsView to display the model scene and realizes the linkage with the table; The linkage control module is used to handle the interaction events between the table and the model scene to achieve the linkage effect; The user interface module is used to provide a user interface and handle user input events; The precise recognition function interface allows users to custom-select the recognition model and adjust the recognition function parameters to reduce misrecognition situations.
[0010] The system further includes: a. A graphics rendering optimization module that uses the caching mechanism of QGraphicsItem to optimize the graphics rendering performance; b. An anti-aliasing effect module that enables or disables the anti-aliasing effect of the graphics as needed to balance the display quality and performance; c. An error handling module that is used to capture and handle possible errors and exceptions during the parsing and display processes; d. A logging module that is used to record log information for subsequent debugging and problem troubleshooting.
[0011] e. A function that includes generating a data file that can be called by EDA software with one click, simplifying the process of building an electrical connector database.
[0012] The system further includes: a. A user-defined settings module that allows users to customize the parameters of model display according to their needs, such as color, line type, transparency, etc.; b. A model update module that is used to automatically reload and display the latest model data after the model file is updated to maintain the timeliness of the data; c. A data export module that allows users to export the currently displayed model data into files of different formats, such as SVG, PDF, or image files; d. A multi-language support module that enables the system to display the corresponding language interface according to the user's regional settings.
[0013] The system further includes: a. A model comparison module that is used to compare the differences between two different model files and display them graphically for easy user understanding and review of changes; b. A version control module that is used to track and manage the version history of model files, support version rollback and difference comparison, and enhance data management capabilities; c. A collaboration module that allows multiple users to collaborate on editing the same model file and synchronize changes in real time.
[0014] The system further includes: a. A hardware acceleration module that utilizes the graphics processing unit (GPU) to accelerate the graphics rendering process and improve the display performance; b. A cloud synchronization module that is used to store model files in the cloud and support cross-device access and editing; c. A security module that ensures the security and privacy of model files and prevents unauthorized access and modification.
[0015] The system further includes: a. A user guide module that provides a detailed user operation manual and online help documents; b. An online update module for automatically checking and downloading the latest updates of the system; c. A feedback module that allows users to submit usage feedback and report problems for developers to improve.
[0016] In a third aspect, there is provided a computer-readable storage medium storing a computer program designed to execute the method described in any one of the above solutions.
[0017] In a fourth aspect, there is provided a computer program product which, when running on an electronic device, enables the electronic device to implement the method described in any one of the above solutions.
[0018] Advantages of the present invention: By integrating the image recognition algorithm and the graphical interface of the Qt framework, the present invention realizes the rapid recognition, accurate modeling, and efficient display and linkage of the end face diagram. It can efficiently parse the model file, accurately display the end face model, and realize the linkage interaction between the model points and the table, thereby improving the efficiency of design and production. It provides an intuitive and efficient solution for the display and linkage of the end face model of the electrical connector. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The present invention has the following drawings: Figure 1 A system architecture diagram of an embodiment of the present invention; Figure 2 A display flow chart of an embodiment of the present invention; Figure 3 A user interface diagram of an embodiment of the present invention; Figure 4 A linkage interaction flow chart of an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0020] To make the objectives, advantages, and features of the present invention more obvious, the present invention will be further described in detail below with reference to the drawings and specific embodiments.
[0021] This embodiment designs a process for an electrical connector end face model display and linkage system. It is known that an electrical connector has multiple contact parts, and each contact part has a specific size and position. The purpose is to realize the recognition and data export functions through the system, which can display the graphical representation of these contact parts and allow users to highlight the corresponding graphical items by clicking on the entries in the table. Specifically, it includes the following steps: S1: Define an XML-formatted model file that details the key information of the end face profile and contacts of the electrical connector, including dimensions, coordinates, shape, etc. The model file is organized as <diagram>and <collection>Two main labels, where <collection>The label is used to store the shape and profile information of the contact, while <diagram>The label records the position distribution information of the contact and the contour shape. This structured data organization method facilitates subsequent parsing and processing.
[0022] S2: Image preprocessing. Before image recognition, the imported image is first preprocessed to improve the recognition accuracy. First, techniques such as Gaussian filtering or median filtering are used to remove noise in the image to ensure the accuracy of subsequent processing. Then, the contrast and brightness of the image are adjusted to make the pins and text more clearly visible. Finally, the image is converted into a black-and-white image to make it easier to identify edges and shapes.
[0023] S3: Use the image recognition technology that combines the Adaboost algorithm based on Haar features and the MESR algorithm with the Tesseract engine to automatically recognize the end-face diagram of the electrical connector and extract key information. Through the trained classifier, the system scans the image to identify possible pin areas. The features of each pin (such as position, size, and shape) are extracted and recorded, and interfering elements in the image are excluded. For example, the recognized contact 1 is located at position (100, 200) and has a size of 20x10. This step greatly improves the automation and accuracy of recognition, reduces manual intervention, and improves efficiency.
[0024] S4: While identifying the pins, the system also calls the MESR algorithm for text detection and combines it with the Tesseract engine for text recognition. Identify areas in the image that may contain text. Perform character recognition on the detected text areas and convert the text in the image into an editable text format.
[0025] S5: Use the C++ language and the Qt framework to develop a graphical interface, including the overall interface, the sample library building function interface, and the precise recognition function interface. These interfaces provide a window for users to interact with the system and also allow users to intuitively view and edit the detailed information of the electrical connector. Initialize QGraphicsView and QGraphicsScene objects and set the scene size to 800x600 pixels.
[0026] S6: Read the XML file through the XML parsing module, parse out the position and size information of the contact, extract the shape definition information and position distribution information, and map them to QGraphicsItem objects, and finally add them to QGraphicsScene for graphical display. For example, parse out the information of contact 1 and prepare to create a corresponding graphic item in the graphic scene.
[0027] S7: According to the parsed information, use QGraphicsEllipseItem to create an elliptical graphic item to represent the contact 1, and add it to the QGraphicsScene. Set its position to (100, 200) and set appropriate dimensions.
[0028] S8: Create a QTableWidget to display the detailed information of the contacts, such as ID, position, and dimensions. Connect a slot function to the signal for changing the current cell of the QTableWidget. When the user clicks on a row in the table, this slot function will be triggered. It will find the corresponding graphic item in the QGraphicsScene and change its color to highlight it.
[0029] S9: Implement basic interaction functions including zooming, panning, selecting, and editing model elements, allowing users to zoom and pan the scene by using the mouse wheel and dragging. Design the user interface, including a toolbar that provides zooming and panning buttons, and a menu option that allows users to adjust the display settings and model parameters as needed.
[0030] S10: Enable the caching mechanism of QGraphicsItem to improve rendering performance, and add error handling code during the parsing and display processes to ensure that when an invalid XML file or parsing error is encountered, the system can give corresponding error prompts.
[0031] S11: Implement the data export function, allowing users to export the currently displayed model as an SVG or PDF file. Add multi-language support so that the system can display the corresponding language interface according to the user's regional settings.
[0032] As Figure 1 shown, the system architecture of the present invention includes a data parsing and storage module, a table display module, a model display module, an interaction control module, and a user interface module.
[0033] The data parsing and storage module is used to parse the XML model file, extract the contact information and store it; The table display module uses QTableWidget to display the contact information and realizes the interaction with the model points; The model display module uses QGraphicsScene and QGraphicsView to display the model scene and realizes the interaction with the table; The interaction control module is used to handle the interaction events between the table and the model scene and realize the interaction effect; The user interface module is used to provide a user interface and handle user input events; The precise recognition function interface allows users to customize the selection of recognition models and adjust the parameters of recognition functions to reduce misrecognition situations.
[0034] As Figure 2 shown, the program uses C++ as the development language and QGraphicsFrameWork as the graphical framework. The program reads and displays the process of the connector model.
[0035] As Figure 3 shown, the user interface includes a QTableWidget for displaying contact information and a QGraphicsView for displaying the model scene. It includes the end face diagram interface of the electrical connector, the recognition interface, and the text detection buttons, sorting buttons, update buttons, save buttons, open output folder buttons, and close buttons in the corresponding function area.
[0036] As Figure 4 shown, the linkage interaction process includes the user selecting the contact point number in the table, the system highlighting the corresponding contact graphic item in the model scene, and the user clicking on the contact graphic item in the model scene, the system highlighting the corresponding row in the table. Users can process the recognition information of the end face diagram of the electrical connector, and then click the "Save" button to generate an XML file of the recognition result. The XML structure of the model file includes <diagram>Label and <collection>Label, wherein <collection>The label records the shape and profile outline information of the contact part, <diagram>The label records the position distribution information of the contact and the contour shape.
[0037] It should be noted that any process or method description in the embodiments can be understood as representing a module, segment, or part of code including one or more executable instructions for implementing a specific logical function or process, and the scope of the preferred embodiments of the present invention includes additional implementations, where the functions can be executed in a manner that may not be in the order shown or discussed, including in a substantially simultaneous manner according to the functions involved or in the reverse order, which should be understood by those skilled in the technical field to which the embodiments of the present invention belong.
[0038] It should be noted that for the logic and / or steps in the embodiments, for example, which can be considered as a defined sequence list of executable instructions for implementing logical functions, can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or in combination with these instruction execution systems, apparatuses, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport a program for use by or in combination with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other appropriate processing as necessary, and then stored in a computer memory.
[0039] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits with logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits with suitable combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0040] Those of ordinary skill in the art can understand that all or part of the steps to implement the methods of the above embodiments can be completed by instructing relevant hardware through a program. The program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0041] In addition, each functional module in the embodiments of the present invention can be integrated into a processing module, or each module can exist physically alone, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. When the above integrated modules are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium.
[0042] The above-mentioned storage medium can be a read-only memory, a magnetic disk, an optical disc, etc.
[0043] The above embodiments have described the technical solutions of the present invention in detail. Obviously, the present invention is not limited to the described embodiments. Based on the embodiments of the present invention, those familiar with the technical field can also make various changes accordingly. However, any changes equivalent or similar to the present invention belong to the scope of protection of the present invention.
[0044] The content not described in detail in this specification belongs to the prior art well-known to those skilled in the art.< / diagram> < / collection> < / collection> < / diagram> < / diagram> < / collection> < / collection> < / diagram> < / diagram> < / collection> < / collection> < / diagram>
Claims
1. A method for displaying and linking an end face model of an electrical connector, characterized in that: The method comprises the following steps: Define a model file, wherein the model file is an XML format file, including shape and contour information of connector contacts, and position distribution information of contacts and contours; Identify the connector end face image, extract key information, and automatically generate the model file; Use QGraphicsScene and QGraphicsView controls in the Qt framework to realize the graphical display of the model, including the overall interface, sample library building function interface and precise recognition function interface; Read the model file through the XML parsing library, extract the shape definition information and location distribution information, create a QGraphicsItem object, and add it to the QGraphicsScene; Combined with QTableWidget to realize the linkage interaction between model points and tables.
2. The method according to claim 1, characterized in that The model files are divided into <diagram>Tags and <collection>Tags, where <collection>The label records the shape and contour information of the contact. <diagram> The tags record the location and distribution information of the contacts and the outline shape.< / diagram> < / collection> < / collection> < / diagram> 3. The method according to claim 1, characterized in that The connector end face image is identified using the Adaboost algorithm and MESR algorithm based on Haar features combined with the image recognition technology of the Tesseract engine.
4. The method according to claim 1, characterized in that The steps also include: highlighting the selected table rows and contact graphic items in the model by setting different colors or styles.
5. The method according to claim 1, characterized in that The steps also include: generating a data file that can be called by EDA software with one click.
6. An electrical connector end face model display and linkage system, characterized in that: The system executes the method described in any one of claims 1 to 5, and the system structure includes: Data parsing and storage module, table display module, model display module, linkage control module and user interface module; Data parsing and storage module, used to parse XML model files, extract contact information and store it; Table display module, using QTableWidget to display contact information and realize linkage with model points; Model display module, using QGraphicsScene and QGraphicsView to display the model scene and realize linkage with the table; The linkage control module is used to process the interaction events between the table and the model scene to achieve the linkage effect; The user interface module is used to provide the user interface and handle user input events.
7. A computer-readable storage medium, characterized in that: The medium stores a computer program, and the program is designed to execute the method according to any one of claims 1 to 5.
8. A computer program product, characterized in that When the computer program product runs on an electronic device, the electronic device implements the method according to any one of claims 1 to 5.