Cyber-Physical-Social Model for Service Recommendation in the Internet of Things

The services in the Internet of Things (IoT) are the key components to realize the value of IoT. The entity-oriented services are discovered from data. However, a large number of heterogeneous data and entities in IoT increase the difficulty of service development. For this, we propose a cyber-physical-social model to recommend services in IoT. The model consists of four layers: in the physical layer, the individual behavior pattern is defined. The system layer is responsible for handling interaction data to solve the heterogeneous data problem. The cyber layer is the agent layer, where we use the defined agents to establish service logic, shielding the entity heterogeneous problem. In the social layer, we explore the behavior similarity between individual users, achieving entity interaction in different scenes. In experiments, we obtain the data from 5 scenes, and the data is used for 6 experiments. In terms of accuracy and response time, our model has outstanding advantages compared with the previous methods.


Introduction
Since IoT is put forward, it has been a concern by all sectors of society and has become a hot issue. e core idea of IoT is to build an intelligent society with higher service quality, and scholars have done lots of work on it, so far. However, the various heterogeneous problems in IoT hinder its rapid development. Currently, the researchers pay more attention to overcoming the heterogeneous problem for the eventbased service recommendation [1][2][3]. e heterogeneous problem in IoT is multidimensional, i.e., the entity heterogeneous problem and the data heterogeneous problem. e former causes di culty in entity management, and the latter increases di culty in data interaction. A pioneering technique used on this problem is the semantic technique, consisting of semantic annotation, knowledge representation, and inference. In this way, the entity or data can be expressed in a uni ed form, so that their readability and usability are increased. Recently, a few methods have been proposed to settle the heterogeneous problem in IoT, such as semantic-aware framework [4][5][6][7][8] and machine learning-based methods [9][10][11][12][13][14][15][16].
Constructing a semantic-aware framework has been a general method for heterogeneous problems. e semanticannotated entity and data can be captured by the awareness framework, and they are represented by a uni ed knowledge form, i.e., RDF. ese methods can perform the service recommendation via mining information from the represented knowledge form. Recently, the machine learningbased method is receiving more and more attention. e researchers adopt embedding learning to represent the heterogeneous relationship between entities. In this case, the service recommendation is achieved in a quantitative way.

Motivation.
e existing methods have made outstanding contributions to solving heterogeneous problems and recommending services. Nevertheless, they still exhibit two signi cant limitations. On the one hand, existing methods fail to fully consider the heterogeneous problems in IoT. at is, Xiao et al. [8] investigate an enabling semantic interaction between heterogeneous entities for ambient assisted living service in IoT. ey introduce the Entity Device Collocating (EDC) Platform to evolve the interoperability between the virtual and real worlds. ese interactions are created upon entity mirrors mapping entities from the physical world to the virtual world. is method only addresses the entity heterogeneous problem. Yao et al. [13] focus on mining the user interests or needs from heterogeneous relationships embedded in interactions. ey propose a unified probabilistic factor-based framework by fusing relationships across heterogeneous entities of IoT, including the user-thing relationship, the user-user relationship, and the thing-thing relationship, during which they consider various context factors.
is method only considers the data heterogeneous problem. Chen et al. [15] emphasize the role of heterogeneous social relationships in calculating the similarity between heterogeneous objects. ey learn the user preference over time by a latent probabilistic model. Jointly considering the similarity and the user preference, they propose a smart object recommendation model in an IoT environment.
is method only addresses the data heterogeneous problem. Mahajan et al. [16] focus on solving the impact of heterogeneous data on a recommendation. ey believe heterogeneous data factors make it challenging for estimating user and smart object representations, and they derive transition probabilities among objects and users to achieve the user preference learning. However, they ignore the impact of the entity heterogeneous problem.
On the other hand, these existing methods, such as [8,13,15] and [16], ignore the service conflict problem. For example, if user I 1 is using object O 1 , and simultaneously, the recommender explores the optimal service O 1 for user I 2 , then O 1 can not be recommended to I 2 , due to the fact that O 1 is in use. ese existing methods fail to consider the above conflict, which reduces accuracy in practice.

