An adaptive elderly care service recommendation method integrating long-term and short-term features

By constructing knowledge-interactive heterogeneous multi-graphs and using graph neural network models to integrate long-term and short-term features, the problem of cold start and update lag in the existing technology is solved, and high accuracy and personalized elderly care service recommendations are achieved.

CN119046536BActive Publication Date: 2025-04-11SUZHOU SIGMA BUILDING INTELLIGENT ENG
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411525120.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-04-11
Estimated Expiration
2044-10-30

AI Technical Summary

Technical Problem

The existing technology has problems of cold start and update lag in the recommendation of elderly care services, making it difficult to accurately recommend new users or provide personalized services in the absence of historical data.

Method used

Adaptive elderly care service recommendation method that integrates long-term and short-term features is adopted. By constructing an interactive directed graph of knowledge directed graph in the elderly care field and user interaction session sequence, it is fused into a knowledge-interaction heterogeneous multi-graph, and the graph neural network model is used to train the embedded vectors of users and services, calculate the recommendation scores and sort them.

Benefits of technology

It improves the accuracy and personalization of elderly care service recommendations, avoids the problem of repeated recommendations, enhances the diversity and novelty of recommendations, and reduces the cost of computing and storage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119046536B_ABST
    Figure CN119046536B_ABST
Patent Text Reader

Abstract

The present invention discloses an adaptive elderly care service recommendation method that integrates long-term features and short-term features, comprising the following steps: integrating the constructed knowledge directed graph and interaction directed graph into a knowledge-interaction heterogeneous multigraph; encoding different nodes and edges in the knowledge-interaction heterogeneous multigraph; converting the attributes of the nodes into feature vectors; performing neighbor aggregation on the nodes in the graph; training the knowledge-interaction heterogeneous multigraph model based on a graph neural network; using the trained model to generate embedding vectors of users and services, calculating recommendation scores based on the user and service embedding representations, sorting according to the recommendation scores, and generating a final recommendation list. The method of the present invention integrates the long-term features of the knowledge directed graph, does not rely on the user's preference data and historical behavior data, and does not have a cold start problem. At the same time, it also integrates short-term interaction features, effectively utilizes the complex relationship information in the heterogeneous multigraph, and improves the accuracy and personalization of the recommendation system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of service recommendation for digital elderly care, and specifically relates to an adaptive elderly care service recommendation method integrating long-term features and short-term features. Background Art

[0002] Digital elderly care is a management model that uses modern information technology, the Internet and smart devices to improve the quality of life and nursing services for the elderly. By collecting and analyzing the health and behavioral data of the elderly, more accurate and personalized elderly care services can be provided to the elderly. At present, elderly care services mainly involve nursing services, medical services, rehabilitation services, catering services, housekeeping services and other contents. Among the many services, elderly users and their families need to spend a lot of time and energy to find elderly care services that meet their needs. However, the elderly care needs of different elderly groups (such as healthy people, disabled people, empty nesters, etc.) are not the same. Even for the same group, the service needs under different scenarios and conditions are different. How to accurately recommend elderly care services to the elderly among the many elderly care services and meet their personalized needs is the guarantee for improving the quality of elderly care services.

[0003] The most widely used recommendation technology is collaborative filtering technology, which makes recommendations based on similarity analysis with users (or products) to determine the characteristics, value, and potential attributes of users (or products). Collaborative filtering technology needs to use historical data to learn users' potential interests and preferences. If there is no historical data, the user's preferences cannot be obtained, and the recommendation results will be inaccurate. In addition, if some new user data is added, the user's preferences need to be relearned, which is inefficient. Therefore, collaborative filtering technology has the problems of cold start and update lag.

[0004] The Chinese patent with publication number CN111767469A discloses a method and device for recommending elderly care services. First, the health data of the target object is obtained, and then the target object is classified by a clustering algorithm to obtain the corresponding category of the target object; the historical behavior data is retrieved according to the corresponding category, and then the recommended elderly care service data is calculated based on the collaborative filtering recommendation algorithm and returned. The coordinated filtering recommendation method is difficult to give effective recommendations in the absence of historical data, especially when new users or new items just enter the system, there is a "cold start" problem.

[0005] Literature (Li Jingxuan. Elderly Care Service Recommendation Method Based on Knowledge Graph and Sentence Embedding [D]. Harbin Institute of Technology, 2019.) In view of the fact that the elderly have fixed consumption habits, this paper studies the implicit preference time series elderly care service recommendation method based on knowledge graph. This method first chooses to perform deep time series modeling on the elderly's preferences, and learns the implicit preference information of the elderly by serializing the historical service interaction records. Then, the GRU (Gated Recurrent Unit) model is used to learn the service vector through the improved ProjE knowledge embedding method to further improve the accuracy of service recommendations. Although this method does not use all the information of the service and historical interaction records, it has made some improvements in solving the cold start problem, but when recommending services, it does not consider the constraints of user-specific needs and cannot meet the requirements of personalized service recommendations.

[0006] The Chinese patent with publication number CN114840777A discloses a multi-dimensional elderly care service recommendation method, device and electronic device. First, the knowledge graph is learned to obtain the matching scores between the elderly user and multiple elderly care services to be recommended, and a set of elderly care services to be recommended is formed to realize elderly care service recommendations based on the personal dimension of the elderly user. On this basis, based on the multi-dimensional user feature information of the elderly user and the matching scores between the elderly user and multiple elderly care services to be recommended, a demand model for community elderly care services is constructed and the weights corresponding to each user feature information are determined through learning. And taking the administrative division of the elderly user's residence as the dimension, the demand for each community elderly care service is scored according to the user feature weight and the elderly care service matching score, and finally an accurate recommendation of elderly care services compatible with personal dimension recommendations and community dimension recommendations is formed. However, this method lacks sufficient user interaction data and it is difficult to provide accurate elderly care service recommendations for new users. In addition, the knowledge graph needs to be continuously updated to reflect the latest information, and the real-time performance of the recommendation is poor.

