Electronic component geometric dimension data extraction method and device, equipment and storage medium
By extracting and processing the dimensional features in the PDF data sheet of electronic components, the problem of low dimensional information extraction efficiency in the prior art is solved, the storage and application of structured data is realized, and the application of three-dimensional models and electronic design automation is supported.
Patent Information
- Application Number
- CN202411110037.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-14
- Publication Date
- 2024-11-26
AI Technical Summary
The prior art cannot automatically distinguish the dimension information and other text information in the PDF data sheet of electronic components, resulting in inefficient extraction, and the signed dimension and tabular data cannot be correctly parsed, and the description dimension text and graphic information cannot be associated.
By obtaining the PDF format data sheet of electronic components, the dimension feature is extracted, the dimension view is positioned, the vector graphics are obtained and the scaling process is performed, the feature elements such as the body, pins and marks are identified, the dimension data is extracted and stored in the structured data structure, including the body, etc. , pins, bounding boxes and markings dimension data.
It realizes the rapid and efficient extraction of structured size data from the electronic component PDF data sheet, supports the automation creation of three-dimensional models of electronic components and the automation of electronic design, and improves the speed and efficiency of data extraction.
Smart Images

Figure CN119027959A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the cross-technical field of electronic design automation, pattern recognition and computer-aided design, and in particular to a method, device, equipment and storage medium for extracting geometric dimension data of electronic components. Background Art
[0002] Electronic component data sheets are usually stored in PDF (Portable Document Format) format, which is an unstructured file format created by Adobe and mainly used for electronic publications. Since PDF documents have good display effects, cross-platform characteristics, document independence, and security, modern electronic component data sheets are stored and disseminated in PDF format. In PDF data sheets, the text information presented is not necessarily in text format, but may also be in image format. In addition, many data sheets themselves are protected by watermarks, so extracting text data from PDF documents is itself a rather difficult problem.
[0003] The difficulty of extracting component geometric dimension data from electronic component PDF data sheets is mainly due to the following aspects:
[0004] First, format diversity: PDF data manuals from different manufacturers have different formats, and there is no unified standard for typesetting and data representation, which makes automated extraction complicated.
[0005] Second, data embedding method: Some geometric dimension data are embedded in PDF in the form of pictures, tables or texts, and the conversion and parsing between these forms are difficult.
[0006] Third, the difficulty of image processing: If the geometric dimension data exists in the form of images, optical character recognition (OCR) or image analysis is required, which places high demands on image quality and parsing algorithms.
[0007] Fourth, the complexity of text parsing: Even geometric dimension data in text form may increase the difficulty of parsing due to inconsistent formats, mixed units, irregular layout, etc.
[0008] Fifth, complex layout: The complex layout and various fonts, symbols, units, etc. of PDF format increase the complexity of parsing and extraction.
[0009] Sixth, information confusion: The data sheet contains a large amount of information that is irrelevant to geometric dimensions. Automated tools need to be able to accurately identify and filter irrelevant content and extract the required dimensional data.
[0010] The above factors make extracting geometric dimension data from electronic component PDF data sheets a complex and challenging task.
[0011] There is an existing technology for extracting text or table data from PDF documents. For example:
[0012] Invention patent CN101782896A: The PDF text extraction method combined with OCR technology effectively improves the accuracy of PDF text extraction and solves the problem that character content of some PDF files cannot be extracted.
[0013] Invention patent CN108038093B: It improves the accuracy of PDF text extraction and does not require all PDF files to undergo OCR recognition, thus saving time in PDF text extraction.
[0014] Invention patent CN109635268B: discloses a method for extracting table information from a PDF file, which can extract cross-page tables and achieve more accurate and better restoration rate complete table extraction.
[0015] The defects or problems of the existing technology are as follows:
[0016] Inability to distinguish dimension information: Existing technologies cannot distinguish dimension information from other text information, which means that dimension information needs to be manually identified and extracted, which is very time-consuming and inefficient. The dimension information in some electronic component data sheets may be in special formats, such as dimensions with symbols and tables, which are difficult for existing technologies to correctly parse.
[0017] Unable to associate descriptive dimension text and graphics: Existing technologies mainly focus on text extraction of text or table data, but are unable to extract graphics describing packages or geometric shapes and their associated dimension information in electronic component data sheets. Summary of the invention
[0018] The present application provides a method, device, equipment and storage medium for extracting geometric dimension data of electronic components, so as to solve the problem that dimension information and other text information cannot be automatically distinguished in the process of extracting geometric dimension data of electronic components.
[0019] In a first aspect, the present application provides a method for extracting geometric dimension data of an electronic component, comprising:
[0020] Get data sheets of electronic components in PDF format;
[0021] Positioning the dimension view of the electronic component based on the dimension features extracted from the PDF format data book;
[0022] Based on the positioning data of the dimension view, the dimension view page data is extracted from the PDF format data manual, and the vector graphics are obtained according to the dimension view page data. The vector graphics are scaled according to the dimension data in the dimension feature to obtain full-scale dimension graphic data. Based on the full-scale dimension graphic data, characteristic elements are identified, and the characteristic elements include at least one of a main body part graphic, a pin part graphic and a mark. Based on the main body part graphic, the dimension data and graphic image of the main body are extracted; based on the pin part graphic, the number of pins is extracted, and the distribution matrix of the center points connecting each pin and the main body part image is used as the pin distribution matrix, and the dimension data and graphic data of the pins are determined by using the pin distribution matrix. According to the dimension data and graphic data of the main body and the pins, the dimension data of the bounding box is calculated, and based on the mark, the image data and coordinates / size of the mark are determined;
[0023] The dimension data and graphic data of the main body, the dimension data and graphic data of the pins, the image data and coordinates / dimensions of the marks, and the dimension data of the bounding box are stored in a set data structure to obtain structured data.
[0024] In one possible design, obtaining a PDF data sheet for an electronic component includes:
[0025] In response to the input data:
[0026] In the case where the data is in a PDF format document, extracting text and obtaining meta information of the electronic component by keyword search, using the input data as a PDF format data manual of the electronic component;
[0027] In the case where the format of the data is a character string, determining a link address according to the character string, acquiring a link page based on the link address, acquiring a PDF format data manual and meta information of the electronic component from the link page, and acquiring a preview image of the electronic component if a preview image of the electronic component exists on the link page;
[0028] Determining the link address according to the character string includes:
[0029] Based on regular expression matching, it is determined whether the string is a link address. If the string is not a link address, a set keyword is added to the string to obtain a search semantic feature. Based on the search semantic feature, a search engine is used to search to determine the link address of the electronic component.
[0030] In one possible design, the set data structure is composed of multiple first elements, the first elements include a body, a pin, a bounding box, a tag and meta-information, and the extracted size data and graphic data of the body, the size data and graphic data of the pin, the image data and coordinates / size of the tag, the size data of the bounding box, and the manufacturer model, packaging or link information of the electronic component are respectively stored in the set data structure as secondary elements of the body, pin, bounding box, tag and meta-information to obtain structured data.
[0031] In a possible design, positioning the dimension view of the electronic component based on the dimension features extracted from the PDF format data sheet includes:
[0032] When at least three size features are acquired, determining positioning data of the size view according to the at least three size features;
[0033] When the acquired size features are less than three, extracting text data from the PDF format data manual, and determining the location data of the size view by searching keywords based on the text data;
[0034] In the case where the positioning data of the dimension view is not determined, the type and packaging characteristics of the electronic component are extracted based on the meta information of the electronic component, and the result data is extracted from the built-in database according to the type and packaging characteristics of the electronic component.
[0035] In one possible design, after positioning the dimension view of the electronic component based on the dimension features extracted from the PDF format data booklet, the method further includes:
[0036] In the case where the dimension data of the dimension feature includes letters and / or diagrams, marking the dimension view corresponding to the dimension feature as a first style;
[0037] In the case where the dimension data of the dimension feature does not include letters and / or diagrams, marking the dimension view corresponding to the dimension feature as a second style;
[0038] Based on the dimension view marked as the first style, the determined dimension data and graphic data of the body, the dimension data and graphic data of the pins, the image data and coordinates / dimensions of the marking, and the dimension data of the bounding box are matched with the diagram character size and stored in the set data structure;
[0039] Based on the dimension view marked as the second style, the determined dimension data and graphic data of the body, the dimension data and graphic data of the pins, the image data and coordinates / sizes of the marking, and the dimension data of the bounding box are directly stored in the setting data structure.
[0040] In one possible design, the pin distribution matrix is represented as:
[0041]
[0042] where x i ,y i ,z i ,θ i They respectively refer to the coordinates of the center point of the cross section where the pin contacts the body and the rotation angle of the pin when the i-th pin takes the center of the component body as the coordinate origin, where i∈[1,n] is a positive integer and n represents the number of pins.
[0043] In a second aspect, the present application provides a device for extracting geometric dimension data of an electronic component, comprising:
[0044] A data acquisition module is configured to acquire a PDF format data sheet of the electronic component;
[0045] A view positioning module, configured to position the dimension view of the electronic component based on the dimension features extracted from the PDF format data manual;
[0046] The data extraction module is configured to extract the dimension view page data from the PDF format data manual based on the positioning data of the dimension view, obtain the vector graphics according to the dimension view page data, scale the vector graphics according to the dimension data in the dimension feature to obtain the full-scale dimension graphic data, identify the characteristic elements based on the full-scale dimension graphic data, the characteristic elements include at least one of the main body part graphics, the pin part graphics and the mark, extract the dimension data and graphic image of the main body based on the main body part graphics; extract the number of pins based on the pin part graphics, use the distribution matrix of the center points connecting each pin and the main body part image as the pin distribution matrix, determine the dimension data and graphic data of the pins using the pin distribution matrix, calculate the dimension data of the bounding box based on the dimension data and graphic data of the main body and the pins, and determine the image data and coordinates / size of the mark based on the mark;
[0047] The data storage module is configured to store the dimension data and graphic data of the main body, the dimension data and graphic data of the pins, the image data and coordinates / dimensions of the mark, and the dimension data of the boundary box in a set data structure to obtain structured data.
[0048] In a third aspect, an embodiment of the present application provides an electronic device, comprising: at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the method for extracting geometric dimension data of electronic components as described in the first aspect and various possible designs of the first aspect.
[0049] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the method for extracting geometric dimension data of electronic components as described in the first aspect and various possible designs of the first aspect is implemented.
[0050] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, it implements the method for extracting geometric dimension data of electronic components as described in the first aspect and various possible designs of the first aspect.
[0051] The electronic component geometric dimension data extraction method, device, equipment and storage medium provided by the present application are aimed at the field of electronic design, and are specifically used to automatically extract dimension data information from the electronic component PDF format data manual, providing useful technical support for the application fields such as the automatic creation of three-dimensional models of electronic components, computer-aided electronic design automation or virtual reality technology. The present application only specifically parses and processes the dimension data related content in the PDF format data manual, and through rapid positioning and local analysis, the processing speed is faster and more efficient. At the same time, according to the electronic characteristics of the electronic components, a data structure for storing electronic component dimension data is proposed, which is used to associate dimension data and vector graphics, including the first-level elements such as the body, pins, bounding box, marking, and meta information. The extracted dimension data is stored in the body, pins and bounding box as secondary elements. This structured data is conducive to the automation of subsequent programs. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0053] Figure 1 A flow chart of a method for extracting geometric dimension data of electronic components provided in an embodiment of the present application;
[0054] Figure 2 A flowchart for obtaining a PDF format data sheet of an electronic component provided in an embodiment of the present application;
[0055] Figure 3 A flow chart of dimension view positioning provided for an embodiment of the present application;
[0056] Figure 4 A size style determination flow chart provided for an embodiment of the present application;
[0057] Figure 5 Schematic diagram of the definition of the XYZ coordinate axes provided in an embodiment of the present application, wherein: (a) represents a front view, and (b) represents a top view.
[0058] Figure 6 A schematic diagram of a data structure for storing electronic component size data provided by an embodiment of the present application;
[0059] Figure 7 Another flow chart of the method for extracting geometric dimension data of electronic components provided in an embodiment of the present application;
[0060] Figure 8 A flowchart for obtaining a manual provided in an embodiment of the present application;
[0061] Fig. 9 A flow chart of view positioning provided in an embodiment of the present application;
[0062] Fig.10 A flowchart of extracting dimension view data provided by an embodiment of the present application;
[0063] Fig.11 A schematic diagram of the structure of an electronic component geometric dimension data extraction device provided in an embodiment of the present application;
[0064] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0065] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0067] In the technical solution of this application, the collection, storage, use, processing, transmission, provision and disclosure of information such as financial data or user data involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good morals.
[0068] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0069] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0070] Nowadays, the PDF format data sheet of electronic components is an unstructured file format. Existing technologies, whether extracting text from PDF documents or extracting tables from PDF documents, or their combination, cannot automatically extract dimensional data from electronic component data sheets. Even through keyword search, in some cases, limited dimensional information such as "length", "width", and "height" is obtained, but it cannot be associated with the geometric shape of the electronic component, let alone the number, spacing, distribution, and other electrical characteristics of the electronic component pins.
[0071] In response to the above problems, this application proposes a method, device, equipment and storage medium for extracting geometric dimension data of electronic components, which are specifically designed to automatically extract dimension data information from the PDF format data manual of electronic components, providing beneficial technical support for application fields such as automated creation of three-dimensional models of electronic components, computer-aided electronic design automation or virtual reality technology.
[0072] An embodiment of the present application provides a method for extracting geometric dimension data of an electronic component. Figure 1 Flow chart of the method for extracting geometric dimension data of electronic components provided in the embodiment of the present application. Figure 1 As shown, the electronic component geometric size data extraction method can be implemented based on an electronic terminal, and the electronic component geometric size data extraction method includes:
[0073] S101. Obtain a PDF format data sheet of an electronic component.
[0074] In some embodiments, Figure 2 The following is a flowchart for obtaining the PDF format data sheet of the electronic components provided in the embodiment of the present application. Figure 2 As shown, S101 specifically includes the following steps:
[0075] S201. Respond to input data.
[0076] S202: When the data is in a PDF format document, extract the text and obtain the manufacturer model, package or link information of the electronic component by keyword search, and use the input data as the PDF format data manual of the electronic component.
[0077] S203. When the format of the data is a character string, determine a link address according to the character string, obtain a link page based on the link address, obtain a PDF format data manual and meta-information of the electronic component from the link page, and when a preview image of the electronic component exists on the link page, obtain a preview image of the electronic component.
[0078] Among them, determining the link address according to the character string includes: judging whether the character string is a link address based on regular expression matching, and if the character string is not a link address, adding set keywords to the character string to obtain a search semantic feature, and based on the search semantic feature, searching through a search engine to determine the link address of the electronic component.
[0079] S102: Positioning the dimension view of the electronic component based on the dimension features extracted from the PDF format data manual.
[0080] In some embodiments, Figure 3 This is a flowchart of the size view positioning provided in the embodiment of the present application. S102 specifically includes the following steps:
[0081] S301 . When at least three size features are acquired, determine positioning data of a size view according to the at least three size features.
[0082] S302: When the number of acquired size features is less than three, extract text data from the PDF format data manual, and determine the location data of the size view by searching keywords based on the text data.
[0083] S303 . When the positioning data of the size view is not determined, based on the meta information of the electronic component, extract the type and packaging characteristics of the electronic component, and extract result data from the built-in database according to the type and packaging characteristics of the electronic component.
[0084] S103. Based on the positioning data of the dimension view, extract the dimension view page data from the PDF format data manual, obtain the vector graphics according to the dimension view page data, scale the vector graphics according to the dimension data in the dimension feature to obtain full-scale dimension graphic data, identify the characteristic elements based on the full-scale dimension graphic data, the characteristic elements include at least one of the main body part graphic, the pin part graphic and the mark, based on the main body part graphic, extract the dimension data and graphic image of the main body; based on the pin part graphic, extract the number of pins, take the distribution matrix of the center points connecting each pin and the main body image as the pin distribution matrix, use the pin distribution matrix to determine the dimension data and graphic data of the pins, calculate the dimension data of the bounding box according to the dimension data and graphic data of the main body and the pins, and determine the image data and coordinates / size of the mark based on the mark.
[0085] It should be noted that in a dimension graphic data, the characteristic element mark does not necessarily exist. In the case of no mark, the identified characteristic element does not include the mark. In electronic components, the other two characteristic elements, namely the body and the pins, generally exist, so the extracted characteristic elements usually include the body and the pins.
[0086] In some embodiments, Figure 4 The size style judgment flow chart provided in the embodiment of the present application is as follows: Figure 4 As shown, after positioning the dimension view of the electronic component based on the dimension features extracted from the PDF format data manual, the method further includes the following steps:
[0087] S401. When the dimension data of the dimension feature includes letters and / or diagrams, mark the dimension view corresponding to the dimension feature as a first style.
[0088] S402: When the dimension data of the dimension feature does not include letters and / or diagrams, mark the dimension view corresponding to the dimension feature as a second style.
[0089] In this embodiment, based on the dimension view marked as the first style, the dimension data and graphic data of the main body, the dimension data and graphic data of the pins, the image data and coordinates / sizes of the mark, and the dimension data of the bounding box determined in step S103 above are matched with the size of the chart characters and stored in the setting data structure. Based on the dimension view marked as the second style, the dimension data and graphic data of the main body, the dimension data and graphic data of the pins, the image data and coordinates / sizes of the mark, and the dimension data of the bounding box determined in step S103 above are directly stored in the setting data structure.
[0090] In some embodiments, the pin distribution matrix is represented as;
[0091]
[0092] where x i ,y i ,z i ,θ i They respectively refer to the coordinates of the center point of the cross section where the pin contacts the body and the rotation angle of the pin when the i-th pin takes the center of the component body as the coordinate origin, where i∈[1,n] is a positive integer and n represents the number of pins.
[0093] The number of rows in this 4×n matrix represents the number of pins of the electronic component. When defining the XYZ coordinate axis, the top view in the dimension view that can most completely display all the pins is usually the XY plane view. It is usually the top view with the largest area occupied by the dimension elements in the dimension view. After defining the XY plane, select the view corresponding to the main view in the dimension view, and use its lowest point as the origin of the Z coordinate. For example, Figure 5 A schematic diagram of the XYZ coordinate axis definition provided in an embodiment of the present application.
[0094] S104, storing the dimension data and graphic data of the main body, the dimension data and graphic data of the pins, the image data and coordinates / dimensions of the mark, and the dimension data of the boundary box in a set data structure to obtain structured data.
[0095] In this embodiment, the set data structure is composed of multiple first elements, the first elements include a body, a pin, a bounding box, a tag and meta-information, and the extracted size data and graphic data of the body, the size data and graphic data of the pin, the image data and coordinates / size of the tag, the size data of the bounding box, and the manufacturer model, packaging or link information of the electronic component are respectively stored in the set data structure as secondary elements of the body, pin, bounding box, tag and meta-information to obtain structured data.
[0096] Figure 6 A schematic diagram of a data structure for storing electronic component size data provided in an embodiment of the present application, such as Figure 6 As shown, this embodiment provides an exemplary setting data structure, which includes multiple first-level elements, namely body, pin, bounding box, tag and meta information, each first-level element includes a second-level element, and the corresponding data extracted in step S103 above is stored in the second-level element, so that structured data is obtained, and structured data is conducive to automated operation. Among them, the second-level elements included in each first-level element and their explanations are as follows:
[0097] The second-level elements included in the first-level element body are:
[0098] Dimension data: If the image data is a vector graphic, the value of the dimension data is consistent with it, and the size of the vector graphic is based on the actual size value extracted from the data manual. Otherwise, the dimension text data obtained by OCR recognition in the scalar graphic in the data manual is stored, including the value, dimension line direction and text coordinates.
[0099] Graphics data: preferably, the vector graphics data after the main part is converted is stored. If the conversion fails, the scalar graphics in the mechanical view are intercepted and stored separately.
[0100] Material color (optional): If the data sheet contains colored electronic component images, locate and select the RGB color of the main part of the electronic component, otherwise assign a default main color according to the electronic component type or leave it blank. For example: the main body of the integrated chip is RGB (5,5,5), the main body of the chip resistor is RGB (25,25,25), the main body of the chip capacitor is RGB (245,135,25), the main body of the chip inductor is RGB (70,65,85), etc.
[0101] The secondary elements included in the primary element pin are:
[0102] Quantity: Number of pins, a positive integer.
[0103] Distribution matrix: The distribution coordinate matrix of the pins.
[0104] Dimension data: If the image data is a vector graphic, the value of the dimension data is consistent with it, and the size of the vector graphic is based on the actual size value extracted from the data manual. Otherwise, the dimension text data obtained by OCR recognition in the scalar graphic in the data manual is stored, including the value, dimension line direction and text coordinates.
[0105] Graphic data: preferably store the converted vector graphics data of a single pin portion. If the conversion fails, each scalar graphics in the mechanical view is intercepted and stored separately.
[0106] Material color (optional): If the data sheet contains colored images of electronic components, locate and select the RGB color of the electronic component pins. Otherwise, the default color of the pins is silver RGB (195,195,195). This value is optional and can be empty.
[0107] The second-level elements included in the first-level element bounding box are:
[0108] Dimensional data: length, width, and height of the bounding box.
[0109] First-level element tag (optional). If it does not exist in the data manual or the extraction fails, it can be empty. The second-level elements included are:
[0110] Coordinates / Size: The coordinates of the marker and the length and width of the area it occupies.
[0111] Text (optional): If the tag can be converted to text, the text content is stored directly, otherwise the graphic data of the tag is stored. This is empty.
[0112] Graphic data: It is preferred to store the converted vector graphics data of a single pin part. If the conversion fails, the scalar graphics of the marked area are stored.
[0113] The second-level elements included in the first-level element meta-information are:
[0114] Link information (optional): If the input data is a link address, the electronic component link information is stored. If the input data is a PDF format data sheet of the electronic component, the link information is empty.
[0115] Manufacturer model: The manufacturer model of the electronic component, extracted from the link information or the electronic component PDF format data sheet.
[0116] Package: The package information of the electronic component, extracted from the linked information or the electronic component PDF format data sheet.
[0117] It should be noted that the "optional" in the above brackets means that the corresponding element is not necessary and can be empty, and is filled in according to the actual component geometry data extraction situation.
[0118] Figure 7 Another flow chart of the method for extracting geometric dimension data of electronic components provided in the embodiment of the present application. The embodiment of the present application provides a method for extracting geometric dimension data of electronic components, such as Figure 7 As shown, the method comprises the following steps:
[0119] Step S10: Obtain a PDF format data sheet of the target electronic component.
[0120] Figure 8 The manual acquisition flow chart provided in the embodiment of this application is as follows: Figure 8As shown, in step S10, if the input is a file, it is determined whether it is a PDF format document. If it is, it is necessary to extract the text and obtain the meta information data of the electronic component by keyword search. The PDF document is used as the final input file for the next step; otherwise, it returns failure and the method ends. If the input is a string, firstly, a regular expression is used to match whether it is a link address. If it is, the link address is accessed through the built-in search engine, the data sheet file link and the electronic component meta information data are extracted from the page, and the PDF format data sheet is cached and downloaded as the final input. If there is a preview image of the electronic component on the link page, the image data of the electronic component is cached at the same time for use in the subsequent processing steps; if the input string is other keywords, the "Datasheet" keyword is automatically added, and the access link address of the electronic component is found and extracted through the built-in search engine, and the previous processing steps of the input as the link address are repeated.
[0121] Step S20: Dimension view positioning.
[0122] Fig. 9 The view positioning flow chart provided in the embodiment of the present application is as follows: Fig. 9 As shown, in step S20, the size feature matching is performed first, and if three or more size features are successfully obtained, it indicates that the input electronic manual PDF format document contains the size view and the positioning is successful. Otherwise, the input PDF format document is subjected to text extraction, and the positioning is attempted by searching Chinese and English keywords, and the positioning result is returned for subsequent processing. For some special electronic components, the data manual may not contain the size view. If the positioning fails, it is necessary to extract the electronic component type and the meta information of the package from the metadata of the electronic component, and then search and extract the result from the built-in database. As long as the positioning fails, the method of the present invention ends the processing and directly returns the result data stored in the built-in database. The so-called built-in database is a database specially provided by the present method, which is obtained by pre-extraction and storage of the size data of electronic components in standard packages, and incremental storage of the size data of electronic components successfully processed by the present method, and is stored in the data structure of the electronic component size data specially provided by the present method.
[0123] It should be noted that the dimensional features include H-shaped dimension markings, symmetrical dimension arrows, dimension data / letters and other elements.
[0124] Step S30: size and style determination.
[0125] Since some electronic components share a data sheet in the form of a series, the dimension data in the dimension feature is provided in the form of letters and tables. Dimension style judgment is mainly used to process the data sheets of such electronic components. If the dimension data in the dimension feature is letters, and there is a dimension table immediately following it, then after the dimension view data extraction in step S40 is completed, it is necessary to additionally perform chart character size matching, otherwise directly proceed to step S50 dimension data storage.
[0126] Step S40: Extracting dimension view data.
[0127] Fig.10 The dimension view data extraction flow chart provided in the embodiment of the present application is as follows: Fig.10 As shown, in step S40, after successfully locating the size view position in step S20, the size view page data of the corresponding position in the data manual is obtained. Prioritize the attempt to extract vector data. If the extraction fails, it indicates that the page view size graphic is a scalar graphic, and the scalar graphic needs to be converted into a vector graphic. After obtaining the vector graphic, according to the size style judgment result of step S30, it is determined whether the chart character size needs to be matched, and then the size graphic is uniformly scaled according to the size data to obtain the full-scale size graphic data. Then, the main body, pins and marks are identified, and it is determined whether there is a mark inside the main image area. If so, the graphic data and coordinate / size data of the mark are extracted; the graphics of the main body part are identified, and the size data and graphics of the main body part are extracted and associated; the graphics of the pin part are identified, and the number of pins is extracted. The size data of a single pin is associated with the graphics by the distribution matrix of the center point connected to each pin and the main body. Finally, the size data of the bounding box is calculated based on the size data and graphic data of the main body and pins.
[0128] Step S50: Dimensional data storage. Before the dimension data is stored, if the appearance image data of the electronic component is successfully cached in step S10, or the appearance image data exists in the data manual document, the material color data of the main body and the pin part are obtained respectively. After the dimension data of the electronic component is successfully obtained, it is stored in the built-in database according to the specific data structure provided by the method.
[0129] The electronic component geometric dimension data extraction method provided in the embodiment of the present application can be applied in the following fields, including but not limited to:
[0130] 1) Automated creation of 3D models: This application can potentially be applied to the automated creation workflow of 3D models of electronic components. Automatically extracting component geometry data from electronic component PDF data sheets and using specific 3D modeling tools for electronic components is the precondition for the automated creation of 3D models of electronic components in the future.
[0131] 2) Electronic Design Automation (EDA): This application can help electronic engineers automatically extract component geometry data from electronic component PDF data sheets and apply it to electronic design automation tools. For example, if a certain electronic component lacks a 3D model, it can assist in setting its spatial layout and volume for interference checking of layout and wiring and mechanical assembly. This will greatly improve the efficiency of electronic design, reduce manual errors, and speed up the product development cycle.
[0132] 3) Virtual reality and augmented reality: This application can help more accurately simulate the geometric dimensions of electronic components in virtual reality and augmented reality technologies. By automatically extracting component geometric dimension data, images and animations of electronic components can be better rendered, thereby improving the realism and credibility of virtual reality and augmented reality.
[0133] Fig.11 The present invention also provides a device for extracting geometrical dimension data of electronic components. Fig.11 As shown, the electronic component geometric dimension data extraction device comprises:
[0134] The data acquisition module 1101 is configured to acquire a PDF format data sheet of an electronic component;
[0135] A view positioning module 1102 is configured to position the dimension view of the electronic component based on the dimension features extracted from the PDF format data manual;
[0136] The data extraction module 1103 is configured to extract the dimension view page data from the PDF format data manual based on the positioning data of the dimension view, obtain the vector graphics according to the dimension view page data, scale the vector graphics according to the dimension data in the dimension feature to obtain the full-scale dimension graphic data, identify the characteristic elements based on the full-scale dimension graphic data, the characteristic elements include at least one of the main body part graphics, the pin part graphics and the mark, extract the dimension data and graphic image of the main body based on the main body part graphics; extract the number of pins based on the pin part graphics, use the distribution matrix of the center points connecting each pin and the main body part image as the pin distribution matrix, determine the dimension data and graphic data of the pins using the pin distribution matrix, calculate the dimension data of the bounding box based on the dimension data and graphic data of the main body and the pins, and determine the image data and coordinates / size of the mark based on the mark;
[0137] The data storage module 1104 is configured to store the dimension data and graphic data of the body, the dimension data and graphic data of the pins, the image data and coordinates / dimensions of the mark, and the dimension data of the bounding box in a set data structure to obtain structured data.
[0138] In some embodiments, the data acquisition module is further configured to: respond to input data: when the format of the data is a PDF format document, extract text and obtain the manufacturer model, packaging or link information of the electronic component by keyword search, and use the input data as the PDF format data manual of the electronic component; when the format of the data is a string, determine the link address according to the string, obtain the link page based on the link address, obtain the PDF format data manual and meta information of the electronic component from the link page, and when there is a preview image of the electronic component on the link page, obtain the preview image of the electronic component; determine the link address according to the string, including: judging whether the string is a link address based on regular expression matching, and when the string is not a link address, adding set keywords to the string to obtain search semantic features, and based on the search semantic features, searching through a search engine to determine the link address of the electronic component.
[0139] In some embodiments, the set data structure is composed of multiple first elements, the first elements including a body, a pin, a bounding box, a tag and meta-information, and the extracted size data and graphic data of the body, size data and graphic data of the pin, image data and coordinates / size of the tag, size data of the bounding box, and manufacturer model, packaging or link information of the electronic component are respectively stored in the set data structure as secondary elements of the body, pin, bounding box, tag and meta-information to obtain structured data.
[0140] In some embodiments, the view positioning module is further configured to: when at least three dimensional features are acquired, determine the positioning data of the dimensional view according to the at least three dimensional features; when the acquired dimensional features are less than three, extract text data from the PDF format data manual, and determine the positioning data of the dimensional view by searching keywords based on the text data; when the positioning data of the dimensional view is not determined, extract the electronic component type and packaging features based on the meta-information of the electronic component, and extract the result data from the built-in database according to the electronic component type and packaging features.
[0141] In some embodiments, the device also includes a style judgment module, which is configured to mark the dimension view corresponding to the dimension feature as a first style when the dimension data of the dimension feature contains letters and / or charts; and mark the dimension view corresponding to the dimension feature as a second style when the dimension data of the dimension feature does not contain letters and / or charts; the data extraction module is further configured to store the determined dimension data and graphic data of the main body, the dimension data and graphic data of the pin, the marked image data and coordinates / sizes, and the dimension data of the bounding box in a set data structure after matching them with the chart character size based on the dimension view marked as the first style; and directly store the determined dimension data and graphic data of the main body, the dimension data and graphic data of the pin, the marked image data and coordinates / sizes, and the dimension data of the bounding box in the set data structure based on the dimension view marked as the second style.
[0142] In some embodiments, the pin distribution matrix is represented as;
[0143]
[0144] where x i ,y i ,z i ,θ i They respectively refer to the coordinates of the center point of the cross section where the pin contacts the body and the rotation angle of the pin when the i-th pin takes the center of the component body as the coordinate origin, where i∈[1,n] is a positive integer and n represents the number of pins.
[0145] The electronic component geometric dimension data extraction device provided in the embodiment of the present application can be used to execute the technical solution of the electronic component geometric dimension data extraction method in the above embodiment. Its implementation principle and technical effect are similar and will not be repeated here.
[0146] Fig.12 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Fig.12 As shown, the electronic device may include: a processor 121 and a memory 122 , wherein the processor 121 and the memory 122 may communicate with each other; illustratively, the processor 121 and the memory 122 communicate with each other via a communication bus 123 .
[0147] The processor 121 executes the computer execution instructions stored in the memory 122, so that the processor 121 executes the scheme in the above embodiment. The processor 121 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.
[0148] The communication bus 123 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM) and may also include non-volatile memory.
[0149] The electronic device provided in the embodiment of the present application may be the terminal device of the above embodiment.
[0150] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the method for extracting geometric dimension data of electronic components in the above embodiment.
[0151] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, it can implement the technical solution of the method for extracting geometric dimension data of electronic components in the above embodiment.
[0152] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0153] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to implement the solution of this embodiment.
[0154] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The above-mentioned module-composed unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
[0155] The above-mentioned integrated module implemented in the form of a software function module can be stored in a computer-readable storage medium. The above-mentioned software function module is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the methods of various embodiments of the present application.
[0156] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
[0157] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a USB flash drive, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.
[0158] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0159] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0160] An exemplary storage medium is coupled to a processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in an electronic control unit or a main control device.
[0161] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0162] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for extracting geometric dimension data of electronic components, characterized in that: include: Get data sheets of electronic components in PDF format; Positioning the dimension view of the electronic component based on the dimension features extracted from the PDF format data book; Based on the positioning data of the dimension view, the dimension view page data is extracted from the PDF format data manual, and the vector graphics are obtained according to the dimension view page data. The vector graphics are scaled according to the dimension data in the dimension feature to obtain full-scale dimension graphic data. Based on the full-scale dimension graphic data, characteristic elements are identified, and the characteristic elements include at least one of a main body part graphic, a pin part graphic and a mark. Based on the main body part graphic, the dimension data and graphic image of the main body are extracted; based on the pin part graphic, the number of pins is extracted, and the distribution matrix of the center points connecting each pin and the main body part image is used as the pin distribution matrix, and the dimension data and graphic data of the pins are determined by using the pin distribution matrix. According to the dimension data and graphic data of the main body and the pins, the dimension data of the bounding box is calculated, and based on the mark, the image data and coordinates / size of the mark are determined; The dimension data and graphic data of the main body, the dimension data and graphic data of the pins, the image data and coordinates / dimensions of the marks, and the dimension data of the bounding box are stored in a set data structure to obtain structured data.
2. The method according to claim 1, characterized in that Get data sheets for electronic components in PDF format, including: In response to the input data: In the case where the data is in a PDF format document, extracting text and obtaining the manufacturer model, package or link information of the electronic component by keyword search, and using the input data as a PDF format data sheet of the electronic component; In the case where the format of the data is a character string, determining a link address according to the character string, acquiring a link page based on the link address, acquiring a PDF format data manual and meta information of the electronic component from the link page, and acquiring a preview image of the electronic component if a preview image of the electronic component exists on the link page; Determining the link address according to the character string includes: Based on regular expression matching, it is determined whether the string is a link address. If the string is not a link address, a set keyword is added to the string to obtain a search semantic feature. Based on the search semantic feature, a search engine is used to search to determine the link address of the electronic component.
3. The method according to claim 2, characterized in that The set data structure is composed of multiple first elements, which include a body, a pin, a bounding box, a tag and meta-information. The extracted size data and graphic data of the body, the size data and graphic data of the pin, the image data and coordinates / size of the tag, the size data of the bounding box, and the manufacturer model, packaging or link information of the electronic component are respectively stored in the set data structure as secondary elements of the body, pin, bounding box, tag and meta-information to obtain structured data.
4. The method according to claim 1, characterized in that Positioning the dimension view of the electronic component based on the dimension features extracted from the PDF format data sheet includes: When at least three size features are acquired, determining positioning data of the size view according to the at least three size features; When the acquired size features are less than three, extracting text data from the PDF format data manual, and determining the location data of the size view by searching keywords based on the text data; In the case where the positioning data of the dimension view is not determined, the type and packaging characteristics of the electronic component are extracted based on the meta information of the electronic component, and the result data is extracted from the built-in database according to the type and packaging characteristics of the electronic component.
5. The method according to claim 1, characterized in that After positioning the dimension view of the electronic component based on the dimension features extracted from the PDF format data manual, the method further includes: In the case where the dimension data of the dimension feature includes letters and / or diagrams, marking the dimension view corresponding to the dimension feature as a first style; In the case where the dimension data of the dimension feature does not include letters and / or diagrams, marking the dimension view corresponding to the dimension feature as a second style; Based on the dimension view marked as the first style, the determined dimension data and graphic data of the body, the dimension data and graphic data of the pins, the image data and coordinates / dimensions of the marking, and the dimension data of the bounding box are matched with the diagram character size and stored in the set data structure; Based on the dimension view marked as the second style, the determined dimension data and graphic data of the body, the dimension data and graphic data of the pins, the image data and coordinates / sizes of the marking, and the dimension data of the bounding box are directly stored in the setting data structure.
6. The method according to claim 1, characterized in that The pin distribution matrix is expressed as: where x i ,y i ,z i ,θ i They respectively refer to the coordinates of the center point of the cross section where the pin contacts the body and the rotation angle of the pin when the i-th pin takes the center of the component body as the coordinate origin, where i∈[1,n] is a positive integer and n represents the number of pins.
7. An electronic component geometric dimension data extraction device, characterized in that: include: A data acquisition module is configured to acquire a PDF format data sheet of the electronic component; A view positioning module, configured to position the dimension view of the electronic component based on the dimension features extracted from the PDF format data manual; The data extraction module is configured to extract the dimension view page data from the PDF format data manual based on the positioning data of the dimension view, obtain the vector graphics according to the dimension view page data, scale the vector graphics according to the dimension data in the dimension feature to obtain the full-scale dimension graphic data, identify the characteristic elements based on the full-scale dimension graphic data, the characteristic elements include at least one of the main body part graphics, the pin part graphics and the mark, extract the dimension data and graphic image of the main body based on the main body part graphics; extract the number of pins based on the pin part graphics, use the distribution matrix of the center points connecting each pin and the main body part image as the pin distribution matrix, determine the dimension data and graphic data of the pins using the pin distribution matrix, calculate the dimension data of the bounding box based on the dimension data and graphic data of the main body and the pins, and determine the image data and coordinates / size of the mark based on the mark; The data storage module is configured to store the dimension data and graphic data of the main body, the dimension data and graphic data of the pins, the image data and coordinates / dimensions of the mark, and the dimension data of the boundary box in a set data structure to obtain structured data.
8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.
