State inversion risk positioning method based on motion trajectory and electrocardiogram timing characteristics

By synchronously collecting electrocardiogram (ECG) signals and GPS data, and using edge computing nodes for spatiotemporal alignment and path feature analysis, the problem of being unable to locate the geographical location and environmental attributes of ECG risk events in existing technologies has been solved, enabling precise risk tracing and emergency response.

CN122440201APending Publication Date: 2026-07-24ANHUI PROVINCIAL HOSPITAL
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI PROVINCIAL HOSPITAL
Filing Date
2026-05-29
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Current exercise ECG monitoring technology cannot simultaneously determine the geographical location and environmental attributes of a risk event when an ECG abnormality is detected, leading to delays in emergency response and incomplete causal analysis.

Method used

By continuously collecting electrocardiogram (ECG) signals and GPS spatiotemporal coordinates during exercise, edge computing nodes are used to analyze ECG characteristics and align them with GPS trajectory data spatiotemporally to identify abrupt change inflection point windows, locate risk initiation points, extract path context features, and determine the dominant risk factors.

Benefits of technology

It enables spatial localization and environmental trigger identification of ECG risk events, provides accurate spatial navigation basis and complete trigger analysis, and improves the accuracy of emergency response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122440201A_ABST
    Figure CN122440201A_ABST
Patent Text Reader

Abstract

The application relates to a state inversion risk positioning method and system based on motion trajectory and electrocardiogram timing characteristics, a computer device and a storage medium. The method comprises: continuously collecting electrocardiogram signals and synchronously recording GPS space-time coordinates; outputting a real-time cardiac function state score based on an edge computing node; triggering state inversion when the score is lower than a preset threshold; identifying a mutation inflection point window by using an electrocardiogram historical segment and a corresponding period GPS trajectory; aligning the mutation inflection point window with the GPS trajectory space-time to position a risk starting point coordinate and record a risk starting time; extracting the road slope, altitude, road type and path fluctuation rate of the position, and correlating and analyzing the electrocardiogram mutation information to determine the dominant cause. The application expands electrocardiogram risk tracing from the time dimension to the space-time two dimensions, and realizes accurate positioning of the risk occurrence position and identification of the environmental cause.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of exercise electrocardiogram (ECG) monitoring technology, and in particular to a risk localization method, system, computer device, and storage medium based on state inversion of exercise trajectory and ECG time-series characteristics. Background Technology

[0002] With the development of wearable devices and edge computing technology, real-time ECG monitoring and risk warning technologies during exercise are gradually maturing. Existing technologies, by collecting ECG signals during exercise and combining them with lightweight inference models on edge computing nodes, can output cardiac function status scores and trigger warnings when scores are abnormal. This type of technology enables real-time assessment of ECG risk and temporal source analysis; that is, after detecting ECG abnormalities, it can deduce the approximate onset time of the risk.

[0003] However, existing exercise ECG monitoring technologies only focus on the temporal evolution of the ECG signal itself, limiting risk localization to the time dimension. They cannot simultaneously determine the geographical location of the risk event and the environmental attributes of that location when an ECG abnormality is detected. This leads to two practical problems: first, when a sudden ECG risk occurs, emergency responders cannot quickly pinpoint the wearer's precise location based on warning information, delaying rescue efforts; second, the analysis of risk triggers relies solely on ECG characteristic changes and exercise intensity data, failing to obtain information about the environmental characteristics of the risk location (such as road slope, altitude, and road surface type), resulting in incomplete trigger determination and difficulty in distinguishing complex risks caused by excessive exercise load combined with environmental factors. Summary of the Invention

[0004] Therefore, it is necessary to provide a state-inversion risk localization method, system, computer equipment, and storage medium based on motion trajectory and ECG temporal characteristics that can realize spatial localization of ECG risk events and identification of environmental triggers, in order to address the above-mentioned technical problems.

[0005] Firstly, this application provides a state-inversion risk localization method based on motion trajectory and electrocardiogram time-series characteristics. The method includes: Continuously collect electrocardiogram signals during exercise and simultaneously record the corresponding GPS spatiotemporal coordinates; The electrocardiogram signal is analyzed based on edge computing nodes, and a real-time cardiac function status score is output. When the real-time cardiac function status score is lower than the preset risk threshold, state inversion is triggered: using historical segments of ECG signals and GPS trajectory data of the corresponding time period, the sudden change inflection point window in the temporal change of ECG characteristics is identified, and the sudden change inflection point window is spatiotemporally aligned with the GPS trajectory data to locate the risk starting point coordinates and record the risk starting time corresponding to the risk starting point coordinates. Extract the path context features of the location of the risk initiation point coordinates, and perform correlation analysis between the path context features and the mutation information of the electrocardiogram features to determine the dominant risk factor.

[0006] In one embodiment, the step of identifying abrupt inflection point windows in the temporal changes of electrocardiogram features includes: Extract the inversion time window containing historical segments of electrocardiogram signals and corresponding GPS trajectory data; The inversion time window is divided into multiple consecutive time windows to obtain a time window sequence; Calculate the set of motion ECG features for each time window in the time window sequence; Convert the motion ECG feature set of each time window into a feature vector; Starting from the second time window in the time window sequence, the Euclidean distance between the feature vector of each time window and the feature vector of its previous adjacent time window is calculated sequentially. The time window in which the Euclidean distance exceeds a preset threshold is marked as the mutation inflection point window.

[0007] In one embodiment, the step of extracting the path context features of the location of the risk initiation point coordinates and performing correlation analysis between the path context features and the abrupt change information of the electrocardiogram features to determine the dominant risk factor includes: Map the risk starting point coordinates to a digital map, and extract the road slope value, altitude, road type classification, and path undulation change rate within a preset distance range before and after the risk starting point coordinates. The path context features, the electrocardiogram features corresponding to the mutation inflection point window, and the change in exercise intensity before and after the risk initiation time corresponding to the risk initiation point coordinates are correlated to construct the causal reasoning input vector; The input vector of the inference of the cause is input into the decision tree classifier, and the dominant cause is output. The dominant cause includes: excessive load on the slope section, high altitude and low oxygen induced type, frequent path undulation induced type and pure exercise excessive load.

