Encapsulation file determination method and device, electronic equipment and storage medium

By automating the association process of symbols and packaging, the problem of manually changing symbol names and packaging in KiCad design is solved, improving design efficiency, reducing errors and reducing costs.

CN120407520APending Publication Date: 2025-08-01粤港澳大湾区(广东)国创中心

Patent Information

Application Number
CN202510367259.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

When designing circuit boards with KiCad, the prior art requires manual changes to symbol names and associated packaging, resulting in inefficiency and error-prone, resulting in waste of manpower, material resources and financial resources.

Method used

By obtaining element information in the symbol file, the association relationship between component symbols and packaging types is automatically determined, and the encapsulation file is automatically determined, including the automated association process between symbols and packaging, reducing human errors.

Benefits of technology

Improves PCB design efficiency, reduces human errors, reduces design costs, simplifies user operations and ensures the accuracy and completeness of information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120407520A_ABST
    Figure CN120407520A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an encapsulation file determination method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining a symbol file, and reading element information used for expressing component symbols from the symbol file; determining a first association relationship between the component symbol and packaging type information based on the element information, and determining a target packaging type for the component symbol through the first association relationship; and determining that a packaging file for the component symbol forms an automatic symbol and packaging association process according to the target packaging type. The information is obtained by reading the symbol file, then the appropriate packaging type is determined according to the preset incidence relation, and finally the packaging file corresponding to the component symbol is found. According to the method, the association between the symbol and the package is automatically processed by using the program, so that the PCB design efficiency is remarkably improved, human errors are reduced, and the design cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of encapsulation file determination, and in particular, to a method for determining an encapsulation file, a device for determining an encapsulation file, an electronic device, and a computer-readable storage medium. Background Art

[0002] With the progress of technology, PCB circuit board design has fully shifted to EDA software modeling. KiCad, as a free and open-source PCB design EDA software, is powerful and can almost meet the needs of various projects.

[0003] However, when using KiCad to design circuit boards currently, there are some efficiency problems. After completing independent modeling, when drawing a schematic diagram, it is still necessary to manually change the symbol names and associate the corresponding packages for subsequent PCB layout. This completely manual operation method is not only time-consuming, but also extremely prone to omitting settings or making mistakes, resulting in a waste of a large amount of manpower, material resources, and financial resources. Therefore, it is urgent to optimize the design process of KiCad to improve efficiency and reduce human errors. Summary of the Invention

[0004] Embodiments of the present invention provide a method, a device, an electronic device, and a computer-readable storage medium for determining an encapsulation file to overcome or at least partially solve the above problems.

[0005] Embodiments of the present invention disclose a method for determining an encapsulation file, including:

[0006] Obtain a symbol file, and read element information for expressing component symbols from the symbol file;

[0007] Determine a first association relationship between the component symbol and encapsulation type information based on the element information, and determine a target encapsulation type for the component symbol through the first association relationship;

[0008] Determine an encapsulation file for the component symbol through the target encapsulation type.

[0009] Optionally, it further includes:

[0010] Determine a second association relationship between the encapsulation file and 3D model type information;

[0011] Determine target model information for the encapsulation file through the second association relationship;

[0012] Determine a target model for the encapsulation file through the target model information.

[0013] Optionally, the step of reading element information for expressing component symbols from the symbol file includes:

[0014] Read the first element sub - information for expressing the component symbol from the symbol file based on the method of lexical analysis and syntactic analysis;

[0015] Read the second element sub - information for expressing the component symbol from the symbol file based on the method of regular expression matching;

[0016] Read the third element sub - information for expressing the component symbol from the symbol file based on the pre - built parsing library for the symbol file;

[0017] Use the first element sub - information, and / or, the second element sub - information, and / or, the third element sub - information to determine the element information.

[0018] Optionally, the step of reading the first element sub - information for expressing the component symbol from the symbol file based on the method of lexical analysis and syntactic analysis includes:

[0019] Decompose the text stream of the symbol file into independent lexical units;

[0020] Determine the grammar rules of the symbol file, and organize the lexical units into an abstract syntax tree according to the grammar rules;

[0021] Traverse the abstract syntax tree and extract the first element sub - information for expressing the component symbol.

[0022] Optionally, the step of reading the second element sub - information for expressing the component symbol from the symbol file based on the method of regular expression matching includes:

[0023] Determine the target pattern of the second element sub - information in the symbol file;

[0024] Determine the regular expression corresponding to the target pattern;

[0025] Read the second element sub - information for expressing the component symbol from the symbol file based on the regular expression.

[0026] Optionally, the element information includes the attribute content of the component symbol, and the step of determining the target package type for the component symbol through the first association relationship includes:

[0027] Determine the symbol name information of the component symbol based on the attribute content;

[0028] Construct a relationship table for expressing the first mapping relationship between the symbol name information and the package type information based on the symbol name information and the first association relationship;

[0029] Determine the target package type for the component symbol through the relationship table;

[0030] The step of determining the target model information for the package file through the second association relationship includes:

[0031] Determine the package name information of the target package type;

[0032] Determine the second mapping relationship between the package name information and the 3D model type information, and add the second mapping relationship to the relationship table;

[0033] Determine the target model information for the package file through the relationship table.

[0034] Optionally, it further includes:

[0035] When the first association relationship, and / or, the second association relationship changes, update the relationship table based on the updated association relationship.

[0036] An embodiment of the present invention also discloses a device for determining a package file, including:

[0037] An element information reading module, configured to obtain a symbol file and read element information for expressing a component symbol from the symbol file;

[0038] A target package type determining module, configured to determine a first association relationship between the component symbol and the package type information based on the element information, and determine the target package type for the component symbol through the first association relationship;

[0039] A package file determining module, configured to determine a package file for the component symbol through the target package type.

[0040] An embodiment of the present invention also discloses an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus;

[0041] The memory is used to store a computer program;

[0042] When the processor is used to execute the program stored in the memory, it implements the method as described in the embodiment of the present invention.

[0043] An embodiment of the present invention also discloses a computer-readable storage medium, on which instructions are stored, and when executed by one or more processors, cause the processors to execute the method as described in the embodiment of the present invention.

