A component modeling and testing method, electronic device and computer-readable medium
By combining standardized modeling with automated testing, a test database and test cases are generated, which solves the problems of insufficient model accuracy and incomplete test coverage in component modeling, and achieves full-process optimization and efficient verification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 粤港澳大湾区(广东)国创中心
- Filing Date
- 2026-04-10
- Publication Date
- 2026-07-31
AI Technical Summary
Traditional component modeling suffers from problems such as insufficient model accuracy, incomplete test coverage, complex processes, and low verification efficiency. In particular, inconsistent description methods for components from different manufacturers and categories lead to modeling challenges and low automation.
By combining standardized modeling with automated testing, a test database is generated based on the product manual, test cases and variant model instances are automatically generated, testing is carried out using automation, and test reports are generated.
The entire process of component modeling and testing has been optimized, improving model accuracy and coverage, reducing manual operation costs, and significantly improving verification efficiency and model reliability after design changes.
Smart Images

Figure CN122490718A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of component modeling technology, specifically relating to a component modeling and testing method, electronic device, and computer-readable medium. Background Technology
[0002] In traditional component design and testing processes, the various attribute information of components and the constraints between these attributes are complex. Different component manufacturers use different description methods, and even different categories of components from the same manufacturer may have significantly different description methods, making component modeling and testing a challenge. Existing technologies have the following shortcomings: Insufficient model accuracy: Simplified assumptions lead to deviations between the modeling results and physical reality.
[0003] Incomplete test coverage: Test scenarios are often limited to common models and it is difficult to cover edge cases.
[0004] The process is complex: the data flow efficiency is low in the modeling, testing, and inspection stages.
[0005] Low verification efficiency: Test conditions need to be manually reconfigured after each design change, resulting in low automation. Summary of the Invention
[0006] To overcome the above-mentioned technical defects, the present invention provides a component modeling and testing method, an electronic device, and a computer-readable medium, which optimizes the entire modeling and testing process by combining standardized modeling with automated testing.
[0007] A component modeling and testing method, comprising: Generate a test database based on the product manual; Test cases are generated based on the test database, and inspection rules are set to inspect the test cases; Based on the parameter combinations used in the test cases, generate a basic model instance to be tested, and generate several deformable model instances based on the basic model instance; Several deformable model instances were tested using a test database; Generate test results and test reports.
[0008] As a further improvement of the present invention, the step of generating a test database based on the product manual includes: Obtain the technical parameter table from the product manual, extract the product model and its corresponding attribute values, and generate a JSON dictionary structure; Extract attribute constraint relationships from the constraint table in the product manual; Extract other constraints from other tables in the product manual; Construct a data structure using attribute constraints, other constraints, product models, and their corresponding attribute values; The data structure is nested into a JSON dictionary structure to generate a test database.
[0009] As a further improvement of the present invention, after generating the test database, the method further includes: performing table checks, data type consistency checks, and data missing checks on the test database.
[0010] As a further improvement of the present invention, the JSON dictionary structure includes: data type key-value pairs, attribute name list key-value pairs, unit list key-value pairs, and attribute correspondence key-value pairs.
[0011] As a further improvement of the present invention, when checking test cases, a YMAL file containing threshold standards for pass and fail is preset and saved for the check results.
[0012] As a further improvement of the present invention, the inspection rules include: interference inspection rules, isolated element inspection rules, constraint relationship inspection rules, and conventional hidden inspection rules.
[0013] As a further improvement of the present invention, the step of testing several deformable model instances using a test database includes: Geometric property testing, model reliability testing, assembly completeness and fit correctness testing, and key feature existence testing were performed on several deformable model instances.
[0014] As a further improvement of the present invention, the test results include: pass, failure, or warning; The test report includes: overview, details, and trend analysis; If the test result is a failure, the test report shall also include: a screenshot of the failure.
[0015] The present invention also provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes the program stored in the memory, it implements the component modeling and testing method as described in any one of claims 1-8.
[0016] The present invention also provides one or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the above-described component modeling and testing method.
[0017] Compared with existing technologies, the beneficial effects of this invention are as follows: This invention automatically generates a test database based on product manuals, standardizes the description methods of component attributes and constraint relationships, eliminates modeling difficulties caused by differences in descriptions of components from different manufacturers and categories, and significantly improves modeling standardization and data usability. By automatically generating basic model instances and multi-dimensional deformable model instances through parameter combinations, it reduces biases caused by simplification assumptions, making the model more closely resemble physical reality; simultaneously, it can automatically cover edge scenarios and extreme parameter combinations, solving the problem of incomplete coverage in traditional testing. It integrates modeling, test case generation, basic model instance and deformable model instance generation, and automated testing into a unified process, achieving seamless data flow, reducing process switching costs, and simplifying complex manual operation procedures. Attached Figure Description
[0018] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, wherein: Figure 1 This is a flowchart of the component modeling and testing method described in Example 1. Detailed Implementation
[0019] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.
[0020] This invention provides a method for modeling and testing components, such as... Figure 1 The above includes: S1. Generate a test database based on the product manual. Standardized attributes and constraints are extracted directly from the product manual, automatically unifying the description formats of different manufacturers and different types of parts. This solves the problems of modeling difficulties and data incompatibility caused by inconsistent descriptions in traditional processes, providing data for subsequent steps.
[0021] Specifically, step S1 includes: S11. Obtain the technical parameter table from the product manual, extract the product model and its corresponding attribute values, and generate a JSON dictionary structure. The JSON dictionary structure includes: data type key-value pairs (type), attribute name list key-value pairs (names), unit list key-value pairs (units), and attribute mapping key-value pairs (values). The attribute name list is a list containing all attribute names, the unit list is a list of units corresponding to the attribute name list keys, and the attribute mapping includes the product model from the main table and its mapping relationship with the attribute values in the first six columns. The attribute mapping is stored as a tree-structured JSON.
[0022] S12. Extract attribute constraint relationships from the constraint table in the product manual. Store the attribute constraint relationships in a standardized form. For example, for a two-attribute table, extract the relationship between two attributes and store it as a key-value pair. For a three-attribute table, extract three attributes and store them as a nested dictionary structure, etc.
[0023] S13. Extract other constraints from other tables in the product manual, as shown in the table below:
[0024] S14. Construct a data structure using attribute constraints, other constraints, product models, and their corresponding attribute values.
[0025] S15. Insert the data structure into a JSON dictionary structure to generate a test database.
[0026] As one implementation method, it also includes: S15. Perform table checks, data type consistency checks, and data missing checks on the test database. Table checks include: checking the non-empty headers of each sheet and the validity of column names. If special characters are not allowed, output the exception and prompt the user for handling. Data type consistency checks include: checking the data type of each column to see if it contains mixed data types. If so, perform data conversion. Data missing checks include: counting missing values and outputting an error table to prompt the user for correction.
[0027] S2. Load model parameters from the test database, combine data according to equivalence class partitioning and boundary value analysis, generate test cases, and set inspection rules to inspect the test cases.
[0028] For example, the model parameters are combined and assigned values: for example, the outer diameter R of the model is in the range of 5~7; the inner diameter r is in the range of 1~2. Then, the test cases are generated as follows: {"names":["R","r"],"values":[{"R":"5","r":"1"},{"R":"6","r":"1"},{"R":"7","r":"1"},{"R":"5","r":"2"}{"R":"6","r":"2"},{"R":"7","r":"2"}...}.
[0029] Based on actual needs, inspection rules are set through CAD software. The inspection rules include: interference inspection rules, isolated element inspection rules, constraint relationship inspection rules, and general hidden inspection rules. At the same time, YMAL files with pass and fail threshold standards are preset and saved for the inspection results.
[0030] Interference check: Check if there is any unreasonable volume overlap between models. If there is overlap, the interference area is highlighted and an interference list is output, listing all interfering part pairs.
[0031] Isolated element check: Checks for geometric topology errors in the part model such as invalid faces, invalid edges, and zero faces that cannot participate in solid calculations, or whether a part dependency in the assembly has been deleted.
[0032] Constraint rules: The constraint relationships between parameters are specified by the user, such as: IF Module = 0.5 AND Number of teeth = 20 TH Diameter = Module × Number of teeth - 5.
[0033] The implementation code is as follows: { “modelName”: “M1”, “expected_results”: { “paradem1”: { “min”: value1, “max”: value2}, / / Parameter threshold "interFlag": true, / / Feature interference check "sketchInspection": true, / / Inspect isolated elements ... } D. Conventional implicit rules, such as inner and outer diameter restrictions, shape and size, geometric perimeter, etc.
[0034] S3. Based on the parameter combination used in the test case, generate the base model instance to be tested through CAD or engine API, and generate several deformable model instances based on the base model instance.
[0035] S4. Several deformable model instances are tested using a test database. During this process, automation is employed to drive the model and execute test cases. Specifically, this includes: Geometric property testing: Based on the input property data, verify whether the physical properties of the model, such as mass, volume, and center of gravity, are within the expected range; whether it can complete the closure, or whether there are topological errors such as self-intersection, cracks, and non-manifold edges.
[0036] Model reliability testing: Check draft angle, minimum inner radius, wall thickness uniformity, etc.
[0037] Assembly completeness and fit correctness test: whether the assembly is complete and whether there are any missing parts; whether the fit relationship is normal, and whether there are any separation, overlap or other phenomena in the model.
[0038] Key feature existence test: such as whether specific holes, bosses, and mating surfaces exist correctly, whether there are any missing or redundant features; whether there are any interferences or isolated elements, etc.
[0039] S5. Generate test results and an HTML test report. Test results include: pass, fail, or warning; the test report includes: overview, details, and trend analysis. When the test result is a failure, the test report also includes: a failure screenshot. The overview includes: the example to be tested, the number of test cases, and the pass rate; the details include: the parameters, detection items, expected results, and actual returned results for each test case. The failure screenshot refers to automatically highlighting the problem area on the model view and generating a screenshot for failed detection items (such as interference areas). Trend score is optional and refers to comparing test results of different versions of the same model.
[0040] The present invention will now be further explained in conjunction with specific implementation methods, as follows: 1. Data preparation: Upload the product manual.
[0041] 2. Data reading and parsing: Identify data from the product manual, read all attributes and corresponding values from the main table, extract attribute constraints and other constraints to construct a data structure, and generate a test database.
[0042] Data structures such as: [{"name":"A","unit":"","style":1,"modelVar":"A","scope":["25","30","35"],"relations":[],"functions":["Configuration Model"]},{"name":"B","unit":"","style":1,"modelVar":"B","scope":["28","20","22"],,"relations":[]"functions":["Configuration Model"]}].
[0043] 3. Load model parameters from the test database, generate test cases based on parameter combinations, and define inspection rules: Parameter combinations generate test cases: similar to [{"A":"25","B":"28","Configuration Model":"A25-B28","3D Model Name":"TEST"}... Set inspection rules: dimension inspection, feature inspection, sketch constraint inspection, etc.
[0044] 4. Generate the base model instance to be tested, execute test cases, and generate deformable model instances: Using Huatian CAD, a base model is generated; test cases are automatically loaded and executed, and the deformed model instance driven by each set of parameters is checked according to the inspection rules, and the test results are output.
[0045] 5. Generate a test report. A portion of the test report content is shown in the table below:
[0046] In summary, the component modeling and testing method of the present invention has the following beneficial effects: It achieves full-process automation, automatically generates a test database based on the product manual, automatically generates test cases, base models and variant model instances, and automatically completes testing and report output. There is no need to manually configure conditions repeatedly, which greatly improves the verification efficiency after design changes and reduces labor costs.
[0047] The test coverage is more comprehensive, effectively reducing errors. By automatically generating deformable model instances through parameter combinations, the test scenarios are expanded. In addition to covering typical working conditions, it can also fully cover edge cases, effectively reducing the occasional errors missed by traditional tests and improving the reliability and stability of the model.
[0048] Early identification of design defects significantly reduces modification costs. Rule checks, constraint verification, geometry and assembly testing can be completed during the modeling stage, identifying potential problems such as interference, isolated elements, and constraint conflicts in advance. This prevents problems from flowing into the later trial production and production stages, greatly reducing the costs of later modifications, rework, and time.
[0049] Standardize data to improve model accuracy and consistency. Automatically extract parameters and constraints from product manuals and generate a standardized test database. Unify the description format of different manufacturers and different types of parts, reduce simplification assumptions and human error, make the model more in line with physical reality, and improve modeling accuracy and data reuse capability.
[0050] Based on the same inventive concept, this invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus. Memory, used to store computer programs; The processor, when executing programs stored in memory, implements the component modeling and testing methods described above.
[0051] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. The communication interface is used for communication between the aforementioned terminal and other devices.
[0052] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0053] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0054] Based on the same inventive concept, the present invention provides one or more computer-readable media storing instructions that, when executed on a computer, cause the computer to perform the component modeling and testing method described in the above embodiments.
[0055] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0056] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0057] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0058] The above are merely preferred embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method of modeling testing of parts, characterized by, include: Generate a test database based on the product manual; Test cases are generated based on the test database, and inspection rules are set to inspect the test cases; Based on the parameter combinations used in the test cases, generate a basic model instance to be tested, and generate several deformable model instances based on the basic model instance; Several deformable model instances were tested using a test database; Generate test results and test reports.
2. The part modeling test method of claim 1, wherein, The step of generating a test database based on the product manual includes: Obtain the technical parameter table from the product manual, extract the product model and its corresponding attribute values, and generate a JSON dictionary structure; Extract attribute constraint relationships from the constraint table in the product manual; Extract other constraints from other tables in the product manual; Construct a data structure using attribute constraints, other constraints, product models, and their corresponding attribute values; The data structure is nested into a JSON dictionary structure to generate a test database.
3. The part modeling test method of claim 2, wherein, After generating the test database, the process also includes: performing table checks, data type consistency checks, and data missing checks on the test database.
4. The part modeling test method according to claim 1 or 2, characterized by, The JSON dictionary structure includes: data type keys, attribute name list keys, unit list keys, and attribute mapping key.
5. The method of claim 1, wherein, When checking test cases, a YMAL file containing pass / fail threshold standards is pre-saved for the check results.
6. The component modeling and testing method according to claim 1, characterized in that, The inspection rules include: interference inspection rules, isolated element inspection rules, constraint relationship inspection rules, and regular hidden inspection rules.
7. The component modeling and testing method according to claim 1, characterized in that, The step of testing several deformable model instances using a test database includes: Geometric property testing, model reliability testing, assembly completeness and fit correctness testing, and key feature existence testing were performed on several deformable model instances.
8. The component modeling and testing method according to claim 1, characterized in that, The test results include: pass, failure, or warning; The test report includes: overview, details, and trend analysis; If the test result is a failure, the test report shall also include: a screenshot of the failure.
9. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; The memory is used to store computer programs; When the processor executes the program stored in the memory, it implements the component modeling and testing method as described in any one of claims 1-8.
10. One or more computer-readable media, characterized in that, It stores instructions that, when executed by one or more processors, cause the processors to perform the component modeling and testing method as described in any one of claims 1-8.