R-KG: A Novel Method for Implementing a Robot Intelligent Service

: Aiming to solve the problem of environmental information being difficult to characterize when an intelligent service is used, knowledge graphs are used to express environmental information when performing intelligent services. Here, we specially design a kind of knowledge graph for environment expression referred to as a robot knowledge graph (R-KG). The main work of a R-KG is to integrate the diverse semantic information in the environment and pay attention to the relationship at the instance level. Also, through the efficient knowledge organization of a R-KG, robots can fully understand the environment. The R-KG firstly integrates knowledge from different sources to form a unified and standardized representation of a knowledge graph. Then, the deep logical relationship hidden in the knowledge graph is explored. To this end, a knowledge reasoning model based on a Markov logic network is proposed to realize the self-developmental ability of the knowledge graph and to further enrich it. Finally, as the strength of environment expression directly affects the efficiency of robots performing services, in order to verify the efficiency of the R-KG, it is used here as the semantic map that can be directly used by a robot for performing intelligent services. The final results prove that the R-KG can effectively express environmental information.


Introduction
With the advent of the global intelligent service wave, the intelligent service of robots is becoming more and more important. Intelligent service often refers to making user needs a central task. More specifically, intelligent service means providing differentiated services for personalized requirements. For example, different users may propose the same command for "drinking tea" in the standard service. Here, the robot may find a random cup and provide it to someone, no matter who the cup belongs to. However, if the robot provides intelligent service, it can find the difference between the same command; thus, the robot may assign a given cup to its rightful owner.
As can be seen from the above example, to perform intelligent service, the robot must have enough environmental information. In the above example, the robot should obtain physical information concerning the water, water dispenser, and water cup directly from the environment and obtain the functional attributes with the functional relationships of these items. To complete intelligent services, robots also need to dig deeper into hidden relationships, for example, it is also necessary to know the ownership of the cup to complete the tea task more accurately. Therefore, in order to meet the needs of intelligent services, it is necessary to seek efficient environmental expression methods to fully and effectively express complex information in the environment. At present, the commonly used environmental information expression methods mainly include predicate logic representation [1,2], production rule representation [3,4], and semantic web ontology representation [5][6][7]. These efforts promote the expression of environmental information, but ignore the relationship between different entities, and can make it difficult for a robot to express the characteristics of environmental information. Moreover, the existing environmental information methods cause a high degree of artificial participation in semantic information, along with insufficient knowledge reasoning ability. The existing environmental information expression methods cannot meet the needs of robots to further improve their ability for intelligent service. In order to solve the shortcomings of existing methods, we propose the use of knowledge graphs to express complex environmental information.
The knowledge graph has emerged in recent years. It is a graph-based storage structure with powerful query and inference capabilities. It shows strong performance for real-time updates and human-computer interaction [8][9][10][11]. The knowledge graph uses three-tuple representations, composed of subject, predicate, and object node tuples, to effectively express the relationship between objects in a given scene. In addition, the knowledge graph emphasizes the entity relationship and the entity attribute value, enriching the ontology knowledge, and strengthening the understanding of the instance level relationship in the environment. These advantages show that the knowledge graph can strongly help to express the environmental information, so we propose a method based on a knowledge graph that has low human participation and focuses on the construction of entity relationships in the environment. Additionally, the method also can dig deeper into implicit relationships in the environment, strengthening human-computer interaction. However, there very little work has introduced knowledge graphs into the intelligent service of robots, and our work attempts to solve the presently blank application of service robotics.
The use of knowledge graphs can achieve structured environmental semantic information, but this expression cannot be directly used by robots. The way a robot performs intelligent service directly depends on the given map. Therefore, it is also necessary to add the structured environmental information to the map to form a semantic map. A semantic map refers to the addition of semantic information based on a traditional map. Our team has searched for efficient semantic mapping methods to help robots perform intelligent services [12,13]. Our approach here is based on a series of improvements on the basis of our previous work. In this paper, the method emphasizes the relationship at the instance level and strengthens the structured processing of information. Compared with the traditional semantic mapping method, the mapping method that adds semantic information from the knowledge graph has the advantages of good scalability, a strong self-adding ability, and a good map updating ability.
In this paper, we mainly present a knowledge graph model R-KG for robot service, which improves the robot's ability to represent environmental knowledge and store environmental knowledge. We firstly propose a knowledge network construction framework based on knowledge graphing. Then, in order to further explore the implicit relationship between objects in the knowledge network, a knowledge reasoning algorithm based on a Markov logic network is proposed. Secondly, on the basis of constructing the knowledge network, the knowledge network and the structured map are combined to form a semantic map. Finally, through the intelligent service experiment based on the semantic map, it is verified that the use of a knowledge graph to represent environment information can effectively help service robots to perform intelligent services.

