Intelligent auxiliary system for psychological consultation based on knowledge graph and semantic recognition

By constructing a combination of cross-cycle evolutionary memory matrix and psychological knowledge graph, intervention strategies are dynamically adjusted, solving the problem that existing technologies cannot track the evolution of user cognition across cycles. This enables personalized and actionable auxiliary content recommendations, improving the auxiliary effect and user compliance of the psychological counseling system.

CN122117262APending Publication Date: 2026-05-29ZHENGZHOU YAFANG INFORMATION CONSULTING CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHENGZHOU YAFANG INFORMATION CONSULTING CO LTD
Filing Date
2026-04-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing knowledge graph-based psychological counseling assistance systems cannot track users' cognitive evolution across rounds, leading to repeated recommendations of the same level of basic cognitive skills. They also lack representation and verification of user environmental constraints, affecting the effectiveness of assistance and user compliance.

Method used

By constructing a cross-round evolutionary memory matrix, the state vector is generated by adjusting the element-wise ratio of the feature vectors of adjacent rounds and the gating weight. Combined with the environmental constraint nodes in the psychological knowledge graph, the intervention level is dynamically switched and the feasibility of candidate paths is verified, and personalized auxiliary content is output.

Benefits of technology

It enables dynamic upgrading of intervention strategies based on the user's cognitive evolution stage, improving the relevance and feasibility of auxiliary content, reducing duplicate recommendations, and enhancing user compliance and auxiliary effectiveness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122117262A_ABST
    Figure CN122117262A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of intelligent psychological counseling assistance, and particularly discloses an intelligent psychological counseling assistance system based on a knowledge graph and semantic recognition, which collects multi-round conversation texts, extracts emotional labels, cognitive bias word elements and situational attributes, maps to a psychological knowledge graph, constructs a conversation intra-subgraph structure with time sequence connection, generates a cross-round evolution memory matrix according to the subgraph structure and user feedback, obtains a fixed-length feature vector after compression and exponential decay weighting, generates a state vector through element-by-element ratio and a gating weight of adjacent round feature vectors, determines a user change stage, dynamically selects an intervention path of a corresponding level, uses an environmental constraint node to perform interval comparison and conflict counting verification on a candidate intervention path, and outputs personalized assistance content that passes the verification; the application realizes tracking of a cognitive evolution trend and adaptive upgrading of an intervention level, and enhances the feasibility of suggestions in a real environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent assistance technology for psychological counseling, specifically to an intelligent assistance system for psychological counseling based on knowledge graphs and semantic recognition. Background Technology

[0002] Currently, psychological counseling assistance systems often employ rule matching or traditional machine learning methods to perform sentiment analysis and symptom identification on user text. However, their ability to understand complex semantics is limited, making it difficult to handle colloquial, implicit, or contradictory psychological expressions. In recent years, knowledge graphs have been introduced into the field of psychology, providing a reasoning basis for intelligent assistance by structurally storing the relationships between psychological concepts, symptom labels, and intervention methods.

[0003] Existing knowledge graph-based psychological counseling assistance methods generate static intervention suggestions based solely on node matching within a single session. This approach fails to track the cognitive evolution of users across sessions, from early feelings of inferiority to persistent feelings of uselessness. Consequently, it repeatedly recommends the same level of basic cognitive skills without dynamically upgrading intervention strategies as the user progresses. Furthermore, it lacks the ability to represent and verify the constraints of the user's real-world environment (such as organizational culture and past social feedback). This results in frequent failures of recommended exposure or behavioral activation tasks due to unrealistic conditions, leading to low user compliance and poor assistance effectiveness. Summary of the Invention

[0004] The purpose of this invention is to provide an intelligent auxiliary system for psychological counseling based on knowledge graphs and semantic recognition, so as to solve the problems mentioned above.

[0005] The objective of this invention can be achieved through the following technical solutions:

[0006] A knowledge graph and semantic recognition-based intelligent assistance system for psychological counseling includes:

[0007] The conversation data parsing module is used to collect multi-round conversation text data from users, extract emotion tags, cognitive bias lexical units and contextual attributes from each round of text, and construct the original conversation sequence with the round as the index.

[0008] The subgraph mapping construction module maps the extracted emotion tags, cognitive bias lexical units, and contextual attributes to the node set of the psychological knowledge graph for each round in the original conversation sequence, and organizes them into a conversational subgraph structure containing nodes and their temporal connections according to the temporal order within the conversation.

[0009] The evolutionary memory generation module generates a cross-round evolutionary memory matrix based on the subgraph structure within each round and the user's feedback tags on the auxiliary content output in the corresponding round. The evolutionary memory matrix is ​​arranged with round index as the row, and each row stores the compressed feature vector of the corresponding round's subgraph. It also assigns a weighting coefficient that decays over time to each historical round earlier than the current round.

[0010] The temporal state deduction module extracts the temporal dependencies between feature vectors of each round from the evolutionary memory matrix, and generates state vectors that represent the evolution trend of user cognition by alternately executing cross-round subgraph structure comparison and gated state update.