[0008] In one embodiment, aligning the abrupt change inflection point window with GPS trajectory data in time and space to locate the coordinates of the risk initiation point includes: Obtain the start and end timestamps of the mutation inflection point window, and construct the mutation inflection point time interval; All trajectory points whose timestamps fall within the time interval of the abrupt change inflection point are retrieved from the GPS trajectory data to form a risk trajectory point set; If the risk trajectory point set is not empty, then the latitude and longitude coordinates of the trajectory point whose timestamp is closest to the center time of the mutation inflection point window in the risk trajectory point set are determined as the risk starting point coordinates; If the risk trajectory point set is empty, then a linear interpolation method is used to calculate the coordinates of the risk starting point by weighting the latitude and longitude coordinates of the two trajectory points whose timestamps are closest to the time interval of the sudden change inflection point according to the distance ratio between their respective timestamps and the time interval of the sudden change inflection point.

[0009] In one embodiment, the method further includes: The risk starting point coordinates are associated with the historical motion trajectory of the wearable device that collects the ECG signals to obtain the past ECG feature records of the risk starting point coordinates in the historical motion. If the past ECG feature records contain at least one abnormal ECG feature event that occurred within the vicinity of the risk initiation point coordinates, then the location of the risk initiation point coordinates is marked as the individual risk-sensitive area; During subsequent exercise, the system monitors in real time whether the current GPS coordinates have entered the marked individual risk-sensitive area. If they have entered and the current electrocardiogram shows signs of abnormal T-wave morphology or decreased heart rate variability, a pre-risk warning will be output before the preset risk threshold is reached.

[0010] In one embodiment, the continuous acquisition of electrocardiogram signals during exercise and the synchronous recording of corresponding GPS spatiotemporal coordinates include: Continuous electrocardiogram (ECG) signals are acquired at a preset sampling frequency, and the local timestamp of each ECG sampling point is recorded. Obtain real-time latitude and longitude coordinates and record the local timestamp of each GPS location point; When the local timestamp of the GPS positioning point is inconsistent with the local timestamp of the ECG sampling point, the GPS trajectory data is interpolated to the ECG sampling time using linear interpolation to form a time-synchronized ECG signal and GPS spatiotemporal coordinate pairing sequence.

[0011] In one embodiment, the method further includes: A spatiotemporal early warning log is generated based on the risk initiation time corresponding to the risk initiation point coordinates, the risk initiation point coordinates, and the dominant triggering factor.

[0012] Secondly, this application also provides a state-inversion risk localization system based on motion trajectory and electrocardiogram time-series characteristics. The system includes: The signal acquisition module is used to continuously acquire electrocardiogram signals during exercise and simultaneously record the corresponding GPS spatiotemporal coordinates; The edge computing module is used to analyze the electrocardiogram signal based on the edge computing node and output a real-time cardiac function status score. The state inversion module is used to trigger state inversion when the real-time cardiac function status score is lower than a preset risk threshold: using historical segments of electrocardiogram signals and GPS trajectory data of the corresponding time period, identifying abrupt inflection point windows in the temporal changes of electrocardiogram characteristics, aligning the abrupt inflection point windows with the GPS trajectory data in time and space, locating the risk start point coordinates, and recording the risk start time corresponding to the risk start point coordinates. The causation determination module is used to extract the path context features of the location of the risk initiation point coordinates, and perform correlation analysis between the path context features and the mutation information of the electrocardiogram features to determine the dominant causation of the risk.

[0013] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the aforementioned state inversion risk localization method based on motion trajectory and electrocardiogram timing characteristics.

[0014] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the aforementioned state inversion risk localization method based on motion trajectory and electrocardiogram timing characteristics.

[0015] The aforementioned risk localization method, system, computer equipment, and storage medium based on motion trajectory and ECG time-series characteristics, by spatiotemporally aligning the abrupt change inflection point window in the ECG characteristic time-series changes with GPS trajectory data, can accurately locate the geographical coordinates of risk events, expanding ECG risk warning from a purely temporal dimension to a dual temporal-spatial dimension. Simultaneously, by extracting the path context features of the risk initiation point and correlating them with ECG abrupt change information, it can identify risk triggers caused by the superposition of environmental factors, such as excessive load on sloped sections, high-altitude hypoxia, and frequent impacts from undulating paths. This improves the completeness and accuracy of trigger determination, providing precise spatial navigation basis for the source analysis and emergency response of sudden death risk in motion scenarios. Attached Figure Description

[0016] Figure 1 This is an application environment diagram of a state inversion risk localization method based on motion trajectory and ECG time series characteristics in one embodiment; Figure 2 This is a flowchart illustrating a state inversion risk localization method based on motion trajectory and ECG time series characteristics in one embodiment; Figure 3 This is a schematic diagram of the identification process for mutation inflection point windows in one embodiment; Figure 4 This is a block diagram of a state inversion risk localization system based on motion trajectory and electrocardiogram time-series characteristics in one embodiment. Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. First, to facilitate understanding of the technical solutions provided by the embodiments of this application, the background technology involved in the embodiments of this application will be described below.

[0018] With the rapid development of wearable smart devices and edge computing technology, real-time ECG monitoring and risk warning in sports scenarios has become a research hotspot in the medical and health field. Traditional sports ECG monitoring solutions typically adopt a combination of front-end data acquisition and cloud-based analysis. Wearable devices collect ECG signals and upload them to a cloud server, where a cloud model performs ECG status assessment and risk judgment. This model relies on stable network transmission and is prone to latency in scenarios with unstable network signals, such as outdoor sports, making it difficult to meet the stringent real-time requirements of sudden cardiac death risk warning. To address this issue, in recent years, technical solutions have emerged that deploy lightweight inference models on edge computing nodes. By performing ECG feature extraction and risk scoring locally, network dependence and response latency are reduced, enabling real-time ECG status assessment in sports scenarios.

[0019] However, existing exercise ECG monitoring technologies still share a common limitation: risk localization is limited to the time dimension. Specifically, whether cloud-based analysis or edge computing solutions, the core logic for risk assessment and early warning output revolves around the temporal evolution of the ECG signal itself. By analyzing changes in temporal characteristics such as heart rate variability, QRS width, and T wave morphology, they determine whether there are precursors to malignant arrhythmias and record the onset time of the abnormality when it is detected. These technologies can answer the question of "when does the risk begin" in the time dimension, but they cannot answer the question of "where does the risk occur." In outdoor sports scenarios, especially long-distance running (such as marathons), cross-country running, and mountaineering, athletes are often in a state of large-scale movement. Once a sudden ECG abnormality occurs, time information alone cannot provide spatial navigation for emergency rescue. In addition, the analysis of risk triggers is limited to changes in ECG characteristics and exercise intensity data (such as heart rate and acceleration), and cannot obtain the environmental attributes of the risk location. In fact, the cardiac load in many sports scenarios is not only due to the exercise intensity itself, but is also closely related to geographical environmental factors such as road slope, altitude, and road surface undulations. For example, the actual load on the heart at the same running speed differs significantly between uphill and flat terrain; the low-oxygen environment at high altitudes further increases the burden on the heart. Current technologies lack spatial localization of risk locations and extraction of environmental features, leading to incomplete causal analysis and difficulty in distinguishing between complex risks caused by simple excessive exercise load and those resulting from the combined effects of environmental factors.