Related Work
This section presents some research similar to our work, and many of the ideas within this article refer to these research works. These works mainly include environmental representation research and knowledge graph research. Specially, the semantic map is introduced for combing R-KG and maps to complete in the actual environment.

Environmental Information Expression
The core concept of intelligent service is efficiently expressing environmental information. At present, the commonly used environmental information representation methods mainly include predicate logic representation, production rule representation, and ontology representation.
Ontology theory has become a research hotspot because of its structured knowledge representation and reasoning ability. Park W et al. [14] proposed a scene knowledge network system design based on domain ontology. Hao Q et al. [15] used the ontology knowledge network model to reorganize the original dataset, making the logical structure of the new dataset more suitable for upper-layer applications and improving the utilization of open data. Yang Y et al. [16] proposed a semi-automatic labeling framework for the representation of Web of Things resource metadata. The framework is based on a probabilistic graphical model that maps from a schematic diagram of a Web of Things resource to a domain-independent knowledge network for the collective inference of entities, classes, and relationships. Das P et al. [17] designed an ontology-based information sharing mechanism between robots to form a collective knowledge network which facilitates the overall control and planning of the system. In addition to ontology representation, Ježek P et al. [18] designed a semantic framework and implemented an object-oriented environment representation through the Semantic Web language. Chen et al. [19] proposed a four-tree-based environment representation method. By designing the access code mechanism, robots using this method can quickly grasp environmental obstacle information to complete navigation tasks in complex scenes. Gao et al. [20] designed a threelayer representation model of an indoor environment and represented the home environment in the form of a holographic map, applying it to the object-oriented task service.
These methods promote the development of environmental information representation. However, methods such as predicate logic and ontological representation emphasize the relationship between concepts in the environment and have an insufficient understanding of the relationship at the instance level. The emergence of knowledge graphing has improved these shortcomings.

Knowledge Graph
The concept of knowledge graphing was proposed by Google in 2012 to further improve the performance of search engines [21] and the concept quickly attracted widespread attention. The related research work of knowledge graphs can be traced back to an early expert system [22]. The expert system uses knowledge reasoning to solve a problem that requires expert knowledge. Douglas Lenat designed the Cyc project in 1984 [23], which concentrated a large amount of common sense of life principles and coded them into a knowledge network. After the advent of the internet in 2006, Bernas Lee proposed the concept of linked data (associated data) [24], aiming to establish data to form a huge data network. In 2007, at Washington University, Banko et al. [25] directly extracted the entity relationship triplet from large-scale free text, including the head entity, the relationship indicator, and the tail entity. Marino [26], using a graphical search method combined with a neural network to merge large knowledge graphs in visual classification pipelines, improved the accuracy of image classification. Kem [27] used a knowledge graph model to describe the spatial structure of an environment, including physics and social entities, and used the relationship between them to form a network space map (CSG). Jaya [28] used a knowledge graph combined with speech recognition and language understanding to solve automatic voice recognition issues. Li A [29] proposed a knowledge graph and inference rules based on a five-element model, using a machine learning method to extract and build the ontology in order to obtain network security. Ni Lao et al. [30] proposed a path-based knowledge graph reasoning method, using each a different relationship as a one-dimensional feature. After classifying the feature vector, a classifier was established, and the extracted relationship was used to solve the problem of path reasoning. Jia [31] constructed a graph of Chinese medicinal knowledge, realizing the effective integration of Chinese medicinal knowledge resources and explored the application prospects of Chinese medicinal knowledge graphs. These results show that knowledge graphing has been well applied in many fields, but there are still few studies in the field of service robots.

Semantic Map
In order to verify that a knowledge graph can effectively help a robot to complete an experiment of intelligent service, the knowledge graph being used needs to be applied to a normal map. The reason for applying a knowledge graph to a normal map is to add semantic information to form a semantic map. A semantic map is a map that combines semantic information and information from a traditional map, adapting to the modern wave of intelligent service. There have been many research studies for semantic mapping. Yu et al. [32] proposed the use of cloud resources to construct semantic mapping for service robots and expand indoor environmental information. Zhang Wen et al. [33] proposed a semantic mapping method focused on an automatic scene recognition problem, specifically, creating an accurate real-time scene classification strategy for an indoor environment. In order to efficiently carry out large-scale scene understanding, Jiang et al. [34] proposed a semantic map construction method for large-scale scenes under the conditional random field based on incremental calculation. This method uses binocular vision to estimate camera motion trajectory according to image sequences. Wang et al. [35] used the ontology method to establish the conceptual system of the local information in the building to construct a semantic map for strengthening humancomputer interaction ability. Wu et al. [12] proposed the construction of a semantic map for intelligent service tasks, effectively enhancing the robustness of semantic mapping. Here, our semantic map focuses on application to service robots and how to integrate the knowledge graph into the map. The steps of this are shown in Section 5.