Contribution.
e contribution of our work is to propose an agent-based cyber-physical-social model (CPSM). e model contains four layers. In the physical layer, we build the individual behavior pattern for data collection. In the system layer, we propose a unified data form, which is used to calculate the user-object relationship by a conditional probability, for the data heterogeneous problem. In the cyber layer, we adopt agents as actuators and propose an algorithm for mapping entities to agents, for the entity heterogeneous problem. In the social layer, we develop a behavior pattern-based user similarity measurement for predicting the interests of different users. Besides, when performing CPSM, we propose two-type service allocation strategies to address the service conflict. In the end, CPSM can perform a complete set of information processing, from data collection to service recommendation, as described.
It is worthy to highlight several aspects of our method as follows.
(i) More fully considering the heterogeneous problem compared with existing methods. We design a novel recommender system with multiple hierarchical functions. e recommender can address both the data heterogeneous problem and the entity heterogeneous problem.
(ii) Better responding to the service conflict compared with existing methods. We propose two-type service allocation strategies corresponding to the individual user service recommendation and the multiuser service recommendation. (iii) Empirical experiment evaluations. We implement experiments on datasets of 6 real-world scenes. e outstanding results of CPSM are achieved in comparison with the state-of-the-art methods.

Related Work
In this section, we will briefly review the research studies related to our work, namely, the semantic-based service recommendation in IoT and the machine learning-based service recommendation in IoT.

Semantic-Based Service Recommendation in IoT.
In the early research studies, service recommendation is realized by raw data [11,17], where distributed sensor data is collected, shared, and interacted. However, with the increase of devices and data in IoT, the heterogeneous problems of entity and data are emerging. In this case, the performance of models would be impacted, and then researchers focus on rising semantic technology. Currently, more and more semanticbased methods are proposed. On the one hand, Bermudez-Edo et al. [4] propose the IoT-Lite based on semantic sensor network ontology, which makes semantic descriptions widely adopted, allowing interoperability. Xu et al. [5] consider that users' needs could not be satisfied due to the larger and larger scale of semantic link network (SLN) and provide rule-based faceted navigation for users to freely browse resources in different facets from an SLN. After analyzing the characteristics of interactions and services in IoT, Ahmed et al. [18] integrate multiple QoS requirements and allow partially matched services into IoT service ranking and selection algorithm for improving the accuracy and performance. Beltran et al. [19] adopt the RESTful standard to manage the configuration profile of objects in IoT, and they apply the ontology base to recommend possible automatic operations. Considering the profile of devices, Felfernig et al. [20] employ content-based collaborative filtering to predict user needs on specific devices. e scale of objects in IoT is increasing, which impacts object retrieval efficiency. To address this problem, I. Mashal et al. [21] propose an object clustering by measuring the semantic similarity between two objects. On the other hand, the enabling interactions between heterogeneous IoT entities for ambient assisted living services [8,9,[22][23][24] are also paid more attention. For example, Hussein et al. [24] designed a context-aware recommendation model in a smart home. Xiao et al. [8] create entity mirrors as actuators mapping entities from the physical world to the virtual world, during which interactions continue to evolve based on service semantic logic. Furthermore, in [7], Meditskos et al. present an ontology-driven situational awareness for activity recognition, providing the models for the semantic enrichment and fusion of heterogeneous multisensory descriptors. Ali et al. [25] propose an ontology knowledge-based health-center recommendation system using user preference. ese methods have made a breakthrough in performance. However, the above models can only be applied to handle static data, and there is still a lack of an effective method for adapting to the dynamic scenario.
Our CPSM is different from the above methods in that we integrate machine learning into it to address this problem. In the CPSM system layer, the weights of interactive relationships based on L, T, and F are regarded as the main service logic. e service response is performed with quantitative calculation in probability, and it can be updated in real time. Compared to using semantic rules, the running time is less.