[0020] Therefore, in order to provide more comprehensive information support for the accurate analysis of sudden death risk and emergency response, this application provides a method, system, computer device and storage medium for state inversion risk localization based on motion trajectory and electrocardiogram time series characteristics.

[0021] It should be noted that the collection, storage, processing, and transmission of sensitive personal information such as electrocardiogram signals, GPS spatiotemporal coordinates, exercise intensity data, and historical exercise trajectories involved in the embodiments of this application are all carried out in strict compliance with relevant laws and regulations. Specifically, the data collection function can only be activated after obtaining explicit and independent informed consent from the user or their legally authorized guardian; users can view, export, or delete their personal data at any time through their terminal devices. All data uploaded to the cloud server has been de-identified or anonymized and cannot directly identify a specific natural person. The collected personal data is only used for cardiac function status assessment, risk tracing analysis, and early warning services during exercise, and will not be used for any commercial purposes beyond the authorized scope or disclosed to third parties. Data transmission between edge computing nodes and the cloud server adopts an encrypted communication protocol to ensure the security and confidentiality of data during transmission. The technical solution of the embodiments of this application itself does not involve unauthorized processing of user personal information, and all data processing operations have a clear authorization basis and legal basis.

[0022] The state inversion risk localization method based on motion trajectory and electrocardiogram time series characteristics provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. The data storage system can store data that server 104 needs to process, such as historical ECG records, GPS trajectory data, and spatiotemporal risk event records. The data storage system can be integrated onto server 104 or placed in the cloud or on other network servers. In this application environment, terminal 102 continuously collects ECG signals during exercise and synchronously records the corresponding GPS spatiotemporal coordinates. Based on its built-in or external edge computing nodes, it analyzes the ECG signals to output a real-time cardiac function status score. When the score is lower than a preset risk threshold, it triggers state inversion: using historical ECG signal segments and corresponding GPS trajectory data, it identifies abrupt change inflection point windows, locates the risk initiation point coordinates and corresponding time through spatiotemporal alignment, extracts the path context features of the coordinate location, and correlates them with ECG change information to determine the dominant risk factor. Server 104 can be used to receive spatiotemporal risk event records uploaded by terminal 102, construct risk heatmaps, and distribute model calibration factors, among other auxiliary functions. The terminal 102 can be, but is not limited to, various portable wearable devices, such as smartwatches, smart bracelets, heart rate monitoring chest straps, and fitness trackers, or it can be a smartphone or tablet that works with wearable sensors; the server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.

[0023] Firstly, when performing exercise ECG risk localization, the primary challenge is how to simultaneously acquire ECG signals and spatial location information, and based on this, achieve real-time status scoring and spatiotemporal localization of the risk initiation point. Existing methods can only provide the approximate time of risk occurrence, failing to provide the location, leading to delays in rescue and a lack of causal analysis. Therefore, in one embodiment, such as... Figure 2 As shown, a state-inversion risk localization method based on motion trajectory and electrocardiogram time series characteristics is provided, which is then applied to... Figure 1 Taking terminal 102 as an example, the explanation includes the following steps: Step S1: Continuously collect electrocardiogram signals during exercise and simultaneously record the corresponding GPS spatiotemporal coordinates.

[0024] In this step, an electrocardiogram (ECG) signal is first acquired using a single-lead ECG electrode attached to the user's chest. The sampling frequency is typically set between 200Hz and 500Hz; in this embodiment, 250Hz is used. Simultaneously, real-time latitude and longitude coordinates are obtained using a GPS receiver module integrated into the same wearable device. The positioning frequency is typically between 0.5Hz and 2Hz; in this embodiment, 1Hz is used.

[0025] Because the ECG sampling frequency differs from the GPS positioning frequency, time synchronization between the two datasets is necessary. Time synchronization can be achieved using one of the following methods: Method 1 (Linear Interpolation): Record a local timestamp for each ECG sampling point and each GPS location. For each ECG sampling time, find the two GPS locations with the closest timestamps, and calculate the latitude and longitude coordinates corresponding to that ECG sampling time using linear interpolation. The interpolation formula is: Let the ECG sampling time be t, the timestamp of the previous GPS point be t1, and the coordinates be... The timestamp of the next GPS point is t2, and the coordinates are... Then the interpolation coefficients After interpolation: , .

[0026] Method 2 (Hardware Synchronization Method): Connect the pulse-second output (PPS) of the GPS receiver module to the synchronization input pin of the ECG acquisition chip. Use the rising edge of PPS to trigger the phase correction of the ECG sampling clock, so that the ECG sampling time is strictly aligned with the GPS time reference.

[0027] Method 3 (Spline Interpolation): For GPS trajectory data, cubic spline interpolation is used to generate a continuous position function. Then, the function is evaluated at each ECG sampling time to obtain the latitude and longitude coordinates at that time.

[0028] This embodiment does not limit the specific synchronization method used, as long as a one-to-one correspondence between the ECG signal and GPS coordinates in time can be obtained. The data format obtained after synchronization is as follows: each ECG sampling point includes four fields: timestamp, ECG amplitude, longitude, and latitude.

[0029] Step S2: Analyze the electrocardiogram signal based on the edge computing node and output a real-time cardiac function status score.