[0011] The intervention path decision module determines the user's current stage of change based on the state vector, selects candidate intervention paths at the corresponding levels according to the order of intervention courses from easy to difficult, and uses the current environmental constraint nodes retrieved from the psychological knowledge graph to verify the feasibility of the candidate intervention paths, and outputs personalized auxiliary content after the verification is successful.

[0012] As a further aspect of the present invention: the intra-session subgraph structure, organized according to the intra-session time order and containing nodes and their temporal connections, specifically includes:

[0013] The confidence weight of the mapping node is determined based on the semantic distance between each emotion label and the corresponding cognitive bias word in the text, and a timestamp is assigned to each node according to the order in which the word appears.

[0014] Calculate the time difference between adjacent timestamp nodes. If the difference is lower than the preset semantic fusion threshold, then establish a bidirectional temporal connection between the two nodes.

[0015] Shrink the group of nodes with bidirectional temporal connections into supernodes, and regenerate the skeleton edges of the intra-session subgraph on a supernode basis.

[0016] As a further aspect of the present invention: the determination of the confidence weight of the mapping node based on the semantic distance between each emotion tag and the corresponding cognitive bias word in the text specifically includes:

[0017] Read the directional orientations of emotion label lexical units and cognitive bias lexical units in the pre-trained vector space, calculate the degree of offset between the two directional orientations, and quantify the degree of offset into a semantic distance value.

[0018] The semantic distance value is compared with multiple preset distance intervals one by one. Each interval corresponds to a pre-stored confidence weight value. The matching confidence weight value is selected based on the comparison results.

[0019] The selected confidence weight values ​​are written as additional tags on the timing connections between the corresponding nodes in the subgraph within the session.

[0020] As a further aspect of the present invention: the generation of the evolutionary memory matrix across rounds specifically includes:

[0021] Read the sum of the degree of all nodes in the subgraph within each round of the session and the density value of the temporal connection edge, and combine the sum of the degree and the density value into the original feature array of the round;

[0022] Obtain user feedback flags for the auxiliary content output in each round, and adjust the sign of the original feature array according to the positive or negative polarity of the feedback flags;

[0023] The adjusted feature array is filled into each row of the blank matrix in the order of round index to form an evolutionary memory matrix spanning rounds.

[0024] As a further aspect of the present invention: assigning a weighted coefficient that decays over time to each historical round earlier than the current round specifically includes:

[0025] The original feature array in each row is compressed into a fixed-length feature vector through dimensionality reduction projection.

[0026] Calculate the number of interval rounds between the current round and each historical round, and select the corresponding decay multiplicative coefficient for each historical round based on the time decay interval in which the number of interval rounds falls;

[0027] Each element in the eigenvector of each historical round is multiplied by its corresponding decay multiplicative coefficient, and the result of the multiplication is written back to the corresponding row position of the evolutionary memory matrix.

[0028] As a further aspect of the present invention: the generation of the state vector representing the evolution trend of user cognition specifically includes:

[0029] The eigenvectors of two adjacent rounds are read sequentially from the evolutionary memory matrix, and the element-wise ratio of the two eigenvectors is calculated to form a difference comparison vector.

[0030] The values ​​of each element in the difference alignment vector are compared with multiple preset threshold intervals, and a corresponding gate weight value is generated based on the interval to which each element belongs.

[0031] Perform an element-wise product operation between the gating weight value and the feature vector of the current round to obtain the fused state update vector;

[0032] Stack the state update vectors obtained in each round in chronological order, and take the last state update vector as the state vector representing the evolution trend of user cognition.

[0033] As a further aspect of the present invention: the process for generating the gating weight value is as follows:

[0034] Three consecutive threshold intervals are pre-defined, each interval is bound to a fixed gate weight value, and the sum of the three gate weight values ​​is one.

[0035] Read the value of each element in the difference comparison vector in sequence, determine which threshold interval the element value falls into, and read the corresponding gate weight value according to the interval it falls into.

[0036] The read gating weight values ​​are assigned to the corresponding weight bits of the elements. After traversing all elements in turn, a gating weight vector composed of the weight bits is obtained.

[0037] As a further aspect of the present invention: the feasibility verification of candidate intervention paths using current environmental constraint nodes retrieved from a psychological knowledge graph specifically includes:

[0038] The candidate intervention path is broken down into multiple action nodes that are executed sequentially, and each action node is accompanied by a list of required environmental conditions;

[0039] Read the environmental condition list of each action node in sequence, compare each condition in the list with the attribute value of the current environmental constraint node one by one, and increment the conflict count if the attribute value does not meet the condition.

[0040] Determine if the cumulative conflict count is zero. If it is zero, the candidate intervention path is deemed to have passed verification. Otherwise, discard the intervention path and return to the previous step to select a new candidate intervention path.

[0041] As a further aspect of the present invention: if the attribute value does not meet the condition, the conflict count is incremented, specifically including:

[0042] Each condition is parsed into an interval expression containing a lower threshold and an upper threshold, and the attribute values ​​corresponding to the conditions in the current environment constraint node are read.

[0043] Determine whether the attribute values ​​are simultaneously greater than or equal to the lower threshold and less than or equal to the upper threshold. If the conditions are met, the corresponding condition comparison is considered successful.

[0044] If the attribute value is lower than the lower threshold or higher than the upper threshold, the condition is determined not to be met, and the conflict count is incremented by one.