Machine Learning-Based Service Recommendation in IoT.
e applications of machine learning in IoT services are rising in recent years, and this is a new perspective to deal with the heterogeneous problem in IoT. In [26], Assem et al. expound on the significance and applied value of machine learning in IoT services because of big data. And IoT should be a wide application of ambient intelligence that is a usercentric paradigm offering self-adaptive environments and tailor-made services [27]. Typically, Yao et al. [12,13] attempt to discover underlying connections of things via mining the content embodied in human-object interactions based on a graph model, realizing service recommendations in terms of user interests. Similarly, Saleem et al. [28] consider both the people-object relationship and the objectobject relationship to recommend smart objects in IoT. Restrepo et al. [29] present a multiagent-based mathematical model for service allocation with a heuristic, probabilistic search algorithm. Kamara-Esteban et al. [9] present an agent-based simulator for emulating human activities within intelligent environments from a single-user and multipleuser point of view, enhancing the interactions between humans and the environment. Hu et al. [14] propose a novel data representation method tailored to IoT by graph representation learning to further improve the semantic expressive ability of data in IoT. Yin et al. [30] focus on the recommendation for an IoT edge environment, and they utilize the convolution neural network to learn the deep features of users and objects. In addition, some work addresses the temporal influence in IoT recommendation. G. White et al. [31] propose a matrix factorization-based collaborative filtering framework, where they execute paths to dynamic adaptation via QoS prediction for time awareness. Huang et al. [32] propose a time-aware service ranking prediction in IoT, which generates the global ranking of IoT objects from the collection of partial rankings for the recommendation. Urbieta et al. [33] give a time-aware object recommendation supporting dynamic reasoning, which applies an abstract service model to represent objects and user tasks via fusing their profiles and the temporal factor. Recently, Chen et al. [15] establish the heterogeneous social relationship to calculate the similarity between heterogeneous objects, and they learn the user preference over time by a latent probabilistic model. Jointly considering both, they propose a smart object recommendation model in an IoT environment. Mahajan et al. [16] believe heterogeneous data factors make it challenging for estimating user and smart object representations, and they derive transition probabilities among objects to achieve the smart object recommendation with contextual factors. However, these methods almost consider the data heterogeneous problem while ignoring the entity heterogeneous problem. None of them mention the service conflict impact. Simultaneously, in these methods, the setting parameter is static. erefore, there is still a lack of overall consideration of the abovementioned shortcomings.
Our work integrates semantic techniques and machine learning. We use a semantic similarity-based entity-agent mapping algorithm for shielding the entity heterogeneous problem and use machine learning to mine entity relationships via the contexts embedded in interactions to solve the data heterogeneous problem. e parameters are set based on existing data captured from interactions, and they can automatically be updated according to the generated data. And on service allocation, we design the individual user-centric allocation method with a bipartite graph model. Furthermore, for multiple-user interaction scenes, we utilize behavior semantic similarities between different users to establish a social-relationship network.

Model Framework
In this section, we present the framework of CPSM based on the idea of unit-IoT. IoT centered on individual users consists of multiple individual user-based units, which are called niches in this paper.

Definition 1 Niche= (I, I_E, B, O, S).
Here, I is an individual user in the IoT environment and it is also the core element in the niche; I_E represents the intelligent environment, which indicates I's daily life in IoT; B is the behavior of I in the niche. Each B i contains multiple I-O interaction actions (Act), B i � {Act 1 , Act 2 , . . ., Act k , . . ., Act n }; O is an object in IoT; S indicates the sensor and other equipment in I_E, which is used to upload the contexts generated by I-O interactions to the network.

Lemma 1 (service logic). I-O interactions are expressed as
Herein, for I, some implicit relationships are embedded in interobject interactions, such as O 1 which are regarded as service logic for I in our method.
(i) e service logic in individual user scenes. In a mirror, I uses the object O j , the recommender recommends the next object that he/she may be interested in or need based on the created service logic. (ii) e service logic in multiple-user scenes. In one or more mirrors, the recommender recommends different objects to each user corresponding to their own service logic.

Mathematical Problems in Engineering
(iii) e advantage against service conflicts. e service logic is essential in IoT service applications because the service recommendation in IoT is almost an entity recommendation, which is easy to make service conflicts in multiple-user scenes. For example, in an IoT scenario, I 1 is interacting with O j , while the recommender explores that I 2 also interests O j at the moment and recommends it to I 2 in general. However, O j is in use by I 1 and unavailable to I 2 . en, the recommender needs to realize this problem and should recommend another object that is similar to O j to I 2 . e adopted service logic can overcome the conflict using the mined relationship sequence.
As illustrated in Figure 1, (a) is responsible for mining service logic from heterogeneous entities and data. (b) uses the logic to allocate services for individual users (A I ) based on a bipartite graph. In (a), we take each niche as a data generating unit in real living and design a mirror for it in cyberspace. We emphasize system processing, during which an entity-agent mapping algorithm and implicit relationship mining are implemented via the captured data. ese mined relationships are used to build the service logic in the mirrors. In (b), there are two service allocation schemes. e first one is the individual service allocation within each mirror, and the second one is a multiuser allocation between different mirrors. e specific details will be introduced in Section 3.3.