[0030] Specifically, the ECG signal obtained in step 1 is divided into time windows of 2 seconds in length, and four features are extracted within each window: the average R-wave peak value ( (unit: mV), average QRS width ( (unit: ms), T-wave morphological abnormality markers ( (Values ​​are 0 or 1), heart rate variability (HRV, unit: ms). Detailed definitions and calculation methods for each feature are as follows: The arithmetic mean of all R-wave peak values ​​within the window. R-wave peak values ​​are detected using the first derivative zero-crossing method: Let the ECG signal sequence be... Its first difference ;when When the value changes from positive to negative, the position corresponding to n is the peak of the R wave, and the ECG amplitude at that position is read. : The arithmetic mean of the widths of all QRS waves within the window. For each R wave, backtrack to... The point where the Q wave first exceeds 0.01 mV / ms is taken as the starting point of the Q wave, and the point where the Q wave ends when the Q wave extends backward to d[n] and falls back to below 0.01 mV / ms is taken as the ending point of the S wave. The time interval between the starting point and the ending point is the QRS wave width. If the difference between the maximum and minimum values ​​of the signal is less than 0.1mV within the interval of 200ms to 400ms after the peak of the R-wave, or if the sign of the maximum slope of the first-order difference in this interval is opposite to that of the conventional T-wave which is in the same direction as the R-wave, then it is marked as 1 (abnormal); otherwise it is marked as 0 (normal). HRV: Extracting RR interval sequences within the window (Q is the number of intervals), calculate the difference between adjacent intervals. , then calculate Standard deviation: ,in for The average value; if Q < 3, then HRV = 0.

[0031] The four features mentioned above are combined into a feature vector, which is then input into a lightweight inference model deployed on edge computing nodes. This model can be implemented using one of the following types: Random forest model: consists of 50-100 decision trees, each tree having a depth of no more than 10 layers; Lightweight neural networks (such as MobileNet and TinyCNN): contain 2-3 convolutional layers and 2 fully connected layers, with the number of parameters controlled to within 100,000; Support Vector Machine model: using the RBF kernel function.

[0032] Specifically, the models listed above can be selected and configured by those skilled in the art according to actual needs (including parameter selection, design, training, etc.). In this embodiment, a lightweight inference model is specifically described using a random forest regressor to map a 4-dimensional ECG feature vector to a continuous score between 0 and 100. The random forest regressor consists of 50 regression trees. Each tree is a binary tree, with internal nodes storing splitting feature indices and splitting thresholds, and leaf nodes storing predicted values ​​(i.e., the mean score of the training samples covered by that node). The maximum depth of each tree is 10, and the minimum number of samples per leaf node is 2. The splitting criterion uses variance reduction (the mean squared error reduction criterion of CART regression trees). The input feature vector is... (All features have been normalized: subtract the training set mean and divide by the standard deviation). The training method is as follows: Collect at least 5000 exercise ECG data segments, each 120 seconds long, labeled by ECG experts with a cardiac function score of 0-100 (0-20: severe arrhythmia; 21-40: moderate arrhythmia; 41-60: mild abnormality; 61-80: borderline state; 81-100: normal). Divide each segment into 2-second windows, and extract feature vectors from each window. And assign a corresponding score. Approximately 300,000 training samples were obtained; the mean and standard deviation were calculated for each feature dimension, and then normalized. The system uses Bootstrap with replacement sampling to generate 50 training subsets, each equal in size to the training set. For each subset, a regression tree is recursively constructed: if the current node has fewer than 2 samples or a depth of 10, splitting stops, and the node's predicted value is the mean of the sample scores; otherwise, two candidate features are randomly selected, and the variance reduction is calculated for all possible splitting thresholds for each feature. The feature with the highest return and the corresponding threshold are then selected for splitting. During real-time execution, the original feature vector of the current window is processed... Use the data saved during the training phase Normalizing (mean and standard deviation) yields ;Will Given a random forest, output the predicted value of each leaf node for each tree. Final cardiac function status score: ,in Let F be the predicted value for the t-th tree. The value of F ranges from 0 to 100, with a score below 60 indicating potential risk. After training, the node thresholds and predicted values ​​for each tree are stored as a JSON file and deployed on edge computing nodes. During inference, the model file is loaded, and the average of the predictions for each tree on the input 4D feature vector is taken.

[0033] It should be noted that this embodiment does not limit the specific model used, as long as it can take the electrocardiogram feature vector as input and output a continuous value between 0 and 100 as a cardiac function status score. The lower the score, the worse the cardiac function status and the closer it is to a risk state.

[0034] Step S3: When the real-time cardiac function status score is lower than the preset risk threshold, trigger state inversion: using historical segments of ECG signals and GPS trajectory data of the corresponding time period, identify the sudden change inflection point window in the temporal change of ECG characteristics, and align the sudden change inflection point window with the GPS trajectory data in time and space to locate the risk starting point coordinates, and record the risk starting time corresponding to the risk starting point coordinates.

[0035] Specifically, the preset risk threshold can be determined in one of the following ways: using group statistical data (e.g., taking 60 points), or dynamically adjusting based on the user's personal baseline historical data (e.g., taking 70% of the user's personal historical average score). In this embodiment, 60 points is used.

[0036] When the score falls below a threshold, state inversion is triggered. First, a historical segment of ECG signal and corresponding GPS trajectory data for a certain duration (e.g., 90 to 180 seconds, 120 seconds in this embodiment) is extracted from the circular buffer and traced back a certain time from the current moment. Then, this historical segment is analyzed to identify abrupt inflection point windows in the temporal changes of ECG characteristics.

[0037] After identifying the abrupt change inflection point window, this window is spatiotemporally aligned with GPS trajectory data: the abrupt change inflection point window has a clear start and end timestamp, which is used to construct a time interval. Trajectory points falling within this interval are retrieved from GPS data, thereby determining the spatial coordinates (latitude and longitude) of the risk initiation point. After locating the risk initiation point coordinates, the corresponding risk initiation time (which can be the center time of the abrupt change inflection point window) is also recorded.

[0038] Step S4: Extract the path context features of the location of the risk starting point coordinates, and perform correlation analysis between the path context features and the mutation information of the electrocardiogram features to determine the dominant risk factor.

[0039] Specifically, the coordinates of the risk starting point obtained in step S3 are mapped onto a digital map, and environmental attributes of that location are extracted, including but not limited to: road slope, altitude, road type classification, and path undulation rate. Then, a correlation analysis is performed between the path context features and abrupt changes in electrocardiogram (ECG) features (such as QRS width change rate, decrease in heart rate variability, and T wave morphology). This correlation analysis can be implemented using decision tree classifiers, logistic regression, or rule-based methods. The classifier outputs the dominant risk trigger, which may include: excessive load on steep slope sections, high-altitude hypoxia-induced type, frequent path undulation-induced type, and purely excessive exercise load.

[0040] Based on the above, this embodiment can simultaneously acquire electrocardiogram signals and GPS trajectory data to achieve real-time assessment of cardiac function status. When a risk is detected, it can accurately locate the spatial coordinates and time of the risk's starting point through state inversion, and then identify the dominant triggering factor of the risk by combining path context features. Compared to existing technologies, this embodiment expands risk location from a single time dimension to a time-space dual dimension, providing spatial navigation basis and environmental triggering factor information for accurate analysis and emergency response to sudden cardiac death during exercise.

[0041] Identifying abrupt inflection point windows in the temporal changes of electrocardiogram (ECG) features is a prerequisite for achieving spatiotemporal alignment. Accurately identifying these inflection point windows from continuously changing ECG feature sequences is crucial for ensuring the accuracy of risk initiation point localization. Therefore, in one embodiment, such as... Figure 3 As shown, the window for identifying abrupt inflection point changes in the temporal variation of electrocardiogram features includes: Step S311: Extract the inversion time window containing historical segments of electrocardiogram signals and corresponding GPS trajectory data.

[0042] Specifically, taking the current trigger time as the endpoint, a length of [length] is extracted forward. Historical segments of electrocardiogram signals and corresponding GPS trajectory data for the same time periods together constitute the inversion time window. Among them, The value should cover the premonitory period of ECG abnormalities. According to clinical statistics, malignant arrhythmias are usually preceded by 30 to 90 seconds of abnormal ECG characteristics. Considering that heart rate variability analysis requires at least 30 seconds of data, this embodiment uses [value missing]. Seconds. This value is sufficient to cover the entire evolutionary process, and the computational burden is moderate.

[0043] Step S312: Divide the inversion time window into multiple consecutive time windows to obtain a time window sequence.

[0044] Specifically, the inversion time window is divided into M consecutive and non-overlapping time windows, each with a length of... seconds, then ,in This indicates rounding down. A 2-second window can encompass 2-3 complete cardiac cycles (normal heart rate 60-90 beats / minute), ensuring statistical stability of features while preserving mutation details. This yields the time window sequence. .

[0045] Step S313: Calculate the motion ECG feature set for each time window in the time window sequence.

[0046] Specifically, for each Four characteristics were calculated using the aforementioned method: mean R-wave peak value. Average QRS width T-wave morphological abnormality markers Heart rate variability eigenvalues .

[0047] Step S314: Convert the motion ECG feature set of each time window into a feature vector.

[0048] Specifically, feature vector .

[0049] Step S315: Starting from the second time window of the time window sequence, calculate the Euclidean distance between the feature vector of each time window and the feature vector of its previous adjacent time window in sequence.

[0050] Specifically, for i = 2 to 60, calculate: Step S316: Mark the time window in which the Euclidean distance exceeds the preset threshold as the mutation inflection point window.

[0051] Specifically, the preset threshold Th is determined as follows: ECG data of the user is collected continuously for 5 minutes during normal exercise (without events where the cardiac function score is below 60). The Euclidean distance between all adjacent windows is calculated using the method described above to obtain the sequence. Calculate the mean μ and standard deviation σ of the sequence, and set a threshold. The 3σ principle is based on the assumption of a normal distribution; normal fluctuations have a probability of falling within this range of approximately 99.7%, effectively distinguishing sudden changes. If users lack historical data, the default initial values ​​for the population can be used temporarily. It will be dynamically updated after at least 100 normal windows have been accumulated.

[0052] Iterate through i=2 to 60, if Then the window Mark as candidate mutation inflection point windows. If multiple candidate windows exist, select... The largest window is used as the final inflection point window for mutation.

[0053] The above method can objectively and repeatably identify the critical time window from stable to abnormal ECG characteristics, providing accurate time anchors for subsequent spatiotemporal alignment and avoiding subjective judgment bias.

[0054] After locating the coordinates of the risk initiation point, further analysis is needed to determine the correlation between the environmental attributes of that location and ECG mutations to identify the dominant risk trigger. Traditional methods rely solely on exercise intensity to determine the trigger, neglecting the influence of the geographical environment, resulting in incomplete causal identification. Therefore, in one embodiment, the step of extracting the path context features of the location of the risk initiation point coordinates and performing correlation analysis between the path context features and ECG mutation information to determine the dominant risk trigger includes: Step S41: Map the coordinates of the risk starting point to a digital map, and extract the road slope value, altitude, road type classification, and path undulation rate within a preset distance range before and after the location of the risk starting point.

[0055] Specifically, the coordinates of the risk starting point obtained from the location will be... As input, the digital map service interface is invoked (in this embodiment, an offline map data package is combined with an online API). The following four features are extracted: ① Road slope value: Unit is percentage (%), positive value indicates uphill, negative value indicates downhill. Based on the digital elevation model, calculate the rate of elevation change within 5 meters before and after the point along the road direction: ,in and The elevations are 5 meters in front and 5 meters behind, respectively.

[0056] ②Altitude: Unit: meters (m), obtained directly from the digital elevation model.

[0057] ③ Road type classification : Enumeration type, encoded as integer values: Highway = 1, Off-road = 2, Steps = 3, Grass = 4, Others = 5.

[0058] ④ Path undulation rate (roughness): Taking the risk starting point coordinates as the center, extend 100 meters forward and backward, and sample the altitude at 1-meter intervals to obtain the sequence. Calculate the standard deviation. , The average altitude of the sampled samples is then... Unit: meters per meter. This indicator reflects the degree of altitude fluctuation within a unit distance.

[0059] Step S42: Associate the path context features, the electrocardiogram features corresponding to the mutation inflection point window, and the change in exercise intensity before and after the risk initiation time corresponding to the risk initiation point coordinates to construct the cause inference input vector.

[0060] Specifically, obtaining the mutation inflection point window and the previous window Based on the characteristic values, calculate the following electrocardiogram mutation indicators: QRS width change rate (If the denominator is 0, then ΔQRS = 0); percentage decrease in heart rate variability (If the denominator is 0, then ΔHRV = 0); Use directly.

[0061] Obtain the starting point of risk ( The average exercise intensity was measured 30 seconds before and after the center of the acceleration period (COP). Exercise intensity was expressed as metabolic equivalent (MET). Triaxial composite acceleration (ACC) was collected using accelerometers, and the regression equation was calibrated. (a and b were obtained by fitting data from 3 minutes of exercise at different treadmill speeds). Let the average MET for the first 30 seconds be... The average MET in the last 30 seconds was The change in exercise intensity (like Then ΔMET=0).

[0062] Construct a 10-dimensional causal reasoning input vector: .

[0063] Step S43: Input the inference vector of the inducement into the decision tree classifier and output the dominant inducement. The dominant inducement includes: heavy load on the slope section, high altitude and low oxygen inducement, frequent path undulation inducement, and heavy load of pure exercise.

[0064] Specifically, this embodiment uses a random forest classifier for causal classification, consisting of 50 decision trees. Each tree uses the CART algorithm, and the splitting criterion is the Gini coefficient. The training process is as follows: ① Sample Collection: Collect at least 2000 samples of exercise-related ECG risk events. Each sample includes the aforementioned 10-dimensional feature vector X and a dominant precipitating factor label Y, annotated by ECG experts in conjunction with on-site video. Y values ​​are 0 (excessive load on steep inclines), 1 (high altitude hypoxia induced type), 2 (frequent undulating route induced type), and 3 (pure excessive exercise load type). At least 500 cases are required for each category.

[0065] ② Feature processing: For continuous features Normalization is performed. and Used directly as a categorical feature.

[0066] ③ Parameter settings: maximum depth 8, maximum number of features 3 (3 features are randomly selected for each split), minimum number of leaf node samples 5. The parameters are determined by validation set grid search.

[0067] ④ Training Process: The dataset is divided into training and validation sets in an 8:2 ratio. Bootstrap sampling is used to generate 50 sub-training sets, each equal in size to the training set. A decision tree is independently constructed for each sub-training set. After construction, the classification accuracy is evaluated on the validation set; in this embodiment, the accuracy reaches 87%.

[0068] ⑤ Reasoning: For a new input X, each decision tree outputs a class prediction, and the random forest determines the final class by majority vote.

[0069] The cause type corresponding to the classifier output category is: 0-slope road section with excessive load (typical feature). ), 1-High altitude hypoxia induced type ( m), 2-path fluctuation frequently induced type ( ), 3-excessive pure exercise load (not meeting the above conditions and ).

[0070] By combining path context features with ECG mutation information and changes in exercise intensity, this embodiment can accurately distinguish the different contributions of environmental factors and pure exercise load to cardiac risk, making the identification of causes more precise and comprehensive.

[0071] After identifying the abrupt change inflection point window, it is necessary to spatiotemporally align this time window with GPS trajectory data to obtain the precise spatial coordinates of the risk initiation point. Since GPS sampling frequency is typically lower than ECG sampling frequency, and temporary loss of positioning signals may occur, accurately extracting coordinates from discrete or sparse trajectory points is crucial to ensuring spatial positioning accuracy. Therefore, in one embodiment, the spatiotemporal alignment of the abrupt change inflection point window with GPS trajectory data to locate the risk initiation point coordinates includes: Step S321: Obtain the start and end timestamps of the mutation inflection point window and construct the mutation inflection point time interval.

[0072] Specifically, setting a mutation inflection point window The start timestamp is The end timestamp is The time interval of the inflection point of the mutation is Window center moment The timestamp precision is in milliseconds.

[0073] Step S322: Retrieve all trajectory points whose timestamps fall within the time interval of the sudden change inflection point from the GPS trajectory data, forming a risk trajectory point set.

[0074] Specifically, from the established ECG-spatiotemporal coordinate pairing sequences, all sequences that satisfy the condition are retrieved. The paired points constitute the risk trajectory point set S. Since the ECG sampling frequency is 250Hz, it can contain a maximum of 500 paired points within a 2-second window.

[0075] Step S323: If the risk trajectory point set is not empty, then the latitude and longitude coordinates of the trajectory point whose timestamp is closest to the center time of the mutation inflection point window are determined as the risk starting point coordinates. If the risk trajectory point set is empty, then a linear interpolation method is used to calculate the risk starting point coordinates by weighting the latitude and longitude coordinates of the two trajectory points whose timestamps are closest to the mutation inflection point time interval according to the distance ratio between their respective timestamps and the mutation inflection point time interval.

[0076] Specifically, the process is handled differently depending on whether the risk trajectory point set is empty: Case 1: S is not empty. For each point in S, calculate its timestamp. and absolute difference .Pick The smallest point, the latitude and longitude of that point The coordinates of the risk initiation point are determined. If multiple points have the same coordinates... Take the earliest timestamp.

[0077] Scenario 2: S is empty (only occurs when the GPS signal is completely lost and interpolation cannot compensate). Find timestamps less than And closest The previous pairing point and timestamp greater than And closest The next pair of points Linear interpolation is used for calculation: ; ; .

[0078] Based on the above, this embodiment prioritizes the use of real trajectory points within the mutation inflection point window. When there are no trajectory points within the window, linear interpolation is performed using the nearest valid point to ensure stable output of risk starting point coordinates under various GPS signal conditions, thereby improving the robustness of spatiotemporal alignment.

[0079] During multiple exercise sessions, users may repeatedly traverse locations where electrocardiogram (ECG) abnormalities have occurred. If these locations can be marked based on historical experience, and warnings can be issued in advance upon re-entry using real-time ECG characteristics, it will help prevent the recurrence of risks. Therefore, in one embodiment, the method further includes: The risk starting point coordinates are associated with the historical motion trajectory of the wearable device that collects the ECG signals to obtain the past ECG feature records of the risk starting point coordinates in the historical motion. If the past ECG feature records contain at least one abnormal ECG feature event that occurred within the vicinity of the risk initiation point coordinates, then the location of the risk initiation point coordinates is marked as the individual risk-sensitive area; During subsequent exercise, the system monitors in real time whether the current GPS coordinates have entered the marked individual risk-sensitive area. If they have entered and the current electrocardiogram shows signs of abnormal T-wave morphology or decreased heart rate variability, a pre-risk warning will be output before the preset risk threshold is reached.

[0080] Specifically, after completing the risk identification, the following information will be stored in the local database to form a historical risk event record: Risk starting point coordinates ; Risk initiation moment ; ECG feature set of mutation inflection point window ; Cardiac Functional Status Score ; The primary contributing factor is the cause.

[0081] Historical motion trajectories are stored at the same frequency (250Hz) as ECG sampling, with each point containing a timestamp and coordinates.

[0082] The coordinates of the risk starting point obtained from the current location Traverse each trajectory point in the historical movement trajectory Calculate the spherical distance d. Use the Haversine formula: in Kilometers (average radius of the Earth). In latitude in radians, It is the difference in latitude in radians. for latitude, for latitude, It is the difference in longitude in radians. If (In this embodiment, 50 meters is used), then it is considered that... Falling Within the vicinity of.

[0083] Search this Before and after the corresponding time Historical ECG characteristic records within a few seconds (30 seconds in this example). If at least one record meets any of the following conditions, an "abnormal ECG characteristic event" is determined to have occurred: Cardiac Functional Status Score ; ; ,in This is the user's individual HRV baseline value. Baseline value calculation method: Take the HRV data from all periods of normal motion (F consistently greater than or equal to 60) over the past 30 days and calculate the mean. and standard deviation ,but .

[0084] If at least one abnormal ECG characteristic event exists, then The area around the storage center and a circular region with a radius of 50 meters are marked as the individual risk-sensitive area. And the surrounding radius, and statistically analyze the most frequent triggering type in the region's history.

[0085] During subsequent movements, the current GPS coordinates are acquired in real time. For each labeled individual risk-sensitive region (center C, radius R), calculate... Distance from C .like Entering this area is determined. At this point, the real-time ECG features of the current 2-second window are extracted, and the current... and HRV value. A precursor is considered to have occurred if any of the following conditions are met: current ; current (That is, a decrease of more than 20%).

[0086] Once the conditions are met, a pre-risk warning will be immediately issued. The warning will include the types of historical triggers for the area and the type of current ECG abnormality (e.g., "You are approaching an area where there has been a history of overload risk on steep sections of road. Your current ECG shows a T-wave abnormality. Please slow down and adjust your breathing."). The warning may be issued via vibration, sound, or screen display.

[0087] Based on the above, this embodiment establishes an individualized risk map using historical movement trajectories and electrocardiogram (ECG) records. When a user passes through a location where an ECG abnormality previously occurred and the current ECG shows early warning signs, it can provide an early warning, realizing a shift from passive alarm to active prevention and improving exercise safety.

[0088] To achieve precise time synchronization between ECG signals and GPS spatiotemporal coordinates, it is necessary to address the issues of different sampling frequencies between the two sensors and inconsistent local timestamps. In one embodiment, the continuous acquisition of ECG signals during exercise and the synchronous recording of the corresponding GPS spatiotemporal coordinates include: Continuous electrocardiogram (ECG) signals are acquired at a preset sampling frequency, and the local timestamp of each ECG sampling point is recorded. Obtain real-time latitude and longitude coordinates and record the local timestamp of each GPS location point; When the local timestamp of the GPS positioning point is inconsistent with the local timestamp of the ECG sampling point, the GPS trajectory data is interpolated to the ECG sampling time using linear interpolation to form a time-synchronized ECG signal and GPS spatiotemporal coordinate pairing sequence.

[0089] Specifically, the wearable device microcontroller (such as an ARM Cortex-M4 with a main frequency of 80MHz) uses an analog-to-digital converter to sample at a preset frequency. Electrocardiogram (ECG) signals were collected. According to the Nyquist sampling theorem, It should be greater than twice the highest frequency component of the electrocardiogram signal (≤150Hz). In this embodiment, it is taken as... Hz. For each ECG sample acquired, the local timestamp T_ECG (converted to millisecond precision) is read from a high-precision timer (crystal oscillator driven, 1μs resolution) and then... Stored in the ECG buffer. It is the electrocardiogram signal at the corresponding timestamp. The instantaneous voltage amplitude at any given moment, measured in millivolts (mV). The value typically ranges from -5mV to +5mV, and is obtained by converting the analog voltage signal detected by the ECG electrodes into a digital value using an analog-to-digital converter.

[0090] GPS receiver modules (such as UBLOX M8N) output NMEA format positioning data at a frequency of 1Hz. Each time a GGA statement is received, the UTC time is parsed (converted to a local timestamp base identical to that of an electrocardiogram). Longitude (lon) and latitude (lat), Store in the GPS buffer.

[0091] For each ECG sampling time Find the two nearest locations in the GPS buffer that meet the following conditions: previous point : ,and Minimum; The last point : ,and Minimum.

[0092] like and t exists for all cases; calculate the interpolation coefficients. , After interpolation: , .

[0093] like Does not exist ( (Earlier than the first GPS point), take , .

[0094] If P_next does not exist (T_ECG_j is later than the last GPS point), take... , .

[0095] The final result is a time-synchronized pairing sequence, where each element is... This sequence can be used directly for subsequent state inversion analysis, or it can be averaged over a 2-second window and stored to save space. , This refers to the synchronous longitude and latitude of the ECG sampling points obtained after interpolation or assignment. , This refers to the longitude and latitude of the location point with the earliest timestamp in the GPS data buffer. , This refers to the longitude and latitude of the location point with the latest timestamp in the GPS data buffer.

[0096] Based on the above, the time mismatch between high-frequency ECG signals and low-frequency GPS trajectories is solved by linear interpolation, so that each ECG sampling point has accurate spatiotemporal coordinates. The error introduced by interpolation is very small in a short time interval, which can meet the accuracy requirements of state inversion.

[0097] After completing the risk initiation point location and cause analysis, in order to record the analysis results in a structured form for subsequent review, sharing or uploading, in one embodiment, a spatiotemporal early warning log is generated based on the risk initiation time corresponding to the risk initiation point coordinates, the risk initiation point coordinates, and the dominant cause.

[0098] The above information can be organized into a structured log format for local storage or uploaded to the cloud.

[0099] Based on the above, the generated spatiotemporal early warning log contains the time of risk occurrence, precise geographical location, and dominant trigger, providing a standardized data recording format for post-event analysis, medical diagnosis, and group risk statistics, which is conducive to building personal risk profiles and regional risk heat maps.

[0100] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.

[0101] Secondly, based on the same inventive concept, this application also provides a system for implementing the aforementioned state inversion risk localization method based on motion trajectory and electrocardiogram timing characteristics. The solution provided by this system is similar to the implementation described in the above method; therefore, the specific limitations in one or more system embodiments provided below can be found in the above-described limitations of the state inversion risk localization method based on motion trajectory and electrocardiogram timing characteristics, and will not be repeated here.

[0102] In one embodiment, such as Figure 4 As shown, the system includes: a signal acquisition module, an edge computing module, a state inversion module, and a cause determination module. Among them: The signal acquisition module is used to continuously acquire electrocardiogram signals during exercise and simultaneously record the corresponding GPS spatiotemporal coordinates; The edge computing module is used to analyze the electrocardiogram signal based on the edge computing node and output a real-time cardiac function status score. The state inversion module is used to trigger state inversion when the real-time cardiac function status score is lower than a preset risk threshold: using historical segments of electrocardiogram signals and GPS trajectory data of the corresponding time period, identifying abrupt inflection point windows in the temporal changes of electrocardiogram characteristics, aligning the abrupt inflection point windows with the GPS trajectory data in time and space, locating the risk start point coordinates, and recording the risk start time corresponding to the risk start point coordinates. The causation determination module is used to extract the path context features of the location of the risk initiation point coordinates, and perform correlation analysis between the path context features and the mutation information of the electrocardiogram features to determine the dominant causation of the risk.

[0103] The various modules in the aforementioned state-inversion risk localization system based on motion trajectory and electrocardiogram timing characteristics can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0104] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, and network interface connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores all data related to the system's operation. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a state-inversion risk localization method based on motion trajectory and electrocardiogram timing characteristics.

[0105] Those skilled in the art will understand that Figure 5The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0106] Thirdly, in one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the methods described in the above method embodiments.

[0107] Fourthly, in one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described in the above method embodiments.

[0108] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0109] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0110] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A state-inversion risk localization method based on motion trajectory and electrocardiogram time series characteristics, characterized in that, The method includes: Continuously collect electrocardiogram signals during exercise and simultaneously record the corresponding GPS spatiotemporal coordinates; The electrocardiogram signal is analyzed based on edge computing nodes, and a real-time cardiac function status score is output. When the real-time cardiac function status score is lower than the preset risk threshold, state inversion is triggered: using historical segments of ECG signals and GPS trajectory data of the corresponding time period, the sudden change inflection point window in the temporal change of ECG characteristics is identified, and the sudden change inflection point window is spatiotemporally aligned with the GPS trajectory data to locate the risk starting point coordinates and record the risk starting time corresponding to the risk starting point coordinates. Extract the path context features of the location of the risk initiation point coordinates, and perform correlation analysis between the path context features and the mutation information of the electrocardiogram features to determine the dominant risk factor.