Robot Intelligent Service Based on Knowledge Graph
This section details the knowledge graph construction process suitable for service robots, including the construction process of the R-KG data layer and concept layer, an especially introduces multimodal entity semantic fusion to realize entity semantic fusion. In the construction of R-KG, it specifically combines the information in the environment with Internet knowledge, expands the information in the environment, thus enhancing the robot's ability to express the environmental information.

The Framework of R-KG Construction
When robots provide intelligent services, it is not enough to only recognize objects in scenes. In order to achieve higher intelligence and autonomy, robots need to grasp various attributes of environmental objects, such as their location, function, and operation methods, not just the category of objects. Considering the diversity of knowledge shown above, robot knowledge graphs (R-KGs) can be used to express environmental information. R-KGs notably help robots to improve their intelligence. Figure 1 shows the framework of R-KG construction.
In Figure 1, the whole process is mainly divided into data acquisition, data layer construction, concept layer construction and final knowledge graph generation.
The data acquisition part is divided into environmental information acquisition and knowledge acquisition from the Internet. The acquisition of environmental information mainly includes identifying items in the environment and preserving the features of items. The knowledge acquisition from the environment connects with the knowledge acquisition from the Internet. For example, when cups are learned of in the environment, the extended attributes of the cups are searched through the Internet, such as "cups can hold water".
The role of the data layer is to add and save environmental information and extended attributes found through the Internet. At the same time, it also needs to perform semantic alignment to complete the addition of data.
The concept layer is to store the knowledge of the data layer in a standard conceptual form to form a standardized expression, which is introduced in Section 3.4.
The final formation of R-KG is to store the previously expressed knowledge through the knowledge base such as neo4j.
The framework mainly includes the construction of a data layer and the construction of a concept layer. The conceptual layer stores refined knowledge (concepts) that are built on top of the data layer and are at the heart of the entire knowledge graph. Figure 2 uses an example of an actual scenario to explain the details inside the data layer and the concept layer and shows the hierarchical relationship between them, which is conveniently expressed. Figure 3 shows the internal structure of data acquisition. In terms of knowledge acquisition, when acquiring knowledge on the Internet, such knowledge is mainly stored on the Internet in two main ways: structured knowledge and unstructured knowledge. Structured data is stored in the database, and the data can be expressed logically with a two-dimensional table structure. Unstructured knowledge is more loosely organized, such as text documents, XML, HTML, etc.

Data collection
Entity data padding

Data Layer Construction
As can be seen in Figure 1, there are different sources of R-KG construction. A knowledge extraction module, shown in Figure 3 is proposed here. The main functions of each module are as follows: Document downloader: The robot crawls webpage text via crawler technology and downloads it to local storage and then processes the webpage text to remove invalid data, thereby obtaining the text data to be learned.
Entity and entity relationship extraction module: This module is based on Stanford University's open source toolkit CoreNLP, which was developed for natural language processing. By using the named entity recognition (NER) parsing module in CoreNLP, the lexical features of the statement are analyzed to realize the entity relationship of the content obtained by the document downloader.
The triplet downloader: Used for structured data, this downloader does not need to be extracted by the entity and entity relationship module, but instead directly downloads the triplet from the data source as a candidate triplet to the triplet candidate set through the triplet downloader.
The triplet filter: The relationships extracted by the robot from the unstructured and structured data must inevitably contain repeated information, and the triplet filtering module avoids the repeated addition of information.
The environment information extraction module: This module obtains the location and attribution relationship between the given entity and other entities in the environment through semantic SLAM (simultaneous localization and mapping) technology [36] and spatial structured reasoning technology [37].  Through the knowledge extraction module, the robot extracts entities and relationships from the environment and generates a triple set. However, the triple set is not the final knowledge graph. It is also necessary to perform entity semantic alignment on the triples in the set to achieve the fusion of different sources of heterogeneous knowledge, as Section 3.3 shows.