[0044] The embodiments of the present invention include the following advantages:

[0045] In an embodiment of the present invention, by obtaining a symbol file and reading element information for expressing a component symbol from the symbol file; determining a first association relationship between the component symbol and package type information based on the element information, and determining a target package type for the component symbol through the first association relationship; determining a package file for the component symbol through the target package type constitutes an automated symbol and package association process. By reading the symbol file to obtain information, then determining a suitable package type according to a preset association relationship, and finally finding a package file corresponding to the component symbol. By automatically processing the association between symbols and packages using a program, the PCB design efficiency is significantly improved, human errors are reduced, and design costs are lowered. Description of the Drawings

[0046] Figure 1 is a flowchart of the steps of a method for determining a package file provided in an embodiment of the present invention;

[0047] Figure 2 is a schematic diagram of the process of a method for determining a package file provided in an embodiment of the present invention;

[0048] Figure 3 is a structural block diagram of a device for determining a package file provided in an embodiment of the present invention;

[0049] Figure 4 is a hardware structural block diagram of an electronic device provided in an embodiment of the present invention;

[0050] Figure 5 is a schematic diagram of a computer-readable medium provided in an embodiment of the present invention. Detailed Embodiments

[0051] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0052] EDA is the abbreviation of Electronic Design Automation, and its Chinese meaning is "Electronic Design Automation". Briefly speaking, EDA software is a series of computer software tools used to assist electronic engineers in designing, analyzing, verifying, and manufacturing electronic products (such as integrated circuits, printed circuit boards, etc.).

[0053] PCB circuit board, whose full name is Printed Circuit Board and Chinese name is printed circuit board. Simply put, a PCB circuit board is a board used to connect electronic components and provide electrical connections. It is like the "skeleton" of an electronic device, carrying various electronic components and connecting them through pre-designed circuit traces to form a complete circuit.

[0054] KiCad is an open-source EDA software suite that provides complete circuit design tools, including schematic capture, PCB layout, component library management, etc. KiCad is popular for its free and cross-platform features, especially in the open-source hardware community and small design teams. Its package format is its custom format.

[0055] In PCB (Printed Circuit Board) design, "component symbol, footprint, and 3D model" are three key and interrelated concepts used to describe and represent electronic components:

[0056] 1. Component Symbol:

[0057] Definition: A component symbol is a graphical representation used in a schematic diagram to abstractly express the functions and connection relationships of electronic components.

[0058] Function: It represents the electrical characteristics of components, such as resistors, capacitors, transistors, etc., and their connection methods. The schematic diagram is the blueprint of circuit design, and the symbols make the logical relationships of the circuit clear and easy to understand.

[0059] Characteristics: Symbols are usually standardized so that engineers can understand and identify different components. It does not directly reflect the physical size or pin arrangement of the component.

[0060] Example: The symbol of a resistor is usually a zigzag line, and the symbol of a capacitor is two parallel lines.

[0061] 2. Footprint:

[0062] Definition: A footprint is the physical layout on a PCB board for actually mounting electronic components. It defines the shape, size, and position of the pads of the component on the PCB.

[0063] Function: The footprint determines how the component is soldered onto the PCB, ensuring that the component can be correctly connected to the circuit.

[0064] Features: The package directly reflects the physical size and pin arrangement of the component. Common package types include SMD (Surface Mount Device) and Through-hole, etc.

[0065] For example: 0603, SOIC-8, DIP-16, etc. are all common package types, which describe the size and number of pins of the component.

[0066] 3. 3D Model:

[0067] Definition: A 3D model is a three-dimensional graphical representation of an electronic component.

[0068] Function: The 3D model is used to create a 3D view of the entire circuit board in PCB design software, which can help engineers check the physical gaps between components, height limits, and the fit with the enclosure.

[0069] Features: The 3D model provides a more intuitive visual effect, helps to discover potential mechanical interference problems, and generates a more realistic prototype diagram.

[0070] For example: The 3D model of a capacitor will show its actual shape, size, and pins.

[0071] Taking the EDA tool KiCAD as an example to draw a PCB circuit board, it mainly includes three parts: schematic diagram, PCB layout, and 3D display;

[0072] Symbols are individual files. The schematic diagram combines various symbols, makes connections, and forms the required circuit diagram.

[0073] Packages are individual files. The PCB editor arranges and connects various packages to assemble the PCB layout.

[0074] After setting the 3D model for each package in the drawn PCB layout, the digital prototype can be viewed physically through a 3D viewer.

[0075] The 3D model can be drawn separately using CAD tools and is not drawn in the EDA tool, but only imported for viewing.

[0076] Reference Figure 1 , which shows the flowchart of the steps of a method for determining a package file provided in an embodiment of the present invention, and specifically may include the following steps:

[0077] Step 101, obtain a symbol file, and read the element information for expressing the component symbol from the symbol file;

[0078] Step 102: Determine the first association relationship between the component symbol and the package type information based on the element information, and determine the target package type for the component symbol through the first association relationship.

[0079] Step 103: Determine the package file for the component symbol through the target package type.

[0080] In the embodiment of the present invention, a symbol file can be obtained, and the element information used to express the component symbol can be read from the symbol file to achieve obtaining the complete definition of the component symbol, laying a foundation for subsequent automatic association of packages. By reading the symbol file, various attributes and structure information of the symbol can be understood.

[0081] Symbol file: A file that stores component symbol information. In the KiCad environment, the symbol file is usually a.kicad_sym file.

[0082] Element information: Various components that make up the component symbol. Specifically, it can include:

[0083] Symbol attribute content: For example, text information such as the name, model, value, and reference designator of the component.

[0084] Symbol label text: For example, text information such as the name and function description of the pin.

[0085] Symbol pattern drawing: Graphic elements used to draw the appearance of the symbol, such as line segments, arcs, rectangles, etc.

[0086] Symbol pin definition: Define information such as the number, position, and electrical type of the pins of the symbol.

[0087] In the embodiment of the present invention, by obtaining the symbol file and reading the element information used to express the component symbol from the symbol file, the following beneficial effects can be achieved:

[0088] It provides a data basis for subsequent automated processing.

[0089] It avoids the cumbersome process of manually inputting or searching for symbol information.