Physical layer
Relationship (values) mining AND mapping entities to agnets System layer Niche1 Niche2 Niche3 Cyber layer

Agent Representation for Heterogeneous Entity.
It is an indisputable fact that the entity in IoT is different and heterogeneous, which makes it very difficult to study the interentity information exchange and apply the implicit entity relationship in IoT. Considering the potential relationship is of great value to IoT services, we propose to design a corresponding mirror (agent) for each entity in the cyberspace of niche to shield the entity heterogeneous problem and realize the unified management. In this way, the I-O interaction is performed by agents. Act). Based on this condition, the context (Ctx), Act, and B are expressed as follows: which is an action sequence of an agent.
For accurately identifying the entity, we present an algorithm for mapping an entity to an agent, as Algorithm 1. In Algorithm 1, the semantic similarity of both identities is considered, such as Sim(Ety i , A i ). When Sim(Ety i , A i ) � 1, the mapping is successful.
Sim(Ety i , A i ) is divided into two parts. One is the string matching of identity as equation (1). C Etyi and C Ai are vectors extracted from the concept of identity, and D(C Etyi , C Ai ) is an edit distance between the concepts.
e other is the WordNet-based semantic similarity as equation (2). depth(C Etyi ) and depth(C Ai ) represent depths of both in the semantic tree, and lso(C Etyi , C Ai ) is the nearest common ancestor concept of both in the semantic tree.

Mining Entity Relationships via I-O Interactions.
When it comes to the entity relationship, our research work is from a single-user and multiple-user point of view. From a single-user point of view, we mine interobject relationships for an individual user in a niche. From a multiple-user point of view, we emphasize the behavior similarity between different users in multiple niches.

Interobject Relationship for an Individual
User. e relationship mining is based on the contents embedded in I-O interactions, namely, contexts. rough analysis of userobject interaction features, we give some main factors for a unified data representation.

Definition 3
Context Ctx � (I, Act, O, L, T, F). As we mentioned, the Ctx is an I-O interaction content. Here, Act is the I-O interaction action, L and Tare where and when Act takes place, respectively, and F represents the frequency of action during this interaction.
In the system layer, we discuss the interobject relationship based on L, T, and F. ω R ij is the relationship value between O i and O j , computed as Herein R L ij , R T ij , and R F ij are relationship values between O i and O j based on L, T, and F, respectively. α, β, and c are weighs corresponding to them, and α + β + λ � 1.
(1) L-Based Relationship Values. Generally, the distance between relative locations of entities is an important influence factor for entity interactions. erefore, we take the distance into account in computing L-based relationship values. As shown in equation (4), R L ij is posed via using the spatial distance attenuation function [34].
where k is a constant coefficient, both p i and p j are the sizes of objects (the number of objects whose locations are the same as ones of O i and O j ), d ij is the actual distance between objects, and θ � 1.5 (i ≠ j).
Considering the location is made up of latitude and longitude in a niche, we use the haversine formula [35] to compute d ij , as  e T-based relationship values are represented by P(t(A j )|t(A i )) in In equation (8), the data in sets is standardized: e range of standardized values is [0, 1], and the average values are normalized in