Multimodal Entity Semantic Fusion
In the process of adding entities to the data layer, entities with different data sources may point to the same object in the real world (e.g., "New York" and "NY" both point to the same American city). Therefore, the entity names that point to the same objects need to be connected to infer the same object in the knowledge graph, which we call entity semantic alignment. The knowledge graph adopts multimodal entity semantic fusion (MESF) to solve the problem of entity semantic alignment.
Because the obtained data has both unstructured text knowledge and structured knowledge. In this section, skip-gram algorithm is used to solve the vector of text knowledge, and TransE algorithm is used to solve the vector of structured knowledge.
Semantic fusion firstly transforms textual information into vectors. Figure 4 shows the flow of the generating vector of textual words. Figure 4 shows the process of obtaining the word vector. In Figure 4, the uppercase letter W represents words and the lowercase letter w represents neural network weights. Skip-gram predicts the probability of a context word appearing based on a given word and provides training samples for neural networks that form word vectors on the right. In the skip-gram, a parameter called skip_window is defined, which represents the predicted number of context words. Also, another parameter is defined called num_skips, which represents the number of outputs. For example, there is a sentence "the cat sleeps at the sofa", where "cat" is selected as the input of the skip-gram model and skip_window = 2 and num_skips = 2. Through the skip-gram model, two sets of training data (input and output) can be obtained, such as "cat" and "sleeps" or "cat" and "the". One-hot encoding is performed on the words in these training data. The positions where the words appear are marked as 1, and the rest are marked as 0. For example, the encoding of "cat" in the above example is (0,1,0,0,0,0). After one-hot encoding of the training data, it is then used as an input for a neural network to obtain the weight of the neural network, shown on the right in Figure 4, before multiplying the one-hot encoding of the neural network and the weight parameters of the neural network to finally obtain the corresponding word vector.  h r t and a relationship, r , as a translation from entity h to entity t . Table 1 shows the detailed steps of the TransE algorithm [38]. / e e e ← 6.

12.
Update (h,r,t): As Table 1 shows, for a given triplet (h, r, t), the TransE model converts the relationship r into a vector, ' r . In this way, the entities h and r can be connected in the form of vectors with small losses.
Defining the distance function ( , ) d h r t + , the formula is shown as follows.
Equation (1) is used to measure the distance between h + r and t. The distance function is minimized using the hinge loss function during the training of the model. The hinge loss function is defined as follows [38]: In Equation (2), S is a triple set in the structured knowledge graph, ' S is a negatively sampled triplet, and γ is the separation distance parameter, where its value is a positive number. After the TransE model training is complete, vector representations of entities and relationships can be obtained.
In the actual environment, too high vector dimension will lead to a rapid increase in the amount of calculations, thus limiting the practical use of the method. Therefore, after obtaining the vector high-dimensional representation, it is necessary to reduce the dimension to adapt to the real environment. Thus, after obtaining the multimodal vector representation, a singular value decomposition (SVD) method is used to reduce the dimension of the vector. Here, matrix M may be entered, which can be decomposed into three matrices by singular values, as per Equation (3): where U and V are unitary matrices and Σ is a diagonal matrix where singular values on the diagonal M are decremented in descending order. By taking the first k columns and the first k singular values, we can get a new k-dimensional representation to achieve dimensionality reduction. Then the vector of text knowledge and structured knowledge is obtained, the similarity measure is performed by using Equation (4) [38] to complete the semantic fusion.
In the formula, Ai and Bi are the components of vectors A and B. The similarity of the vector calculated by the formula with the ranges (−1,1), where −1 means that the entities represented by the two vectors are completely different and 1 means that they are two identical entities. By calculating the similarity in Equation (4), it is judged whether the semantics are consistent, and the fusion is completed.
After the knowledge extraction and multi-modal entity semantic fusion module processes have occurred, the robot completes the construction of the data layer in the R-KG.

Concept Layer Construction
After completing the construction of the data layer, it is necessary to further extract the conceptual relationship among the data. The construction of the conceptual layer is divided into two steps, namely, the extraction of concepts and the establishment of relationships between concepts. Specifically, to identify and classify entities in the environment as concepts and then establish an upper and lower relationship between the concepts based on the hierarchy and connection between concepts, respectively.
The knowledge graph extracts the candidate concepts by calculating the frequency of their use in the vocabulary in the domain document. Since the service robot mainly works in an indoor environment, the candidate concepts mainly represent indoor information. Here, the concept is a word or phrase that appears at a fairly high frequency in the field. The concept of an indoor environment is defined by the following two characteristics, namely, (1) that the frequency of occurrence in the indoor field is higher than that occurring in other fields and (2) that the distribution in the indoor field is more uniform, rather than being concentrated in individual indoor domain documents.
For the first feature, a quantitative description is made using domain relevance. Domain relevance is a quantitative indicator that describes the relevance of concepts and domains. The equation for this is as follows: represents a collection of domains and ( | ) k P t D represents conditional probability, which is derived as follows: where , where dj represents any document in the domain and , t dj f is the probability that concept t appears in the document. By setting the parameters , α β , the probability of a concept unrelated to the neighborhood being found is reduced.
After extracting the relevant concepts of the indoor field, it is necessary to establish a connection with these mutually discrete concepts. In the knowledge graph, the concept is connected by the above lower relationship, so establishing the essence of the concept is to establish the upper and lower relationship of the concept.
In the language area, some fixed language patterns are used to describe relationships between objects, such as "X is a Y" or "A is like B and C". Using these linguistic models to describe the relationships between the upper and lower positions, the robot can learn the subordinate relationship of concepts in the encyclopedic text related to the indoor field, thereby concatenating the discrete concepts and forming a structured hierarchical concept layer. The hierarchical relationship of concepts is shown in Figure 5. It is an example of the relationship of the concept hierarchy, which shows that the relationship of the concept hierarchy is essentially the logical conception of human beings.
In this way, the robot establishes the concept layer and data layer of the R-KG to express the environment information perceived by the robot ontology and the semantic description information, such as the attributes, concepts, and relationships of the entities acquired by the internet.