2. The method according to claim 1, characterized in that, The window for identifying abrupt inflection point changes in the temporal variation of electrocardiogram features includes: Extract the inversion time window containing historical segments of electrocardiogram signals and corresponding GPS trajectory data; The inversion time window is divided into multiple consecutive time windows to obtain a time window sequence; Calculate the set of motion ECG features for each time window in the time window sequence; Convert the motion ECG feature set of each time window into a feature vector; Starting from the second time window in the time window sequence, the Euclidean distance between the feature vector of each time window and the feature vector of its previous adjacent time window is calculated sequentially. The time window in which the Euclidean distance exceeds a preset threshold is marked as the mutation inflection point window.

3. The method according to claim 1, characterized in that, The step of extracting the path context features of the location of the risk initiation point coordinates and performing correlation analysis between the path context features and the abrupt change information of the electrocardiogram features to determine the dominant risk factor includes: Map the risk starting point coordinates to a digital map, and extract the road slope value, altitude, road type classification, and path undulation change rate within a preset distance range before and after the risk starting point coordinates. The path context features, the electrocardiogram features corresponding to the mutation inflection point window, and the change in exercise intensity before and after the risk initiation time corresponding to the risk initiation point coordinates are correlated to construct the causal reasoning input vector; The input vector of the inference of the cause is input into the decision tree classifier, and the dominant cause is output. The dominant cause includes: excessive load on the slope section, high altitude and low oxygen induced type, frequent path undulation induced type and pure exercise excessive load.