[0045] After completing the comparison of all condition items, output the final conflict count.

[0046] The beneficial effects of this invention are:

[0047] (1) This invention constructs a cross-round evolutionary memory matrix, assigns an exponentially decaying weighted coefficient to historical rounds, and uses the element-wise ratio of the feature vectors of adjacent rounds and gating weights to adjust and generate state vectors. This can automatically identify the cognitive evolution stage of users from early feelings of inferiority to persistent feelings of uselessness. After matching and changing the stage according to the state vector, the intervention level is dynamically switched according to the course sequence from easy to difficult. This allows the auxiliary content to upgrade from basic cognitive skills to behavioral activation or social support links as the user progresses, thereby reducing the repeated recommendation of the same level of strategy and improving the pertinence and timeliness of the intervention.

[0048] (2) This invention retrieves the current environmental constraint nodes from the psychological knowledge graph, decomposes the candidate intervention path into action nodes and their associated environmental condition lists, and parses the conditions into interval expressions containing lower and upper thresholds, comparing them one by one with the attribute values ​​of the constraint nodes to accumulate conflict counts. Only when the conflict count is zero is a validated suggestion output; otherwise, it automatically returns to reselect a path. This method can filter out suggestions that are not feasible due to environmental factors such as organizational cultural apathy or past social rejection before recommending behavioral tasks such as exposure therapy, avoiding negative experiences after user failure and improving the feasibility and user compliance of auxiliary content. Attached Figure Description

[0049] The invention will now be further described with reference to the accompanying drawings.

[0050] Figure 1 This is a system block diagram of the present invention;

[0051] Figure 2 This is a flowchart of the evolutionary memory matrix generation process in this invention. Detailed Implementation

[0052] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0053] Please see Figure 1 As shown, this invention is an intelligent auxiliary system for psychological counseling based on knowledge graphs and semantic recognition, comprising:

[0054] The conversation data parsing module is used to collect multi-round conversation text data from users, extract emotion tags, cognitive bias lexical units and contextual attributes from each round of text, and construct the original conversation sequence with the round as the index.

[0055] The subgraph mapping construction module maps the extracted emotion tags, cognitive bias lexical units, and contextual attributes to the node set of the psychological knowledge graph for each round in the original conversation sequence, and organizes them into a conversational subgraph structure containing nodes and their temporal connections according to the temporal order within the conversation.

[0056] The evolutionary memory generation module generates a cross-round evolutionary memory matrix based on the subgraph structure within each round and the user's feedback tags on the auxiliary content output in the corresponding round. The evolutionary memory matrix is ​​arranged with round index as the row, and each row stores the compressed feature vector of the corresponding round's subgraph. It also assigns a weighting coefficient that decays over time to each historical round earlier than the current round.

[0057] The temporal state deduction module extracts the temporal dependencies between feature vectors of each round from the evolutionary memory matrix, and generates state vectors that represent the evolution trend of user cognition by alternately executing cross-round subgraph structure comparison and gated state update.

[0058] The intervention path decision module determines the user's current stage of change based on the state vector, selects candidate intervention paths at the corresponding levels according to the order of intervention courses from easy to difficult, and uses the current environmental constraint nodes retrieved from the psychological knowledge graph to verify the feasibility of the candidate intervention paths, and outputs personalized auxiliary content after the verification is successful.

[0059] The conversation data parsing module is used to collect multi-round conversation text data from users, extracting emotion tags, cognitive bias lexical units, and contextual attributes from each round of text, and constructing the original conversation sequence using the round number as an index. Specifically, this includes:

[0060] The system receives user-initiated conversational text data each time, delivered via a user interface deployed on mobile devices or web pages. This conversational text data consists of the user's personal psychological state, daily events, or emotional experiences described in natural language. The system treats each submitted text as an independent round, recording its global sequence number, timestamp, and user identifier. For each round's text data, the system invokes a pre-trained semantic parsing unit to perform three-dimensional feature extraction: first, identifying explicit or implicit emotion categories in the text, such as "anxiety," "sadness," and "anger," and labeling the corresponding words or phrases as emotion tags; second, matching and extracting cognitive bias terms such as "mind reading," "labeling," and "black-and-white thinking" from the text based on a list of common cognitive biases in cognitive behavioral theory; and third, identifying specific external events or environmental contexts mentioned in the text, such as "work report," "colleague dinner," and "exam failure," and labeling them as contextual attributes. After completing the above extraction, the system stores the round number, emotion tags, cognitive bias terms, contextual attributes, and original text of that round as a structured record. Subsequently, the system uses the round number as the primary key to arrange all structured records of historical rounds in ascending order, forming the original session sequence. Each element in this sequence is a complete feature triple corresponding to a round, which can be used in subsequent processes.

[0061] In the subgraph mapping construction module, for each round in the original conversation sequence, the extracted emotion tags, cognitive bias lexical units, and contextual attributes are mapped to the node set of the psychological knowledge graph, and organized according to the temporal order within the conversation into a conversational subgraph structure containing nodes and their temporal connections, specifically including:

[0062] For each round in the original conversation sequence, all extracted emotion tags, cognitive bias lexical units, and situational attributes are first treated as candidate entities and matched one by one with the node names in a pre-constructed psychological knowledge graph. The psychological knowledge graph contains various psychologically related nodes, such as "anxiety," "sadness," "mind-reading cognitive bias," "labeling cognitive bias," "work report situation," and "social rejection situation." When a candidate entity completely matches a node name or successfully matches through a synonym mapping table, the candidate entity is identified as a mapped node, and its unique identifier in the psychological knowledge graph is recorded, thus forming the initial node set for that round.

[0063] After node mapping is completed, the confidence weight of each mapped node is determined based on the semantic distance between each emotion tag and its corresponding cognitive bias term in the original text of that round. The semantic distance is calculated as follows: Locate the starting character positions of the emotion tag term and the cognitive bias term in the original text of that round, and calculate the number of character intervals between the two starting positions. When the number of intervals is less than or equal to 5 characters, the semantic distance is considered close, and a confidence weight of 0.9 is assigned; when the number of intervals is greater than 5 characters and less than or equal to 15 characters, the semantic distance is considered medium, and a confidence weight of 0.6 is assigned; when the number of intervals is greater than 15 characters, the semantic distance is considered far, and a confidence weight of 0.3 is assigned. If an emotion tag corresponds to multiple cognitive bias terms, the distance for each pair is calculated separately, and each pair is assigned its own confidence weight. Each node can carry multiple confidence weights, and the maximum value is taken as the confidence weight of that node.

[0064] Simultaneously, each node is assigned a timestamp based on the order in which each lexical element (emotional label lexical element, cognitive bias lexical element, contextual attribute lexical element) appears in the original text during that round. The timestamp assignment rule is as follows: the timestamp value corresponding to the first lexical element in the text is 1, the timestamp value corresponding to the second lexical element is 2, and so on. If the same lexical element appears multiple times in the text, the first occurrence position is used as the timestamp. Each node may correspond to multiple lexical elements, and the smallest first occurrence position value is taken as the final timestamp of that node.

[0065] After obtaining the timestamp of each node, all nodes in the current round are traversed. For each pair of adjacent timestamps, the timestamp difference between them (i.e., the larger timestamp value minus the smaller timestamp value) is calculated, and this difference is compared with a preset semantic fusion threshold. The semantic fusion threshold is determined by the total span of all timestamps in the current round: first, the difference between the largest and smallest timestamp values ​​in the current round is calculated as the total time span; then, the total time span is multiplied by a fixed ratio of 0.2, and the product is rounded up to obtain the semantic fusion threshold. When the timestamp difference between two nodes is less than the semantic fusion threshold, a bidirectional temporal connection is established between these two nodes, i.e., from the node with the smaller timestamp to the node with the larger timestamp, and simultaneously from the node with the larger timestamp to the node with the smaller timestamp.

[0066] After determining the bidirectional temporal connections between all adjacent timestamp nodes, identify all node groups connected by bidirectional temporal connections in the subgraph for this round. For each connected group, shrink all nodes within it into a single supernode. The supernode's identifier is the combination of the minimum and maximum timestamp values ​​of all nodes within the group, such as "start value to end value of the timestamp interval". Simultaneously, delete all bidirectional temporal connection edges within the original group, retaining only the connections between the supernode and nodes outside the original group. If multiple nodes in the original group are connected to the same external node, retain only one connection edge, and set its weight to the sum of the weights of the original multiple connection edges.

[0067] Regenerate the skeleton edges of the intra-session subgraph for this round, using supernodes as units. Specifically, iterate through all supernodes and uncollapsed independent nodes. For each pair of nodes, if there exists at least one unidirectional or bidirectional connection in the original graph from any node in the first node's group to any node in the second node's group, then create a skeleton edge between the corresponding two new nodes. The direction of the skeleton edge is determined based on the original connection direction: if there is at least one unidirectional connection in the original graph, the skeleton edge is set to unidirectional; if there is at least one bidirectional connection in the original graph, the skeleton edge is set to bidirectional. After completing the above operations, the final intra-session subgraph structure for this round is obtained. This subgraph contains supernodes, independent nodes, and the skeleton edges between them, for use in subsequent processes.

[0068] Please see Figure 2 As shown, in the evolutionary memory generation module, based on the subgraph structure within each round and the user's feedback tags on the auxiliary content output in the corresponding round, a cross-round evolutionary memory matrix is ​​generated. The evolutionary memory matrix is ​​arranged with round indices as rows, and each row stores the compressed feature vector of the corresponding round's subgraph. Furthermore, historical rounds earlier than the current round are assigned weighting coefficients that decay over time. Specifically, this includes:

[0069] For each round in which the in-session subgraph construction has been completed, first, read the sum of the degrees of all nodes in the subgraph and the density value of the temporal connection edges in the subgraph. The degree of a node refers to the number of edges connected to that node; the sum of the degrees of all nodes in the subgraph is obtained. The density value of temporal connection edges is calculated as follows: count the total number of actual bidirectional and unidirectional temporal connection edges in the subgraph, divide by the total number of all possible node pairs in the subgraph (the number of node pairs equals the number of nodes multiplied by the number of nodes minus one, then divided by two); the resulting ratio is the density value. Combine the sum of the degrees and the density values ​​in order into an array containing two elements, called the original feature array for that round.