[0090] It ensures the accuracy and integrity of the obtained information.

[0091] In the embodiment of the present invention, the first association relationship between the component symbol and the package type information can be determined based on the element information, and the target package type for the component symbol can be determined through the first association relationship to establish an automatic association between the component symbol and the package type, so that the user does not need to manually select the package.

[0092] First association relationship: It refers to the correspondence between the element information of the component symbol and the package type information. This association relationship can be predefined rules, configuration files, database query results, etc. For example, the corresponding package type can be determined according to specific attributes of the symbol (such as component type, package size).

[0093] Package type information: It refers to the relevant information describing the package type, such as package name, package size, pin arrangement, etc.

[0094] Target package type: It refers to the most suitable package type determined for the current component symbol according to the first association relationship.

[0095] Through the preset association rules, it can be ensured that the selected package type matches the electrical characteristics and physical dimensions of the symbol.

[0096] In the embodiment of the present invention, by determining the first association relationship between the component symbol and the package type information based on the element information, and determining the target package type for the component symbol through the first association relationship, the following beneficial effects are achieved:

[0097] The automatic association of symbols and packages is realized, greatly improving the design efficiency.

[0098] The possibility of manually selecting a mismatched package due to human error is reduced.

[0099] The user operation is simplified, and the learning cost is reduced.

[0100] In the embodiment of the present invention, the package file for the component symbol is determined through the target package type, so as to determine the target package file corresponding to the component symbol from multiple package files through the target package type, so as to significantly improve the PCB design efficiency, reduce human errors, and reduce the design cost by automatically processing the association between symbols and packages using a program.

[0101] Package file: It refers to a file storing component package information. In the KiCad environment, the package file is usually a.kicad_mod file.

[0102] In the embodiment of the present invention, by generating the package file for the component symbol through the target package type, the following beneficial effects are achieved:

[0103] By automatically processing the association between symbols and packages using a program, the PCB design efficiency is significantly improved, human errors are reduced, and the design cost is reduced.

[0104] It is ensured that the generated package file is consistent with the target package type.

[0105] Reduces the workload of users manually creating or editing packages.

[0106] In an embodiment of the present invention, by obtaining a symbol file and reading element information for expressing component symbols from the symbol file; determining a first association relationship between the component symbol and the package type information based on the element information, and determining a target package type for the component symbol through the first association relationship; determining a package file for the component symbol through the target package type constitutes an automated symbol and package association process. Information is obtained by reading the symbol file, and then the appropriate package type is determined according to the preset association relationship, and finally the package file corresponding to the component symbol is found. By automatically processing the association between symbols and packages using a program, the PCB design efficiency is significantly improved, human errors are reduced, and the design cost is lowered.

[0107] Based on the above embodiments, variant embodiments of the above embodiments are proposed. Here, it should be noted that for the sake of brevity of description, only the differences from the above embodiments are described in the variant embodiments.

[0108] In practical applications, with the development of technology, PCB circuit board design is almost entirely modeled by EDA software. KiCad is a free and open-source PCB design EDA software that provides almost all the functions required for any project.

[0109] Currently, after separately modeling symbols, footprints, and 3D models, when using KiCad to draw a schematic diagram, the symbol name needs to be changed and the corresponding package needs to be set for the drawing of the PCB board diagram; after the schematic diagram is completed, when drawing the PCB board diagram, the corresponding 3D model also needs to be set for each package for the generation of the 3D digital prototype diagram. All current changes and settings need to be manually completed by humans. This process is time-consuming and extremely prone to missed settings and errors, causing great losses in manpower, material resources, and financial resources.

[0110] In an optional embodiment of the present invention, the following steps may further be included:

[0111] Step 201, determining a second association relationship between the package file and the 3D model type information;

[0112] Step 202, determining target model information for the package file through the second association relationship;

[0113] Step 203, determining a target model for the package file through the target model information.

[0114] In the embodiments of the present invention, the second association relationship between the encapsulated file and the 3D model type information can be determined to establish an automatic association between the encapsulated file and its corresponding 3D model, so that the user does not need to manually specify the 3D model. Through the preset association rules, it can be ensured that the selected 3D model matches the physical size and shape of the encapsulation.

[0115] 3D model type information: Refers to the relevant information describing the 3D model, such as the path, file name, format (such as STEP, STL) of the model file, etc. It may also contain some descriptive information, such as the source of the model, the creator, etc.

[0116] Second association relationship: Refers to the corresponding relationship between the encapsulated file and the 3D model type information. This association relationship can be predefined rules, configuration files, database query results, etc. For example, the corresponding 3D model can be determined according to the name or type of the encapsulation.

[0117] In the embodiments of the present invention, by determining the second association relationship between the encapsulated file and the 3D model type information, the following beneficial effects can be achieved:

[0118] The automatic association between the encapsulation and the 3D model is realized, greatly improving the design efficiency.

[0119] The possibility of artificially selecting a mismatched 3D model due to human error is reduced.

[0120] The user operation is simplified, and the learning cost is reduced.

[0121] It lays a foundation for the subsequent automatic generation of 3D digital prototypes.

[0122] In the embodiments of the present invention, the target model information for the encapsulated file is determined through the second association relationship; the purpose of this step is to find the specific 3D model information corresponding to the current encapsulated file according to the second association relationship established above.

[0123] Target model information: Refers to the most suitable 3D model information determined for the current encapsulated file according to the second association relationship, including the path, file name, etc. of the model file.

[0124] In the embodiments of the present invention, by determining the target model information for the encapsulated file through the second association relationship, the following beneficial effects can be achieved:

[0125] The 3D model information that matches the encapsulation is accurately found.

[0126] It provides clear guidance for the subsequent determination of the 3D model.

[0127] The process of manually searching for and selecting 3D model files is avoided.

[0128] In the embodiments of the present invention, the target model for the encapsulated file can be determined through the target model information, so that the target model corresponding to the encapsulated file can be determined through the determined target model information, so as to automatically load or reference the corresponding 3D model in the PCB design software, thereby associating the 3D model with the encapsulation. This enables the user to view the PCB board with the 3D model in the software and generate a 3D digital prototype.