Behavior Similarity between Different Users in Multiple
Niches. From a single-user point of view, our main work focuses on service recommendations for an individual user. However, different niches are intersected, because multiple individual users are interacting with each other dynamically. Based on the behavior similarity mining between different users, we can achieve the multiuser service recommendation in multiple niches.
In this section, the behavior similarity is expressed by the semantic distance of behaviors, including two parts. One is the action adjacency distance computing with the action vectors. e other is the semantic distance computing for the action label text based on EMD [36].
In equation (10), we use Euclidean Distance Formula to gain adjacency distance between Act i and Act j .
where v (Act i ) is an action vector learned from contexts by the Continuous Bag-of-Word Model (CBOW). ||x|| represents the Euclidean Distance of x. d adj is the adjacency distance between v (Act i ) and v (Act j ).
Definition 4. Act i l and Act j l are the action text labels, and here, Act i l � {(w p1 C p1 ), (w p2 , c p2 ), . . ., (wpm, c pm )} and Act j l � {(w q1 , c q1 ), (w q2 , cq2), . . ., (w qn , c qn )}. c i is the normalized frequency of w i (w i is a word from the action vector.) Act i l and Act j l are composed of multiple sets of words, and we employ EMD to compute the semantic distance between them. As shown in d alt Act i ,Act j � EMD Act i ,Act j � min where d alt is the semantic distance between Act i l and Act j l , and f ij is the consumption of conversion from w qi to w qj . e input:Ctx; output:entity-agent mapping result; (1) 6 Mathematical Problems in Engineering   Mathematical Problems in Engineering 7 semantic distance between Act i and Act j is a linear combination of the adjacency relationship and the action label text semantic, as equation (12): d as Act i ,Act j � λd adj ′ Act i ,Act j +(1− λ)d alt ′ Act i ,Act j .
where d as (ACT i , ACT j ) is the action semantic distance, and . φ represents the empty action, and λ ∈ (0,1). e behavior is represented by an action sequence, which emerges the living state of an individual user over a period of time. Multiple behaviors compose behavior patterns in a niche. Definition 6. Behavior pattern in a niche. S p and S q are the behavior patterns in different niches, respectively. S p ∷ � {(B p1 , c p1 ), (B p2 , c p2 ), . . . , (B pm , c pm )} and S q ∷ � {(B q1 , c q1 ),  (B q2 , c q2 ), . . . , (B qn , c qn )}, where c i is the normalized frequency of B i , and the distance between B pm and B qn is calculated by equation (13). e | B i | is the length of the action sequence, and min(•) indicates the minimum of the consumption conserved from Act pi to Act qj via dynamic programming.
e behavior similarity between multiple users is performed with the distance of different behavior patterns in niches. We utilize the capacity scaling algorithm [37] to solve the semantic distance of behavior patterns, as Algorithm 2.
In Algorithm 2, the main processing includes two parts. One is that regarding action sequences as nodes, the directed edge between any action sequences in S p and S q is established (row 4∼row7). In this part, the time complexity is O(mn). e other is solving the minimum consumption path (row 9∼row10), and its time complexity is O(K 2 (K+2log2K) log(2+b max )), K � max{m, n}.

Service Allocation Strategy.
In this section, we perform to solve the service allocation in two scenarios. One is to provide service for the individual user in fixed scenarios. e other is to provide service for different users in cross scenarios. As illustrated in Figure 2, in (a), when CPSM captures the action context of I i (A I i ) in niche i (mirror i ), the service logic is dynamically generated with a bipartite graph based on the relationship sequence of O i (A O i ). In (b), when CPSM captures the action context of various users in cross niches (mirrors) simultaneously, we adopt the optimal relationship sequence to generate service logic based on the behavior semantic distance between users in [U pq ].