[0070] Obtain the user's feedback flag for the auxiliary content output in this round. The feedback flag is actively submitted by the user after each auxiliary content is received, and the flag value is either positive (e.g., a value incremented by one) or negative (e.g., a value minus one). When the feedback flag is positive, it indicates that the user approves of the auxiliary content in this round; when the feedback flag is negative, it indicates that the user does not approve. Based on the polarity of the feedback flag, adjust the sign of the original feature array obtained in the first segment: multiply the first element of the original feature array (i.e., the sum of degrees) by the value of the feedback flag to obtain the adjusted first element; multiply the second element (i.e., the density value) by the same feedback flag value to obtain the adjusted second element. If the feedback flag is positive, both elements remain unchanged; if the feedback flag is negative, both elements become their opposites.

[0071] A blank matrix is ​​pre-built, with the number of rows preset to the maximum number of supported rounds (e.g., 100 rows) and the number of columns preset to the number of elements in the original feature array (i.e., 2 columns). Following ascending order of round index, the original feature array from each round, after sign adjustment, is sequentially filled into the corresponding row of the blank matrix: the adjusted array from the first round is filled into the first row, the array from the second round into the second row, and so on. Rows corresponding to rounds that have not yet occurred remain zero. After filling, this matrix becomes the evolutionary memory matrix across rounds.