[0129] Target model information: Information such as the model file path and file name determined in step 202.

[0130] Target model: Refers to the actual 3D model loaded or referenced according to the target model information.

[0131] Determining the target model for the encapsulated file through the target model information can achieve the following beneficial effects:

[0132] Realize the visual association between the encapsulation and the 3D model.

[0133] Facilitate operations such as mechanical interference checking and dimensional evaluation for the user.

[0134] Provide a basis for generating a more realistic 3D digital prototype and help detect design problems at an early stage.

[0135] In the embodiments of the present invention, by determining the second association relationship between the encapsulated file and the 3D model type information; determining the target model information for the encapsulated file through the second association relationship; and determining the target model for the encapsulated file through the target model information, an automated encapsulation and 3D model association process is formed. By establishing the association relationship between the encapsulated file and the 3D model information, determining the target model information, and finally determining the target model. By automatically processing the association between the encapsulation and the 3D model using a program, the PCB design efficiency is significantly improved, human errors are reduced, and support is provided for generating high-quality 3D digital prototypes.

[0136] In an optional embodiment of the present invention, the step of reading the element information for expressing the component symbol from the symbol file includes:

[0137] Reading the first element sub-information for expressing the component symbol from the symbol file based on the method of lexical analysis and syntactic analysis;

[0138] Reading the second element sub-information for expressing the component symbol from the symbol file based on the method of regular expression matching;

[0139] Reading the third element sub-information for expressing the component symbol from the symbol file based on the pre-constructed parsing library for the symbol file;

[0140] Determine the element information by using the first element sub - information, and / or the second element sub - information, and / or the third element sub - information.

[0141] 1. Method based on lexical analysis and syntactic analysis:

[0142] Implementation:

[0143] Use a lexical analyzer (Lexer) to break down the text stream of the KiCad symbol file into individual lexical units (Tokens).

[0144] Use a syntactic analyzer (Parser) to organize the lexical units into an abstract syntax tree (AST) or other intermediate representation forms according to the syntax rules of the KiCad symbol file.

[0145] Traverse the AST to extract the required first element sub - information, which may include symbol attributes, labels, pattern drawing, and pin definition information.

[0146] Advantages:

[0147] High accuracy: It can parse strictly according to the syntax rules of the KiCad symbol file to ensure the accuracy of information.

[0148] Strong scalability: When the format of the KiCad symbol file changes, only the rules of the lexical analyzer and syntactic analyzer need to be updated.

[0149] Structured data: Parse the file content into structured data for convenient subsequent processing and conversion.

[0150] Applicable scenarios: When in - depth understanding and precise parsing of the KiCad symbol file are required.

[0151] 2. Method based on regular expression matching:

[0152] Implementation:

[0153] Use regular expressions to match specific patterns in the KiCad symbol file, and these patterns correspond to the syntax structures of symbol attributes, labels, pattern drawing, and pin definitions.

[0154] Based on the specific pattern, extract the matched text information as the second element sub - information.

[0155] Advantages:

[0156] Simple to implement: Regular expression matching is usually easier to implement compared to lexical analysis and syntactic analysis.

[0157] Relatively high efficiency: For simple file structures, regular expression matching can be relatively efficient.

[0158] Applicable scenarios: When the structure of the KiCad symbol file is relatively simple and stable, or as a method for rapid prototyping verification.

[0159] 3. Method based on the existing KiCad symbol file parsing library:

[0160] Implementation:

[0161] Utilize pre-built KiCad symbol file parsing libraries. These parsing libraries have already implemented the parsing function for KiCad symbol files.

[0162] Call the interfaces provided by the parsing library to obtain the required third element sub-information.

[0163] Advantages:

[0164] High development efficiency: There is no need to write parsing code from scratch, which can save development time.

[0165] Verified: Existing parsing libraries usually undergo extensive testing and use, and have high reliability.

[0166] Applicable scenarios: When a suitable KiCad symbol file parsing library is available, the symbol information can be quickly read.

[0167] 4. Mix and use multiple methods:

[0168] Implementation:

[0169] Among the first element sub-information, the second element sub-information, and the third element sub-information, any one element sub-information may be part of the element information or all of the element information. The above methods can be used alone or in combination. For example, first use regular expressions to quickly locate the key areas in the text stream, and then use lexical analysis and syntactic analysis to perform more precise parsing on these areas.

[0170] Advantages:

[0171] Balance efficiency and accuracy: Appropriate methods can be selected according to actual needs to achieve a balance between efficiency and accuracy.

[0172] Improve robustness: By combining the advantages of multiple methods, the adaptability to different format changes can be improved.

[0173] Applicable scenarios: When the structure of the KiCad symbol file is relatively complex and both efficiency and accuracy need to be considered.

[0174] In an alternative embodiment of the present invention, the step of reading the first element sub - information for expressing the component symbol from the symbol file in the method based on lexical analysis and syntactic analysis includes:

[0175] Decompose the text stream of the symbol file into independent lexical units;

[0176] Determine the grammar rules of the symbol file, and organize the lexical units into an abstract syntax tree according to the grammar rules;

[0177] Traverse the abstract syntax tree and extract the first element sub - information for expressing the component symbol.

[0178] 1. Lexical Analysis

[0179] Objective: Decompose the original text stream of the KiCad symbol file into meaningful independent units, called lexical units (Tokens). Tokens are like words in a language and are the smallest units for syntactic analysis.

[0180] Implementation method:

[0181] Define Token types: First, all possible Token types need to be defined. For example:

[0182] Keywords: PROPERTY, SYMBOL, POLYLINE, CIRCLE, PIN, etc.;

[0183] Identifiers: property names, pin names, etc.;

[0184] Strings: property values, symbol names, etc.;

[0185] Numbers: coordinates, line widths, etc.;

[0186] Parentheses: (,);

[0187] Spaces and new - line characters: used to separate Tokens (usually ignored in the lexical analysis stage).

[0188] Write a lexical analyzer: A lexical analyzer is usually implemented through regular expressions or finite automata. It reads the input text character by character, recognizes Token patterns that match the definitions, and generates corresponding lexical unit Token objects. Each lexical unit Token object usually contains:

[0189] Type (e.g., KEYWORD, STRING, NUMBER);

[0190] Value (e.g., "value", 10.5, "IN1");

[0191] Location information (line number, column number, used for error reporting).

[0192] Example (simplified): Assume that there is (property Value "1k" (at 10 20)) in the KiCad file. The lexical analyzer may generate the following token sequence: [TOKEN(KEYWORD,"property"),TOKEN(IDENTIFIER,"Value"),TOKEN(STRING,"1k"),TOKEN(LPAREN,"("),TOKEN(IDENTIFIER,"at"),TOKEN(NUMBER,"10"),TOKEN(NUMBER,"20"),TOKEN(RPAREN,")")]

[0193] 2. Syntactic Analysis

[0194] Objective: To organize the lexical unit Token sequence generated by the lexical analyzer into a structured representation, such as an abstract syntax tree (AST), according to the grammatical rules of the KiCad symbol file. The AST reflects the grammatical structure and relationships of the code.

[0195] Implementation:

[0196] 2.1 Define grammar rules: It is necessary to define the grammar rules of the KiCad symbol file, usually using Backus-Naur Form (BNF) or similar grammar representation.

[0197] For example:

[0198] For example:

[0199] BNF

[0200] symbol_file::=symbol_definition*

[0201] symbol_definition::='('SYMBOL STRING...')'

[0202] property_definition::='('PROPERTY IDENTIFIER STRING...')'

[0203] polyline_definition::='('POLYLINE'('PTS coordinate_pair*')'...')'

[0204] coordinate_pair::=NUMBER NUMBER

[0205] pin_definition::='('PIN...')'

[0206] 2.2 Writing the parser: The parser usually uses algorithms such as recursive descent parser, LL parser, or LR parser. It reads the sequence of Tokens and constructs the AST according to the grammar rules. The nodes of the AST represent the grammar structures, such as symbol_definition, property_definition, etc., and the leaf nodes are Tokens.

[0207] Example (simplified): For the above Token sequence, the parser may construct an AST where the root node may be symbol_definition, the child nodes contain property_definition nodes, and the property_definition nodes in turn contain IDENTIFIER and STRING nodes.

[0208] 3. Traversing the Abstract Syntax Tree (AST)

[0209] Goal: Traverse the constructed AST to extract the required symbol attributes, labels, pattern drawing, and pin definition information.

[0210] Implementation method:

[0211] Define the traversal method: Depth-first search, breadth-first search, or other traversal algorithms can be used to visit each node of the AST.

[0212] Identify the target nodes: During the traversal, identify the nodes representing symbol attributes, labels, pattern drawing, and pin definition. The types of these nodes have been determined during the syntax analysis phase.

[0213] Extract information: Extract relevant data from the target nodes. For example, extract the attribute name and value from the property_definition node, extract the coordinate information from the polyline_definition node, and extract the pin name, number, etc. from the pin_definition node.

[0214] Example (simplified): When traversing the AST, when encountering a property_definition node, extract the values of IDENTIFIER and STRING in its child nodes as the attribute name and value respectively. When encountering a polyline_definition node, extract the values of NUMBER in its child nodes and parse them into coordinate pairs.

[0215] In an embodiment of the present invention, by decomposing the text stream of the symbol file into independent lexical units, determining the grammar rules of the symbol file, and organizing the lexical units into an abstract syntax tree according to the grammar rules, traversing the abstract syntax tree, and extracting the first element sub-information for expressing the component symbol, the KiCad symbol file can be accurately parsed to extract structured information. This method is generally more powerful and reliable than regular expressions, especially when dealing with complex grammar structures.

[0216] In an optional embodiment of the present invention, the step of reading the second element sub-information for expressing the component symbol from the symbol file by the method based on regular expression matching includes:

[0217] Determining the target pattern of the second element sub-information in the symbol file;

[0218] Determining the regular expression corresponding to the target pattern;

[0219] Reading the second element sub-information for expressing the component symbol from the symbol file based on the regular expression.

[0220] In practical applications, the KiCad symbol file is usually in text format, using specific keywords and grammar to describe various elements of the symbol. For example, attributes may start with (property...), labels may start with (symbol...), graphic elements (such as lines, circles) may start with (polyline...) or (circle...), and pins may start with (pin...).

[0221] 1. Analyze the target information and the corresponding pattern:

[0222] For each type of second element sub-information to be extracted, analyze its target pattern in the KiCad symbol file.

[0223] 1.1 Symbol property (Property):

[0224] Target pattern: (property <name> " <value> " <position> <orientation>...)

[0225] Regular expression example: \(property\s+([a-zA-Z0-9_]+)\s+"([^"]*)"

[0226] Explanation:

[0227] \(property\s+: Matches the (property keyword and one or more spaces.

[0228] ([a-zA-Z0-9_]+): Matches the property name (one or more letters, digits, or underscores) and captures it into the first group.

[0229] \s+: Matches one or more spaces.

[0230] "([^"]*)": Matches the property value enclosed in double quotes (zero or more non-double quote characters) and captures it into the second group.

[0231] 1.2 Symbol Label (Symbol Name):

[0232] Target pattern: (symbol" <name>"...)

[0233] Regular expression example: \(symbol\s+"([^"]*)"

[0234] Explanation:

[0235] \(symbol\s+: Matches the (symbol keyword and one or more spaces.

[0236] "([^"]*)": Matches the symbol name enclosed in double quotes and captures it into the first group.

[0237] 1.3 Pattern drawing (Lines, Circles, etc.):

[0238] This part is complex because KiCad uses different keywords to describe different graphic elements.

[0239] Line: (polyline(pts...)...)

[0240] Regular expression example: \(polyline\s+\(pts\s+(.*?)\)\)

[0241] Explanation:

[0242] \(polyline\s+\(pts\s+: Matches the (polyline and (pts keywords and the spaces between them.

[0243] (.*?): Matches any characters between (pts and ) (non-greedy mode) and captures it into the first group. This group contains the coordinate information.

[0244] Circle: (circle...)

[0245] Regular expression example: \(circle\s+([0-9.]+)\s+([0-9.]+)\s+([0-9.]+)\) (Needs to be adjusted according to the actual format)

[0246] Explanation: Matches the (circle keyword, then the center coordinates and radius (assuming they are numbers).

[0247] 1.5 Pin definition (Pin):

[0248] Target pattern: (pin <type> <shape> <name> <number> <position>...)

[0249] Regular expression example: \(pin\s+([a-zA-Z]+)\s+([a-zA-Z]+)\s+"([^"]*)"\s+([0-9]+)

[0250] Explanation:

[0251] \(pin\s+: Matches the (pin keyword and one or more spaces.

[0252] ([a-zA-Z]+): Matches the pin type (e.g., input, output) and captures it into the first group.

[0253] \s+: Matches one or more spaces.

[0254] ([a-zA-Z]+): Matches the pin shape and captures it into the second group.

[0255] \s+: Matches one or more spaces.

[0256] "([^"]*)": Matches the pin name enclosed in double quotes and captures it into the third group.

[0257] \s+: Matches one or more spaces.

[0258] ([0-9]+): Matches the pin number and captures it into the fourth group.

[0259] 2. Implement the matching using a programming language:

[0260] Select a programming language (e.g., Python) and use its regular expression library (e.g., re module) to implement the matching.

[0261]

[0262]

[0263] 3. Process the matching results:

[0264] The regular expression will return the matched strings. These strings need to be further processed, for example:

[0265] Attributes and tags: Directly use the captured groups.

[0266] Pattern drawing: For lines, the coordinate information in (pts...) needs to be parsed. This may require further regular expressions or string processing.

[0267] Pins: Directly use the captured groups, and type conversion may be required (e.g., converting the pin number to an integer).

[0268] In an alternative embodiment of the present invention, the element information includes the attribute content of the component symbol, and the step of determining the target package type for the component symbol through the first association relationship includes:

[0269] Determine the symbol name information of the component symbol based on the attribute content;

[0270] Construct a relationship table based on the symbol name information and the first association relationship to express the first mapping relationship between the symbol name information and the package type information;

[0271] Determine the target package type for the component symbol through the relationship table;

[0272] The step of determining the target model information for the package file through the second association relationship includes:

[0273] Determine the package name information of the target package type;

[0274] Determine the second mapping relationship between the package name information and the 3D model type information, and add the second mapping relationship to the relationship table;

[0275] Determine the target model information for the package file through the relationship table.

[0276] In a specific implementation, step 102 may include the following sub-steps:

[0277] Step 102.1: Determine the symbol name information of the component symbol based on the attribute content;

[0278] Term Explanation:

[0279] Attribute content: Refers to the information stored in the component symbol, such as the type, value, model number, etc. of the component.

[0280] Symbol name information: Refers to the unique identifier of the component symbol in the schematic diagram, such as R1, C2, U3, etc.

[0281] Purpose: Extract the name from the attributes of the symbol, which is the basis for subsequent package lookup.

[0282] Beneficial effect: Accurately obtain the identifier of the symbol, providing key information for subsequent package association.

[0283] Step 102.2: Construct a relationship table based on the symbol name information and the first association relationship to express the first mapping relationship between the symbol name information and the package type information;

[0284] Term Explanation:

[0285] Relationship table: A table that stores symbol names and corresponding package type information, such as an Excel table.

[0286] First mapping relationship: Refers to the mapping from symbol name to package type.

[0287] Purpose: To create or update a table that associates symbol names with expected package types.

[0288] Beneficial effects: Centralize the management of the correspondence between symbols and packages, facilitating viewing, editing, and maintenance. Provide a data basis for automated package searching.

[0289] Step 102.3: Determine the target package type for the component symbol through the relationship table;

[0290] Glossary:

[0291] Target package type: The package type corresponding to the current symbol name determined according to the relationship table.

[0292] Purpose: Use the relationship table to automatically search for and determine the corresponding package type according to the symbol name.

[0293] Beneficial effects: Achieve automatic matching from symbols to packages, eliminating the need for manual selection, improving efficiency and reducing errors.

[0294] In a specific implementation, step 202 may include the following sub-steps:

[0295] Step 202.1: Determine the package name information of the target package type;

[0296] Glossary:

[0297] Package name information: Refers to the unique identifier of the package, such as R0603-A, SOIC-8, etc.

[0298] Purpose: Obtain the name of the determined package, which is the basis for subsequent 3D model searching.

[0299] Beneficial effects: Accurately obtain the identifier of the package, providing key information for subsequent 3D model association.

[0300] Step 202.2: Determine the second mapping relationship between the package name information and the 3D model type information, and add the second mapping relationship to the relationship table;

[0301] Glossary:

[0302] Second mapping relationship: Refers to the mapping from package name to 3D model type.

[0303] Objective: Associate the package name with the corresponding 3D model information and update the relationship table.

[0304] Beneficial effects: Expand the relationship table to include the correspondence between packages and 3D models. Provide a data basis for automatically searching for 3D models and facilitate unified management.

[0305] Step 202.3: Determine the target model information for the package file through the relationship table.

[0306] Glossary:

[0307] Target model information: The 3D model information corresponding to the current package name according to the relationship table.

[0308] Objective: Use the relationship table to automatically search for and determine the corresponding 3D model information based on the package name.

[0309] Beneficial effects: Achieve automatic matching from packages to 3D models without manual selection, further improving efficiency and reducing errors.

[0310] Example illustration:

[0311] Suppose we establish an Excel relationship table. One entry is that the resistor R1 in the schematic diagram corresponds to the symbol R in the symbol library, and after renaming it to R1, the selected model of this resistor is 0603, the corresponding package name information is R0603-A, and the 3D model type is 3D-R0603, as shown in Table 1;

[0312] Table 1:

[0313] Schematic symbol name Symbol library symbol Package name information 3D model type information R1 R R0603-A 3D-R0603 C1 C C0805 3D-C0805

[0314] Operation process:

[0315] The program reads the schematic diagram and finds a resistor symbol R with the name "R1" in its attribute content;

[0316] The program searches the relationship table and finds that the corresponding package name information for "R1" is "R0603-A";

[0317] The program determines that "0603" is the target package type of this resistor symbol;

[0318] The program determines that the package name information of the target package type is "R0603-A";

[0319] The program searches the relationship table and finds that the corresponding 3D model type information for "R0603-A" is "3D-R0603";

[0320] The program determines that "3D-R0603" is the target model information for this package file;

[0321] Through the above relationship table, the program automatically operates the EDA tool, calls the symbol R in the schematic diagram, renames it to R1, and fills in the package parameter in the symbol attribute of R1 with R0603-A to determine the package file; fills in the 3D model parameter corresponding to the package file R0603-A with 3D-R0603 to determine the target model.

[0322] Optionally, when the user creates a blank schematic diagram through the EDA tool (KiCAD), the program call relationship table is enabled. The program will call the corresponding symbol according to the relationship table, write the corresponding package name into the parameters of the symbol according to the component number, automatically open the PCB editor, place the corresponding package, and write the corresponding 3D model into the package parameters.

[0323] Optionally, it further includes:

[0324] When the first association relationship and / or the second association relationship changes, update the relationship table based on the updated association relationship.

[0325] Exemplarily, assume that during the design process, it is found that the previously selected package R0603-A for the resistor R1 is not suitable (for example, the size is too large, or the pin arrangement does not meet the requirements). We need to replace it with R0603-B. At the same time, it may also be found that the 3D model 3D-R0603 corresponding to R0603-B also needs to be replaced with 3D-R0603-V2.

[0326] Operation process:

[0327] Change of the first association relationship: The user realizes that the package of the resistor R1 needs to be replaced, so the package information about R1 in the relationship table needs to be modified.

[0328] Change of the second association relationship: At the same time, the user also realizes that the 3D model of the corresponding package needs to be replaced, so the 3D model information about R0603-B in the relationship table needs to be modified.

[0329] Update the relationship table: The user modifies the relationship table, updates the package name information corresponding to R1 from R0603-A to R0603-B, and updates the 3D model type information corresponding to R0603-B from 3D-R0603 to 3D-R0603-V2.

[0330] The updated relationship table may be as shown in Table 2;

[0331] Table 2:

[0332]

[0333] Program update: Run the program, and the program will read the updated relationship table.

[0334] Automatically update the EDA tool: According to the updated relationship table, the program automatically updates the package of resistor R1 to R0603-B in the EDA tool, and updates the 3D model corresponding to the package R0603-B to 3D-R0603-V2.

[0335] The purpose of updating the relationship table based on the updated association relationship when the first association relationship and / or the second association relationship changes is as follows:

[0336] Adapt to design changes: During the design process, the selection and parameters of components often change. Updating the relationship table can reflect these changes in a timely manner and ensure the accuracy of design data.

[0337] Maintain data consistency: By updating the relationship table, it can ensure that the data among the schematic diagram, PCB layout, and 3D model remains consistent, avoiding design errors caused by inconsistent information.

[0338] Simplify the update process: Users only need to modify the relationship table, and the program can automatically complete the update in the EDA tool, avoiding the cumbersome operation of manually modifying one by one.

[0339] By updating the relationship table based on the updated association relationship when the first association relationship and / or the second association relationship changes, the following beneficial effects can be achieved:

[0340] Improve design flexibility: It can easily handle design changes and quickly adjust component selection.

[0341] Reduce errors: Avoid errors and omissions that may be caused by manual updates.

[0342] Improve efficiency: Automated updates save a lot of time, allowing engineers to focus on more important design tasks.

[0343] Facilitate maintenance: Centralize the management of component information, making it convenient for maintenance and update.

[0344] To enable those skilled in the art to better understand the embodiments of the present invention, the following uses an example to illustrate the embodiments of the present invention.

[0345] Refer to Figure 2 , Figure 2 which is a schematic flow diagram of a method for determining a package file provided in the embodiments of the present invention;

[0346] S1. Use the schematic editor of KiCad software to draw a schematic diagram, export the symbol list, and create a relationship table of symbols, packages, 3D models, and device models according to the requirements from the symbol list.

[0347] S2. The program retrieves the relationship table, automatically renames and packages the symbols in the schematic diagram, and copies and renames the corresponding packages and sets the corresponding 3D models.

[0348] Example 1. The relationship table is Table 3. Through Table 3, the existing symbols, packages, and 3D models are associated.

[0349] Table 3:

[0350] Serial number Device serial number Symbol Package name 3D model 1 C1 C C0603-A 3D-C0603-A 2 C2 C C0805-A 3D-C0805-A 3 R1 R R0402-A 3D-R0402-A 4 R2 R R1206-A 3D-R1206-A

[0351] The independent files of the symbols, packages, and 3D models are all ready. They are associated through the relationship table. When the developer opens the EDA tool, creates a blank schematic diagram, and enables the program to call the relationship table, the program will call the corresponding symbols according to the relationship table, write the corresponding package name to the parameters of the symbols according to the component numbers, automatically open the PCB editor, place the corresponding packages, and write the corresponding 3D models in the package parameters.

[0352] Example 2. As shown in Table 4, the symbols, packages, and 3D models copy the source files according to this table and are renamed. That is, the called symbols, packages, and 3D models can be copied and renamed according to the relationship table to become new files.

[0353] Table 4:

[0354] Serial number Device serial number Symbol Symbol name change Package name Package name change 3D model 3D model name change 1 C1 C C-01 C0603-A C0603-01 3D-C0603-A 3D-C0603-01 2 C2 C C-02 C0805-A C0805-02 3D-C0805-A 3D-C0805-02 3 R1 R R-03 R0402-A R0402-03 3D-R0402-A 3D-R0402-03 4 R2 R R-04 R1206-A R1206-04 3D-R1206-A 3D-R1206-04

[0355] S3. After the relationship table is updated, use the update function of the program to update the symbol, package, and 3D model settings.

[0356] For example, as shown in Table 5, the called symbols, packages, and 3D models can be file-replaced according to the relationship table.

[0357] Serial number Device serial number Symbol Symbol replacement Package name Package replacement 3D model 3D model replacement 1 C1 C C-A C0603-A C0603-B 3D-C0603-A 3D-C0603-B 2 C2 C C-B C0805-A C0805-C 3D-C0805-A 3D-C0805-C 3 R1 R R-C R0402-A R0402-D 3D-R0402-A 3D-R0402-D 4 R2 R R-D R1206-A R1206-E 3D-R1206-A 3D-R1206-E

[0358] Optionally, functions such as association, renaming, and replacement can be performed concurrently.

[0359] S4. The relationship table can be made separately. The program automatically places the corresponding symbols on the schematic diagram according to the relationship table and performs the operations of S2.

[0360] It should be noted that for the method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that the embodiments of the present invention are not limited by the described action sequences, because according to the embodiments of the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0361] Reference Figure 3 , a structural block diagram of an encapsulation file determination device provided in an embodiment of the present invention is shown, which may specifically include the following modules:

[0362] An element information reading module 301, configured to obtain a symbol file and read element information for expressing a component symbol from the symbol file;

[0363] A target encapsulation type determination module 302, configured to determine a first association relationship between the component symbol and the encapsulation type information based on the element information, and determine a target encapsulation type for the component symbol through the first association relationship;

[0364] An encapsulation file determination module 303, configured to determine an encapsulation file for the component symbol through the target encapsulation type.

[0365] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, refer to the partial description of the method embodiment.

[0366] In addition, an embodiment of the present invention further provides an electronic device, as Figure 4 shown, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404. Among them, the processor 401, the communication interface 402, and the memory 403 complete communication with each other through the communication bus 404.

[0367] The memory 403 is used to store a computer program;

[0368] The processor 401, when executing the program stored on the memory 403, implements the encapsulation file determination method described in any one of the above embodiments:

[0369] The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity, only a thick line is used to represent it in the figure, but it does not mean that there is only one bus or one type of bus.

[0370] The communication interface is used for communication between the above terminal and other devices.

[0371] The memory may include a Random Access Memory (RAM), or may also include a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located far from the aforementioned processor.

[0372] The aforementioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may 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 gate or transistor logic devices, discrete hardware components.

[0373] As Figure 5 shown, in another embodiment provided by the present invention, a computer-readable storage medium 501 is further provided. Instructions are stored in the computer-readable storage medium. When it runs on a computer, it causes the computer to execute the package file determination method described in the above embodiment.

[0374] The embodiments of the present invention have been described above in conjunction with the accompanying drawings. However, the present invention is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present invention, those of ordinary skill in the art can also make many forms without departing from the spirit and scope protected by the claims of the present invention, and all of them fall within the protection scope of the present invention.

[0375] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the embodiments of the present invention can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present invention.

[0376] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0377] In the 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 merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections between each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical or other forms.

[0378] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0379] In addition, in each embodiment of the present invention, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0380] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or this part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical discs that can store program codes.

