A preoperative risk prediction method based on a knowledge graph
By constructing a description of the sequence of changes in vital signs and extending the atlas relationship, the postoperative risk status is identified, which solves the time and stability problems of preoperative risk prediction in existing technologies and achieves more accurate preoperative risk prediction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HEFEI NO 2 PEOPLES HOSPITAL
- Filing Date
- 2026-02-10
- Publication Date
- 2026-06-05
AI Technical Summary
Existing technologies struggle to identify abnormal changes in a timely manner when vital signs exhibit complex fluctuations during preoperative risk prediction. This leads to a reliance on post-operative aggregation of features for risk identification, which fails to provide forward-looking and stable predictions under conditions of rapid state evolution or cross-changes of multiple indicators.
By extracting continuous changes in preoperative vital signs, a description of the sequence of vital sign changes is generated, abnormal changes are identified, the relationships in the atlas are extended step by step, relevant postoperative risk status nodes are identified, and a risk association path description is formed, thereby enhancing the temporal continuity and individual adaptability of risk prediction.
It improves the temporal continuity and individual adaptability of preoperative risk prediction, enhances the consistency of risk outcome interpretation, and ensures the foresight and stability of risk prediction.
Smart Images

Figure CN122158115A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of preoperative risk prediction technology, and in particular to a preoperative risk prediction method based on knowledge graphs. Background Technology
[0002] The field of preoperative risk prediction technology encompasses research on assessing and predicting various health risks that surgical patients may face in the preoperative stage. The core of this technology lies in collecting multi-dimensional medical data from patients before surgery, combining medical knowledge, statistical methods, and reasoning mechanisms to construct judgment criteria for predicting postoperative complications, disease evolution trends, or other potential harms. The overall technology field includes clinical data analysis, risk factor modeling, predictive model construction, and medical decision support. Its goal is to assist doctors in scientifically predicting the risks that patients may face in the preoperative stage, so as to optimize treatment plans and reduce the possibility of postoperative adverse events.
[0003] One method for preoperative risk prediction based on knowledge graphs involves using knowledge graph technology to analyze the correlation between structured and unstructured medical information of preoperative patients. By constructing a relationship network between entities, it can assist in the judgment of preoperative risks. For medical subcategories such as basic patient information, medical history records, physiological parameters, and laboratory data, entities and relationships in the graph are extracted and fused to form a medical knowledge network that can be used for reasoning. Based on this network, graph embedding computation and path association analysis are performed to identify key nodes related to risk factors and their potential associations, thereby completing the risk prediction process. Typically, semantic information extraction, relationship matching and recognition, graph structure modeling, and path scoring are used to complete the systematic prediction and analysis of preoperative risks.
[0004] Existing technologies typically involve holistic reasoning based on the correlations between medical data, focusing more on the statistical or semantic relationships between indicators and risk outcomes. When preoperative vital signs exhibit complex fluctuations, it is difficult to characterize abnormal transitions in the process of change. This leads to risk identification relying on post-hoc aggregated features. Under conditions of rapid state evolution or cross-changes of multiple indicators, problems such as dispersed risk orientation and unclear time positioning can easily arise. For example, when the indicator values are still within the normal range but the sequence of changes is abnormal, it is difficult to generate effective risk warnings in a timely manner, thus limiting the foresight and stability of the prediction results. Summary of the Invention
[0005] To address the technical problems existing in the prior art, this invention provides a preoperative risk prediction method based on knowledge graphs. The technical solution is as follows: A knowledge graph-based method for preoperative risk prediction includes the following steps: S1: Extract continuous change data of blood pressure, heart rate, respiratory rate and body temperature of patients in the preoperative stage, analyze the start and direction of change of each vital sign data, break it down into change events, connect different types of change events in sequence, and generate a description of the sequence of changes in vital signs. S2: Based on the sequence of vital sign change events in the description of the sequence of vital sign changes, combine two adjacent vital sign change events into event pairing units, retrieve the preset standard response order, verify the consistency of the order, retain the event mismatch units with inconsistent order, and obtain the abnormal change connection description. S3: Read the inconsistent event pairing unit in the abnormal change connection description, locate the corresponding vital sign status node, extend the search of the atlas relationship step by step, identify the relevant postoperative risk status node, form a risk status node set, and obtain the associated risk status description. S4: Based on each risk status node in the associated risk status description, retrieve the path associated with the postoperative risk status node, expand the path in the order of vital sign status node and postoperative risk status node, compare the continuous and consistent vital sign status node connection segments in the multiple paths, form a path segment description, and obtain the risk associated path description.
[0006] As a further aspect of the present invention, the description of the sequence of changes in vital signs includes an event sequence identifier, a combination of types of changes in vital signs, and overall structural features of changes; the description of abnormal change connections includes a set of sequential abnormality categories, a type of abnormal connection pattern, and information on the degree of abnormality; the description of associated risk status specifically includes a set of postoperative risk status nodes, a risk status coverage range, and a risk association level identifier; and the description of risk association paths includes a set of risk-corresponding path segments, a co-occurrence sequence of vital sign statuses, and path stability features.
[0007] As a further aspect of the present invention, the step of obtaining S1 is as follows: S101: Extract blood pressure, heart rate, respiratory rate, and body temperature data from multi-parameter monitoring devices during the preoperative stage, arrange them sequentially based on the time label corresponding to each vital sign data, identify the direction of numerical change between adjacent records, locate the starting position of continuous change in each type of vital sign data, and generate a set of time series change starting points. S102: Call the starting positions of each item in the time series change starting point set, divide the continuous data segments with the same change direction in each type of vital sign according to the order of records within the vital signs, mark the start and end time and change attributes of each segment, establish the corresponding data segment boundaries, and obtain the single type of vital sign change segment sequence. S103: Based on the start time of each segment in the single-category vital sign change segment sequence, the segments of different categories of vital sign changes such as blood pressure, heart rate, respiratory rate, and body temperature are uniformly sorted, and adjacent events in time are sequentially connected to construct a complete vital sign change event chain, thereby obtaining a description of the sequence of vital sign changes.
[0008] As a further aspect of the present invention, the step of obtaining S2 is as follows: S201: Based on the sequence of vital sign change events described in the sequence of vital sign changes, select two vital sign change events that are adjacent in time according to the start time of the events, extract the vital sign type marker and time sequence marker corresponding to each group of events, and combine them to form an event pairing unit consisting of any two of the following: blood pressure, heart rate, respiratory rate, and body temperature, and generate an event pairing arrangement sequence. S202: Call the vital sign type markers in each event pairing unit in the event pairing sequence, and according to the combination of the two types of vital signs in the pairing, query the corresponding standard response sequence in the medical knowledge graph database, extract the standard response order information recorded in the knowledge graph, and make a consistency judgment with the actual arrangement order of the two vital sign events in the pairing unit to obtain the response sequence corresponding to the state sequence. S203: Based on the consistency judgment results in the state sequence corresponding to the response order, filter all event pairing units marked as inconsistent in order, extract the corresponding vital sign type combination, arrangement order and time position index information, organize all sequence conflict event pairing units in chronological order, and generate an abnormal change connection description.
[0009] As a further aspect of the present invention, the step of obtaining S3 is as follows: S301: Read all inconsistent event pairing units in the abnormal change connection description, locate the vital sign status node corresponding to each group of vital sign types in the medical knowledge graph database based on the information of various vital sign types and change directions in the pairing units, and complete the retrieval and labeling of vital sign status nodes by comparing the event attributes in the pairing units with the node labels in the graph, and generate vital sign status node matching results. S302: Call each vital sign status node in the matching result of the vital sign status nodes, and extend it step by step along the directed connection relationship between the vital sign status nodes according to the connection relationship defined in the medical knowledge graph. Each round of extension starts with the current vital sign status node and extends to the next level. All vital sign status nodes involved in the effective paths are accumulated in sequence to establish an extension path node set. S303: Based on the end-point vital sign status node of each path in the extended path node set, search for whether there is a direct or indirect connection relationship with the postoperative risk status node, filter the postoperative risk status nodes connected to the end-point nodes with the relationship, extract the postoperative risk status nodes involved in the connection in all associated paths, rearrange the corresponding relationship according to the time order of the event pairing unit, and generate an associated risk status description.
[0010] As a further aspect of the present invention, the step of obtaining S4 is as follows: S401: Based on each risk state node in the associated risk state description, retrieve the association path between the risk state node and the vital sign state node in the medical knowledge graph database, extract the sequence of vital sign state nodes and the sequence of postoperative risk state nodes connected in sequence in the path, record the path expansion content according to the connection order of the vital sign state nodes, establish the path sequence information corresponding to the risk state node, and generate a risk path node sequence set. S402: Call the connection order of vital sign status nodes of each path in the risk path node sequence set, compare the order of vital sign status nodes in the path corresponding to different risk status nodes, determine the consistency of the order of continuous node combinations in multiple paths, filter the connection segments of vital sign status nodes that appear continuously in the same order, and obtain a set of continuous sequence segments. S403: Based on the connecting segments of each group of vital sign status nodes in the continuous sequence fragment set, mark the risk status node category and path location index information to which the connecting segment belongs, organize the correspondence between vital sign status node connecting segments and postoperative risk status nodes, summarize all fragment content according to risk status nodes, and generate a risk association path description.
[0011] As a further aspect of the present invention, S5: Based on the path segments in the risk association path description, locate the corresponding position of each path segment in the description of the sequence of changes in the patient's vital signs, identify the corresponding postoperative risk status nodes, arrange them in the order of the events of changes in vital signs, form a risk status arrangement result, and obtain the preoperative risk prediction result. The preoperative risk prediction results specifically include the postoperative risk status ranking sequence, individual risk distribution results, and comprehensive risk prediction conclusions.
[0012] As a further aspect of the present invention, the step of obtaining S5 is as follows: S501: Based on each group of path segments in the risk association path description, extract the connection order of vital sign status nodes in the path segment, identify event segments that are consistent with the connection order in the current patient's vital sign change sequence description, mark the start and end positions of each path segment in the vital sign change event sequence, and generate path segment localization results. S502: Call each located path segment in the path segment location result, read the postoperative risk status node identifier content connected to the end of the segment, backfill the position mark of the corresponding path segment in the patient event sequence, organize the relative order information of the postoperative risk status nodes in the time series, and obtain the risk node priority list. S503: Based on the time sequence of all postoperative risk status nodes in the risk node priority list, extract the corresponding sorting position of each risk status node in the sequence, organize it into a risk status node arrangement that is consistent with the progression sequence of vital sign changes, and generate preoperative risk prediction results.
[0013] The beneficial effects of the technical solutions provided in the embodiments of the present invention include at least the following: In this invention, by abstracting the continuous changes in preoperative vital signs into an alignable temporal event structure, risk triggering clues based on the deviation of the order of changes are introduced. This makes risk identification no longer rely on the intensity of single-point features, but focuses on the abnormal patterns of change connections. Multiple constraint verifications are completed through the combination of stable states in the risk association path, so that the risk orientation has a clear evolutionary basis. The risk results are strictly embedded in the patient's actual change sequence, thereby enhancing the performance of risk prediction in terms of temporal continuity, individual adaptability, and consistency of result interpretation. Attached Figure Description
[0014] Figure 1 This is a flowchart of the method of the present invention; Figure 2 This is a flowchart illustrating the acquisition process of S1 in this invention; Figure 3 This is a flowchart illustrating the acquisition process of S2 in this invention; Figure 4 This is a flowchart illustrating the acquisition process of S3 in this invention; Figure 5 This is a flowchart illustrating the acquisition process of S4 in this invention; Figure 6 This is a flowchart of the acquisition process for S5 of the present invention. Detailed Implementation
[0015] The technical solution of the present invention will now be described with reference to the accompanying drawings.
[0016] In embodiments of the present invention, words such as "exemplarily," "for example," etc., are used to indicate that something is an example, illustration, or description. Any embodiment or design described as "exemplary" in the present invention should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of the word "exemplary" is intended to present the concept in a concrete manner. Furthermore, in embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one.
[0017] In the embodiments of this invention, the terms "image" and "picture" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning. Similarly, the terms "of," "corresponding (relevant)," and "corresponding" may sometimes be used interchangeably. It should be noted that, without emphasizing the distinction between them, they convey the same meaning.
[0018] In this embodiment of the invention, sometimes a subscript such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meaning they express is the same.
[0019] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0020] Please see Figure 1 This invention provides a technical solution: a preoperative risk prediction method based on knowledge graphs, comprising the following steps: S1: Extract continuous change data of blood pressure, heart rate, respiratory rate and body temperature of patients in the preoperative stage from multi-parameter monitoring equipment. Analyze the starting position and direction of change of each vital sign data according to time tags. According to the time progression, split the continuous change data segment in each type of vital sign into corresponding change events. Connect the change events of different types of vital signs in sequence according to the time sequence to form the sequential content of preoperative vital sign change events and obtain the description of the sequence of vital sign changes. S2: Based on the sequence of vital sign changes in the description of the sequence of vital sign changes, select two adjacent vital sign change events in the time series as event pairing units. Retrieve the standard response sequence relationship related to the vital sign type corresponding to the event pairing unit from the preset medical knowledge graph library. Verify the event pairing unit according to the arrangement order of vital sign types in the event pairing unit. Identify event pairing units where the event sequence is inconsistent with the standard response sequence. Retain all inconsistent event pairing units to obtain the abnormal change connection description. S3: Read the inconsistent event pairing unit in the abnormal change connection description, locate the vital sign status node corresponding to the inconsistent event pairing unit in the preset medical knowledge graph library, carry out a step-by-step search along the relationship between the vital sign status nodes, locate the postoperative risk status node that is related to the vital sign status node during the step-by-step search, form a set of risk status nodes corresponding to the inconsistent event pairing unit, and obtain the associated risk status description. S4: Based on each risk status node in the associated risk status description, retrieve the associated paths corresponding to each risk status node in the preset medical knowledge graph database, expand the path along the connection order of vital sign status nodes and postoperative risk status nodes in the path, compare the connection order of vital sign status nodes in the multiple expanded paths, identify the connection segments of vital sign status nodes that appear consecutively in the same order in the paths corresponding to different risk status nodes, form the path segment description corresponding to the risk status node, and obtain the risk associated path description. S5: Based on the path segments in the risk association path description, locate the corresponding position of each path segment in the current patient's vital sign change sequence description, identify the postoperative risk status nodes pointed to by the path segments, arrange the identified postoperative risk status nodes according to the order of occurrence of vital sign change events, form a risk status arrangement result consistent with the patient's preoperative vital sign change sequence, and obtain the preoperative risk prediction result.
[0021] The description of the sequence of vital sign changes includes the chronological order of events, the combination of types of vital sign changes, and the overall structural characteristics of the changes. The description of the connection of abnormal changes includes the set of sequential abnormality categories, the type of abnormal connection pattern, and the information on the degree of abnormality. The description of the associated risk status specifically includes the set of postoperative risk status nodes, the coverage of risk status, and the identification of risk association levels. The description of the risk association path includes the set of risk-corresponding path segments, the co-occurrence sequence of vital sign status, and the stability characteristics of the path. The preoperative risk prediction results specifically include the postoperative risk status ranking sequence, the individual risk distribution results, and the comprehensive risk prediction conclusion.
[0022] Please see Figure 2 The steps to obtain S1 are as follows: S101: Extract blood pressure, heart rate, respiratory rate, and body temperature data from multi-parameter monitoring devices during the preoperative stage, arrange them sequentially based on the time label corresponding to each vital sign data, identify the direction of numerical change between adjacent records, locate the starting position of continuous change in each type of vital sign data, and generate a set of time series change starting points. Preoperative blood pressure, heart rate, respiratory rate, and body temperature data were extracted from a multi-parameter monitoring device (specifically a bedside monitor integrating a non-invasive blood pressure cuff pump sensor, electrocardiogram (ECG) surface electrodes, chest impedance respiratory sensor, and infrared ear temperature probe). The raw numerical streams from each hardware channel were read via analog-to-digital conversion (ADC). Each value was bound to a relative timestamp recorded by the system clock, establishing a five-dimensional data matrix containing systolic blood pressure (mmHg), diastolic blood pressure (mmHg), heart rate per minute (bpm), respiratory rate per minute (rpm), and cochlear temperature (°C). The column vectors in the matrix were arranged in ascending order of relative timestamps. For each dimension of the vital sign data sequence, a noise filtering threshold was set to filter out minute fluctuations in readings. For example, based on standard medical measurement error standards, the systolic blood pressure setting... The heart rate setting is 2 mmHg. It is 3 bpm, based on the current time. numerical value Subtract the previous sampling time numerical value Obtain the instantaneous difference The instantaneous difference The absolute value and the corresponding noise filtering threshold Perform a numerical comparison; if Greater than Then mark the current change state value as +1 (significant increase), if Less than negative The state value of the marker change is -1 (significant decrease). If the absolute value is less than or equal to... The state value is then marked as 0 (stationary). All data points along the entire timeline are iterated through sequentially to generate a state value sequence. A sliding scan is then performed on the state value sequence, comparing the state values at adjacent time points. and When detected Not equal to 0 and Not equal to When, or detected Not equal to 0 and When the value equals 0, lock that moment. For each state mutation point, the timestamp corresponding to the mutation point is extracted and stored in a temporary index list. For example, when detecting a patient's heart rate data, if the difference calculated at 50 seconds relative to the time is +5 bpm, which is greater than the threshold of 3 bpm, the state is marked as +1. If the difference at 49 seconds is 1 bpm, the state is marked as 0. Thus, 50 seconds is identified as the starting point of the heart rate increase. The above difference calculation, threshold comparison and state transition scanning operations are repeated for all vital sign dimensions. All identified mutation point timestamps are summarized to generate a set of time series change starting points.
[0023] S102: Call the starting positions of each item in the time series change starting point set, divide the continuous data segments with the same change direction in each type of vital sign according to the order of records within the vital signs, mark the start and end time and change attributes of each segment, establish the corresponding data segment boundaries, and obtain the single type of vital sign change segment sequence. Retrieve the starting positions of each item in the time series change starting point set, and for a single category of vital sign data, read the record in the index list. Timestamp of the starting position and the Timestamp of the starting position These two timestamps are defined as candidate intervals to be processed. The changed state values of all original sampling points within this interval are iterated over, and the changes in these values are statistically analyzed. The percentage of data points with the same initial position state value direction is considered if this percentage exceeds a preset continuity confidence level of 85%. If so, the interval is confirmed as a valid monotonic process. Write the start time field to this data segment. Write the previous sampling time into the end time field, and calculate the value corresponding to the end time. Value corresponding to the start time The difference between the values is defined as the amplitude of change. Simultaneously, based on the state value at the starting position (+1 or -1), the text label "continuously rising" or "continuously falling" is written to the attribute field of the data segment. If this percentage is less than 85% (e.g., temperature fluctuates repeatedly within the interval without showing a consistent trend), the interval is determined to be a clinically insignificant random fluctuation or artifact, and the data for that time period is directly marked and removed, not included as a valid event in subsequent sequences. If the time interval between two starting positions is less than the preset minimum event duration (e.g., 5 seconds), the small segment is merged with the previous segment or removed. For the process of systolic blood pressure rising from 120 mmHg to 140 mmHg, the system records the start time as a relative time of 100 seconds, the end time as 130 seconds, the change attribute as "systolic blood pressure_rise," and the amplitude as 20 mmHg. This process is repeated for all candidate intervals of heart rate, respiratory rate, and body temperature, constructing structured data blocks containing category, start and end time, direction of change, and amplitude to obtain a sequence of single-category vital sign change segments.
[0024] S103: Based on the start time of each segment in the sequence of single-category vital sign changes, the segments of different categories of vital sign changes such as blood pressure, heart rate, respiratory rate, and body temperature are uniformly sorted, and the time-adjacent event contents are sequentially connected to construct a complete chain of vital sign changes events, thus obtaining a description of the sequence of vital sign changes. Based on the start time of each segment in the sequence of single-type vital sign changes, a global event container is created. All blood pressure, heart rate, respiratory rate, and body temperature change segments generated in previous steps are imported into this container. The start time field of each change segment structure is then extracted. Used as the sort key, perform a quicksort operation to sort all fragments within the container according to... The values are rearranged in ascending order. For two segments with the same start time, a secondary sort is performed according to a preset physiological response priority table. For example, the priority value of heart rate change is set to 1, and the priority value of body temperature change is set to 2. The smaller the value, the higher the priority. Then, a doubly linked list structure is created, with the first sorted segment set as the head node. Subsequent segments are then added to the list as successor nodes. During the node connection process, the previous node is read. End time With the next node start time The time difference between the two events is calculated and written into the connection edge as the event interval attribute. If the time difference is less than zero, it is marked as an overlapping event. Finally, a linear narrative structure with multiple types of vital signs appearing alternately is formed, which progresses along the time axis. For example, the first node of the linked list is "relative time 10s_heart rate_increase", the next node it points to is "relative time 15s_systolic blood pressure_increase", and then points to "relative time 40s_respiratory rate_decrease". This series of structured nodes constitutes the input sequence required for subsequent knowledge graph reasoning, and obtains the description of the sequence of changes in vital signs.
[0025] Please see Figure 3 The steps to obtain S2 are as follows: S201: Based on the sequence of vital sign changes described in the order of vital sign changes, select two vital sign change events that are adjacent in time according to the start time of the events, extract the vital sign type label and time sequence label corresponding to each group of events, and combine them to form an event pairing unit consisting of any two of the following: blood pressure, heart rate, respiratory rate, and body temperature, and generate an event pairing arrangement sequence. Based on the sequence of vital sign changes described in the order of vital sign changes, an empty pairing list is initialized as a data container. A sliding window is set with a step size of 1 event unit and a window length of 2 event units. Starting from the head node of the event list, the first event in the window is recorded as the predecessor event along the time progression direction. The second event is recorded as the successor event. ,extract The physical sign type field (e.g., "systolic blood pressure"), change attribute field (e.g., "rising") and time tags Extract the same The physical sign type field (e.g., "heart rate"), variable attribute fields (e.g., "decline") and time tags ,examine and If they are the same, then combine them into a single tuple object. The type identifier combination of the binary object is " - "As an index key; The actual time difference (Unit: seconds) is used as an association parameter and stored in the pairing list. After one window movement is completed, the original... Updated to new Continue reading the next node in the linked list as the new node. Repeat the extraction and combination operations until the entire linked list has been traversed. For a sequence containing three consecutive events: "increased blood pressure", "increased heart rate", and "decreased body temperature", the first slide generates "blood pressure-heart rate" pairings, the second slide generates "heart rate-body temperature" pairings, and an event pairing permutation sequence is generated.
[0026] S202: Call the vital sign type markers in each event pairing unit in the event pairing sequence, and based on the combination of the two types of vital signs in the pairing, query the corresponding standard response sequence in the medical knowledge graph database, extract the standard response order information recorded in the knowledge graph, and make a consistency judgment with the actual arrangement order of the two vital sign events in the pairing unit to obtain the response sequence corresponding to the state sequence. Invoke the vital sign type markers in each event pairing unit of the event pairing sequence, and perform verification for each event pairing unit to be verified. Analyze the preceding event types it contains. With subsequent event types Construct the query statement: MATCH (n:Vitals {type: $Type_a})-[r:LEADS_TO]->(m:Vitals {type: $Type_b}) RETURN r, initiates a retrieval request to the preset medical knowledge graph through the graph database interface, and locates the representative entity in the entity node set of the graph. The source node (e.g., "systolic blood pressure_elevation") and the representative For the target node (e.g., "heart rate slowing down"), check if there is a directional edge between the two nodes. If the search results return a direct directed edge from the source node to the target node, then read the "standard response weight" attribute stored on that edge. and the "standard time interval range" attribute (Unit: seconds) The actual time difference between the paired units and Perform a numerical interval comparison. If there is no directed edge, or although there is a directed edge, the actual time difference is not significant. Less than or greater than (For example, if the graph defines the standard response time for a decrease in heart rate after an increase in blood pressure as 10-30 seconds, but the actual record shows that it occurs within 5 seconds or takes more than 60 seconds), then the actual order of the paired unit is determined to be inconsistent with the standard physiological logic defined by the graph, and the comparison result is marked as "False". Conversely, if there is a directed edge and the time interval is within the range, it is marked as "True". For the case where "increased blood pressure" is followed by "increased heart rate", if the graph only contains the knowledge entry "increased blood pressure leads to pressure reflex causing a decrease in heart rate", that is, only the edge of systolic blood pressure_increased -> heart rate_decreased exists, and there is no edge of systolic blood pressure_increased -> heart rate_increased does not exist, then the pairing is directly determined to be a logical anomaly and marked as "False". Boolean value marking is performed on all paired units in the sequence in turn to obtain the state sequence corresponding to the response order.
[0027] S203: Based on the consistency judgment results in the state sequence corresponding to the response order, filter all event pairing units marked as inconsistent in order, extract the corresponding vital sign type combination, arrangement order and time position index information, organize all sequence conflict event pairing units according to time order, and generate abnormal change connection description. Based on the consistency judgment results in the state sequence corresponding to the response order, a structured array for storing abnormal information is created. The paired state sequence marked with Boolean is traversed. Once an entry marked "False" is detected, the original event pairing unit data corresponding to that entry is immediately read. The preceding event ID, the succeeding event ID, the start and end timestamps of the two events, and the specific abnormal type description (such as "reverse correlation" or "time limit exceeded") are extracted. This information is encapsulated into an abnormal object. According to the order of occurrence of the original events on the time axis, the abnormal objects are appended to the structured array one by one. For the unit marked "blood pressure rise - heart rate increase" in the above example, which is marked as False, the system records its abnormal description as "violation of pressure reflex mechanism" and records its occurrence time as the relative time T=120s. All such abnormal records are retained, and normal physiological response pairs marked "True" are removed. Finally, an event linked list containing only those that violate the conventional logic of medical knowledge graphs is output, generating an abnormal change connection description.
[0028] Please see Figure 4 The steps to obtain S3 are as follows: S301: Read all inconsistent event pairing units in the abnormal change connection description, locate the vital sign status node corresponding to each group of vital sign types in the medical knowledge graph database based on the information of various vital sign types and change directions in the pairing units, and complete the retrieval and labeling of vital sign status nodes by comparing the event attributes in the pairing units with the node labels in the graph, and generate vital sign status node matching results. Read all inconsistent event pairs in the abnormal change connection description, and parse the predecessor event from the data structure of each abnormal pair. and subsequent events Detailed attributes, for Extract its characteristic type (e.g., "HeartRate") and change trend (e.g., "Increase"), construct a combined query key "HeartRate_Increase", and target it. Extract the physical characteristics (e.g., "BloodPressure") and their changing trends (e.g., "Decrease"), construct a combined query key "BloodPressure_Decrease", launch the graph database query interface, and use the Cypher query statement: MATCH (n:VitalsState) WHERE n.name = $KEY RETURN id(n), n.properties, which substitutes the combined query key values of the above two variables into the variables respectively. The system performs a search, traversing the entity node layer of the pre-defined medical knowledge graph to find a completely matching node object. If the search is successful, it returns the unique identifier of that node. (e.g., node ID: 1024) and its associated attribute list. If the query result is empty, fuzzy matching logic is executed. The Levenshtein edit distance between the query key value and the existing node name in the graph is calculated. The node with the highest edit distance and semantic similarity less than 2 is selected as the alternative matching object. For example, for the input key value "Temp_Spike", if there is no directly corresponding node in the graph but there is "Hyperthermia_Onset", and the semantic correlation score between the two is greater than 0.9, then the latter is used as the mapping target. The two events in each pairing unit are mapped to specific node IDs in the graph. A mapping index table from the time series data space to the graph knowledge space is established. For the aforementioned abnormal pairing "increased heart rate -> decreased blood pressure", the nodes N1 "Tachycardia" and N2 "Hypotension" in the graph are locked respectively, and these two node IDs are marked as the graph anchor points of the abnormal event. The above mapping operation is repeated for all inconsistent pairing units. All successfully mapped node IDs and their metadata are summarized to generate the vital sign status node matching results.
[0029] S302: Call each vital sign status node in the matching result of vital sign status nodes, and extend it level by level along the directed connection relationship between vital sign status nodes according to the connection relationship defined in the medical knowledge graph. Each round of extension starts with the current vital sign status node and extends to the next level. In turn, accumulate all vital sign status nodes involved in all valid paths and establish an extension path node set. Call each vital sign status node in the matching results, using each map anchor node marked in S301. As the starting root node for breadth-first search (BFS), the maximum search depth is set. For a 3-level path queue (i.e., allowing 3 jumps along associated edges), initialize an empty path queue. and a set of visited nodes Push the starting node into the queue and start the iteration loop. In each iteration, take a node from the head of the queue. Query all graphs containing the character "". Outbound from the starting point Get the target adjacent node pointed to by each outgoing edge. Read the relation type attributes on the edges (such as "CAUSES", "PRECEDES", or "INDICATES"). If the relation type belongs to a preset set of pathological evolution relations, then... Add the current path, and push the updated path back into the queue for the next search round. deposit To prevent infinite loops, the search process records the intermediate node IDs and connection weights of each jump in real time. For the starting node "Tachycardia," the first layer of search identifies the associated node "Reduced_Stroke_Volume" (reduced stroke volume). The second layer, along the "CAUSES" relationship, identifies the node "Cardiac_Output_Drop" (decreased cardiac output). The third layer identifies the node "Tissue_Perfusion_Risk" (risk of insufficient tissue perfusion). The system then analyzes the complete link covered by these three layers of search. Tachycardia->Reduced_Stroke_Volume->Cardiac_Output_Drop->Tissue_Perfusion_Risk is recorded as a valid extended path. After traversing all starting anchor points and completing multi-level searches, all generated path branches are collected to establish a set of extended path nodes.
[0030] S303: Based on the vital sign status node at the end of each path in the extended path node set, search for whether there is a direct or indirect connection relationship with the postoperative risk status node, filter the postoperative risk status nodes connected to the end nodes with the relationship, extract the postoperative risk status nodes involved in the connection in all associated paths, rearrange the corresponding relationship according to the time order of the event pairing unit, and generate an associated risk status description. Based on the endpoint vital sign status node of each path in the extended path node set, traverse the endpoint nodes of each extended path in the set. Check if the node's label attributes contain risk identifiers such as "RiskState" or "PostOpComplication". If they are directly contained, the node is directly identified as a risk node; otherwise, it is classified as a risk node. Starting anew, a targeted query is initiated again to search for nodes with risk labels within one hop of the current node. For example, for the terminal node "Tissue_Perfusion_Risk", if the system detects that it has the "RiskState" label, it is retained. If the terminal node is "Lactic_Acidosis", although it has no direct risk label, it is directly connected to "Septic_Shock" (septic shock, with the RiskState label), then "Septic_Shock" is included as an associated risk node in the results. The frequency of all locked risk nodes is counted, and for multiple different risk nodes caused by the same abnormal pairing unit, a risk node set is established. The timestamp of the set is paired with the original anomaly unit. Bind and construct a mapping tuple. The system sorts these tuples according to the chronological order of the original events. For example, for abnormal pairings with a relative time of T=120s, it associates two nodes: "risk of hypovolemic shock" and "risk of myocardial ischemia". For abnormal pairings with T=300s, it associates a node: "risk of respiratory failure". The system organizes these risk nodes along the timeline to form a structured narrative of risk evolution and generates a description of associated risk states.
[0031] Please see Figure 5 The steps to obtain S4 are as follows: S401: Based on each risk status node in the associated risk status description, retrieve the association path between the risk status node and the vital sign status node in the medical knowledge graph database, extract the sequence of vital sign status nodes and the sequence of postoperative risk status nodes connected in sequence in the path, record the path expansion content according to the connection order of the vital sign status nodes, establish the path sequence information corresponding to the risk status node, and generate a risk path node sequence set. For each risk state node in the associated risk state description, initialize an empty path set container, and iterate through each unique postoperative risk state node listed in the associated risk state description. (e.g., "postoperative hypotensive shock"), using this node For the target endpoint, perform a reverse breadth-first search (BFS) or full path search within the pre-defined medical knowledge graph to find all directed acyclic paths pointing to the risk node, setting a maximum hop limit for each path. The path length is 5 (meaning the path length does not exceed 5 nodes), filtering out all starting nodes that belong to the "vital signs status node" category and whose endpoints are... The valid path, for each retrieved path Extract the IDs of all nodes arranged sequentially along the path to construct an ordered list of nodes. ,in This refers to a vital sign (such as a sudden increase in heart rate). In a risky state, record the connection weights between every two adjacent nodes on the path. (This weight is a dimensionless value between 0 and 1, representing the probability or intensity of pathological transmission.) Calculate the cumulative weight product for the entire path. As a measure of path association strength, for example, for the risk node "myocardial ischemia", path A is retrieved as "increased systolic blood pressure -> increased heart rate -> increased myocardial oxygen consumption -> myocardial ischemia" and path B as "decreased body temperature -> vasoconstriction -> increased blood pressure -> myocardial ischemia". The node sequences of these two paths are stored in a temporary storage area, and a unique tracking ID is assigned to each path. This operation is repeated for all risk nodes, and all extracted path lists are summarized to generate a set of risk path node sequences.
[0032] S402: Call the connection order of vital sign status nodes of each path in the risk path node sequence set, compare the order of vital sign status nodes in the path corresponding to different risk status nodes, determine the consistency of the order of continuous node combinations in multiple paths, filter the connection segments of vital sign status nodes that appear continuously in the same order, and obtain a set of continuous sequence segments. The algorithm retrieves the connection order of vital sign status nodes for each path in the risk path node sequence set, and uses either the Longest Common Subsequence (LCS) algorithm or the frequent subgraph mining algorithm to identify nodes belonging to the same risk type within the set. Multiple paths are compared in pairs or groups, and two paths are selected. and The system reads the sequence of vital sign status nodes contained in each path, constructs a node ID sequence matrix, and traverses the matrix elements to identify consecutive node segments that appear in the same order. For example, in path A and another path C, "anxiety -> elevated systolic blood pressure -> increased heart rate -> coronary artery spasm -> myocardial ischemia," the system identifies that the segment "elevated systolic blood pressure -> increased heart rate" appears in both paths in an adjacent and consistent order, and records the starting node of this common segment. and termination node Calculate the frequency of this segment in all paths pointing to the same risk node. Set frequency filtering threshold A value of 0.6 (meaning it appears in at least 60% of relevant paths) will Greater than The segments are marked as "high confidence risk precursor patterns". If a segment appears only in a single path, it is discarded. The above common substructure extraction operation is performed for different risk types to extract all node sequence segments that pass frequency verification, resulting in a set of continuous sequential segments.
[0033] S403: Based on the connecting segments of each group of vital sign status nodes in the continuous sequence fragment set, mark the risk status node category and path location index information of the connecting segment, organize the correspondence between vital sign status node connecting segments and postoperative risk status nodes, summarize all fragment content according to risk status nodes, and generate risk association path descriptions. Based on the connection segments of each group of vital sign status nodes in the continuous sequential fragment set, each extracted common connection segment is... (e.g., "elevated systolic blood pressure -> increased heart rate") Create an index object containing the node sequence content of the connection segment, its path hierarchy depth in the original knowledge graph (e.g., the segment is usually located 2-3 hops away from the risk node), and its associated risk node ID. Iterate through all index objects, grouping and archiving them according to risk node categories, and construct a hash map with risk nodes as keys and corresponding feature path segments as values. (Map), for example, the key is "myocardial ischemia" and the value is a list [{"increased systolic blood pressure -> increased heart rate", weight 0.8}, {"continuously decreased blood oxygen saturation -> lactic acid accumulation", weight 0.9}]. For each connection segment, its contribution score to the target risk node in the graph is calculated. The calculation method is the sum of the path association strength of all paths to which the segment belongs, divided by the total number of paths (i.e., average association strength, dimension 1). This score is written into the mapping table as a weight attribute to complete the explicit structural description of the implicit risk patterns in the knowledge graph. Finally, a structured dataset containing risk type, feature path segments and corresponding weight relationships is output, generating a risk association path description.
[0034] Please see Figure 6 The steps to obtain S5 are as follows: S501: Based on each group of path segments in the risk-related path description, extract the connection order of vital sign status nodes in the path segments, identify event segments that are consistent with the connection order in the current patient's vital sign change sequence description, mark the start and end positions of each path segment in the vital sign change event sequence, and generate path segment localization results. Based on each group of path segments in the risk association path description, read the template of each risk path segment. Obtain the sequence of nodes it contains. (For example, "increased systolic blood pressure -> increased heart rate"), which is converted into a feature vector, and the sequence of changes in the current patient's vital signs generated in step S1 is loaded. Set a sliding matching window with a window size equal to length ,from Starting with the first event, the window moves backward one by one, and at each movement step, the subsequence of events captured within the window is... With template sequence A step-by-step comparison is performed, including the vital sign type ID and the change attribute ID. The edit distance between the two is calculated. If the distance is 0 (i.e., a perfect match), the current window is locked. Starting index in and terminating index This match is recorded as a "hit instance," and the absolute time interval corresponding to this hit instance is extracted. For example, in the patient's 30-minute preoperative monitoring data, event segments completely consistent with the "increased systolic blood pressure -> increased heart rate" template were detected at the 5th and 12th minutes, respectively. The system recorded the start and end timestamps of these two locations, repeated the above full sequence scan operation on the templates in all risk-related path descriptions, summarized the location information of all hit instances, constructed an index table containing template ID, hit count and specific time coordinates, and generated path segment localization results.
[0035] S502: Call each located path segment in the path segment location result, read the postoperative risk status node identifier content connected at the end of the segment, backfill the position mark of the corresponding path segment in the patient event sequence, organize the relative order information of the postoperative risk status nodes in the time series, and obtain the risk node priority list. For each located path segment in the path segment localization result, iterate through each hit instance in the index table, and based on the template ID corresponding to that instance, reverse the lookup to find the postoperative risk status node pointed to by that template in the risk-related path description. (e.g., "postoperative bleeding risk"), read the termination timestamp of the hit instance in the patient event sequence. ,Will and Bind and create a triplet. The risk warning targets, among which The weight score for this path segment is calculated in S4. If multiple path segments with different risk nodes are triggered at the same time point, they are sorted from highest to lowest weight score. If the same risk node is triggered multiple times at different time points, all trigger records are retained to reflect the cumulative risk effect. All generated risk warning objects are sorted by timestamp. The risks are inserted into a linear list in ascending order. For example, if a path pointing to "hypoperfusion" is identified at a relative time T=300s and a path pointing to "arrhythmia" is identified at T=600s, the system stores these two risk nodes in the list in the order of [300s: hypoperfusion, 600s: arrhythmia]. For conflicting risks within overlapping time windows, priority is adjusted according to a preset medical critical value level table, with higher-level risks (such as cardiac arrest risk) placed before lower-level risks (such as abnormal body temperature), resulting in a risk node priority list.
[0036] S503: Based on the time sequence of all postoperative risk status nodes in the risk node priority list, extract the corresponding sorting position of each risk status node in the sequence, organize it into a risk status node arrangement that is consistent with the progression of vital sign change events, and generate preoperative risk prediction results. Based on the chronological order of all postoperative risk status nodes in the risk node priority list, a final prediction result document object is created. Each risk warning entry in the list is read sequentially, and its risk name, predicted trigger time, and associated original vital sign evidence chain are extracted. This information is formatted into natural language description paragraphs or structured JSON data blocks. For consecutive occurrences of the same risk node (e.g., three consecutive triggers of "hypoperfusion"), they are merged into an aggregate record labeled "persistent high risk," and its duration is calculated. For different types of risk node sequences, their evolution trend is analyzed. If the list presents a specific evolution sequence of "hypoperfusion -> acidosis -> shock," a "condition deterioration cascade warning" label is added to the result. Finally, all processed risk entries are linked together according to the timeline to form a complete prediction report that is chronologically deduced and includes specific trigger times and risk types. This report directly maps the postoperative risk trajectory that may be induced by changes in the patient's preoperative vital signs, generating preoperative risk prediction results.
[0037] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A preoperative risk prediction method based on knowledge graphs, characterized in that, Includes the following steps: S1: Extract continuous change data of blood pressure, heart rate, respiratory rate and body temperature of patients in the preoperative stage, analyze the start and direction of change of each vital sign data, break it down into change events, connect different types of change events in sequence, and generate a description of the sequence of changes in vital signs. S2: Based on the sequence of vital sign change events in the description of the sequence of vital sign changes, combine two adjacent vital sign change events into event pairing units, retrieve the preset standard response order, verify the consistency of the order, retain the event mismatch units with inconsistent order, and obtain the abnormal change connection description. S3: Read the inconsistent event pairing unit in the abnormal change connection description, locate the corresponding vital sign status node, extend the search of the atlas relationship step by step, identify the relevant postoperative risk status node, form a risk status node set, and obtain the associated risk status description. S4: Based on each risk status node in the associated risk status description, retrieve the path associated with the postoperative risk status node, expand the path in the order of vital sign status node and postoperative risk status node, compare the continuous and consistent vital sign status node connection segments in the multiple paths, form a path segment description, and obtain the risk associated path description.
2. The preoperative risk prediction method based on knowledge graphs according to claim 1, characterized in that: The description of the sequence of vital sign changes includes the sequence identifier of events, the combination of vital sign change types, and the overall structural features of the changes. The description of the abnormal change connection includes the set of sequential abnormality categories, the type of abnormal connection pattern, and the abnormality degree identifier. The description of the associated risk status specifically includes the set of postoperative risk status nodes, the coverage of risk status, and the risk association level identifier. The description of the risk association path includes the set of risk-corresponding path segments, the co-occurrence sequence of vital sign status, and the path stability features.
3. The preoperative risk prediction method based on knowledge graphs according to claim 1, characterized in that: The steps for obtaining S1 are as follows: S101: Extract blood pressure, heart rate, respiratory rate, and body temperature data from multi-parameter monitoring devices during the preoperative stage, arrange them sequentially based on the time label corresponding to each vital sign data, identify the direction of numerical change between adjacent records, locate the starting position of continuous change in each type of vital sign data, and generate a set of time series change starting points. S102: Call the starting positions of each item in the time series change starting point set, divide the continuous data segments with the same change direction in each type of vital sign according to the order of records within the vital signs, mark the start and end time and change attributes of each segment, establish the corresponding data segment boundaries, and obtain the single type of vital sign change segment sequence. S103: Based on the start time of each segment in the single-category vital sign change segment sequence, the segments of different categories of vital sign changes such as blood pressure, heart rate, respiratory rate, and body temperature are uniformly sorted, and adjacent events in time are sequentially connected to construct a complete vital sign change event chain, thereby obtaining a description of the sequence of vital sign changes.
4. The preoperative risk prediction method based on knowledge graphs according to claim 1, characterized in that: The steps for obtaining S2 are as follows: S201: Based on the sequence of vital sign change events described in the sequence of vital sign changes, select two vital sign change events that are adjacent in time according to the start time of the events, extract the vital sign type marker and time sequence marker corresponding to each group of events, and combine them to form an event pairing unit consisting of any two of the following: blood pressure, heart rate, respiratory rate, and body temperature, and generate an event pairing arrangement sequence. S202: Call the vital sign type markers in each event pairing unit in the event pairing sequence, and according to the combination of the two types of vital signs in the pairing, query the corresponding standard response sequence in the medical knowledge graph database, extract the standard response order information recorded in the knowledge graph, and make a consistency judgment with the actual arrangement order of the two vital sign events in the pairing unit to obtain the response sequence corresponding to the state sequence. S203: Based on the consistency judgment results in the state sequence corresponding to the response order, filter all event pairing units marked as inconsistent in order, extract the corresponding vital sign type combination, arrangement order and time position index information, organize all sequence conflict event pairing units in chronological order, and generate an abnormal change connection description.
5. The preoperative risk prediction method based on knowledge graphs according to claim 1, characterized in that: The steps for obtaining S3 are as follows: S301: Read all inconsistent event pairing units in the abnormal change connection description, locate the vital sign status node corresponding to each group of vital sign types in the medical knowledge graph database based on the information of various vital sign types and change directions in the pairing units, and complete the retrieval and labeling of vital sign status nodes by comparing the event attributes in the pairing units with the node labels in the graph, and generate vital sign status node matching results. S302: Call each vital sign status node in the matching result of the vital sign status nodes, and extend it step by step along the directed connection relationship between the vital sign status nodes according to the connection relationship defined in the medical knowledge graph. Each round of extension starts with the current vital sign status node and extends to the next level. All vital sign status nodes involved in the effective paths are accumulated in sequence to establish an extension path node set. S303: Based on the end-point vital sign status node of each path in the extended path node set, search for whether there is a direct or indirect connection relationship with the postoperative risk status node, filter the postoperative risk status nodes connected to the end-point nodes with the relationship, extract the postoperative risk status nodes involved in the connection in all associated paths, rearrange the corresponding relationship according to the time order of the event pairing unit, and generate an associated risk status description.
6. The preoperative risk prediction method based on knowledge graphs according to claim 1, characterized in that: The steps for obtaining S4 are as follows: S401: Based on each risk state node in the associated risk state description, retrieve the association path between the risk state node and the vital sign state node in the medical knowledge graph database, extract the sequence of vital sign state nodes and the sequence of postoperative risk state nodes connected in sequence in the path, record the path expansion content according to the connection order of the vital sign state nodes, establish the path sequence information corresponding to the risk state node, and generate a risk path node sequence set. S402: Call the connection order of vital sign status nodes of each path in the risk path node sequence set, compare the order of vital sign status nodes in the path corresponding to different risk status nodes, determine the consistency of the order of continuous node combinations in multiple paths, filter the connection segments of vital sign status nodes that appear continuously in the same order, and obtain a set of continuous sequence segments. S403: Based on the connecting segments of each group of vital sign status nodes in the continuous sequence fragment set, mark the risk status node category and path location index information to which the connecting segment belongs, organize the correspondence between vital sign status node connecting segments and postoperative risk status nodes, summarize all fragment content according to risk status nodes, and generate a risk association path description.
7. The preoperative risk prediction method based on knowledge graphs according to claim 1, characterized in that: The method further includes: S5: Based on the path segments in the risk association path description, locate the corresponding position of each path segment in the description of the sequence of changes in the patient's vital signs, identify the corresponding postoperative risk status nodes, arrange them in the order of vital sign change events, form a risk status arrangement result, and obtain the preoperative risk prediction result. The preoperative risk prediction results specifically include the postoperative risk status ranking sequence, individual risk distribution results, and comprehensive risk prediction conclusions.
8. The preoperative risk prediction method based on knowledge graphs according to claim 7, characterized in that: The steps for obtaining S5 are as follows: S501: Based on each group of path segments in the risk association path description, extract the connection order of vital sign status nodes in the path segment, identify event segments that are consistent with the connection order in the current patient's vital sign change sequence description, mark the start and end positions of each path segment in the vital sign change event sequence, and generate path segment localization results. S502: Call each located path segment in the path segment location result, read the postoperative risk status node identifier content connected to the end of the segment, backfill the position mark of the corresponding path segment in the patient event sequence, organize the relative order information of the postoperative risk status nodes in the time series, and obtain the risk node priority list. S503: Based on the time sequence of all postoperative risk status nodes in the risk node priority list, extract the corresponding sorting position of each risk status node in the sequence, organize it into a risk status node arrangement that is consistent with the progression sequence of vital sign changes, and generate preoperative risk prediction results.