4. The method according to claim 1, characterized in that, The step of aligning the abrupt change inflection point window with GPS trajectory data in time and space to locate the coordinates of the risk starting point includes: Obtain the start and end timestamps of the mutation inflection point window, and construct the mutation inflection point time interval; All trajectory points whose timestamps fall within the time interval of the abrupt change inflection point are retrieved from the GPS trajectory data to form a risk trajectory point set; If the risk trajectory point set is not empty, then the latitude and longitude coordinates of the trajectory point whose timestamp is closest to the center time of the mutation inflection point window in the risk trajectory point set are determined as the risk starting point coordinates; If the risk trajectory point set is empty, then a linear interpolation method is used to calculate the coordinates of the risk starting point by weighting the latitude and longitude coordinates of the two trajectory points whose timestamps are closest to the time interval of the sudden change inflection point according to the distance ratio between their respective timestamps and the time interval of the sudden change inflection point.

5. The method according to claim 4, characterized in that, The method further includes: The risk starting point coordinates are associated with the historical motion trajectory of the wearable device that collects the ECG signals to obtain the past ECG feature records of the risk starting point coordinates in the historical motion. If the past ECG feature records contain at least one abnormal ECG feature event that occurred within the vicinity of the risk initiation point coordinates, then the location of the risk initiation point coordinates is marked as the individual risk-sensitive area; During subsequent exercise, the system monitors in real time whether the current GPS coordinates have entered the marked individual risk-sensitive area. If they have entered and the current electrocardiogram shows signs of abnormal T-wave morphology or decreased heart rate variability, a pre-risk warning will be output before the preset risk threshold is reached.