[0381] The above is only the specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.< / position> < / number> < / name> < / shape> < / type> < / name> < / orientation> < / position> < / value> < / name>

Claims

1. A method for determining an encapsulated file, characterized in that Including: Obtain a symbol file, and read element information for expressing a component symbol from the symbol file; Determine a first association relationship between the component symbol and package type information based on the element information, and determine a target package type for the component symbol through the first association relationship; Determine a package file for the component symbol through the target package type.

2. The method according to claim 1, wherein Also including: Determine a second association relationship between the package file and 3D model type information; Determine target model information for the package file through the second association relationship; Determine a target model for the package file through the target model information.

3. The method according to claim 1, wherein The step of reading element information for expressing a component symbol from the symbol file includes: Read first element sub-information for expressing a component symbol from the symbol file based on a lexical analysis and syntactic analysis method; Read second element sub-information for expressing a component symbol from the symbol file based on a regular expression matching method; Read third element sub-information for expressing a component symbol from the symbol file based on a pre-constructed parsing library for the symbol file; Determine element information by using the first element sub-information, and / or the second element sub-information, and / or the third element sub-information.

4. The method according to claim 3, characterized in that, The step of reading first element sub-information for expressing a component symbol from the symbol file based on a lexical analysis and syntactic analysis method includes: Decompose the text stream of the symbol file into independent lexical units; Determine the syntax rules of the symbol file, and organize the lexical units into an abstract syntax tree according to the syntax rules; Traverse the abstract syntax tree to extract first element sub-information for expressing a component symbol.