[0007] Therefore, an adaptive elderly care service recommendation method that integrates long-term and short-term characteristics is urgently needed. Summary of the invention

[0008] In order to solve the defects of the prior art, the present invention provides an adaptive elderly care service recommendation method integrating long-term characteristics and short-term characteristics.

[0009] In order to solve the above technical problems, the present invention provides the following technical solutions:

[0010] The present invention provides an adaptive elderly care service recommendation method integrating long-term characteristics and short-term characteristics, comprising the following steps:

[0011] S1. Construct a knowledge directed graph in the field of elderly care based on the entities, attributes and relationships involved in elderly care services;

[0012] S2. Construct an interactive directed graph based on the user's interactive conversation sequence;

[0013] S3, fuse the knowledge directed graph and the interaction directed graph into a knowledge-interaction heterogeneous multigraph;

[0014] S4, encoding different nodes and edges in the knowledge-interaction heterogeneous multigraph;

[0015] S5, converting the attributes of the node into a feature vector;

[0016] S6, perform neighbor aggregation on nodes in the knowledge-interaction heterogeneous multigraph;

[0017] S7, Model training for knowledge-interaction heterogeneous multi-graph based on graph neural network;

[0018] S8. Use the trained model to generate embedding vectors for users and services, calculate recommendation scores based on the embedded representations of users and services, sort by recommendation scores, and generate the final recommendation list.

[0019] Preferably, the knowledge directed graph of step S1 involves entities, attributes and relationships; an entity represents an object or concept in the real world and is a node in the knowledge directed graph; an attribute represents a feature of an entity and is an additional field of a node; a relationship connects two entities, represents a semantic association between them, and is a directed edge in the knowledge directed graph, which points from one knowledge node to another.

[0020] Preferably, in the interactive directed graph of step S2, the user's interactive session sequence records the user's behavioral data in a browsing session; each interactive object is a node in the interactive directed graph, and the interactive object is at least one of an item and a service; the user's interactive behavior forms a directed edge, which points from one interactive node to another interactive node, and the edge relationship represents an interactive behavior, including at least one of click, favorite, and comment.

[0021] Preferably, the step S3 specifically includes the following steps:

[0022] S31, extracting a knowledge node set and a knowledge relationship set from the knowledge directed graph; extracting an interaction node set and an interaction relationship set from the interaction directed graph;

[0023] Among them, the knowledge node set is the set of all entity nodes in the knowledge directed graph, the knowledge relationship set is the set of all entity relationships in the knowledge directed graph; the interaction node set is the set of all interaction object nodes in the interaction directed graph, and the interaction relationship set is the set of all interaction behavior relationships in the interaction directed graph;

[0024] S32, assigning node type code type1 and node index number index1 to all nodes in the knowledge node set and the interaction node set, and for nodes with the same entity or interaction object name, their node type code type1 and node index number index1 are the same;

[0025] S33, assigning edge type code type2 and edge index number index2 to all edges in the knowledge relationship set and the interaction relationship set, and for edges with the same relationship name and the ending node name of the relationship connection, the edge type code type2 and edge index number index2 are the same;

[0026] S34. For each node in the knowledge node set and the interaction node set, the field of the node type code type1 and the field of the node index number index1 are used as input parameters, and the node is digitized according to the following formula:

[0027] ;

[0028] After being digitized, it can be ensured that the same node has a unique node value;

[0029] S35, comparing each node value in the interactive node set with each node value in the knowledge node set. If the values ​​of two nodes are the same, the two nodes represent the same node, and such a node is called a first node to be fused.

[0030] S36, finding a one-hop neighbor node set of the first node to be merged in the knowledge directed graph, where the one-hop neighbor node set represents a set of nodes directly connected to the first node to be merged in the knowledge directed graph;

[0031] S37, using each node value in the neighbor node set in step S36 to compare with each node value in the interactive node set, if their node values ​​are the same, then the two nodes are the same node, and such a node is the second node to be fused;

[0032] S38, taking the first node to be fused as the starting node of the fused edge and the second node to be fused as the ending node of the fused edge, respectively matching each interactive behavior relationship edge in the interactive relationship set; if the starting node value and the ending node value of the interactive behavior relationship edge are respectively the same as the values ​​of the first node to be fused and the second node to be fused, then adding a relationship edge between the first node to be fused and the second node to be fused in the knowledge directed graph, and integrating the edge into the knowledge relationship set;

[0033] S39, repeat steps S35 to S38 until all nodes in the interactive node set are traversed, and the fused node set and edge set constitute a knowledge-interaction heterogeneous multigraph.

[0034] Preferably, the knowledge-interaction heterogeneous multigraph in step S3 is formally represented according to the following formal definition:

[0035] A knowledge-interaction heterogeneous multigraph is a graph data structure with multiple node types or multiple edge types, represented by G = (V, E), where nodes and edges have multiple types and there is more than one edge between two nodes. The specific definition is as follows:

[0036] (1) Node set V: contains nodes of different types;

[0037] ; Among them, V i is a set of nodes of type i, and the jth node in the set of node type i is v ij ;

[0038] (2) Edge set E: contains edges of different types;

[0039] ; Among them, E i is the set of edges of type i;

[0040] Each edge can be represented as a triple e rs =(u,r,v), where , , V i is the set of nodes of node type i, V j is a set of nodes of type j, u and v are nodes of type i and type j respectively, e rs represents the sth edge in a set of edge type r, Indicates the type of edge, Indicates the index number of the edge of the same type;

[0041] (3) Node type mapping : is a function that defines the type of each node, i.e. Indicates that the type of node v is i;

[0042] (4) Edge type mapping : is a function that defines the type of each edge, i.e. Indicates that the type of edge e is j;

[0043] (5) Node attribute set: Each node Has a set of attributes , where each attribute is a key-value pair, representing a specific attribute and its corresponding value;