6. The method according to claim 1, characterized in that, The continuous acquisition of electrocardiogram signals during exercise and the synchronous recording of the corresponding GPS spatiotemporal coordinates include: Continuous electrocardiogram (ECG) signals are acquired at a preset sampling frequency, and the local timestamp of each ECG sampling point is recorded. Obtain real-time latitude and longitude coordinates and record the local timestamp of each GPS location point; When the local timestamp of the GPS positioning point is inconsistent with the local timestamp of the ECG sampling point, the GPS trajectory data is interpolated to the ECG sampling time using linear interpolation to form a time-synchronized ECG signal and GPS spatiotemporal coordinate pairing sequence.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: A spatiotemporal early warning log is generated based on the risk initiation time corresponding to the risk initiation point coordinates, the risk initiation point coordinates, and the dominant triggering factor.

8. A state-inversion risk localization system based on motion trajectory and electrocardiogram time-series characteristics, characterized in that, The system includes: The signal acquisition module is used to continuously acquire electrocardiogram signals during exercise and simultaneously record the corresponding GPS spatiotemporal coordinates; The edge computing module is used to analyze the electrocardiogram signal based on the edge computing node and output a real-time cardiac function status score. The state inversion module is used to trigger state inversion when the real-time cardiac function status score is lower than a preset risk threshold: using historical segments of electrocardiogram signals and GPS trajectory data of the corresponding time period, identifying abrupt inflection point windows in the temporal changes of electrocardiogram characteristics, aligning the abrupt inflection point windows with the GPS trajectory data in time and space, locating the risk start point coordinates, and recording the risk start time corresponding to the risk start point coordinates. The causation determination module is used to extract the path context features of the location of the risk initiation point coordinates, and perform correlation analysis between the path context features and the mutation information of the electrocardiogram features to determine the dominant causation of the risk.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the state inversion risk localization method based on motion trajectory and electrocardiogram timing characteristics as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the state inversion risk localization method based on motion trajectory and electrocardiogram timing characteristics as described in any one of claims 1 to 7.