5. The method according to claim 3, characterized in that The step of reading second element sub-information for expressing a component symbol from the symbol file based on a regular expression matching method includes: Determine a target pattern of the second element sub-information in the symbol file; Determine a regular expression corresponding to the target pattern; Read second element sub-information for expressing a component symbol from the symbol file based on the regular expression.

6. The method according to claim 2, characterized in that, The element information includes attribute content of the component symbol, and the step of determining a target package type for the component symbol through the first association relationship includes: Determine symbol name information of the component symbol based on the attribute content; Construct a relationship table for expressing a first mapping relationship between the symbol name information and the package type information based on the symbol name information and the first association relationship; Determine a target package type for the component symbol through the relationship table; The step of determining target model information for the package file through the second association relationship includes: Determine package name information of the target package type; Determine a second mapping relationship between the package name information and the 3D model type information, and add the second mapping relationship to the relationship table; Determine target model information for the package file through the relationship table.

7. The method according to claim 6, characterized in that, Also including: When the first association relationship, and / or the second association relationship changes, update the relationship table based on the updated association relationship.

8. An encapsulation file determination device, characterized in that, It includes: An element information reading module, configured to obtain a symbol file and read element information for expressing a component symbol from the symbol file; A target package type determining module, configured to determine a first association relationship between the component symbol and the package type information based on the element information, and determine a target package type for the component symbol through the first association relationship; A package file determining module, configured to determine a package file for the component symbol through the target package type.

9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus; The memory is used to store a computer program; When the processor executes the program stored on the memory, it implements the method according to any one of claims 1-7.

10. A computer-readable storage medium, on which instructions are stored, and when executed by one or more processors, cause the processors to execute the method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Circuit board material coding packaging method and device, equipment and medium

    CN114021659A

  • Method and device for establishing component analog data and electronic equipment

    CN116011396A

  • Device information management method and device, electronic equipment and medium

    CN117474504A

  • Electronic component packaging type classification system using artificial neural network

    US20190392322A1

Cited By

  • Circuit design system based on flexible device structure

    CN122616479B