Knowledge Reasoning Based on Probabilistic Soft Logic
Knowledge extraction and semantic fusion can basically construct the knowledge graph. However, the service robot can only acquire some low-level knowledge here, such as physical attributes, category attributes, and the position attributes of the entity. Using this low-level knowledge, robots can only perform general services, such that the robot cannot perform intelligent personalized services. Some implied high-level knowledge needs to be obtained through knowledge reasoning, such as spatially reflecting the attribution between operable small items and fixed large items, along with the ownership relationship between the operable items and their given owner. Obtaining this knowledge realizes the independent development process of the knowledge graph and strengthens the intelligence level of a service robot.
In order to realize deep reasoning of knowledge graph, this paper proposes a knowledge reasoning network based on probabilistic soft logic (PSL) to mine the relationships in the deep level of the R-KG. Figure 6 shows the reasoning framework of probabilistic soft logic.

Inference rule acquisition
Weight learning PSL inference

Relationship determination
Add relationship Figure 6. Reasoning framework for probabilistic soft logic. Figure 6 shows that the framework of knowledge reasoning mainly includes the acquisition module of the inference rule, the weight learning module, and the inference module. For the acquisition of inference rules, the path features in the knowledge graph are obtained by the goaloriented wandering strategy, and the query predicates and evidence predicates are generated, thereby constructing the rule definition of the evidence predicate to the query predicate. For learning rule weights, a prior knowledge graph on query predicates and evidence predicates is used for discriminant training to obtain the weights of the given rules. Finally, the probabilistic soft logic model is used to calculate the maximum probability value of all rules and the inferred knowledge is added to the knowledge graph to realize the autonomous development of the knowledge graph.

Acquire Inference Rules
Learning rules in the knowledge graph mainly includes three processes, namely, the acquisition of the knowledge graph path, the matching of the path features, and the learning of rules in knowledge graph.
Above, in the knowledge graph path reasoning, a walk strategy with target guidance was used [39]. According to the dynamic calculation of a given target ( , ) R H T θ = , the potential of each adjacent node can be calculated, and the walk can be guided according to the possibility, as to avoid the introduction of noise. Here, H and T represent entities and R represents relationships for a given target The formula for calculating the probability that the connection edge g of entity i to entity j (that is, the relationship, r, between i and j) is selected as follows [39]: where , i j r P is the probability that edge g is selected and ( ( , ), ) is the possibility to measure that edge g is selected, where the calculation needs to incorporate global information, introducing vector representations of entities and relationships to calculate Φ : [ , ] represent the vector representations of relationships and entities, respectively. Path collection in the knowledge graph can be obtained by random walking with a target orientation. Traverse path collections are used to generate query predicates and evidence predicates. The definitions of query predicates and evidence predicates are shown in Table 2. Table 2. Query predicates and evidence predicates.

Category
Logical Representation Meaning Query predicate Relation (entity 1, entity 2) There is a relationship between entity 1 and entity 2 Evidence predicate Has Path (entity 1, entity 2, n) There are n relationship paths between entity 1 and entity 2 According to the query predicate and evidence predicate generated in the knowledge graph path, the rule definition of the evidence predicate to the query predicate is constructed, and the normalized representation of the training rule formation in the training set is shown in Figure 7.  As shown in Figure 7, assuming that there exists a relationship r3 between e1 and e3 in the knowledge graph, this triplet is called a query predicate. Next, we find all the paths in the knowledge graph where e1 and e3 exist, such as (e1, r1, e2) and (e2, r2, e3). Such triplets are called evidence predicates. Then, there is a relationship where r3 = r1 + r2 between the evidence predicate and the relational predicate. In this way, a new rule is generated. If the entities e4 and e5 are connected through the relations r1 and r2, then a new triplet (e4, r3, e5) is generated.