Experiment
In this section, we conduct 6 experiments on 5 real-world data sets to validate the performance of our proposed model CPSM. In order to verify the effectiveness of our proposed model, we adopt the dataset CASAS (http://ailab.wsu.edu/ casas/datasets/) collected from a smart home environment. In CASAS, there are five scenarios, including entertainment place, office, kitchen, transportation, medical place, and home application environment. As shown in Table 1, it is easy to see that the numbers of the marked object and collected Ctx are different between scenarios, because the active frequency of the individual user in each scenario is different. e collected data comes from the behavior records of 100 users within two months.

Evaluation Methodology.
In recent years, some related works have proved the advantages of their methods for service recommendations in IoT. To test the significance of CPSM, we adopt the following methods as baselines.
(i) B.Xiao's logical object-oriented entity interaction method (EDC) [8]. is method proposes a semantic logic-based framework, where it constructs the mirrors as actuators instead of entities.
(ii) L.Yao's implicit relationship mining method based on the graph model (FST) [12].  [15]. is method proposes an object social relationship learning framework, where the similarity between objects can be calculated. Jointly considering the user preference and the object similarity, it leverages collaborative filtering to achieve object recommendations in IoT. (iv) P. Mahajan's smart object recommendation architecture (SORec) [16]. is method proposes a smart object recommendation model, which derives the transition probabilities among objects with contextual factors. It utilizes the probabilities to mine the user preference object.
We evaluate the five methods in accuracy and response time. We vary the training set percentage from 20% to 60% for cross-validation. e corresponding test data is randomly divided into 4 groups. We explore the results through six tests, including simulations from five single scene data validations and one multiple scene data validation.
For the evaluation of accuracy, we consider the service conflict in IoT; namely, one service sometimes may not meet the needs of more than one user at the same time. erefore, we propose a new metric to calculate the accuracy, as follows: where PS is the optimal service recommended to the user, ES is the service that fails to meet user needs, and CS is the conflicting service in PS.
For the evaluation of response time, we measure the running time of each one in the case of the five methods running with the same amount of data. Tables 2-4 show the accuracy based on cross-validation on 6 types of data sets. As we can see, CPSM outperforms the other baselines. On the other hand, with the increase in training set scale, CPSM has an     advantage over the others, and the detailed observations are revealed as follows.

Experimental Results.
(i) When the training set is less than 30%, the semantic logic-based algorithm (EDC) is superior to the machine learning-based algorithms (FST, TSI-temCF, SORec, and CPSM) in general. With the increase of the training set, the performance of FST, TSItemCF, SORec, and CPSM is gradually showing up. e reason is that these methods exploit the mined implicit entity interactions and potential interests, which would help them to provide the more needed services for individual users. Among them, CPSM has the best performance.
is is because CPSM combines both machine learning and semantic techniques against data heterogeneous and entity heterogeneous problems in real IoT applications, and it considers service conflicts in recommendations. Machine learning is able to mine the interobject relationship for an individual user, and on this basis, semantic similarity is used to explore the interindividual behavior relationship. e adopted service logic can handle the service conflict for the user's real-time demand.
(ii) Further, we carry out a second experiment to verify the parameter setting impacts on FST, TSItemCF, SORec, and CPSM in terms of the training set of 60%. In the experiment, we randomly divide the test data from each scenario into four groups to run, and the results are shown in Figure 3. As we expected, CPSM is superior to the other baselines in the performance stability; namely, the performance of CPSM is less influenced by parameter settings. In FST, TSItemCF, and SORec, the parameters in the solutions of the entity relationship mining are set manually, and on the contrary, CPSM will automatically generate these parameters in the processing of the solutions based on the real dataset. In our work, the parameters are obtained by automatic generation, which is closer to the actual demands. (iii) e response time is one of the most important criteria to measure the performance of baselines. We first analyze the time complexity for all methods from the theoretical point of view, as shown in Table 5. EDC performs service recommendations using the established various semantic logics, which consume a lot of time. e time consumption for the other machine learning-based models is similar. Furthermore, we implement experiments on 6 types of datasets to measure the running time. e results are illustrated in Figure 4, which shows that FST, TSItemCF, SORec, and CPSM spend less running time than EDC.
To evaluate the contributions of L, T, and F to CPSM, we implement an ablation experiment. CPSM/L indicates the model that only considers the location factor. CPSM/T is the model that only considers the time factor. CPSM/F is the model that only considers the frequency factor. e results are shown in Figure 5. CPSM outperforms all of CPSM/L, CPSM/T, and CPSM/F, which denotes that each factor plays a role. Among them, the performance ranking is that CPSM/ L > CPSM/F > CPSM/T, which implies that the location factor is the most important for the user, and the user intends to use the object nearby them.

Conclusion
In this paper, we propose an oriented-IoT novel service recommendation method, which shields the multidimensional heterogeneous problems in IoT. To address the entity heterogeneous problem, we propose an entity-agent mapping algorithm for agent representation corresponding to the entity. To solve the data heterogeneous problem, we use the location factor, the time factor, and the frequency factor to learn the entity relationship embedded in user-object interactions. To emphasize service conflict, we propose twotype service allocation optimization strategies for the individual user and multiple users. We use real-world datasets to evaluate the empirical performance of CPSM. e final results indicate that CPSM outperforms state-of-the-art methods in both accuracy and response time.

Data Availability
e data adopted during this study are included in this article.
Disclosure e earlier version is published at the 2020 International Conference on Robots and Intelligent System (ICRIS), and on this basis, this paper has achieved a lot of optimization and improvement on the methodology and experiment.