[0044] Right now ,in, is the attribute name, Is the attribute value.

[0045] Preferably, the step S4 encodes different nodes and edges in the knowledge-interaction heterogeneous multigraph, specifically comprising: first calculating the one-hot vector of each element in the set, where the dimension of the one-hot vector is the number of elements in all sets; then multiplying the one-hot vector by the transpose of the embedding matrix A to obtain the initial encoding value of each node element;

[0046] The embedding matrix A is usually randomly initialized to a smaller value, and its dimension is mxd; where m is the number of elements in the node set, and d is the dimension of the embedding vector, which can be customized; the specific value of the embedding matrix A is determined during the model training process. After multiple rounds of iterations and optimization, each row of the embedding matrix A will converge to a vector that can effectively represent each object.

[0047] Preferably, the step S5 of converting the node attributes into a feature vector specifically comprises the following steps:

[0048] S51, encoding the attributes of the node according to different types, wherein the attributes of the node include at least one of a numerical attribute, a categorical attribute, and a text attribute, the numerical attribute is encoded using a standardized method, the categorical attribute is encoded using an embedding method, and the text attribute is encoded using a word vector method;

[0049] S52, connecting the codes of all attributes of the node into a single feature vector according to the set sequence, that is, the attribute feature vector;

[0050] S53, concatenate and fuse the attribute feature vector and the node feature vector in the following form:

[0051] h=[a,b]

[0052] Among them, a represents the attribute feature vector, b represents the node feature vector, and h represents the fused feature vector.

[0053] Preferably, performing neighbor aggregation on the nodes in the knowledge-interaction heterogeneous multigraph in step S6 specifically includes the following steps:

[0054] For each node, the features of its neighboring nodes are aggregated according to the following formula:

[0055] ;

[0056] Among them, h v and h u They represent the characteristics of node v and its neighbor node u, r represents the edge type, Represents the set of neighbor nodes of node v with all edge types r. represents the number of edges of type r among all edges of node v, W r is the weight matrix of the edge type r that needs to be learned, W0 is the node's own weight, It represents the features of the node after aggregating the features of neighboring nodes and passing through the ReLU activation function.

[0057] Preferably, in step S7, model training is performed on the knowledge-interaction heterogeneous multigraph based on a graph neural network, specifically comprising the following steps:

[0058] S71. Set the range parameter k of feature perception in the following manner: for nodes with a larger degree in the graph, since they have richer features, the k value is set to be smaller; and for nodes with a smaller degree in the graph, since the nodes reflect less feature information, the k value is set to be larger to perceive features in a wider range, so that the features of each node in the graph can be balanced and the overall calculation burden can be reduced; the specific k value is calculated according to the following empirical formula:

[0059] ;

[0060] Among them, degree represents the degree of the current node;

[0061] S72. Determine the number of layers of graph convolution according to a range parameter k of feature perception;

[0062] S73, clearing the gradient of the weight parameters of the previous round of training;

[0063] S74. Use the following graph convolution operator to transfer and aggregate node features in the convolution layers of different types of edges and perform forward propagation.

[0064] ;

[0065] in, and They represent the features of the k-th convolution of node v and its neighbor node u, r represents the edge type, Represents the set of neighbor nodes of node v with all edge types r. represents the number of edges of type r among all edges of node v, is the weight matrix of edge type r that needs to be learned in the kth layer, is the weight of the k-th layer node itself, It represents the feature of the node after aggregating the features of the neighboring nodes in the kth layer and passing through the ReLU activation function;

[0066] S75. In each training batch, the loss between the probability distribution of the node type to which the sample belongs predicted by the model and the actual node type of the sample is calculated. The loss is calculated using the cross entropy loss function:

[0067] ;

[0068] Where N is the number of samples in the current batch, C is the number of node types, is the actual node type of the i-th sample, is the probability that the model predicts that the i-th sample belongs to node type j;

[0069] S76, then use the back propagation mechanism to calculate the weight parameter gradient and update the parameter;

[0070] S77. Repeat S73-S75 until the loss converges to the set training threshold, and stop training to obtain the training model.

[0071] Compared with the prior art, the present invention has the following beneficial effects:

[0072] The connection relationship between nodes and edges of the knowledge directed graph in the present invention is stable, the structure can be maintained for a long time, and it supports different types of nodes (such as entities, events, attributes) and edges (such as causal relationships, temporal relationships, hierarchical relationships), adapting to complex knowledge expressions in different fields in the long term, and can well reflect the long-term characteristics of entities and relationships. The structure of the interactive directed graph will be continuously updated with the progress of the session to adapt to the immediate changes in user needs. The generation of nodes and edges is closely related to the user's instant interactive behavior and the current system state, and can extract the key features of the user in the short term, which can well reflect the short-term characteristics of specific session tasks or user interaction scenarios.

[0073] The method of the present invention fuses the long-term features of the knowledge directed graph and the short-term features of the interaction directed graph, effectively utilizing the complex relationship information in the heterogeneous multigraph, capturing the user's stable interests and preferences, and reflecting the user's immediate needs and temporary interests. On the one hand, it improves the accuracy of the recommendation system, and on the other hand, it avoids the problem of repeated recommendations dominated by long-term features, and improves the diversity and novelty of recommendations. In addition, through the feature perception adjustment parameter k, the feature perception range can be adjusted according to the recommendation accuracy requirements, reducing the cost of calculation and storage. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 It is a flow chart of an adaptive elderly care service recommendation method integrating long-term and short-term features of the present invention;

[0075] Figure 2 It is a directed graph of knowledge in the field of elderly care constructed by the present invention;

[0076] Figure 3 is an interactive directed graph constructed by the present invention;

[0077] Figure 4It is a flow chart of the algorithm for integrating the knowledge directed graph and the interaction directed graph into the knowledge-interaction heterogeneous multigraph of the present invention;