Learn Weights of Rules
After learning the inference rules, the method of maximum likelihood parameter estimation is commonly used to learn Markov logic network model weights [40]. In the database, if a closed atom is in the database, we set its value to 0. For n closed atoms, the database can be represented by vector Therefore, based on Equation (12), the gradient of the log-likelihood function for the weight wi of the rule Fi is expressed as follows [40]: In Equation (12) databases. However, the number of statistical rules Fi in the database is very complicated. It is very difficult to calculate the establishment expectation Fi. Therefore, the method of directly using the maximum likelihood estimation is not practical. The use of discriminant training to obtain the weights of the rules [41] is an effective method. To this end, the data are divided into two sets, namely, query predicate set Y and evidence predicate set X. Learning weights by finding the maximum likelihood estimate for the conditional probability is carried out as per Equation (13) (13) In Equation (13), Zx is the distribution function under the given X condition and ( , ) i n x y is the number of closed formulas corresponding to the ith formula. The conditional log-likelihood function of Equation (12) is biased to obtain the following differential function [41]: where is the number of closed-form true values of the ith formula based on the current weight vector 1 2 { , , } n W w w w =   ， in all possible databases. When the number of rules for the ith formula in the knowledge graph is greater than its own expectation, the value of wi (the weight of the rule) will increase in the iteration, otherwise the weight will decrease.

Knowledge Graph Reasoning Based on Probabilistic Soft Logic
The method of probabilistic soft logic is to reason about the uncertain knowledge in the knowledge graph. The uncertainty of knowledge in the knowledge graph can be expressed as follows: ( 1 2) max{ ( 1) ( 2) 1,0} I l l I l I l ( 1 2) min{ ( 1) ( 2),1} I l l I l I l ∨ = + (16) ( 2) 1 ( 1) I l I l ¬ = − (17) The probability that the fact r is denoted as I(r), and the satisfaction of the distance between each entity relationship and the true value of knowledge (actual fact) is expressed as follows: where rbody is the inference result and rhead is the corresponding fact. By using d(r), the probabilistic soft logic defines the probability value of the probability distribution for all facts: where r λ is the rule weight, R is the rule set, and ( ) d r is the distance between the fact and the inference prediction result. It is impossible to satisfy each rule in the reasoning process of the probabilistic soft logic inference model. Therefore, the probabilistic soft logic model calculates the maximum probability value of interpretation of all rules in the dataset by the maximum inference algorithm (MPE). The distance satisfaction between the interpretation of the highest probability value and the interpretation of the lowest probability value is the most probable interpretation of the closed atom, which satisfies all the logical rules as much as possible, that is, the weight value and the maximum of all the satisfied rules.
After learning the inference and weight value learning rules, the next step is to create a flow chart of knowledge reasoning training based on the Markov model. The steps of this are as shown in Figure 8.   Figure 8 shows the entire process of knowledge reasoning based on probabilistic soft logic. The specific technical details of each part have been introduced in the previous sections. Through the knowledge reasoning process shown in Figure 8, R-KG can obtain deeper relationships and improve itself autonomously.

Semantic Map Construction Based on R-KG
In order to verify that the R-KG can be greatly used by robots, it is necessary to enable the robot to complete the service in the actual environment with R-KG. The robot performs intelligent service directly via the semantic map, so the R-KG is combined with normal map to form a semantic map for performing tasks. Figure 9 shows the framework of semantic map construction based on the R-KG. Computer,desk,keyboard..

Feature Extraction
Knowledge base

Map construction
Semantic map Semantics coordinate Figure 9. The framework of semantic map.
The semantic map construction framework, based on the R-KG, has the following steps for construction: Step 1: Use the Kinect camera to obtain scene information. The Kinect camera will generate both a color image and a depth image. The pixels of the color image are represented as (x, y, g, b), and the pixels of the depth image are represented as (x, y, d). (x, y) represents the position of the pixel in the picture, (r, g, b) represents the color value of the pixel, and d represents the depth distance of the pixel. The PCL library was then used to convert the depth and color images into point cloud data.
Step 2: After obtaining point cloud data, use Mask RCNN technology to perform instance segmentation on the obtained point cloud. The point cloud is labeled with the semantic information of the item.
Step 4: The ORB features of the detected items in the environment are used to match with the item feature library in the R-KG. After the matching is successful, search R-KG for attributes related to the detected item. The item's point cloud and attributes are added to the corresponding location on the raster map.
Step 5: Repeat the process above.
Step 6: The construction of the semantic map is complete.

Analysis of Experimental Results
In the actual environment, the knowledge graph can effectively represent the semantic information in the environment. After forming the semantic map in combination with the grid map, it can help the robot to complete the intelligent task efficiently. Here, the experiment analyzes the validity of the construction of the R-KG and verifies the effect of the environmental information expression based on R-KG.