[0072] For each row of the evolutionary memory matrix, the original feature array containing two elements needs to be compressed into a fixed-length feature vector through dimensionality reduction projection. In this module, the fixed length is 8 dimensions. The compression process is as follows: For the first element of the original feature array in the i-th row, let's denote the value of A and the value of the second element, let's denote the value of B. The i-th row of the feature vector is calculated using the following linear weighting formula. Each component ( (From 1 to 8). The calculation formula is: the eigenvector of ... Each component equals A multiplied by the weighting coefficient. Add B multiplied by the weighting factor Among them, the weighting coefficient and It consists of 8 pre-calculated pairs of values, each pair summing to 1, and following... Increasing order, The value gradually decreased from 0.9 to 0.2. Gradually increase from 0.1 to 0.8. For example, =1 =0.9, =0.1; =2 =0.8, =0.2; and so on until... =8 o'clock =0.2, =0.8. For each After separate calculations, eight components were obtained, which were then... The sequential arrangement forms the fixed-length feature vector corresponding to each row. All rows undergo the same compression operation, replacing the original feature array of each row in the evolutionary memory matrix with the corresponding feature vector.

[0073] For the current round (denoted as round T), each of the preceding historical rounds (rounds 1 to T-1) needs to be assigned a time-decaying weighted coefficient. First, the number of rounds between the current round and each historical round is calculated; this number equals T minus the round number. Then, the corresponding decay multiplicative coefficient is selected based on the time decay interval containing the number of rounds. This module uses exponential decay, and the formula for calculating the decay multiplicative coefficient is: the decay multiplicative coefficient equals the natural constant. The negative power of (number of intervals multiplied by the decay factor). Here, the decay factor is a preset constant with a value of 0.1. The formula can be expressed mathematically as: In the formula The attenuation multiplicative factor is... It is a natural constant (approximately 2.71828). The number of interval rounds, This is the attenuation factor (with a value of 0.1). For example, when the number of interval rounds is 1, the attenuation multiplicative factor is equal to... The power of -0.1 is approximately equal to 0.9048; when the number of intervals is 2, it equals The negative 0.2 power is approximately equal to 0.8187; when the number of intervals is 3, it is approximately equal to 0.7408; and so on, the larger the number of intervals, the smaller the attenuation multiplicative coefficient.

[0074] After obtaining the decay multiplicative coefficient corresponding to each historical round, each element of the eigenvector in the row containing that historical round in the evolutionary memory matrix is ​​multiplied by the decay multiplicative coefficient. Specifically, for the 8-dimensional eigenvector in the i-th row (i < T), the values ​​of dimensions 1 to 8 are read sequentially, multiplied by the calculated decay multiplicative coefficient corresponding to the i-th row, and then the product is written back to the corresponding position in the i-th row of the evolutionary memory matrix, overwriting the original value. For the T-th row of the current round, no decay operation is performed, and its original compressed eigenvector remains unchanged. After the above operations, the eigenvectors of all historical rounds in the evolutionary memory matrix are decay-weighted, while the eigenvector of the current round retains its original value. This matrix is ​​then used in subsequent processes.

[0075] In the temporal state deduction module, the temporal dependencies between feature vectors of each round are extracted from the evolutionary memory matrix. By alternately executing cross-round subgraph structure comparison and gated state updates, a state vector representing the user's cognitive evolution trend is generated, specifically including:

[0076] The eigenvectors of two adjacent rounds are read sequentially from the evolutionary memory matrix. Let the current round be round T; then, the eigenvectors of round T-1 and round T are read. Both eigenvectors have a fixed length of 8 dimensions. The element-wise ratio of these two eigenvectors is calculated as follows: the first dimension value of the round T eigenvector is divided by the first dimension value of the round T-1 eigenvector to obtain the first dimension ratio; similarly, division is performed on dimensions 2 through 8 to obtain 8 ratios. These 8 ratios are arranged in dimensional order to form a difference comparison vector.

[0077] Three consecutive threshold intervals are predefined to divide the value of each element in the difference alignment vector into different intervals. In this module, the boundary values ​​of the three threshold intervals are set as follows: the first interval is values ​​greater than or equal to 0 and less than 0.8, the second interval is values ​​greater than or equal to 0.8 and less than or equal to 1.2, and the third interval is values ​​greater than 1.2. Each interval is bound to a fixed gating weight value, and the sum of the three gating weight values ​​is 1. Specifically, the gating weight value bound to the first interval is 0.2, the gating weight value bound to the second interval is 0.6, and the gating weight value bound to the third interval is 0.2.

[0078] Each element in the difference alignment vector is read sequentially, and its value is determined to fall into one of the three threshold intervals. If the value is greater than or equal to 0 and less than 0.8, it falls into the first interval, and the corresponding gate weight value of 0.2 is read. If the value is greater than or equal to 0.8 and less than or equal to 1.2, it falls into the second interval, and the corresponding gate weight value of 0.6 is read. If the value is greater than 1.2, it falls into the third interval, and the corresponding gate weight value of 0.2 is read. The read gate weight value is assigned to the corresponding weight bit of the element, meaning the value of that weight bit is equal to the read gate weight value. After traversing all 8 elements in the difference alignment vector, a sequence of 8 weight bit values ​​arranged in order is obtained, called the gate weight vector.

[0079] The gating weight vector is multiplied element-wise with the feature vector of the current round (round T). Specifically, the first dimension of the gating weight vector is multiplied by the first dimension of the feature vector of round T, resulting in the first dimension of the product. This operation is repeated, multiplying the second through eighth dimensions respectively, resulting in eight product values. These eight values ​​are then arranged in dimensional order to form a new 8-dimensional vector, called the fused state update vector. This state update vector represents the cognitive state of the current round after fusing gating information.

[0080] For each pair of adjacent rounds in the evolutionary memory matrix (i.e., round 1 and round 2, round 2 and round 3, ..., round T-1 and round T), repeat the operations in sections one through four to obtain the state update vector for each round (from round 2 to round T). Stack these state update vectors in ascending order of their round numbers to form a two-dimensional sequence, where each row corresponds to the state update vector of one round.

[0081] From the stacked two-dimensional sequence described above, the state update vector corresponding to the last round (i.e., round T) is extracted and used as the state vector representing the user's cognitive evolution trend from round 1 to round T. This state vector retains key information from the original feature vector after temporal comparison and gating, and is used to subsequently determine the user's current stage of change. For the case with only one round (i.e., T equals 1), it is impossible to calculate the ratio between adjacent rounds; in this case, the feature vector of round 1 is directly output as the state vector.

[0082] In the intervention path decision-making module, the user's current stage of change is determined based on the state vector. Candidate intervention paths at corresponding levels are selected according to the order of intervention courses from easy to difficult. The feasibility of the candidate intervention paths is verified using the current environmental constraint nodes retrieved from the psychological knowledge graph. Personalized support content is output after successful verification, specifically including:

[0083] The state vector is matched against multiple pre-stored feature templates for different stages of change. Each stage (e.g., pre-reflection, reflection, preparation, action, and maintenance) corresponds to a fixed feature vector range. The Euclidean distance between the state vector and each stage template is calculated, and the stage with the closest distance is selected as the user's current stage of change. Then, following the order of intervention courses from easy to difficult, a corresponding intervention level is pre-assigned to each stage of change: pre-reflection corresponds to the basic cognitive skills level, reflection corresponds to the basic cognitive skills level, preparation corresponds to the behavioral activation level, action corresponds to the social support linking level, and maintenance corresponds to the consolidation and practice level. Based on the determined stage of change, a candidate intervention path for the corresponding level is selected. The candidate intervention path is one of multiple paths pre-stored in the psychological knowledge graph, and each path consists of a series of action nodes executed sequentially.

[0084] After selecting candidate intervention paths, the current environmental constraint nodes are retrieved from the psychological knowledge graph. These nodes are pre-stored knowledge graph nodes representing the characteristics of the user's real-world environment. For example, the "cold company culture node" includes the attribute value "colleague response rate 30%", and the "remote residence node" includes the attribute value "public transportation waiting time greater than 30 minutes". The selected candidate intervention path is broken down into multiple action nodes to be executed sequentially, each with a list of environmental conditions. For example, the action node "actively invite colleagues to lunch" includes the environmental conditions "colleague response rate greater than or equal to 50%" and "free time during lunch break greater than or equal to 30 minutes".

[0085] Initialize a conflict count variable and set its value to zero. Read the environmental condition list of each action node sequentially, following the execution order of the action nodes in the candidate intervention path. For the currently read action node, compare each condition in its environmental condition list with the corresponding attribute value in the current environmental constraint node. For each condition comparison, if the condition is not met, increment the conflict count by one; if the condition is met, do not change the conflict count. After completing the comparison of all conditions for one action node, continue reading the environmental condition list of the next action node and repeat the above comparison process until all conditions for all action nodes have been compared.

[0086] After completing all comparisons, determine if the final conflict count is zero. If the conflict count is zero, it means that all action nodes of the candidate intervention path meet the current environmental constraints, and the candidate intervention path is deemed to have passed verification. If the conflict count is greater than zero, it means that at least one environmental condition is not met, and the candidate intervention path is deemed to have failed verification. For candidate intervention paths that fail verification, discard them and return to the previous step, that is, select the next candidate intervention path in the same intervention level and repeat the aforementioned feasibility verification process until a verified path is found, or output the default path after traversing all paths in this level.

[0087] When comparing each condition in the environmental condition list with the attribute value of the current environmental constraint node, each condition is first parsed into a range expression containing a lower threshold and an upper threshold. For example, the condition "colleague response rate greater than or equal to 50%" is parsed into a lower threshold of 50% and an upper threshold of positive infinity; the condition "free time during lunch break less than or equal to 60 minutes" is parsed into a lower threshold of 0 and an upper threshold of 60 minutes. Simultaneously, the attribute value corresponding to that condition in the current environmental constraint node is read; for example, the value of "colleague response rate" is read as 30% from the "apathetic company culture node".

[0088] Then, it checks whether the read attribute value simultaneously satisfies two conditions: the attribute value is greater than or equal to the lower threshold, and the attribute value is less than or equal to the upper threshold. If both conditions are met, the condition is considered to have passed the comparison, and the conflict count remains unchanged. If the attribute value is lower than the lower threshold, or higher than the upper threshold, the condition is considered not met, and the conflict count is incremented by one. This process is repeated until all conditions in the environment condition list of the current action node have been compared. After all comparisons are complete, the final conflict count is output.

[0089] The working principle of this invention is as follows: Multi-turn conversation text data is collected from users. Emotional tags, cognitive bias terms, and contextual attributes are extracted from each round of text to construct an original conversation sequence. For each round, the extracted information is mapped to a node set in a psychological knowledge graph. Confidence weights are determined based on the character interval between emotional tags and cognitive bias terms, and timestamps are assigned according to the order of term appearance. Bidirectional temporal connections are established based on the timestamp difference and semantic fusion threshold. Connected node groups are shrunk into supernodes, generating a conversational subgraph structure containing skeleton edges. Based on the subgraph structure of each round and user feedback markers, the sum of node degrees and edge density values ​​are extracted to form an original feature array. After sign adjustment, this array is filled into an evolutionary memory matrix. Each row is compressed into a fixed value through linear weighting. The length feature vector is weighted by an exponential decay coefficient of the number of intervals in the historical rounds. The feature vectors of adjacent rounds are read sequentially from the evolutionary memory matrix, and the element-wise ratio is calculated to form a difference comparison vector. A gate weight vector is generated based on a preset threshold interval and multiplied element-wise with the feature vector of the current round to obtain a state update vector. After stacking, the last vector is taken as the state vector of the cognitive evolution trend. The change stage is matched according to the state vector and the candidate intervention path of the corresponding level is selected. The path is decomposed into a list of action nodes and their environmental conditions. The attribute values ​​of the current environmental constraint nodes retrieved from the knowledge graph are compared with the interval. If all conditions are met, the verified personalized assistance content is output. Otherwise, the path is reselected until the verification is passed or the default path is output.

[0090] The foregoing has provided a detailed description of one embodiment of the present invention, but this description is merely a preferred embodiment and should not be construed as limiting the scope of the invention. All equivalent variations and modifications made within the scope of the claims of this invention should still fall within the patent coverage of this invention.

Claims

1. A psychological counseling intelligent assistance system based on knowledge graphs and semantic recognition, characterized in that: include: The conversation data parsing module is used to collect multi-round conversation text data from users, extract emotion tags, cognitive bias lexical units and contextual attributes from each round of text, and construct the original conversation sequence with the round as the index. The subgraph mapping construction module maps the extracted emotion tags, cognitive bias lexical units, and contextual attributes to the node set of the psychological knowledge graph for each round in the original conversation sequence, and organizes them into a conversational subgraph structure containing nodes and their temporal connections according to the temporal order within the conversation. The evolutionary memory generation module generates a cross-round evolutionary memory matrix based on the subgraph structure within each round and the user's feedback tags on the auxiliary content output in the corresponding round. The evolutionary memory matrix is ​​arranged with round index as the row, and each row stores the compressed feature vector of the corresponding round's subgraph. It also assigns a weighting coefficient that decays over time to each historical round earlier than the current round. The temporal state deduction module extracts the temporal dependencies between feature vectors of each round from the evolutionary memory matrix, and generates state vectors that represent the evolution trend of user cognition by alternately executing cross-round subgraph structure comparison and gated state update. The intervention path decision module determines the user's current stage of change based on the state vector, selects candidate intervention paths at the corresponding levels according to the order of intervention courses from easy to difficult, and uses the current environmental constraint nodes retrieved from the psychological knowledge graph to verify the feasibility of the candidate intervention paths, and outputs personalized auxiliary content after the verification is successful.

2. The intelligent auxiliary system for psychological counseling based on knowledge graphs and semantic recognition according to claim 1, characterized in that, The intra-session subgraph structure, organized according to the temporal order within the session and containing nodes and their temporal connections, specifically includes: The confidence weight of the mapping node is determined based on the semantic distance between each emotion label and the corresponding cognitive bias word in the text, and a timestamp is assigned to each node according to the order in which the word appears. Calculate the time difference between adjacent timestamp nodes. If the difference is lower than the preset semantic fusion threshold, then establish a bidirectional temporal connection between the two nodes. Shrink the group of nodes with bidirectional temporal connections into supernodes, and regenerate the skeleton edges of the intra-session subgraph on a supernode basis.

3. The intelligent auxiliary system for psychological counseling based on knowledge graphs and semantic recognition according to claim 2, characterized in that, The determination of the confidence weight of the mapping node based on the semantic distance between each emotion tag and the corresponding cognitive bias word in the text specifically includes: Read the directional orientations of emotion label lexical units and cognitive bias lexical units in the pre-trained vector space, calculate the degree of offset between the two directional orientations, and quantify the degree of offset into a semantic distance value. The semantic distance value is compared with multiple preset distance intervals one by one. Each interval corresponds to a pre-stored confidence weight value. The matching confidence weight value is selected based on the comparison results. The selected confidence weight values ​​are written as additional tags on the timing connections between the corresponding nodes in the subgraph within the session.

4. The intelligent auxiliary system for psychological counseling based on knowledge graphs and semantic recognition according to claim 1, characterized in that, The generation of the evolutionary memory matrix across rounds specifically includes: Read the sum of the degree of all nodes in the subgraph within each round of the session and the density value of the temporal connection edge, and combine the sum of the degree and the density value into the original feature array of the round; Obtain user feedback flags for the auxiliary content output in each round, and adjust the sign of the original feature array according to the positive or negative polarity of the feedback flags; The adjusted feature array is filled into each row of the blank matrix in the order of round index to form an evolutionary memory matrix spanning rounds.

5. The intelligent auxiliary system for psychological counseling based on knowledge graphs and semantic recognition according to claim 1, characterized in that, The assignment of time-decreasing weighted coefficients to each historical round earlier than the current round specifically includes: The original feature array in each row is compressed into a fixed-length feature vector through dimensionality reduction projection. Calculate the number of interval rounds between the current round and each historical round, and select the corresponding decay multiplicative coefficient for each historical round based on the time decay interval in which the number of interval rounds falls; Each element in the eigenvector of each historical round is multiplied by its corresponding decay multiplicative coefficient, and the result of the multiplication is written back to the corresponding row position of the evolutionary memory matrix.

6. The intelligent auxiliary system for psychological counseling based on knowledge graphs and semantic recognition according to claim 1, characterized in that, The generation of the state vector representing the evolution trend of user cognition specifically includes: The eigenvectors of two adjacent rounds are read sequentially from the evolutionary memory matrix, and the element-wise ratio of the two eigenvectors is calculated to form a difference comparison vector. The values ​​of each element in the difference alignment vector are compared with multiple preset threshold intervals, and a corresponding gate weight value is generated based on the interval to which each element belongs. Perform an element-wise product operation between the gating weight value and the feature vector of the current round to obtain the fused state update vector; Stack the state update vectors obtained in each round in chronological order, and take the last state update vector as the state vector representing the evolution trend of user cognition.

7. The intelligent auxiliary system for psychological counseling based on knowledge graphs and semantic recognition according to claim 6, characterized in that, The process for generating the gating weight value is as follows: Three consecutive threshold intervals are pre-defined, each interval is bound to a fixed gate weight value, and the sum of the three gate weight values ​​is one. Read the value of each element in the difference comparison vector in sequence, determine which threshold interval the element value falls into, and read the corresponding gate weight value according to the interval it falls into. The read gating weight values ​​are assigned to the corresponding weight bits of the elements. After traversing all elements in turn, a gating weight vector composed of the weight bits is obtained.

8. The intelligent auxiliary system for psychological counseling based on knowledge graphs and semantic recognition according to claim 1, characterized in that, The feasibility verification of candidate intervention paths using current environmental constraint nodes retrieved from a psychological knowledge graph specifically includes: The candidate intervention path is broken down into multiple action nodes that are executed sequentially, and each action node is accompanied by a list of required environmental conditions; Read the environmental condition list of each action node in sequence, compare each condition in the list with the attribute value of the current environmental constraint node one by one, and increment the conflict count if the attribute value does not meet the condition. Determine if the cumulative conflict count is zero. If it is zero, the candidate intervention path is deemed to have passed verification. Otherwise, discard the intervention path and return to the previous step to select a new candidate intervention path.

9. The intelligent auxiliary system for psychological counseling based on knowledge graphs and semantic recognition according to claim 8, characterized in that, If the attribute value does not meet the condition, the conflict count is incremented, specifically including: Each condition is parsed into an interval expression containing a lower threshold and an upper threshold, and the attribute values ​​corresponding to the conditions in the current environment constraint node are read. Determine whether the attribute values ​​are simultaneously greater than or equal to the lower threshold and less than or equal to the upper threshold. If the conditions are met, the corresponding condition comparison is considered successful. If the attribute value is lower than the lower threshold or higher than the upper threshold, the condition is determined not to be met, and the conflict count is incremented by one. After completing the comparison of all condition items, output the final conflict count.