Part program matching method and system
By sorting existing parts and sorting similarity, the target program of target parts is obtained, and the problem of low efficiency of matching parts programs in the existing technology is solved, and efficient component programming is achieved.
Patent Information
- Application Number
- CN202311588129.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, the method of matching component programs is inefficient and is likely to be unable to accurately match the target program, especially when the similarity of components is incomplete.
By classifying existing components and obtaining target components of the same category based on the similarity of the first component, the target program is obtained using the similarity sorting and preset quantity to improve matching efficiency.
It improves the efficiency of finding target components, reduces programming workload, enhances the reference of target programs, and improves programming efficiency and accuracy.
Smart Images

Figure CN120336862A_ABST
Abstract
Description
Technical Field
[0001] The present invention generally relates to the technical field of data processing. More specifically, the present invention relates to a method and system for matching component programs. Background Art
[0002] If it is necessary to process a third component, and there is now an engineering drawing file of the third component, it is necessary to obtain the processing program of the third component according to the engineering drawing file. For example, the third component can be processed by a numerically controlled machine tool according to the processing program. In the first case, the processing program can be directly obtained by programming the third component according to the engineering drawing file; in the second case, the processing program of the third component can be programmed by referring to the processing program of the second component that has been programmed before, where the second component has a relatively high similarity with the third component, and thus the similarity between the processing programs of the second component and the third component is relatively high. For the second case, the higher the similarity between the second component and the third component, the higher the similarity between the processing programs of the second component and the third component, and the more the workload required for programming the third component can be reduced. The reason is that the higher the similarity between the processing programs of the second component and the third component, the greater the possibility that more content of the processing program of the second component can be referred to when programming the third component.
[0003] In the prior art, there is a method for matching the processing program of another component according to the engineering drawing file of the first component, where the other component is the same as the first component: the first component is sequentially compared with the existing components stored. If the number and category of the types of elements of the first component are the same as the number and category of the types of elements of an existing component, then the processing program of the existing component is the target program. If the number and category of the types of elements of the first component are not completely the same as the number and category of the types of elements of an existing component, then the target program is not matched. This matching method has low efficiency and a high possibility of not matching the target program. Summary of the Invention
[0004] To solve the above one or more technical problems, the present invention proposes to obtain at least one target component according to the similarity between the first existing component and the first component, and then obtain the target program of the target component. For this purpose, the present invention provides solutions in the following aspects.
[0005] In a first aspect of an embodiment of the present invention, a method for matching component programs is provided, including: classifying the existing components according to the types of elements of the existing components; obtaining the types of first elements of a first component; further obtaining a first existing component of the same category as the first component, and obtaining at least one target component according to the similarity between the first existing component and the first component, and further obtaining the target program of the target component.
[0006] In one embodiment, classifying the existing components according to the types of elements of the existing components includes: classifying existing components with the same number and category of element types into one category.
[0007] In one embodiment, obtaining at least one target component according to the similarity between the first existing component and the first component includes: sorting the similarities in descending order to obtain a first sequence, where the larger the similarity in the first sequence, the more forward it is, and taking the first and consecutive preset number of first existing components corresponding to the similarities in the first sequence as target components.
[0008] In one embodiment, the method for obtaining the similarity includes: the similarity is obtained according to the number of element types of the first component, the number of elements of the same element type of the first existing component, and the number of elements of the same element type of the first component.
[0009] In one embodiment, the similarity is obtained according to the number of element types of the first component, the number of elements of the same element type of the first existing component, and the number of elements of the same element type of the first component, including: the similarity is obtained according to obtained, where X i is the similarity between the i-th first existing component and the first component, n is the number of element types of the first component, A ik is the number of elements of the k-th type of the i-th first existing component, B k is the number of elements of the k-th type of the first component, and the category of the k-th type of elements of the i-th first existing component is the same as the category of the k-th type of elements of the first component.
[0010] In a second aspect of an embodiment of the present invention, a system for matching component programs is provided, including: a processor and a memory, where the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method of any of the above embodiments is implemented.
[0011] In the third aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which program instructions are stored. When the program instructions are loaded and executed by a processor, the processor is caused to execute the method according to any one of the embodiments in the first aspect of the embodiments of the present invention.
[0012] The beneficial effects of the present invention include:
[0013] According to the types of elements of existing components, the existing components are classified, which improves the efficiency of subsequent searching for target components. According to the similarity between the first existing component and the first component, at least one target component is obtained, and then the target program of the target component is obtained. The processing program of the first existing component with a relatively high similarity to the processing program of the first component is obtained, which is the target program. When programming the first component, the target program can be referred to, and the possibility of obtaining an excellent effect by referring to the target program for programming is relatively high, and the possibility of reducing the workload required for programming when programming the first component is relatively large.
[0014] In addition, the first existing components corresponding to the first and consecutive preset number of similarities in the first sequence are taken as target components. When programming the first component, the target program of the target component can be referred to, making the processing program of the target component more referential. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] By referring to the drawings and reading the following detailed description, the above and other objects, features, and advantages of the exemplary embodiments of the present invention will become easily understandable. In the drawings, several embodiments of the present invention are shown in an exemplary rather than restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts, where:
[0016] Figure 1 is a flowchart schematically showing a method for matching component programs according to an embodiment of the present invention;
[0017] Figure 2 is a block diagram schematically showing the structure of a system for matching component programs according to this embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0018] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0019] The following will describe the specific embodiments of the present invention in detail with reference to the drawings.
[0020] Figure 1 It is a flowchart schematically showing a method for matching component programs according to an embodiment of the present invention. As Figure 1 shown, first, according to a first aspect of the present invention, a method for matching component programs is provided, including: classifying the existing components according to the types of elements of the existing components; obtaining the types of the first elements of the first component; further obtaining the first existing component of the same category as the first component, and obtaining at least one target component according to the similarity between the first existing component and the first component, and further obtaining the target program of the target component.
[0021] Specifically described as follows, as Figure 1 shown, it includes steps S1 to S3:
[0022] In step S1, the existing components are classified. Specifically, the existing components are classified according to the types of elements of the existing components.
[0023] If it is necessary to process a third component, and now there is an engineering drawing file of the third component, it is necessary to obtain the processing program of the third component according to this engineering drawing file. For example, the third component can be processed by a numerically controlled machine tool according to this processing program. In the first case, the processing program of the third component can be directly obtained by programming according to this engineering drawing file; in the second case, the processing program of the third component can be programmed by referring to the processing program of the second component that has been programmed before, where the similarity between the second component and the third component is relatively high, and then the similarity between the processing programs of the second component and the third component is relatively high. For the second case, the higher the similarity between the second component and the third component, the higher the similarity between the processing programs of the second component and the third component, and the more the workload required for programming the third component can be reduced. The reason is that the higher the similarity between the processing programs of the second component and the third component, the greater the possibility that more content of the processing program of the second component can be referred to when programming the third component.
[0024] In order to improve the efficiency of finding the second component, the existing components are classified. For example, the processing programs of the existing components can be classified, or the processing programs and engineering drawing files of the existing components can be classified, or only the engineering drawing files can be classified. The processing program of the corresponding component can be indexed through the engineering drawing file, etc. The types of components' elements are related to the similarity between components. Therefore, the existing components are classified according to the types of elements of the existing components. It should be noted that the types of the components' elements can be obtained through the engineering drawing files of the components.
[0025] In step S2, obtain the types of the first elements of the first component part.
[0026] The types of the first elements of the first component part can be obtained through the engineering drawing file of the first component part. Furthermore, the first existing component parts of the same category as the first component part can be obtained according to the types of the first elements.
[0027] In step S3, further obtain the first existing component parts of the same category as the first component part, obtain at least one target component part according to the similarity between the first existing component parts and the first component part, and further obtain the corresponding target program. Specifically, further obtain the first existing component parts of the same category as the first component part, obtain at least one target component part according to the similarity between the first existing component parts and the first component part, and further obtain the target program of the target component part.
[0028] In order to obtain the processing program of the first existing component part with a relatively high similarity to the processing program of the first component part, obtain at least one target component part according to the similarity between the first existing component part and the first component part, and further obtain the target program of the target component part. Obtain at least one target component part and the corresponding target program. When programming the first component part, the processing program of the target component part can be referred to, and the effect of referring to the processing program of the target component part is relatively good.
[0029] In one embodiment, classify the existing component parts according to the types of the elements of the existing component parts, including: classifying the existing component parts with the same number and category of element types into one category.
[0030] Classify the existing component parts with the same number and category of element types of the component part elements into one category. The reason is that the existing component parts with the same number and category of element types of the component part elements are more likely to be similar, and furthermore, the processing programs of the existing component parts are more likely to be similar.
[0031] Classify the existing component parts with the same number and category of element types of the component part elements into one category, which is convenient for finding the component parts similar to the first component part and can improve the searching efficiency.
[0032] For example, if the type of the elements of one component part is only a convex round platform, and the type of the elements of another component part is also only a convex round platform, then these two component parts are classified into one category.
[0033] In one embodiment, obtaining at least one target component according to the similarity between the first existing component and the first component includes: sorting the similarities in descending order to obtain a first sequence, where the larger the similarity in the first sequence, the more forward it is, and taking the first existing components corresponding to the first and consecutive preset number of similarities in the first sequence as target components.
[0034] If the preset number is greater than the number of similarities in the first sequence, that is, the preset number is greater than the number of first existing components corresponding to the similarities in the first sequence, take this first existing component as the target component. For example, if the number of similarities in the first sequence is 2 and the preset number is 3, then take the first existing components corresponding to the similarities in the first sequence as target components.
[0035] If only one target component is obtained, the similarity between this target component and the first component can be the largest. When programming the first component, the processing program of this target component can be referred to, but the effect of referring to the processing program of this target component may be lower than that of referring to the processing programs of multiple target components. These multiple target components are the first existing components corresponding to the first and consecutive preset number of similarities in the first sequence. Therefore, take the first existing components corresponding to the first and consecutive preset number of similarities in the first sequence as target components.
[0036] In one embodiment, the preset number is set to 3. In other embodiments, the implementer can set the preset number according to the specific implementation scenario so that when programming the first component, the effect of programming with reference to the obtained target program is relatively excellent.
[0037] For example, if the number of first existing components corresponding to the first component is 4, and the similarities between the first component and the first existing components are 0.2, 0.1, 0.25, and 0.5 respectively, and the preset number is taken as 3, then take the first and consecutive preset number of similarities of 0.2, 0.25, and 0.5 in the corresponding first sequence.
[0038] In one embodiment, the method for obtaining the similarity includes: the similarity is obtained according to the number of element types of the first component, the number of elements of the same element type of the first existing component, and the number of elements of the same element type of the first component.
[0039] When calculating the similarity corresponding to the first component, one method is as follows: The number of elements of each type of the first component elements is respectively compared and analyzed with the number of elements of the same type of the corresponding first existing component elements. Therefore, the number of element types of the first component, the number of elements of the same element type of the first existing component, and the number of elements of the same element type of the first component are related to the similarity corresponding to the first component, and the similarity is obtained based on the number of element types of the first component, the number of elements of the same element type of the first existing component, and the number of elements of the same element type of the first component.
[0040] In one embodiment, the similarity is obtained based on the number of element types of the first component, the number of elements of the same element type of the first existing component, and the number of elements of the same element type of the first component, including: The similarity is obtained based on obtained, where X i is the similarity between the i-th first existing component and the first component, n is the number of element types of the first component, A ik is the number of elements of the k-th type of the i-th first existing component, B k is the number of elements of the k-th type of the first component, and the category of the k-th type of elements of the i-th first existing component is the same as the category of the k-th type of elements of the first component. The purpose of adding 1 in the denominator is to prevent the denominator from being 0. The purpose of adding 1 is to prevent the denominator from being 0.
[0041] |A ik - B k | is the absolute value of the difference between the number of elements of the k-th type of the i-th first existing component and the number of elements of the k-th type of the first component. The smaller |A ik - B k | is, the smaller the corresponding difference is. The smaller it is, the greater the possibility that the similarity between the first component and the i-th first existing component is greater. The smaller it is, The greater it is, the greater the possibility that the similarity between the first component and the i-th first existing component is greater, and the greater the possibility that the processing procedure of the first component is similar to the processing procedure of the i-th first existing component. The greater it is, the greater X i is.
[0042] Figure 2 is a schematic structural block diagram showing a system for matching component programs according to an embodiment of the present invention.
[0043] The present invention also provides a system for matching component programs. As Figure 2As shown, the system includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement a method for matching component programs according to the first aspect of the present invention.
[0044] The system also includes other components well-known to those skilled in the art, such as a communication bus and a communication interface. Their settings and functions are known in the art, so they will not be described in detail here.
[0045] In the present invention, the aforementioned memory can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, device, or component. For example, a computer-readable storage medium can be any suitable magnetic storage medium or magneto-optical storage medium, such as resistive random access memory (RRAM), dynamic random access memory (DRAM), static random access memory (SRAM), enhanced dynamic random access memory (EDRAM), high-bandwidth memory (HBM), hybrid memory cube (HMC), etc., or any other medium that can be used to store the required information and can be accessed by an application, module, or both. Any such computer storage medium can be part of the device or accessible or connectable to the device. Any application or module described in the present invention can be implemented using computer-readable / executable instructions that can be stored or otherwise maintained by such a computer-readable medium.
[0046] In the description of this specification, the meanings of "a plurality of" and "several" are at least two, for example, two, three, or more, unless otherwise specifically and clearly defined.
[0047] Although this specification has shown and described multiple embodiments of the present invention, it is obvious to those skilled in the art that such embodiments are provided only by way of example. Those skilled in the art will think of many changes, alterations, and alternative ways without departing from the spirit and concept of the present invention. It should be understood that various alternative solutions to the embodiments of the present invention described herein can be adopted in the process of practicing the present invention.
Claims
1. A method for matching component programs, characterized in that, Including: Classify the existing components according to the types of elements of the existing components; Obtain the type of the first element of the first component; Furthermore, obtain the first existing component of the same category as the first component, and obtain at least one target component according to the similarity between the first existing component and the first component, and then obtain the target program of the target component.
2. The method for matching component programs according to claim 1, characterized in that Classifying the existing components according to the types of elements of the existing components includes: Classify the existing components with the same number and category of element types into one category.
3. A method for matching component programs according to claim 1, characterized in that, Obtaining at least one target component according to the similarity between the first existing component and the first component includes: Sort the similarities from largest to smallest to obtain a first sequence. The larger the similarity in the first sequence, the more forward it is. Select the first existing components corresponding to the first and consecutive preset number of similarities in the first sequence as the target components.
4. A method for matching component programs according to claim 1 or 3, characterized in that, The method for obtaining the similarity includes: The similarity is obtained according to the number of element types of the first component, the number of elements of the same element type of the first existing component, and the number of elements of the same element type of the first component.
5. A method for matching component programs according to claim 4, characterized in that The similarity is obtained according to the number of element types of the first component, the number of elements of the same element type of the first existing component, and the number of elements of the same element type of the first component, including: The similarity is obtained according to , where X i is the similarity between the i-th first existing component part and the first component part, n is the number of element types of the first component part, A ik is the number of elements of the k-th type of the i-th first existing component part, B k is the number of elements of the k-th type of the first component part, and the category of the k-th type of elements of the i-th first existing component part is the same as the category of the k-th type of elements of the first component part.
6. A system for matching component programs, characterized in that, Including: A processor and a memory, where the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the method for matching component programs according to any one of claims 1 to 5 is implemented.
7. A computer-readable storage medium, characterized in that, Wherein program instructions are stored, and when the program instructions are loaded and executed by the processor, the processor is caused to execute the method for matching component programs according to any one of claims 1 to 5.