# Cloud-Edge Collaboration-Based Knowledge Sharing Mechanism for Manufacturing Resources
## 4 Knowledge Reuse Matching  
When the intelligent manufacturing production line is altered due to equipment failure or the addition of new manufacturing resources to the process, it is necessary to study and learn the manufacturing resource processing experience. Thus, similar processing tasks in the knowledge base should be extracted, which requires establishing a task matching mechanism. The proposed task-oriented manufacturing resource ontology forms a basis for the matching mechanism that enables knowledge reuse. This section analyzes such a mechanism from the perspective of between-device knowledge exchange and finds new application scenarios for the original resource operation rules.  
Complete manufacturing process matching involves considering multiple task model levels. Refining the search objects to action primitives improves the knowledge reusability and cross-domain practicability. To this end, this article adopts the breadth-first search method. Specifically, when a new manufacturing task is generated or a new resource is added to production, the mechanism first obtains the processing knowledge from the module where the resource is located. A similar task experience is then searched and, if found, used to build a direct learning data stream in the module. If no similar processing modules are found, the cloud platform is connected to search for similar tasks. The search algorithm's pseudo-code implementation is given in Algorithm 1, and its explanation is as follows.  
Figure 5: Simplified engraving tasks.  
The rapid matching mechanism for knowledge reuse assumes that the target task is composed of \(m\) action primitives. Let \(n\) denote the number of action primitive models on the edge of the knowledge base. The algorithm searches for the task model with the highest matching degree. At the algorithm's start, the edge server decomposes the target task and traverses the action primitives. While learning action primitives, the feature vectors \(\overrightarrow{\mathbf{v}}\) are extracted based on action \(i\)'s ontology model and include the equipment resources \(r\), related skills \(s\), action description \(a\), and environmental conditions \(e\). Thus, the vector can be expressed as \(\overrightarrow{\mathbf{v}}=(r,s,a,e)\). The ontology model involves various data types. To facilitate subsequent processing and comparison, a variety of data type conversions are realized by calculating the feature vector's hash value, and the feature vector is converted into an \(n\)-bit digital signature \(r_{h}\) composed of zeros and ones. The feature vectors' degree of influence in knowledge learning is different, as indicated by the associated weight values. The set of weights is denoted \(\{w_{1}\), \(w_{2}\), \(w_{3}\), \(w_{4}\), \(w_{5}\}\). If the weighting process encounters a non-zero value (i.e., a one), the hash value is multiplied by the weight \(w_{n}\). Otherwise, the weight \(w_{n}\) is multiplied by \(-1\). After the weighting calculation is completed, it is added vertically and merged into an \(n\)-bit sequence string signature \(Q_{n}\). After dimensionality reduction, the action primitive's standardized signature \(S_{n}\) is obtained. The Hamming distance _Dis_ between the standardized signatures is utilized to judge the similarity between the actions. Once a similar action sample set \(C_{l}\) is found, the knowledge reuse impact is evaluated on qualified samples. The action primitives with high similarity and good execution effect should be reused. Each action primitive's execution plan is determined and then reorganized to obtain the task-oriented execution plan's completeness. The definition of all symbols is shown in Table 1.