[0078] Figure 5 It is the knowledge-interaction heterogeneous multigraph formed by the present invention;

[0079] Figure 6 It is the knowledge-interaction heterogeneous multigraph formally defined by the present invention. DETAILED DESCRIPTION

[0080] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0081] like Figure 1 As shown, this embodiment provides an adaptive elderly care service recommendation method that integrates long-term features and short-term features.

[0082] Step 1: Construct a knowledge directed graph G in the field of elderly care based on entities, their attribute values, and the relationships between entities k (like Figure 2 As shown). Knowledge directed graph G k Involves entities, attributes, and relationships.

[0083] (1) An entity represents an object or concept in the real world. v is used to represent an entity, and V is used to represent the set of entities.

[0084] (2) Attributes represent the characteristics of an entity. Attributes are represented by triples (v, p, t), where v is the entity, p is the attribute name, and t is the attribute value.

[0085] (3) A relationship connects two entities and represents the semantic association between them. A relationship is represented by a triple (v i ,r,v j ) indicates that v i and v j are two entities, r is entity v i and v j The relationship between them, and the set formed by the relationship is represented by E.

[0086] In this embodiment, there are the following entities:

[0087] Elderly person A, Green Tree Nursing Home, long-term care service, caregiver B, Red Cross, coronary heart disease, quick-acting heart-saving pills.

[0088] Entity Elderly A, Green Tree Nursing Home, Long-term Care Services has the following attributes:

[0089]

[0090] The attributes of the above entities can be expressed as (elderly person A, age, 80), (elderly person A, gender, male), (Green Tree Nursing Home, address, Dongcheng District, Beijing), (long-term care service, price, 300 yuan / day).

[0091] The relationships between entities are as follows:

[0092]

[0093] The relationship between the above entities can be expressed as: (Elderly person A, lives in, Green Tree Nursing Home), (Green Tree Nursing Home, provides, long-term care services), (Caregiver B, works in, Green Tree Nursing Home), (Green Tree Nursing Home, is affiliated with, the Red Cross Society), (Elderly person A, suffers from, coronary heart disease), (Quick-acting Heart-saving Pills, can treat, coronary heart disease).

[0094] Knowledge directed graph G k The attributes of entities and the relationships between entities in the knowledge graph G are fixed in a relatively long period of time. k It contains the long-term characteristics of users.

[0095] Step 2: Construct an interactive directed graph G based on the user's interactive conversation sequence c (like Figure 3 In the interactive directed graph G c In G, each interactive object is a node, and the user's interactive behavior forms a directed edge. Interaction behaviors include: click, favorite, comment, etc. The user's interactive session sequence records the user's behavior data in a browsing session, and each browsing session will be different. Therefore, the interactive directed graph G c It contains the short-term characteristics of the user.

[0096] In this embodiment, there is the following interactive session sequence:

[0097] Session 1: Elderly person A -> (click) -> Green Tree Nursing Home -> (collect) -> Long-term care services;

[0098] Conversation 2: Elderly person A -> (purchase) -> quick-acting heart-saving pills.

