| Nowadays,Internet of Things(Io T)smart devices are widely popular.With the rapid growth of smart devices and network services,manual operations are slow and error-prone,and cannot adapt to the interaction of a large number of smart devices and network services.Trigger-Action Programming(TAP),as a traditional programming paradigm for operating Io T smart devices and network services,helps eliminate the barriers of different ecosystems and customize the personal rules of Io T services.It has accumulated a large number of users.Therefore,it is particularly important to recommend appropriate rules to users from the existing massive TAP rules.Most recommendation systems usually emphasize the accuracy of recommendations,while the novelty and diversity are ignored,which reduces the user experience.Therefore,this paper sets out to balance accuracy and diversity in TAP rule recommendations.As a network of everything,physical spaces interact with virtual spaces in Io T,which determines the inherent advantages of the graph structure when representing Io T.TAP data can be represented as a heterogeneous graph containing multiple types of nodes and edges,and each node also has an attribute description in text form.How to make good use of graph structure and text description to recommend appropriate TAP rules for users is worth studying.To this end,this paper proposes unsupervised and supervised learning methods,which learn the feature of each rule from a large number of TAP rules in order to recommend appropriate rules to users.As for the unsupervised learning method,we use Nonnegative Matrix Factorization(NMF)to learn the rule features.According to the nodes connection between one type and another type in the TAP heterogeneous graph,a relation matrix can be constructed.In the matrix,0 indicates that there is no relation between two nodes,and a positive value indicates that there is relation between two nodes,meanwhile the larger the value,the stronger the relation.NMF decomposes the nonnegative matrix into two matrices containing node features.Before NMF learning features,this paper proposes three weighted relation matrix generation methods as key points,which are called co-occurrence frequency weight(CFW),concept similarity weight(CSW)and TF-IDF weight(TIW).The results show that the rule features obtained by performing NMF on the matrix generated by CFW have best performance in TAP rule recommendations.As for supervised learning method,this paper proposes a Multi-Modal Representation Learning(MRL)model named TAP-TAG.It combines the text description and graph structure of TAP rules.TAP-TAG has two branches: one is the Knowledge Graph Embedding(KGE)model,which learns the relation features of the triplets extracted from the graph structure;the other is the Convolutional Neural Network(CNN)model for learning semantic features from text descriptions.By mapping and aligning the relation and semantic features learned by KGE and CNN in a common space,and using the distance between them as a loss,we learn the multimodal features.Experimental results show that TAP-TAG helps recommend accurate and diverse TAP rules for users.The experimental results show that unsupervised and supervised learning methods have their own advantages and disadvantages.Unsupervised learning occupies very little time and space resources,and has low requirements for hardware,but its accuracy is low;supervised learning has significant improvement in accuracy,but it also significantly increases the occupation of time and space resources,and has high requirements for hardware.Therefore,it is necessary to select appropriate machine learning methods for Io T rule recommendations according to different application scenarios. |