R-KG Simulation Results
In order to more intuitively display the effectiveness of the method, we selected the kitchen module in the R-KG to demonstrate the structure of the knowledge graph. The simulation of the kitchen module construction is shown in Figure 10. The knowledge graph was constructed and queried using the Neo4j database.  Figure 10 shows a part of the R-KG in the kitchen environment to more clearly show the internal characteristics of R-KG. It shows that R-KG stores the environmental information in the form of node relationships in the graph, also shows that the items are associated with each other in a logical level. These characteristics correspond to the fact that R-KG does not simply store information, but it is to explore the effective association of items through the logical relationship between the items, so as to form an efficient representation of the information.

Analysis of Entity Semantic Fusion of R-KG
In the process of R-KG construction, the semantic alignment of knowledge from different sources is needed. In order to verify that the multi-modal entity semantic alignment method proposed in this paper can effectively solve the problem of reducing entity semantic ambiguity in the knowledge network construction process, we took 50 sets of objects related to robot service from the YAGO [42] and encyclopedia knowledge bases. The multi-modal entity semantic fusion method was used for semantic fusion here.
The Precision (P) and F1 values were used to evaluate the semantic fusion effects of entities, R stands for Recall. The definitions are as follows and Table 3 shows the detailed concepts in the equations 20,21. According to the above-mentioned precision rate and the evaluation index of the F1 value, the test results obtained by the experiment are shown in Figure 11. The blue line in Figure 11 is the precision rate result and the red line is the F1 value result. By observing the semantic fusion results of 50 sets of test samples, the precision of the multi-modal entity semantic fusion method and the average value of F1 are both about 70%.
As mentioned in the semantic fusion section, in order to use this method in a real environment, we took a dimensionality reduction operation. Higher-dimensional semantic representations will bring more accurate semantic fusion effects, while reducing dimensions will lose some accuracy. Our approach is a compromise between accuracy and efficiency. In this case, our method still maintains an average value of 70% in terms of precision and F1 value, which shows that our method achieves a better effect. At the same time, it can be seen from the figure that the precision and F1 value are worth stable changes, which shows that the method has better robustness.

Analysis of Knowledge Reasoning Based on Markov Logic Network
The reasoning of the R-KG aims to dig deeper into relationship hierarchies in a given environment. For example, in the previous example of the tea-drinking task, the dominant knowledge of the knowledge graph includes that the tea needs hot water and that the hot water comes from the water dispenser. Through the logical reasoning method, it can be concluded that there is a direct connection between the tea and the water dispenser. When the task is executed, the robot automatically links the two to complete the intelligent service.
In order to verify the accuracy and efficiency of the Markov-based knowledge-based reasoning algorithm proposed in this paper, common knowledge graph inference methods such as the TransE algorithm, Rescal algorithm and Markov Logic Network (MLN) algorithm have been used as horizontal alignment. TransE infers new knowledge by computing the distance of vectors which transform entities and relationships into low-dimensional vector spaces. The Rescal algorithm decomposes the structured data into entity and relation matrices by tensor decomposition and makes the product of the decomposed relationship and entity matrices as close as possible to the original tensor value. Two subsets of WN18 and WN11 were selected from the Freebase knowledge bases FB15k [43] and FB13 [44], using the Wordnet knowledge network to verify the effect of knowledge reasoning. Figure 12 shows the running time comparison of the four algorithms under the dataset, and Table 4 shows a comparison of the reasoning accuracy.  In Table 4, the evaluation criteria refer to the literature [45], Mean Rank represents the average number of correct results ranked in the forecast results. The smaller value of Mean Rank, the better prediction is. Hits@10 represents the probability the correct result in the top ten of the forecast results. Similarly, Hits@1 represents the probability that the top one result is the correct of the forecast results.
Seen in Figure 12, our method almost requires the least amount of time out of the four datasets, which shows our algorithm is superior to other methods in terms of operational efficiency. As can be seen in Table 4, in mean rank's comparison, our method shows a stable effect, the gap is little compared with the optimal method on each dataset. In comparison of Hits@1 and Hits@10, our method is obviously better than other methods. These comparison results show that our method has advantages in accuracy.
By synthesizing the results of Figure 12 and Table 4, it can be seen that our method of knowledge reasoning has advantages in efficiency and accuracy.