[0099] Step 3: Convert the knowledge directed graph G k and the interactive directed graph G c Fusion into knowledge-interactive heterogeneous multi-graph G (such as Figure 4 In order to fully learn long-term and short-term features, it is necessary to transform the knowledge directed graph G k and the interactive directed graph G c Fusion. Since the knowledge directed graph G k and the interactive directed graph G cThe types of nodes and edges are different. For example, the elderly and nursing homes are two different types of entities. Positional relationships and interactive relationships are two different types of relationships. Since there is more than one edge between two nodes in the fused graph, the fused graph is a knowledge-interaction heterogeneous multigraph G. k and the interactive directed graph G c The fusion into knowledge-interaction heterogeneous multigraph G specifically includes the following steps:

[0100] S31. From the knowledge directed graph G k Extract the knowledge node set V k , knowledge relationship set E e ; From the interactive directed graph G c Extract the interactive node set V c , interaction relationship set E c ;

[0101] Among them, the knowledge node set V k is a knowledge directed graph G k The set of all entity nodes in the knowledge relationship set E e is a knowledge directed graph G k The set of all entity relationships in V; the set of interaction nodes V c is an interactive directed graph G c The set of all interaction object nodes in the interaction relationship set E c is an interactive directed graph G c The set of all interactive behavior relationships in .

[0102] In this embodiment, the knowledge node set V k , knowledge relationship set E e , interactive node set V c and the interaction relationship set E c They are as follows:

[0103] Knowledge Node Set V k ={Elderly person A, Green Tree Nursing Home, Long-term care service, Caregiver B, Red Cross, Coronary heart disease, Quick-acting heart-saving pills};

[0104] Knowledge relation set E e ={(Elderly person A, lives in, Green Tree Nursing Home), (Green Tree Nursing Home, provides, long-term care services), (Caregiver B, works in, Green Tree Nursing Home), (Green Tree Nursing Home, is affiliated with, the Red Cross), (Elderly person A, suffers from, coronary heart disease), (Quick-acting Heart-saving Pills, can treat, coronary heart disease)};

[0105] Interaction node set V c={Elderly person A, Green Tree Nursing Home, Long-term care service, Quick-acting heart-saving pills};

[0106] Interaction relationship set E c ={(Elderly person A, click, Green Tree Nursing Home), (Elderly person A, collection, long-term care service), (Elderly person A, purchase, quick-acting heart-saving pills)}.

[0107] S32, for the knowledge node set V k and the set of interaction nodes V c All nodes in the are assigned node type code type1 and node index number index1. For nodes with the same entity or interaction object name, their node type code type1 and node index number index1 are the same.

[0108] In this embodiment, the knowledge node set V k The node type code type1 and node index number index1 in are as follows:

[0109]

[0110] Interaction node set V c The node type code type1 and node index number index1 are as follows:

[0111]

[0112] S33, for the knowledge relationship set E e and the interaction relationship set E c All edges in are assigned edge type code type2 and edge index number index2. For edges with the same relationship name and the ending node name of the relationship connection, their edge type code type2 and edge index number index2 are the same.

[0113] In this embodiment, the knowledge relationship set E e The edge type code type2 and edge index number index2 in are as follows:

[0114]

[0115] Interaction relationship set E c The type2 and edge index number index2 in are as follows:

[0116]

[0117] S34. For the knowledge node set V k and the set of interaction nodes V cFor each node in , the node type code type1 field and the node index number index1 field are used as input parameters, and the node is digitized according to the following formula:

[0118] ;

[0119] After being digitized, it can be ensured that the same node has a unique node value.

[0120] In this embodiment, the knowledge node set V k The node values ​​after digitization are as follows:

[0121]

[0122] Interaction node set V c The node values ​​after digitization are as follows:

[0123]

[0124] S35, using the interactive node set V c Each node value and knowledge node set V k If two node values ​​are the same, then the two nodes represent the same node. Such a node is called the first node to be fused. .

[0125] In this embodiment, the knowledge node set V k The elderly A and the interaction node set V c The node values ​​of the elderly A in the table are the same, so these two nodes represent the same node, that is, the first node to be fused. ;

[0126] S36. In the knowledge directed graph G k Find the first node to be merged The set of one-hop neighbor nodes V r , the one-hop neighbor node set is represented in the knowledge directed graph and the first node to be fused A collection of directly connected nodes.

[0127] In this embodiment, the first node to be merged That is, the one-hop neighbor node set of elderly person A is {Green Tree Nursing Home, Coronary Heart Disease}.

[0128] S37, use each node value in the neighbor node set in step S36 to interact with the node set V cThe values ​​of each node in are compared again. If their node values ​​are the same, then the two nodes are the same node. Such a node is the second node to be fused. .

[0129] In this embodiment, the value of each node in the set {Green Tree Nursing Home, Coronary Heart Disease} is used to compare the value of each node in the set of interactive nodes V. c By comparing the node values ​​in , we can know that the Green Tree Nursing Home node is the second node to be merged. .

[0130] S38: The first node to be merged As the starting node of the fused edge, the second node to be fused As the end node of the fused edge, match each interactive behavior relationship edge in the interactive relationship set respectively. If the start node value and the end node value of the interactive behavior relationship edge are respectively the same as the first node to be fused and the second node to be fused The value of is the same, then the first node to be fused in the knowledge graph and the second node to be fused Add a relationship edge between them and integrate the edge into the knowledge relationship set.

[0131] In this example, we use Elderly A as the starting node of the fusion edge and Green Tree Nursing Home as the ending node of the fusion edge, and match each edge in the interactive relationship set. We find that the starting node and the ending node of the relationship (Elderly A, Click, Green Tree Nursing Home) are respectively connected to the first node to be fused. and the second node to be fused The same, therefore, we can add an edge (Elderly A, click, Green Tree Nursing Home) to the knowledge graph and add the edge to the knowledge relationship set.

[0132] S39, repeat steps S35 to S38 until the interactive node set V c After all nodes in the traversal are completed, the fused node set and edge set constitute the knowledge-interaction heterogeneous multigraph G (such as Figure 5 as shown).

[0133] Specifically, the knowledge-interaction heterogeneous multigraph G is formally represented according to the following formal definition:

[0134] The knowledge-interaction heterogeneous multigraph G is a graph data structure with multiple node types or multiple edge types, represented by G=(V, E), where nodes and edges have multiple types and there is more than one edge between two nodes. The specific definition is as follows:

[0135] Node set V: contains nodes of different types. ; Among them, V i is a set of nodes of type i, and the jth node in the set of node type i is v ij .

[0136] Edge set E: contains edges of different types. ; Among them, E i is the set of edges of type i. Each edge can be represented as a triple e rs =(u,r,v);where, , , V i is the set of nodes of node type i, V j is a set of nodes of type j, u and v are nodes of type i and type j respectively, e rs represents the sth edge in a set of edge type r, Indicates the type of edge, Indicates the index number of the edge of the same type.

[0137] Node Type Mapping : is a function that defines the type of each node, i.e. Indicates that the type of node v is i.

[0138] Edge Type Mapping : is a function that defines the type of each edge, i.e. Indicates that the type of edge e is j.

[0139] Node attribute collection: each node Has a set of attributes , where each attribute is a key-value pair, representing a specific attribute and its corresponding value. ,in is the attribute name, Is the attribute value.

[0140] In this embodiment, the entity set in the knowledge-interaction heterogeneous multigraph G corresponds to the node set V, and the relationship and interaction behavior set corresponds to the edge set E, such as Figure 6 As shown in Figure 2, the knowledge-interaction heterogeneous multigraph G is formally represented according to the following formal definition:

[0141] The node set V contains the following 7 node types, namely: V1 is the elderly type, V2 is the nursing home type, V3 is the nursing service type, V4 is the medical staff type, V5 is the public welfare organization type, V6 is the disease type, and V7 is the drug type.

[0142] ;

[0143] ;

[0144] ;

[0145] ;

[0146] ;

[0147] ;

[0148] ;

[0149] .

[0150] The edge set E contains the following types: E1 is a position relationship type, E2 is a supply relationship type, E3 is a subordination relationship type, E4 is a gain-loss relationship type, E5 is a treatment relationship type, and E6 is an interaction relationship type.

[0151]

[0152] Node Type Mapping :

[0153] , indicating a node are elderly;

[0154] , indicating a node It is a nursing home;

[0155] , indicating a node It is elderly care services;

[0156] , indicating a node They are medical staff;

[0157] , indicating a node It is a public welfare organization;

[0158] , indicating a node It is a disease;

[0159] , indicating a node It's medicine.

[0160] Edge Type Mapping :

[0161] and , indicating a node and and nodes and There is a positional relationship between them;

[0162] , indicating a node and There is a supply relationship between them;

[0163] , indicating a node and There is a subordinate relationship between them;

[0164] , indicating a node and There is a relationship of gain and loss between them;

[0165] , indicating a node and There is a healing relationship between them;

[0166] , and ,express Respectively and nodes , as well as There is an interactive relationship between them.

[0167] Node attribute set P:

[0168] Node v 11 There are 2 attributes, namely (gender, male) and (age, 80); ;

[0169] Node v 21 There is 1 attribute, which is (address, Dongcheng District, Beijing); ;

[0170] Node v 31 There is 1 attribute, which is (price, 300 yuan / day); .

[0171] Step 4: Encode different nodes and edges in the knowledge-interaction heterogeneous multigraph G. First, calculate the one-hot vector of each element in the set, and the dimension of the one-hot vector is the number of elements in all sets. Then multiply the transpose of the embedding matrix A and the one-hot vector to get the initial encoding value of each node element.

[0172] In this embodiment, the node set , the number of elements is 7, and the dimension of the unique hot vector of each element in the set is 7.

[0173] The one-hot vector of v11 is (1,0,0,0,0,0,0);

[0174] The one-hot vector of v21 is (0,1,0,0,0,0,0);

[0175] The one-hot vector of v31 is (0,0,1,0,0,0,0);

[0176] The one-hot vector of v41 is (0,0,0,1,0,0,0);

[0177] The one-hot vector of v51 is (0,0,0,0,1,0,0);

[0178] The one-hot vector of v61 is (0,0,0,0,0,1,0);

[0179] The one-hot vector of v71 is (0,0,0,0,0,0,1).

[0180] The embedding matrix A is usually randomly initialized to a small value, and its dimension is 7xd; where d is the dimension of the embedding vector, which can be customized. The specific value of the embedding matrix A is determined during the model training process. After multiple rounds of iteration and optimization, each row of the embedding matrix A will converge to a vector that can effectively represent each object.

[0181] Edge Set , the number of elements is 9, the dimension of the unique hot vector of each element in the set is 9, and the initial encoding generation method is the same as the node encoding, which will not be repeated here.

[0182] Step 5: Convert the node attributes into feature vectors. This includes the following steps:

[0183] S51, encoding the attributes of the node according to different types, wherein the attributes of the node include at least one of a numerical attribute, a categorical attribute, and a text attribute, the numerical attribute is encoded using a standardized method, the categorical attribute is encoded using an embedding method, and the text attribute is encoded using a word vector method;

[0184] S52, connecting the codes of all attributes of the node into a single feature vector according to a set order, i.e., the attribute feature vector;

[0185] S53, concatenate and fuse the attribute feature vector and the node feature vector in the following form:

[0186] h=[a,b]

[0187] Among them, a represents the attribute feature vector, b represents the node feature vector, and h represents the fused feature vector.

[0188] In this embodiment, the characteristics of the node long-term care service v31 are:

[0189] [0.51, 0.26, 0.59, 0.06, 0.36, 0.84, 0.21];

[0190] The price attribute features are: [1, 0, 0, 0.45];

[0191] The features after the price attribute features and node features are fused and connected are:

[0192] [0.51, 0.26, 0.59, 0.06, 0.36, 0.84, 0.21, 1, 0, 0, 0.45].

[0193] Step 6: Aggregate neighbors of nodes in the graph.

[0194] For each node, the features of its neighboring nodes are aggregated according to the following formula:

[0195] ;

[0196] Among them, h v and h u They represent the characteristics of node v and its neighbor node u, r represents the edge type, represents the number of edges of type r among all edges of node v, Wr is the weight matrix of edge type r that needs to be learned, W0 is the weight of the node itself, which can be taken as 1, It represents the features of the node after aggregating the features of neighboring nodes and passing through the ReLU activation function.

[0197] In this embodiment, the node v 11 For example, its neighbor nodes are v 21 、v 31 、v 61 and v 71 , and v 21 The side has e 11 and e 61 , and v 31 The side is e 62 , and v 61 The point side is e 41 , and v 71 The side is e 63 , the edge types are 1, 4, and 6 respectively.

[0198] Assume that the feature vectors of the above nodes are:

[0199] ;

[0200] ;

[0201] ;

[0202] ;

[0203] .

[0204] v 11 The features after aggregation are:

[0205]

[0206] Step 7: Model training of knowledge-interaction heterogeneous multigraph based on graph neural network. In step S7, model training of knowledge-interaction heterogeneous multigraph based on graph neural network specifically includes the following steps:

[0207] S71. Set the range parameter k of feature perception in the following manner: for nodes with a larger degree in the graph, since they have richer features, the k value is set to be smaller; and for nodes with a smaller degree in the graph, since the nodes reflect less feature information, the k value is set to be larger to perceive features in a wider range, so that the features of each node in the graph can be balanced and the overall calculation burden can be reduced; the specific k value is calculated according to the following empirical formula:

[0208] ;

[0209] Among them, degree represents the degree of the current node;

[0210] S72. Determine the number of layers of graph convolution according to a range parameter k of feature perception;

[0211] S73, clearing the gradient of the weight parameters of the previous round of training;

[0212] S74. Use the following graph convolution operator to transfer and aggregate node features in the convolution layers of different types of edges and perform forward propagation.

[0213] ;

[0214] in, and They represent the features of the k-th convolution of node v and its neighbor node u, r represents the edge type, Represents the set of neighbor nodes of node v with all edge types r. represents the number of edges of type r among all edges of node v, is the weight matrix of edge type r that needs to be learned in the kth layer, is the weight of the k-th layer node itself, It represents the feature of the node after aggregating the features of the neighboring nodes in the kth layer and passing through the ReLU activation function;

[0215] S75. In each training batch, the loss between the probability distribution of the node type to which the sample belongs predicted by the model and the actual node type of the sample is calculated. The loss is calculated using the cross entropy loss function:

[0216] ;

[0217] Where N is the number of samples in the current batch, C is the number of node types, is the actual node type of the i-th sample, is the probability that the model predicts that the i-th sample belongs to node type j;

[0218] S76, then use the back propagation mechanism to calculate the weight parameter gradient and update the parameter;

[0219] S77. Repeat S73-S75 until the loss converges to the set training threshold, and stop training to obtain the training model.

[0220] Step 8: Use the trained model to generate embedding vectors for users and services, calculate recommendation scores based on the embedded representations of users and services, sort by recommendation scores, and generate the final recommendation list.

[0221] In this example, enter the following information:

[0222] Elderly person C one-hot encoding: [1, 0, 0, 0];

[0223] Long-term care services are one-hot encoded: [0, 1, 0, 0].

[0224] Edge index: [(elderly person C, click, long-term care service), (elderly person C, collection, Green Tree Nursing Home), (elderly person C, collection, quick-acting heart-saving pills), (Green Tree Nursing Home, belongs to, Red Cross Society)].

[0225] Using the embedding vectors of trained model nodes:

[0226] The embedding representation of the elderly C: [0.5, 0.3, 0.1];

[0227] Long-term care service embedding representation: [1.2, 0.4, 0.2];

[0228] Green Tree Nursing Home embedding representation: [0.6, 0.2, 0.3];

[0229] The embedding representation of Suxiao Jiuxin Pill is: [0.4, 0.3, 0.2];

[0230] Red Cross embedding representation: [0.1, 0.2, 0.8].

[0231] For user A, calculate the recommendation score between him and the item:

[0232] Recommendation score (long-term care services) = [0.5, 0.3, 0.1] · [1.2, 0.4, 0.2] = 0.6 +0.12 + 0.02 = 0.74;

[0233] Recommendation score (Green Tree Nursing Home) = [0.5, 0.3, 0.1] · [0.6, 0.2, 0.3] = 0.3 + 0.06 + 0.03 = 0.39;

[0234] Recommendation score (Quick-acting Heart-saving Pill) = [0.5, 0.3, 0.1] · [0.4, 0.3, 0.2] = 0.2 + 0.09 + 0.02 = 0.31;

[0235] Recommendation score (Red Cross) = [0.5, 0.3, 0.1] · [0.1,0.2,0.8] = 0.05 + 0.06 +0.08 = 0.19.

[0236] Sort by recommendation score from high to low to generate a recommendation list:

[0237] Recommended list = [Long-term care services, Green Tree Nursing Home, Quick-acting Heart Pills, Red Cross].

[0238] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An adaptive elderly care service recommendation method integrating long-term and short-term features, characterized in that: The following steps are involved: S1. Construct a knowledge directed graph in the field of elderly care based on the entities, attributes and relationships involved in elderly care services. A knowledge directed graph involves entities, attributes and relationships. An entity represents an object or concept in the real world and is a node in a knowledge directed graph. An attribute represents the characteristics of an entity and is an additional field of a node. A relationship connects two entities and represents the semantic association between them. It is a directed edge in a knowledge directed graph and points from one knowledge node to another. S2. Construct an interactive directed graph based on the user's interactive conversation sequence; the user's interactive conversation sequence in the interactive directed graph records the user's behavior data in a browsing session; each interactive object is a node in the interactive directed graph, and the interactive object is at least one of an item and a service; the user's interactive behavior forms a directed edge, which points from one interactive node to another interactive node, and the edge relationship represents an interactive behavior, including at least one of click, favorite, and comment; S3, fusing the knowledge directed graph and the interaction directed graph into a knowledge-interaction heterogeneous multigraph; specifically comprising the following steps: S31, extracting a knowledge node set and a knowledge relationship set from the knowledge directed graph; extracting an interaction node set and an interaction relationship set from the interaction directed graph; Among them, the knowledge node set is the set of all entity nodes in the knowledge directed graph, the knowledge relationship set is the set of all entity relationships in the knowledge directed graph; the interaction node set is the set of all interaction object nodes in the interaction directed graph, and the interaction relationship set is the set of all interaction behavior relationships in the interaction directed graph; S32, assigning node type code type1 and node index number index1 to all nodes in the knowledge node set and the interaction node set, and for nodes with the same entity or interaction object name, their node type code type1 and node index number index1 are the same; S33, assigning edge type code type2 and edge index number index2 to all edges in the knowledge relationship set and the interaction relationship set, and for edges with the same relationship name and the ending node name of the relationship connection, the edge type code type2 and edge index number index2 are the same; S34. For each node in the knowledge node set and the interaction node set, the field of the node type code type1 and the field of the node index number index1 are used as input parameters, and the node is digitized according to the following formula: ; After digitization, ensure that the same node has a unique node value; S35, comparing each node value in the interactive node set with each node value in the knowledge node set. If the values ​​of two nodes are the same, the two nodes represent the same node, and such a node is called a first node to be fused. S36, finding a one-hop neighbor node set of the first node to be merged in the knowledge directed graph, where the one-hop neighbor node set represents a set of nodes directly connected to the first node to be merged in the knowledge directed graph; S37, using each node value in the neighbor node set in step S36 to compare with each node value in the interactive node set, if their node values ​​are the same, then the two nodes are the same node, and such a node is the second node to be fused; S38, taking the first node to be fused as the starting node of the fused edge and the second node to be fused as the ending node of the fused edge, respectively matching each interactive behavior relationship edge in the interactive relationship set; if the starting node value and the ending node value of the interactive behavior relationship edge are respectively the same as the values ​​of the first node to be fused and the second node to be fused, then adding a relationship edge between the first node to be fused and the second node to be fused in the knowledge directed graph, and integrating the edge into the knowledge relationship set; S39, repeating steps S35 to S38 until all nodes in the interactive node set are traversed, and the fused node set and edge set constitute a knowledge-interaction heterogeneous multigraph; S4, encoding different nodes and edges in the knowledge-interaction heterogeneous multigraph; S5, converting the attributes of the node into a feature vector; S6, perform neighbor aggregation on nodes in the knowledge-interaction heterogeneous multigraph; S7, Model training for knowledge-interaction heterogeneous multi-graph based on graph neural network; S8. Use the trained model to generate embedding vectors for users and services, calculate recommendation scores based on the embedded representations of users and services, sort by recommendation scores, and generate the final recommendation list.

2. According to claim 1, the adaptive elderly care service recommendation method integrating long-term features and short-term features is characterized in that: The knowledge-interaction heterogeneous multigraph in step S3 is formally represented according to the following formal definition: A knowledge-interaction heterogeneous multigraph is a graph data structure with multiple node types or multiple edge types, represented by G = (V, E), where nodes and edges have multiple types and there is more than one edge between two nodes. The specific definition is as follows: (1) Node set V: contains nodes of different types; ; Among them, V i is a set of nodes of type i, and the jth node in the set of node type i is v ij ; (2) Edge set E: contains edges of different types; ; Among them, E i is the set of edges of type i; Each edge is represented as a triple e rs =(u,r,v), where , , V i is the set of nodes of node type i, V j is a set of nodes of type j, u and v are nodes of type i and type j respectively, e rs represents the sth edge in a set of edge type r, Indicates the type of edge, Indicates the index number of the edge of the same type; (3) Node type mapping : is a function that defines the type of each node, i.e. Indicates that the type of node v is i; (4) Edge type mapping : is a function that defines the type of each edge, i.e. Indicates that the type of edge e is j; (5) Node attribute set: Each node Has a set of attributes , where each attribute is a key-value pair, representing a specific attribute and its corresponding value; Right now ,in, is the attribute name, Is the attribute value.

3. The adaptive elderly care service recommendation method integrating long-term and short-term features according to claim 1 is characterized in that: The step S4 encodes different nodes and edges in the knowledge-interaction heterogeneous multigraph, specifically comprising: first calculating the one-hot vector of each element in the set, where the dimension of the one-hot vector is the number of elements in all sets; then multiplying the one-hot vector by the transpose of the embedding matrix A to obtain the initial encoding value of each node element; The embedding matrix A is usually randomly initialized to a smaller value, and its dimension is mxd; where m is the number of elements in the node set, and d is the dimension of the embedding vector, which is user-defined; the specific value of the embedding matrix A is determined during the model training process. After multiple rounds of iterations and optimization, each row of the embedding matrix A will converge to a vector that can effectively represent each object.

4. The adaptive elderly care service recommendation method integrating long-term and short-term features according to claim 1 is characterized in that: The step S5 of converting the node attributes into feature vectors specifically includes the following steps: S51, encoding the attributes of the node according to different types, wherein the attributes of the node include at least one of a numerical attribute, a categorical attribute, and a text attribute, the numerical attribute is encoded using a standardized method, the categorical attribute is encoded using an embedding method, and the text attribute is encoded using a word vector method; S52, connecting the codes of all attributes of the node into a single feature vector according to a set order, i.e., the attribute feature vector; S53, concatenate and fuse the attribute feature vector and the node feature vector in the following form: h=[a,b] Among them, a represents the attribute feature vector, b represents the node feature vector, and h represents the fused feature vector.

5. The adaptive elderly care service recommendation method integrating long-term and short-term features according to claim 1 is characterized in that: In step S6, neighbor aggregation is performed on the nodes in the knowledge-interaction heterogeneous multigraph, which specifically includes the following steps: For each node, the features of its neighboring nodes are aggregated according to the following formula: ; Among them, h v and h u They represent the characteristics of node v and its neighbor node u, r represents the edge type, represents the number of edges of type r among all edges of node v, Wr is the weight matrix of edge type r that needs to be learned, W0 is the weight of the node itself, It represents the features of the node after aggregating the features of neighboring nodes and passing through the ReLU activation function.

6. The adaptive elderly care service recommendation method integrating long-term and short-term features according to claim 1 is characterized in that: In step S7, model training is performed on the knowledge-interaction heterogeneous multigraph based on the graph neural network, specifically including the following steps: S71. Set the range parameter k of feature perception in the following manner: for nodes with a larger degree in the graph, since they have richer features, the k value is set to be smaller; and for nodes with a smaller degree in the graph, since the nodes reflect less feature information, the k value is set to be larger to perceive features in a wider range; the specific k value is calculated according to the following empirical formula: ; Among them, degree represents the degree of the current node; S72. Determine the number of layers of graph convolution according to a range parameter k of feature perception; S73, clearing the gradient of the weight parameters of the previous round of training; S74. Use the following graph convolution operator to transfer and aggregate node features in the convolution layers of different types of edges and perform forward propagation. ; in, and They represent the features of the k-th convolution of node v and its neighbor node u, r represents the edge type, Represents the set of neighbor nodes of node v with all edge types r. represents the number of edges of type r among all edges of node v, is the weight matrix of edge type r that needs to be learned in the kth layer, is the weight of the k-th layer node itself, It represents the feature of the node after aggregating the features of the neighboring nodes in the kth layer and passing through the ReLU activation function; S75. In each training batch, the loss between the probability distribution of the node type to which the sample belongs predicted by the model and the actual node type of the sample is calculated. The loss is calculated using the cross entropy loss function: ; Where N is the number of samples in the current batch, C is the number of node types, is the actual node type of the i-th sample, is the probability that the model predicts that the i-th sample belongs to node type j; S76, then use the back propagation mechanism to calculate the weight parameter gradient and update the parameter; S77. Repeat S73-S75 until the loss converges to the set training threshold, and stop training to obtain the training model.

Citation Information

Patent Citations

  • Elderly care service recommendation method and device

    CN111767469A

  • Multi-dimensional old-age care service recommendation method and device and electronic equipment

    CN114840777A

  • Personalized service recommendation method based on knowledge graph

    CN117011004A