Intelligent Service Experiment
The introduction of this paper shows that robots cannot directly use the knowledge graph to complete intelligent service as intelligent service depends on the map. Thus, in order to verify that R-KG can effectively express environmental information, this paper adds the structured knowledge of R-KG to the normal map for constructing the semantic map as shown in Figure 13. Also, we set the comparative group that adds information based on ontology theory to construct the semantic map [46]. The experiment has compared the differences between the two groups in two aspects, the accuracy and speed of the robot performing the intelligent task.
The experiment uses a "Turtlebot" robot as experimental platform. The operating environment is set up on a computer configured with an Intel Core i5-6500 CPU, 8GB of memory, and Windows 10. Turtlebot's hardware mainly includes Yujin Kobuki mobile base, 2200 mAh battery and removable structural module. Kinect vision sensors are installed at the same time. The color camera resolution of the Kinect sensor is 1920 × 1080, 30fps, and the depth camera resolution is 512 × 424, 30 fps. The robot uses the ROS (robot operating system) operating system to help the robot achieve 3D mapping and follow functions. The robot moves at 0.5 m/s. Five sets of data were designed experimentally. The five sets of data were obtained by placing the robot at the starting position of 3 m, 4 m, 5 m, 6 m, and 7 m from the target area. In each set of data, we selected 20 groups of tasks, for example, finding the glasses of Adam (a fake name), letting the robot send water to Adam, etc., evaluating the efficiency of R-KG according to the number of times the task was completed correctly. The experimental results are shown in Tables 5 and 6.  Tables 5 and 6 present 20 sets of data at each distance. Table 5 shows the data of the robot accurately performing tasks at each distance. Table 6 shows the average time required for the robot to accurately complete the task at each distance. For example, at a distance of 3 m, the robot has completed the task correctly 10 times and the average time is 16 s. Table 5 shows that our method is more accurate than the traditional method, and Table 6 shows that our method is faster than traditional method. As the distance increases, our method's advantages in speed and accuracy are more obvious.
The reason for the difference between two groups is that the R-KG fully expresses the semantic information of the environment, such that the robot can use the expressed knowledge to form its own logical chain, thus completing the task. For example, when searching for a cup, the robot can use the learned knowledge to find that the cup is on the table and the table is next to the wall, then the cup feature on the table matches the cup of A to obtain the belonging relationship. In this way, when the robot performs the intelligent service using the map, the related landmark points can be quickly found, thereby completing the task accurately and efficiently. Additionally, as the distance increases, the search space faced by the robot is larger, and the advantages of our method are more obvious, which is verified in Tables 5 and 6. These experimental results demonstrate that our method can effectively express the environmental information, thus helping the robot to efficiently complete intelligent services.
Finally, Figure 14 visualizes the entire process of the tea-drinking task. In Figure 14, (a) (b) (c) (d) respectively show a part of the entire task. (a) shows that the robot first obtains the cup from the environment. (b) shows that after the robot finds the cup, it finds tea in the environment and adds it to the cup. (c) shows that the robot found hot water and added it to the cup after completing the first two steps. (d) shows that after the first three steps have been completed, the cup is delivered to the person being served.
In Figure 14, the entire task took 4 min, where the robot accurately identified the cup belonging to "B" and found the tea through the environmental information represented by the knowledge network, adding hot water. The personalization requirements presented in this paper were verified by identifying the water cup of "B", and the time spent completing the entire task was short, showing the efficiency of completing the task. The whole experiment, together with the previous item search experiments, proves that using knowledge maps to represent environmental information can effectively help robots to complete intelligent services.

Conclusions and Future Work
In order to realize the intelligent service of robots, this paper has proposed a R-KG model combining a knowledge graph and robots. Firstly, this paper has proposed to combine the environmental information perceived by the robot with the sensor and the knowledge of the internet to form a logical reasoning knowledge base for the R-KG. Then, the semantic fusion of the entities in the process of constructing the knowledge base has been carried out, and the effectiveness of the semantic fusion has been verified by experiments. At the same time, the conclusion on knowledge reasoning proves that our proposed method of knowledge reasoning based on probabilistic soft logic has advantages in efficiency and accuracy. It can help R-KG to achieve autonomous development of itself. Finally, the knowledge graph using for semantic map were combined to verify that the R-KG model can help robots in the actual environment. The results of these knowledge analyses proved that R-KG can efficiently characterize the environment and help service robots to complete intelligent services.
The work presented in this paper requires further research, mainly on the following aspects: (1) The process of knowledge fusion to the knowledge base requires further research. Only the semantic fusion of items is considered, and there is no existing research on the relationship between items and the fusion of item attributes, so some algorithms related to the fusion of item attributes and item relations may be considered in the future in order to achieve better knowledge fusion.
(2) The process of knowledge reasoning requires further research. The autonomous learning of inference rules can only mine existing rules in the knowledge base, and it is impossible to learn some inference rules that have never appeared in the knowledge base. In the future, one may consider borrowing some deterministic reasoning method to improve the accuracy of reasoning.

Conflics of Interest:
The authors declared that they have no conflicts of interest to this work.