Medical record data processing method and system based on medical large model

By acquiring and processing historical medical record data of medical entities, utilizing multi-layer attention mechanisms and pre-trained models, comprehensive feature representations are generated and parameters are optimized, solving the problems of low data processing efficiency and lagging recommendation in existing technologies, and achieving efficient and accurate medical decision support.

CN120977606BActive Publication Date: 2025-12-26SICHUAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511483460.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2025-12-26
Estimated Expiration
2045-10-17

AI Technical Summary

Technical Problem

Existing medical record data processing methods suffer from low data processing efficiency, inaccurate feature extraction, and a lack of foresight in diagnosis and treatment recommendations. They are unable to fully capture the complex relationships between medical entities and the dynamic changes in the diagnosis and treatment process, and the recommendation results lag behind actual diagnosis and treatment needs.

Method used

By acquiring a set of historical medical record data units for the target medical entity, extracting core feature vectors and filtering neighboring data units, adjusting weight allocation using a multi-layer attention mechanism, generating a comprehensive feature representation, combining it with a pre-trained medical recommendation model for time-series prediction, and optimizing model parameters.

Benefits of technology

It improves the efficiency and accuracy of medical record data processing, provides scientific and quantitative medical decision support, and the model can adapt to new medical data and treatment needs, thereby improving the accuracy and reliability of recommendation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120977606B_ABST
    Figure CN120977606B_ABST
Patent Text Reader

Abstract

The application provides a medical record data processing method and system based on a medical large model. First, the historical medical entity data unit set of a target medical entity is obtained, including multiple medical entities and diagnosis and treatment record characteristics. Then, the core feature vector is extracted, the neighbor data unit set is selected according to the preset rule, the weight is adjusted according to the dynamic association score of the core feature vector and the neighbor data unit by using the multi-layer attention mechanism, the feature weight of each neighbor data unit is allocated, the weighted feature vector is output, then the weighted feature vector and the core feature vector are cross-layer fused to generate a comprehensive feature expression, finally, the pre-trained medical recommendation model is called to perform time series prediction on the comprehensive feature expression, the recommendation priority score is output, and the model parameters are optimized accordingly, so that the medical record data is effectively processed and the subsequent diagnosis and treatment recommendation is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of smart medical treatment, in particular to a medical record data processing method and system based on a medical large model. BACKGROUND

[0002] In the field of medical record data processing, existing technical methods mainly rely on traditional data mining and statistical analysis means, facing challenges such as low data processing efficiency, inaccurate feature extraction, and lack of forward-looking diagnosis and treatment recommendations. Currently, the methods commonly used in the industry when processing medical record data mostly only analyze single medical records in isolation, making it difficult to fully capture the complex associations between medical entities and the dynamic changes in the diagnosis and treatment process. Meanwhile, existing technologies often use fixed feature templates or simple feature selection algorithms in feature extraction, which cannot be adjusted adaptively according to the characteristics of specific medical entities, resulting in a lack of representativeness and discrimination in the extracted features.

[0003] In terms of association analysis, existing methods mostly rely on pre-set static association rules, making it difficult to dynamically capture new association relationships between medical entities due to changes in the diagnosis and treatment process, thereby limiting the depth and breadth of data processing. In addition, existing technologies in diagnosis and treatment recommendation usually predict based on simple statistics or experience rules of historical data, lacking precise grasp and quantitative evaluation of future diagnosis and treatment trends, resulting in recommended results often lagging behind actual diagnosis and treatment needs. SUMMARY

[0004] In view of the above-mentioned problems, in combination with the first aspect of the present application, the embodiments of the present application provide a medical record data processing method based on a medical large model, which comprises:

[0005] obtaining a set of historical medical record data units corresponding to a target medical entity, the set of historical medical record data units containing a plurality of associated medical entity features and corresponding diagnosis and treatment record features;

[0006] extracting a core feature vector corresponding to the target medical entity in the set of historical medical record data units, and filtering a set of neighbor data units having diagnosis and treatment associations with the core feature vector from the set of historical medical record data units based on a pre-set association rule;

[0007] performing feature weight distribution on each neighbor data unit in the set of neighbor data units through a multi-layer attention mechanism, and outputting a corresponding weighted feature vector, wherein each layer of the attention mechanism adjusts the weight distribution proportion according to the dynamic association score between the core feature vector and the corresponding neighbor data unit;

[0008] The weighted feature vector output by the multi-layer attention mechanism is cross-layer fused with the core feature vector to generate a comprehensive feature expression of the target medical entity;

[0009] A pre-trained medical recommendation model is called to perform time series prediction on the comprehensive feature expression, and a recommended priority score of the target medical entity in a subsequent diagnosis and treatment process is output, and parameters of the medical recommendation model are optimized according to the recommended priority score.

[0010] In still another aspect, the embodiment of the present application also provides a medical record data processing system based on a medical large model, comprising a processor and a machine readable storage medium, the machine readable storage medium is connected with the processor, the machine readable storage medium is used for storing programs, instructions or codes, and the processor is used for executing the programs, instructions or codes in the machine readable storage medium to realize the above-mentioned method.

[0011] Based on the above aspects, the embodiment of the present application integrates the historical medical record data unit set of the target medical entity, accurately locates the historical diagnosis and treatment information closely related to the current medical entity through core feature vector extraction and diagnosis and treatment associated neighbor data unit screening. Further, the multi-layer attention mechanism adjusts the weight distribution ratio through dynamic correlation score, not only captures the subtle differences between neighbor data units, but also realizes the reinforcement learning of key features, significantly improving the accuracy and effectiveness of feature expression. The cross-layer fusion strategy organically combines the weighted feature vector and the core feature vector to generate a comprehensive feature expression that not only contains historical diagnosis and treatment information but also reflects the characteristics of the current medical entity, providing a rich and multi-dimensional input for the medical recommendation model. The pre-trained medical recommendation model performs time series prediction on this basis and outputs a guiding recommended priority score, effectively solving the problems of information silos and decision lag in traditional medical decision-making. More importantly, by optimizing the parameters of the medical recommendation model according to the recommended priority score, a data-driven and continuously evolving closed-loop optimization mechanism is formed, enabling the model to continuously adapt to new medical data and diagnosis and treatment needs, improving the accuracy and reliability of the recommendation results. As a result, not only the efficiency and accuracy of medical record data processing are improved, but also scientific and quantitative support is provided for medical decision-making. BRIEF DESCRIPTION OF DRAWINGS

[0012] Figure 1 is an execution flow diagram of the medical record data processing method based on a medical large model provided by the embodiment of the present application.

[0013] Figure 2 is a schematic diagram of exemplary hardware and software components of the medical record data processing system based on a medical large model provided by the embodiment of the present application. DETAILED DESCRIPTION

[0014] The application will be specifically described below with reference to the accompanying drawings, Figure 1 is a flowchart of a medical record data processing method based on a medical large model provided by an embodiment of the application. The medical record data processing method based on a medical large model will be described in detail below.

[0015] In step S110, a historical medical record data unit set corresponding to a target medical entity is obtained, and the historical medical record data unit set contains a plurality of associated medical entity features and corresponding diagnosis and treatment record features.

[0016] In this embodiment, the target medical entity can be a patient suffering from a certain disease. Specifically, taking a patient diagnosed with a certain complex cardiovascular disease as an example, the historical medical record data unit set corresponding to the patient can be obtained, which is accumulated for a long time and covers all medical information of the patient from the first visit to the present.

[0017] The medical entity features include the basic information of the patient, such as age, gender, height, weight, and other physical characteristics, as well as special information such as family history and allergy history. For example, for the cardiovascular disease patient, the age can be 55 years old, male, 175 cm tall, 80 kg in weight, and has a family history of cardiovascular disease and is allergic to a certain commonly used drug.

[0018] The diagnosis and treatment record features record the details of each visit, such as but not limited to the visit time, the specific diagnosis result of the disease, the treatment method, the medication, etc. For example, the first visit was two years ago, diagnosed as early cardiovascular stenosis, and the treatment method was drug therapy, taking anti-platelet drugs and lipid-lowering drugs; the second visit was a year ago, the disease had progressed, and the diagnosis was moderate cardiovascular stenosis, in addition to continuing drug therapy, regular rehabilitation training programs were added; the third visit was six months ago, with new symptoms, diagnosed as mild myocardial ischemia, and the treatment method was adjusted to replace the drug variety and increase the use of heart monitoring equipment. Thus, a historical medical record data unit set containing a plurality of associated medical entity features and corresponding diagnosis and treatment record features is generated.

[0019] In step S120, a core feature vector corresponding to the target medical entity in the historical medical record data unit set is extracted, and a neighbor data unit set having diagnosis and treatment association with the core feature vector is filtered from the historical medical record data unit set based on a preset association rule.

[0020] In this embodiment, for the patient with cardiovascular disease, the core feature vector extraction process is as follows: considering the development of the patient's condition, the degree of cardiovascular stenosis, myocardial ischemia, medication history and rehabilitation training participation are taken as key factors to construct the core feature vector. For example, the degree of cardiovascular stenosis is divided into mild, moderate and severe, represented by numbers 1, 2 and 3 respectively; the myocardial ischemia condition is quantified by the key indicators of electrocardiogram data; the medication history records the names and duration of various drugs taken; the rehabilitation training participation is measured by the number and duration of training per week. Through the above information, a multi-dimensional core feature vector can be constructed.

[0021] Then, the neighbor data unit set is filtered based on the preset association rule. First, a global association network of the historical medical record data unit set is constructed, which is constructed according to the appearance frequency and co-occurrence relationship of the patient in the historical diagnosis and treatment records. For example, the patient often has diagnosis and treatment interaction with the cardiologist, and also has frequent contact with the rehabilitation doctor during rehabilitation training, thus forming an association relationship. In this global association network, a set of direct association nodes of the patient is identified, which can represent the associated medical entities that have at least one common diagnosis and treatment record with the patient, such as cardiologists, rehabilitation doctors, and specific heart monitor device suppliers.

[0022] Next, based on the diagnosis and treatment time sequence characteristics and disease type characteristics of each node in the direct association node set, the diagnosis and treatment path matching degree between each node and the patient is calculated. For example, the cardiologist continuously tracks the treatment of the patient during the development of the patient's condition, and the diagnosis and treatment time sequence is closely related to the development of the patient's condition, and the disease type is completely matched with the treatment of cardiovascular disease, so the diagnosis and treatment path matching degree is high; while the rehabilitation doctor also participates in the treatment, but the diagnosis and treatment time sequence and disease type association are relatively weak, and the matching degree is slightly lower. The direct association node set is sorted in descending order of diagnosis and treatment path matching degree, and the medical record data unit corresponding to the node with a matching degree higher than a preset threshold (such as 0.6) is selected to form an initial neighbor data unit set, which may include detailed diagnosis and treatment records of the cardiologist, data records of specific heart monitor devices used, etc.

[0023] Then, the initial neighbor data unit set is extended by cross-department association. For example, the department identifier feature and the disease classification code contained in each medical record data unit in the initial neighbor data unit set can be parsed. It is found that the departments involved are the cardiology department and the rehabilitation department, and the disease classification code is a specific code related to cardiovascular diseases. According to the department identifier feature, a diagnosis and treatment path transfer matrix between departments is constructed, such as the probability of transferring from the cardiology department to the rehabilitation department for rehabilitation training is 0.3, the probability of transferring from the rehabilitation department back to the cardiology department for disease assessment is 0.2, and so on. Each element in the matrix represents the probability value of the association transfer between two departments in historical diagnosis and treatment. For the disease classification code corresponding to the patient, the highest transfer probability path between its own department (cardiology department) and other departments in the diagnosis and treatment path transfer matrix is found, and it is found that the association transfer probability with the rehabilitation department is relatively high. The rehabilitation department is taken as an extended department set, and the medical record data units containing the patient and the rehabilitation department identifier are retrieved from the historical medical record data unit set, such as the rehabilitation training effect evaluation record of the rehabilitation department doctor on the patient. The retrieved medical record data units are merged with the initial neighbor data unit set, and after removing the duplicate data units, the cross-department association extended set, i.e., the final neighbor data unit set, is generated.

[0024] In step S130, feature weight distribution is performed on each neighbor data unit in the neighbor data unit set by a multi-layer attention mechanism, and a corresponding weighted feature vector is output, wherein each layer of the attention mechanism adjusts the weight distribution proportion according to the dynamic association score between the core feature vector and the corresponding neighbor data unit.

[0025] In this embodiment, in the first layer of the attention mechanism, the initial attention weight can be generated according to the cosine similarity between the core feature vector and the feature vector of each neighbor data unit. Taking the diagnosis and treatment record of the cardiologist as an example, the cosine similarity between its feature vector and the core feature vector of the patient is calculated. Assuming that the calculated cosine similarity is 0.8, indicating that they have high similarity in many feature dimensions, a high initial attention weight is given, and the initial attention weight is multiplied by the diagnosis and treatment time decay factor of each neighbor data unit to generate a time-aware primary weight distribution result. For the diagnosis and treatment record of the cardiologist, the interval between the record time and the current time is short, and the diagnosis and treatment time decay factor is calculated to be 0.9 (dynamically adjusted according to the interval length between the record time of the medical record data unit and the current time), so the primary weight distribution result is 0.8 x 0.9 = 0.72.

[0026] In the intermediate layer attention mechanism, the severity of the disease feature can be introduced to correct the primary weight distribution result. Analyze the number of complications, treatment cycle length, and medication intensity indicators recorded in the cardiologist's medical records to generate a disease severity score. Suppose the cardiologist's medical records show that the patient has some minor complications, a long treatment cycle, and a large medication intensity, and the comprehensive assessment of the disease severity score is 0.7. The disease severity score and the primary weight distribution result are weighted and superimposed, such as setting the weight of the disease severity score to 0.6 and the weight of the primary weight distribution result to 0.4. The corrected intermediate weight distribution result is 0.7x0.6+0.72x0.4=0.708.

[0027] In the final layer attention mechanism, the department attribute feature of the medical entity can be combined to finally adjust the intermediate weight distribution result. Detect the consistency of the department (cardiology department) to which the cardiologist's medical records belong and the current department (assuming it is still the cardiology department) of the patient. Since the department attribute is consistent, no cross-department penalty coefficient is applied to the intermediate weight distribution result, and the intermediate weight distribution result 0.708 remains unchanged. After all neighbor data units have been adjusted in this way, the weight distribution result is normalized so that the sum of the weights of all neighbor data units is 1. The final attention weight value of the cardiologist's medical record neighbor data unit is 0.708, and the corresponding weighted feature vector is output according to the final attention weight value. In this way, by performing such operations on each neighbor data unit in the neighbor data unit set, the corresponding weighted feature vector is output.

[0028] Step S140, cross-layer fusion of the weighted feature vector output by the multi-layer attention mechanism and the core feature vector to generate a comprehensive feature representation of the target medical entity.

[0029] In this embodiment, the primary weighted feature vector output by the first layer attention mechanism can be subjected to feature dimension reduction processing to retain key dimensions related to disease classification. Taking the primary weighted feature vector generated by the cardiologist's medical record as an example, the primary weighted feature vector may originally be a high-dimensional vector containing a lot of medical details. Through principal component analysis and other methods, it can be reduced to a lower-dimensional vector that still retains key information related to cardiovascular disease classification, such as only retaining key dimensions such as the degree of cardiovascular stenosis and myocardial ischemia.

[0030] The reduced primary weighted feature vector is input into a bidirectional gated recurrent unit to capture the forward and reverse dependencies of the diagnosis and treatment features in the time series. The bidirectional gated recurrent unit analyzes the feature changes of the vector at different time points, such as how the degree of cardiovascular stenosis gradually develops over time, the trend of changes in myocardial ischemia during the treatment process, and the like. The hidden state of the last time step of the bidirectional gated recurrent unit is extracted as the time series fusion feature.

[0031] The time series fusion feature is dot multiplied with the intermediate weighted feature vector output by the intermediate layer attention mechanism to generate an intermediate fusion result. Assuming that the time series fusion feature vector is [a1, a2], the intermediate weighted feature vector is [b1, b2], and the intermediate fusion result vector obtained after dot multiplication is [a1x b1, a2x b2].

[0032] The intermediate fusion result is spliced with the final weighted feature vector output by the final layer attention mechanism to form a cross-layer spliced feature vector. For example, the final weighted feature vector is [c1, c2], and the cross-layer spliced feature vector obtained after splicing is [a1x b1, a2x b2, c1, c2].

[0033] The cross-layer spliced feature vector is added to the original core feature vector through a residual connection, and a layer normalization method is used to eliminate the feature scale difference to generate a comprehensive feature expression. Assuming that the original core feature vector is [d1, d2], a new vector is obtained after addition, and then the layer normalization processing is performed to normalize the features of each dimension of the vector so that they are distributed within a reasonable range, and finally the comprehensive feature expression of the target medical entity (the cardiovascular disease patient) is generated.

[0034] In step S150, a pre-trained medical recommendation model is called to perform time series prediction on the comprehensive feature expression, output a recommended priority score of the target medical entity in the subsequent diagnosis and treatment process, and optimize the parameters of the medical recommendation model according to the recommended priority score.

[0035] In this embodiment, the comprehensive feature expression can be divided into a disease feature segment, a treatment feature segment, and a prognosis feature segment, which are respectively input into the time series prediction branches of the medical recommendation model arranged in parallel. For the comprehensive feature expression of the cardiovascular disease patient, the disease feature segment contains information such as the degree of cardiovascular stenosis and the myocardial ischemia condition; the treatment feature segment contains information such as the types of drugs used and the treatment methods; and the prognosis feature segment contains information such as the rehabilitation training effect and the possible complication risk.

[0036] In each time series prediction branch, an expanded convolutional neural network is adopted to capture the feature change patterns at different time scales. Taking the disease feature segment as an example, the historical data sampling frequency is extracted, assuming that the historical data sampling frequency is once a month. Based on the sampling frequency, the initial expansion factor is determined to be 2, and after aligning the initial expansion factor with the preset reference time scale (assuming one week), the dynamically adjusted target expansion factor is generated to be 3. The disease feature segment is input into the stacked expanded convolutional layer, and the expansion factor of each expanded convolutional layer is incremented according to the target expansion factor, and a local feature normalization operation is inserted between adjacent expanded convolutional layers. For example, the expansion factor of the first expanded convolutional layer is 3, and the second is 6, generating multi-scale preliminary features. Cross-layer feature fusion is performed on the multi-scale preliminary features and the historical time series sliding window features of the disease feature segment to generate cross-layer features containing long and short-term dependencies. Time attention mechanism is applied to the cross-layer features, and time attention weights are generated according to the feature fluctuation amplitude and time interval length of each time node. After multiplying the time attention weights with the cross-layer features, time adjustment features are generated. The time adjustment features are input into the gated convolution unit, and the features with strong relevance to the current time scale are selected through the learnable gating parameters to generate time gating features. The time gating features are dynamically associated and mapped with the target expansion factor to update the expansion factor configuration of the next time step, and the prediction features of the disease feature segment time series prediction branch are output. Similar operations are also performed on the treatment feature segment and the prognosis feature segment.

[0037] After modality alignment, the prediction features output by each time series prediction branch are spliced to generate a multi-modal fusion prediction vector. The dimension differences of the disease feature segment prediction features, the treatment feature segment prediction features, and the prognosis feature segment prediction features output by each time series prediction branch are detected, assuming that the disease feature segment prediction feature dimension is 5, the treatment feature segment prediction feature dimension is 4, and the prognosis feature segment prediction feature dimension is 6. Through a shared linear projection matrix, they are mapped to a unified dimension space (assuming a unified dimension of 6) to generate unified dimension space features. The cosine similarity matrix between the disease feature segment prediction features and the treatment feature segment prediction features in the unified dimension space features is calculated, and target feature pairs with a similarity higher than a preset threshold (such as 0.5) are identified from the matrix. Bidirectional feature exchange operation is performed on the target feature pairs to generate exchanged features. Cross-modal maximum pooling processing is performed on the exchanged features to extract the maximum value in each feature dimension, generating a pooled feature vector. The pooled feature vector is spliced into a multi-channel fusion matrix along the feature channel dimension, and a channel attention mechanism is applied to the multi-channel fusion matrix to dynamically adjust the channel weights according to the activation frequency of each channel in the historical training, generating a multi-modal fusion prediction vector.

[0038] The multi-modal fusion prediction vector is input into a fully connected layer network to calculate a recommendation priority score. The error gradient between the recommendation priority score and the true diagnosis and treatment record label is returned to the dilated convolutional neural network and the fully connected layer network through a back propagation algorithm, and the convolution kernel parameters of the medical recommendation model and the weights of the fully connected layer are updated. For example, the calculated recommendation priority score is 0.7, while the score corresponding to the true diagnosis and treatment record label is 0.8, and there is an error. Through the back propagation algorithm, the error gradient is returned, and the convolution kernel parameters of the dilated convolutional neural network and the weights of the fully connected layer network are adjusted, so that the model can more accurately output the recommendation priority score in subsequent prediction. After multiple such training and optimization, the accuracy of the medical recommendation model in recommending the priority score of the subsequent diagnosis and treatment process of the target medical entity is continuously improved.

[0039] Based on the above steps, the embodiments of the present application integrate the historical medical record data unit set of the target medical entity, accurately locate the historical diagnosis and treatment information closely related to the current medical entity through core feature vector extraction and diagnosis and treatment associated neighbor data unit screening. Further, the multi-layer attention mechanism adjusts the weight distribution ratio through dynamic association score, not only capturing the subtle differences between neighbor data units, but also achieving reinforcement learning of key features, significantly improving the accuracy and effectiveness of feature expression. The cross-layer fusion strategy combines the weighted feature vector and the core feature vector organically, generating a comprehensive feature expression that not only contains historical diagnosis and treatment information but also reflects the characteristics of the current medical entity, providing a rich and multi-dimensional input for the medical recommendation model. The pre-trained medical recommendation model performs time series prediction on this basis and outputs a guiding recommendation priority score, effectively solving the problems of information silos and decision lag in traditional medical decision-making. More importantly, by optimizing the parameters of the medical recommendation model according to the recommendation priority score, a data-driven, continuously evolving closed-loop optimization mechanism is formed, enabling the model to continuously adapt to new medical data and diagnosis and treatment needs, improving the accuracy and reliability of the recommendation results. As a result, not only the efficiency and accuracy of medical record data processing are improved, but also scientific and quantitative support is provided for medical decision-making.

[0040] In one possible implementation, step S120 includes:

[0041] Step S121, according to the occurrence frequency and co-occurrence relationship of the target medical entity in the historical diagnosis and treatment record, a global association network of the historical medical record data unit set is constructed.

[0042] Still taking the patient with cardiovascular disease as an example, the patient has been to different departments for treatment and received various treatments many times since the first discovery of the cardiovascular disease. The patient has a high frequency of visits to the cardiology department and also has treatment activities in the rehabilitation department, the laboratory department and other departments due to the patient's condition. In terms of frequency, the patient visits the cardiology department 10 times, visits the rehabilitation department 5 times, and has blood tests and other related tests in the laboratory department 8 times. In terms of co-occurrence, after each visit to the cardiology department, the patient is most likely to have blood tests and other related tests in the laboratory department; and after a period of drug treatment, the patient is transferred to the rehabilitation department for rehabilitation training. Based on this information, a complex global association network is constructed, in which the nodes represent various medical entities, including different departments, doctors, examination equipment, etc., and the edges represent the association between them, which is based on the actual activities of the patient in the historical diagnosis and treatment records.

[0043] In step S122, a set of directly associated nodes of the target medical entity is identified in the global association network, each node in the set of directly associated nodes representing an associated medical entity having at least one common diagnosis and treatment record with the target medical entity.

[0044] For example, the set of directly associated nodes of the patient includes a cardiologist, a rehabilitation doctor, a laboratory doctor, and a specific heart monitoring device. The cardiologist is directly responsible for diagnosis and development of a drug treatment plan, has multiple common diagnosis and treatment records with the patient, such as performing a heart examination on the patient and prescribing drugs for treating cardiovascular disease, etc. The rehabilitation doctor intervenes in the stable period of the patient's condition and guides rehabilitation training, and has common diagnosis and treatment records with the patient during the rehabilitation treatment period. The laboratory doctor is responsible for various blood tests, electrocardiogram tests, etc. on the patient to provide data support for diagnosis, and also has multiple common diagnosis and treatment records with the patient. The specific heart monitoring device monitors the heart condition of the patient in real time during the patient's hospitalization, and the data thereof is an important basis for diagnosis and treatment decisions, and also has a close diagnosis and treatment association with the patient. Each node in the set of directly associated nodes represents an associated medical entity having at least one common diagnosis and treatment record with the target medical entity.

[0045] In step S123, a diagnosis and treatment path matching degree between each node in the set of directly associated nodes and the target medical entity is calculated based on diagnosis and treatment time sequence characteristics and disease type characteristics of each node.

[0046] For example, taking a cardiologist as an example, from the initial diagnosis of the patient to the development of the disease at each stage, the cardiologist is continuously involved in the diagnosis and treatment of cardiovascular diseases. From the initial diagnosis of the degree of cardiovascular stenosis to the subsequent adjustment of the drug treatment plan according to the changes in the disease, the cardiologist's diagnosis and treatment behavior is closely related to the development of the patient's condition, and the diagnosis and treatment path matching degree is calculated by comprehensively considering the diagnosis and treatment time sequence and the disease type characteristics. Assuming that the diagnosis and treatment time sequence is divided into different stages, each stage is given a certain weight, and the disease type matching degree is also set a corresponding weight, the diagnosis and treatment path matching degree of the cardiologist and the patient is calculated by weighting. For example, the diagnosis and treatment time sequence weight is set to 0.6, and the disease type weight is set to 0.4. In terms of diagnosis and treatment time sequence, the cardiologist participated in the key stage of the patient's disease development, scoring 0.8; the disease type is completely matched, scoring 1. Then the diagnosis and treatment path matching degree of the cardiologist is 0.6x0.8+0.4x1=0.88. For the physiotherapist, the diagnosis and treatment time sequence is intervened after a period of drug treatment of the patient, and the disease type is auxiliary cardiovascular disease rehabilitation. Similarly, the diagnosis and treatment path matching degree is calculated according to the above weight and scoring method, assuming that the diagnosis and treatment time sequence score is 0.6, and the disease type score is 0.7, the diagnosis and treatment path matching degree is 0.6x0.6+0.4x0.7=0.64. The diagnosis and treatment path matching degree of the laboratory doctor is also similar, assuming that the diagnosis and treatment time sequence score is 0.7, and the disease type score is 0.8, the diagnosis and treatment path matching degree is calculated to be 0.6x0.7+0.4x0.8=0.74. The diagnosis and treatment path matching degree of the specific heart monitoring device is 0.6x0.75+0.4x0.9=0.81.

[0047] In step S124, the set of directly associated nodes is sorted in descending order of the diagnosis and treatment path matching degree, and the medical record data units corresponding to the nodes with a matching degree higher than a preset threshold are selected to form an initial neighbor data unit set.

[0048] For example, the diagnosis and treatment path matching degrees calculated above are sorted, the cardiologist has the highest matching degree of 0.88, followed by the specific heart monitoring device 0.81, then the laboratory doctor 0.74, and the physiotherapist 0.64. The preset threshold is set to 0.7, so the medical record data units corresponding to the cardiologist, the specific heart monitoring device and the laboratory doctor are selected to form the initial neighbor data unit set. The medical record data unit of the cardiologist contains detailed diagnosis records, drug treatment plan change records, etc.; the medical record data unit of the specific heart monitoring device records the heart data of each monitoring; and the medical record data unit of the laboratory doctor has blood test results, electrocardiogram test results, etc.

[0049] Step S125, performing cross-departmental association expansion on the initial neighbor data unit set, and determining a medical record data unit set containing multi-department diagnosis and treatment features after expansion as the final neighbor data unit set.

[0050] In a possible implementation, step S125 includes:

[0051] Step S1251, parsing the department identifier feature and the disease classification code contained in each medical record data unit in the initial neighbor data unit set.

[0052] For example, the department identifier of the medical record data unit of a cardiologist is the cardiology department, and the disease classification code is a specific code related to cardiovascular diseases; the medical record data unit of a specific heart monitoring device is related to the use of the device for monitoring by the cardiology department; and the department identifier of the medical record data unit of a laboratory doctor is the laboratory department, and the disease classification code is also related to the test index around cardiovascular diseases.

[0053] Step S1252, constructing a diagnosis and treatment path transfer matrix between departments according to the department identifier feature, each element in the diagnosis and treatment path transfer matrix representing a probability value of associated transfer between two departments in historical diagnosis and treatment.

[0054] For example, it is found through statistical historical diagnosis and treatment data that the probability of transferring from the cardiology department to the rehabilitation department for rehabilitation training is 0.3, because some patients need rehabilitation assistance after a period of drug treatment; the probability of transferring from the cardiology department to the laboratory department for examination is 0.8, and relevant tests are basically performed every time; the probability of transferring from the rehabilitation department back to the cardiology department for disease assessment is 0.2; and the probability of transferring from the laboratory department to the cardiology department for feedback of examination results to adjust the treatment plan is 0.9. The diagnosis and treatment path transfer matrix is constructed in this way, and each element in the matrix represents a probability value of associated transfer between two departments in historical diagnosis and treatment.

[0055] Step S1253, for the disease classification code corresponding to the target medical entity, finding the highest transfer probability path between the department to which it belongs and other departments in the diagnosis and treatment path transfer matrix.

[0056] For example, the department to which the disease classification code of the patient belongs is the cardiology department, and the transfer probability between the cardiology department and the laboratory department in the diagnosis and treatment path transfer matrix is 0.8, which is the highest.

[0057] Step S1254, taking the department identifier corresponding to the highest transfer probability path as an expanded department set, and retrieving medical record data units containing the target medical entity and at least one expanded department identifier from the historical medical record data unit set.

[0058] For example, the retrieval finds some records related to special examination items for cardiovascular diseases in addition to the partial medical record data units of the laboratory physician that have been included in the initial neighbor data unit set, which details the detection results of special indicators for cardiovascular diseases that were not fully covered in the initial set.

[0059] In step S1255, the retrieved medical record data units are merged with the initial neighbor data unit set, and after removing duplicate data units, an extended set of cross-department associations is generated.

[0060] For example, the newly retrieved records related to special examination items for cardiovascular diseases can be merged with the medical record data units of the cardiologist, the specific heart monitoring device, and the laboratory physician in the initial neighbor data unit set, and after careful comparison, duplicate data units such as duplicate blood test records are removed, and finally an extended set of cross-department associations containing multi-department diagnosis and treatment characteristics is formed, that is, the final neighbor data unit set. This neighbor data unit set not only contains the diagnosis and treatment information of the cardiology department and the data of the specific heart monitoring device, but also supplements more comprehensive diagnosis and treatment data related to the laboratory department, providing a richer and more accurate information basis for subsequent analysis and processing.

[0061] In one possible implementation, step S130 includes:

[0062] In step S131, in the first-layer attention mechanism, initial attention weights are generated according to the cosine similarity between the core feature vector and the feature vectors of each neighbor data unit.

[0063] Still taking the patient with cardiovascular disease mentioned earlier as an example, for this patient with cardiovascular disease, the core feature vector contains key information such as the degree of cardiovascular stenosis, myocardial ischemia status, medication history, and rehabilitation training participation. The neighbor data unit set contains the diagnosis and treatment records of the cardiologist, the diagnosis and treatment records of the rehabilitation physician, the test reports of the laboratory physician, and the data records of the specific heart monitoring device, etc.

[0064] Taking the diagnosis and treatment records of the cardiologist as an example, the cosine similarity between its feature vector and the core feature vector is calculated. The diagnosis and treatment record feature vector of the cardiologist contains information such as the specific measurement value of cardiovascular stenosis at each diagnosis and treatment, the detailed diagnosis result of myocardial ischemia, the type and dosage of drugs prescribed, etc. By calculating the sum of the products of the two vectors in each dimension, and then dividing by the product of the lengths of the two vectors, the cosine similarity is obtained. Assuming that after detailed calculation, the cosine similarity between the diagnosis and treatment record feature vector of the cardiologist and the core feature vector is 0.85, this 0.85 is the initial attention weight, indicating that the diagnosis and treatment record of the cardiologist has high similarity with the core feature of the patient in many aspects.

[0065] Step S132, multiplying the initial attention weight and the diagnosis time decay factor of each neighbor data unit to generate a time-aware primary weight distribution result, wherein the diagnosis time decay factor is dynamically adjusted according to the interval length between the record time of the medical record data unit and the current time.

[0066] In this embodiment, for the diagnosis record of the cardiologist, it is assumed that the time interval between the latest diagnosis record and the current time is 1 month. According to the preset time decay calculation rule, the closer to the current time, the greater the decay factor. Assuming that the decay factor is set in months, the decay factor is 0.95 for 1 month from the current time (the value is calculated according to the actual set decay function, for example, it can be a function that decreases with the increase of time interval). Then, the time-aware primary weight distribution result of the cardiologist's diagnosis record is 0.85, the initial attention weight, multiplied by the diagnosis time decay factor 0.95, that is, 0.85x0.95=0.8075.

[0067] Step S133, in the intermediate layer attention mechanism, introducing the disease severity feature to correct the primary weight distribution result, specifically including: analyzing the number of complications, the length of treatment period and the medication intensity index recorded in each neighbor data unit to generate a disease severity score, and weighting and superimposing the disease severity score and the primary weight distribution result to generate a corrected intermediate weight distribution result.

[0068] In this embodiment, the number of complications, the length of treatment period and the medication intensity index recorded in the cardiologist's diagnosis record are analyzed to generate a disease severity score. It is assumed that the diagnosis record shows that the patient currently has a mild arrhythmia complication, the treatment period has lasted for 6 months, and the medication intensity is at a medium level. According to the preset disease severity score rule, the number of complications, the length of treatment period and the medication intensity are quantitatively scored respectively. For example, the mild arrhythmia complication score is 3 points (full score 10 points), the 6-month treatment period score is 5 points (full score 10 points, the longer the treatment period, the higher the score), and the medium medication intensity score is 4 points (full score 10 points). Then the disease severity score is calculated by weighting, assuming that the weight of the number of complications is 0.3, the weight of the length of treatment period is 0.3, and the weight of the medication intensity is 0.4, then the disease severity score is 3x0.3+5x0.3+4x0.4=0.9+1.5+1.6=4 points (full score 10 points). The disease severity score and the primary weight distribution result are weighted and superimposed, assuming that the weight of the disease severity score is 0.4 and the weight of the primary weight distribution result is 0.6, then the corrected intermediate weight distribution result is 4x0.4+0.8075x0.6=1.6+0.4845=2.0845.

[0069] Step S134, in the last layer attention mechanism, the intermediate weight distribution result is finally adjusted in combination with the department attribute characteristics of the medical entity, specifically including: detecting the consistency of the department to which each neighbor data unit belongs and the department in which the target medical entity is currently located, and when the department attributes are inconsistent, a cross-department penalty coefficient is applied to the intermediate weight distribution result.

[0070] For example, the consistency of the department to which the cardiologist's diagnosis and treatment record belongs (cardiology department) and the department in which the target medical entity is currently located (assuming that it is still in the cardiology department for diagnosis and treatment) can be detected. Since the department attributes are consistent, no cross-department penalty coefficient is applied to the intermediate weight distribution result, and the intermediate weight distribution result remains 2.0845.

[0071] For the diagnosis and treatment records of the rehabilitation doctor, the calculation is also performed according to the above steps. First, calculate the cosine similarity with the core feature vector, assuming it is 0.7. The rehabilitation doctor's last diagnosis and treatment record is 3 months away from the current time, and according to the time decay rule, the diagnosis and treatment time decay factor at this time is 0.9. Then the primary weight distribution result is 0.7x0.9=0.63. The rehabilitation doctor's diagnosis and treatment record shows that the patient's rehabilitation training progress is normal, there is no obvious complication, and the treatment cycle is 3 months, and the drug intensity is low. According to the disease severity scoring rule, after quantitative scoring, it is assumed that the disease severity score is 2 points (full score 10 points). After weighting and superposition, the intermediate weight distribution result is 2x0.4+0.63x0.6=0.8+0.378=1.178. Since the department attribute of the rehabilitation department is inconsistent with the department attribute of the cardiology department where the current patient is located, it is assumed that the cross-department penalty coefficient is 0.8, then the final adjusted weight is 1.178x0.8=0.9424.

[0072] For the test report of the laboratory doctor and the data record of the specific heart monitoring equipment, the respective weight distribution results after multi-layer adjustment are also calculated according to the same process.

[0073] Step S135, the multi-layer adjusted weight distribution results are normalized to obtain the final attention weight value of each neighbor data unit, and the corresponding weighted feature vector is output according to the final attention weight value of each neighbor data unit.

[0074] Assuming that the cardiologist diagnosis record weight is 2.0845, the rehabilitation doctor diagnosis record weight is 0.9424, the laboratory report weight is 1.5, and the specific heart monitoring device data record weight is 1.2. The total weight is 2.0845+0.9424+1.5+1.2=5.7269. Then the final attention weight value of the cardiologist diagnosis record is 2.0845÷5.7269≈0.364, the final attention weight value of the rehabilitation doctor diagnosis record is 0.9424÷5.7269≈0.165, the final attention weight value of the laboratory report is 1.5÷5.7269≈0.262, and the final attention weight value of the specific heart monitoring device data record is 1.2÷5.7269≈0.209. According to these final attention weight values, the original feature vector of each neighbor data unit is weighted and calculated respectively to output the corresponding weighted feature vector. For example, the original feature vector of the cardiologist diagnosis record is [a1, a2, a3], and its weighted feature vector is [0.364×a1, 0.364×a2, 0.364×a3].

[0075] In one possible implementation, step S140 includes:

[0076] Step S141, the primary weighted feature vector output by the first-layer attention mechanism is processed for feature dimension reduction, and key dimensions related to the disease classification are retained.

[0077] Taking the primary weighted feature vector generated by the cardiologist diagnosis record as an example, this vector may contain information of numerous dimensions, such as detailed time of each diagnosis, accurate numerical value of specific drug dosage, detailed data of various examination indexes, etc. Through dimension reduction processing by principal component analysis or other methods, according to the disease classification characteristics of cardiovascular diseases, key dimensions such as cardiovascular stenosis degree, myocardial ischemia condition, and key drug categories are retained. Assuming that the original primary weighted feature vector is a 10-dimensional vector, after dimension reduction, 3 key dimensions are retained, becoming a 3-dimensional vector.

[0078] Step S142, the primary weighted feature vector after dimension reduction is input into the bidirectional gated recurrent unit to capture the forward and reverse dependence relationship of the diagnosis features in the time sequence.

[0079] In this embodiment, the bidirectional gated recurrent unit analyzes the feature changes of this 3-dimensional vector at different time points. For example, how the cardiovascular stenosis degree gradually develops over time, what influence the previously used drugs have on the myocardial ischemia condition, and the future development trend, etc. Through the processing of the bidirectional gated recurrent unit, it can learn the forward dependence relationship of the diagnosis features in the time sequence, i.e., the development trend from the past to the present, and also capture the reverse dependence relationship, i.e., the influence of the past on the current condition.

[0080] Step S143, the hidden state of the last time step of the bidirectional gated recurrent unit is extracted as the temporal fusion feature, and the temporal fusion feature is dot producted with the intermediate weighted feature vector output by the intermediate layer attention mechanism to generate an intermediate fusion result.

[0081] Suppose that after the calculation of the bidirectional gated recurrent unit, the hidden state of the last time step is a new 3-dimensional vector [b1, b2, b3], which is the temporal fusion feature.

[0082] Suppose that the intermediate weighted feature vector output by the intermediate layer attention mechanism is [c1, c2, c3], and the dot product operation is to multiply the corresponding dimensions to obtain the intermediate fusion result vector [b1×c1, b2×c2, b3×c3].

[0083] Step S144, the intermediate fusion result is spliced with the final weighted feature vector output by the end layer attention mechanism to form a cross-layer spliced feature vector.

[0084] Suppose that the final weighted feature vector output by the end layer attention mechanism is [d1, d2, d3], and the cross-layer spliced feature vector obtained after splicing is [b1×c1, b2×c2, b3×c3, d1, d2, d3], which becomes a 6-dimensional vector.

[0085] Step S145, the cross-layer spliced feature vector is added to the original core feature vector through residual connection, and layer normalization method is used to eliminate feature scale difference to generate the comprehensive feature expression.

[0086] Suppose that the original core feature vector is [e1, e2, e3], and it is added to the cross-layer spliced feature vector in corresponding dimensions to obtain a new 6-dimensional vector [f1, f2, f3, f4, f5, f6], where f1=b1×c1+e1, f2=b2×c2+e2, f3=b3×c3+e3, f4=d1, f5=d2, f6=d3. Then, the layer normalization method is used to normalize each dimension of the new vector, so that the feature distribution of each dimension is within a reasonable range. For example, for dimension f1, the normalized result is (f1-the mean of this dimension)÷the standard deviation of this dimension. After processing all dimensions in this way, the comprehensive feature expression of the target medical entity (the cardiovascular disease patient) is finally generated, which comprehensively integrates the information of multiple neighbor data units and the information of the core feature vector, and through multi-layer processing and fusion, more comprehensively and accurately reflects the patient's condition and diagnosis and treatment, providing high-quality input data for subsequent medical recommendation models.

[0087] In one possible implementation, step S150 includes:

[0088] Step S151, the comprehensive feature expression is divided into a disease feature segment, a treatment feature segment and a prognosis feature segment, which are respectively input into the time series prediction branches arranged in parallel in the medical recommendation model.

[0089] In this embodiment, for the comprehensive feature expression of the cardiovascular disease patient, the disease feature segment contains specific numerical changes such as the degree of cardiovascular stenosis, detailed indicators of myocardial ischemia, and other information reflecting the characteristics and development trend of the patient's disease; the treatment feature segment covers the names of various drugs used, dose adjustment, and treatment methods such as surgery and rehabilitation training arrangements; the prognosis feature segment involves the effect evaluation of rehabilitation training and the risk estimation of possible complications.

[0090] Step S152, in each time series prediction branch, an expanded convolutional neural network is used to capture feature change patterns at different time scales, wherein the expansion factor of the expanded convolution is dynamically set according to the historical data sampling frequency of the corresponding feature segment.

[0091] For example, in a possible implementation, step S152 includes:

[0092] Step S1521, taking the disease feature segment, the treatment feature segment or the prognosis feature segment corresponding to the time series prediction branch as an input feature segment, extracting the historical data sampling frequency of the input feature segment.

[0093] Step S1522, determining an initial expansion factor based on the historical data sampling frequency, and generating a dynamically adjusted target expansion factor after aligning the initial expansion factor with a preset reference time scale.

[0094] Taking the disease feature segment as an example, the historical data sampling frequency of the feature segment is extracted. Assuming that in the past diagnosis and treatment process, detailed examination records are made every half month for disease features such as the degree of cardiovascular stenosis and the condition of myocardial ischemia, i.e. the historical data sampling frequency is once every half month. The initial expansion factor is determined based on the sampling frequency. Assuming that according to the setting rules, the initial expansion factor corresponding to the sampling frequency of once every half month is 2. The preset reference time scale is assumed to be one week. In order to align the expansion factor with the reference time scale, corresponding adjustment is made. Since half a month is 14 days and one week is 7 days, the ratio is 2:1, so the dynamically adjusted target expansion factor is 4 (i.e. the initial expansion factor 2 multiplied by the ratio 2).

[0095] Step S1523, inputting the input feature segment into stacked expanded convolutional layers, wherein the expansion factor of each expanded convolutional layer is increased according to the target expansion factor, and local feature normalization operations are inserted between adjacent expanded convolutional layers to generate multi-scale preliminary features.

[0096] For example, the expansion factor of the first expansion convolution layer is 4, which convolves the input disease feature segment data to extract feature information from the data through the convolution kernel, obtaining a preliminary feature representation. Then, local feature normalization is performed on these features to adjust the feature values to an appropriate range, making them more stable and comparable. Then enter the second expansion convolution layer, the expansion factor becomes 8, and the convolution operation is performed again to further extract more complex and abstract features, and then the local feature normalization is also performed. In this way, after the processing of multiple expansion convolution layers, multi-scale preliminary features are generated, which cover disease feature information at different scales.

[0097] In step S1524, the multi-scale preliminary features are fused with the historical time sequence sliding window features of the input feature segment to generate cross-layer features containing long and short-term dependencies.

[0098] For example, when analyzing the changes in the degree of cardiovascular stenosis, not only the features at the current time are considered, but also the trends in the past few time windows. Suppose the historical time sequence sliding window is set to contain data from the past three months, through the cross-layer feature fusion operation, the multi-scale preliminary features at different time scales are combined with the features in the historical time sequence sliding window, so that the model can capture the dependence of disease features on long and short-term time series, such as how the degree of cardiovascular stenosis gradually develops, the fluctuations in the short term, and the long-term trends, etc.

[0099] In step S1525, a time attention mechanism is applied to the cross-layer features to generate time attention weights according to the feature fluctuation amplitude and time interval length of each time node, and then the time adjustment features are generated by multiplying the time attention weights with the cross-layer features.

[0100] In the disease feature segment, the cardiovascular stenosis degree and myocardial ischemia status at different time nodes may have different fluctuation amplitudes. For example, the cardiovascular stenosis degree changes greatly and has a high fluctuation amplitude in a certain time period, while it changes relatively smoothly in another time period. At the same time, the interval length from the current time to different time nodes is also different. According to these factors, the time attention weight of each time node is calculated. Suppose that at a certain time node, the cardiovascular stenosis degree has a large fluctuation amplitude and is close to the current time, according to the set calculation rule, the time attention weight of this time node is high, for example, 0.8; while the fluctuation amplitude of another time node is small and it is far from the current time, the weight is 0.2. Multiply these time attention weights with the corresponding cross-layer features, for example, if the cross-layer feature value of a certain dimension is 10, multiplied by the weight 0.8, the adjusted feature value of that dimension is 8, thereby generating time adjustment features, highlighting the feature information of important time nodes.

[0101] Step S1526, input the time adjustment feature into the gating convolution unit, filter the feature elements with strong relevance to the current time scale through the learnable gating parameters, and generate the time gated feature.

[0102] The learnable gating parameters in the gating convolution unit are learned and adjusted according to the input time adjustment feature. For example, for the disease feature of cardiovascular disease, some specific indicators such as the severity of recent myocardial ischemia are more critical to the diagnosis and treatment decision at the current time scale. The gating parameters will filter each element in the time adjustment feature according to these conditions, enhance the feature elements with strong relevance to the current time scale, and suppress the elements with weak relevance. Assuming that an element value of 5 about the degree of cardiovascular stenosis in the time adjustment feature is adjusted to 7 after the filtering of the gating convolution unit according to the requirements of the current time scale and the action of the learnable gating parameters, the time gated feature is generated.

[0103] Step S1527, dynamically associate and map the time gated feature with the target dilation factor, update the dilation factor configuration of the next time step, and output the prediction feature of the time series prediction branch.

[0104] For example, according to the current disease feature reflected by the time gated feature and the target dilation factor, the dilation factor of the next time step is dynamically adjusted. For example, if the time gated feature shows that the disease feature changes more complexly, more fine-grained feature extraction is needed, and then the dilation factor of the next time step may be appropriately increased. Assuming that the current target dilation factor is 8, according to the time gated feature and the dynamic association mapping rule, the dilation factor of the next time step is updated to 10. Finally, the prediction feature of the disease feature segment time series prediction branch is output.

[0105] For the treatment feature segment and the prognosis feature segment, the same steps are performed. The treatment feature segment determines the dilation factor according to the historical data sampling frequency of drug use and treatment methods, and outputs the prediction feature of the treatment feature segment after the operations of the dilation convolution layer, the cross-layer feature fusion, the time attention mechanism, and the gating convolution unit. The prognosis feature segment also outputs the corresponding prediction feature after a series of processing according to its own historical data sampling frequency and other information.

[0106] Step S153, after the modal alignment of the prediction features output by each time series prediction branch, the prediction features are spliced to generate a multi-modal fusion prediction vector.

[0107] In one possible implementation, step S153 includes:

[0108] Step S1531, detecting the dimension difference of the disease feature segment prediction feature, the treatment feature segment prediction feature and the prognosis feature segment prediction feature output by each of the time series prediction branches, when the dimensions are inconsistent, mapping the disease feature segment prediction feature, the treatment feature segment prediction feature and the prognosis feature segment prediction feature to a unified dimension space through a shared linear projection matrix, and generating a unified dimension space feature.

[0109] Suppose that the disease feature segment prediction feature is a 10-dimensional vector containing different quantitative indicators of the degree of cardiovascular stenosis, various parameters of myocardial ischemia and other information; the treatment feature segment prediction feature is an 8-dimensional vector covering the types of drugs used, dose changes and related encodings of treatment methods; and the prognosis feature segment prediction feature is a 12-dimensional vector involving multiple evaluation indicators of rehabilitation training effect and risk levels of possible complications. Since the dimensions of the three prediction features are inconsistent, they need to be mapped to a unified dimension space through a shared linear projection matrix.

[0110] Suppose that the preset unified dimension space is 15-dimensional. The shared linear projection matrix will map the disease feature segment prediction feature from 10-dimensional to 15-dimensional through a series of complex linear transformations according to the characteristics of each prediction feature vector. Specifically, for each dimension of the disease feature segment prediction feature, the linear projection matrix will assign different weights for calculation according to its relevance to the unified dimension space. For example, the degree of cardiovascular stenosis may be multiplied by the corresponding row vector of the linear projection matrix according to its importance in the unified dimension space to obtain the value in the new dimension space. Similarly, the treatment feature segment prediction feature is mapped from 8-dimensional to 15-dimensional, and the prognosis feature segment prediction feature is mapped from 12-dimensional to 15-dimensional, finally generating the unified dimension space feature.

[0111] Step S1532, calculating the cosine similarity matrix between the disease feature segment prediction feature and the treatment feature segment prediction feature in the unified dimension space feature, and identifying the target feature pair with a similarity higher than a preset threshold from the cosine similarity matrix.

[0112] For each pair of dimensions in the unified dimension space of the disease feature segment prediction feature and the treatment feature segment prediction feature, the cosine similarity is calculated. Taking the first dimension as an example, assuming that the value of the disease feature segment prediction feature in this dimension is a1, and the value of the treatment feature segment prediction feature in this dimension is b1. First, the dot product a1x b1 is calculated, and then the modulus of the two vectors in this dimension is calculated respectively, the modulus of the disease feature segment prediction feature in this dimension is the square root of a1, and the modulus of the treatment feature segment prediction feature in this dimension is the square root of b1. Then the dot product is divided by the product of the two moduli, and the cosine similarity between the two dimensions is obtained. All dimensions are calculated in this way to form a two-dimensional cosine similarity matrix.

[0113] Assuming that the preset threshold is 0.6. In the generated cosine similarity matrix, each element is checked one by one. For example, it is found that the cosine similarity between the 3rd dimension of the disease feature segment prediction feature and the 5th dimension of the treatment feature segment prediction feature is 0.7, which is greater than the preset threshold 0.6, so this pair of features is identified as the target feature pair. There may be other feature pairs that meet the conditions, such as the cosine similarity between the 7th dimension of the disease feature segment prediction feature and the 4th dimension of the treatment feature segment prediction feature is 0.8, etc., which are all target feature pairs.

[0114] In step S1533, a bidirectional feature exchange operation is performed on the target feature pair, the feature element at the corresponding position in the disease feature segment prediction feature is replaced by the corresponding element of the treatment feature segment prediction feature, and the feature element at the corresponding position in the treatment feature segment prediction feature is replaced by the original element of the disease feature segment prediction feature to generate the exchanged feature.

[0115] Taking the target feature pair of the 3rd dimension of the disease feature segment prediction feature and the 5th dimension of the treatment feature segment prediction feature as an example, the feature element in the 3rd dimension of the disease feature segment prediction feature is replaced by the corresponding element in the 5th dimension of the treatment feature segment prediction feature, and the feature element in the 5th dimension of the treatment feature segment prediction feature is replaced by the original element in the 3rd dimension of the disease feature segment prediction feature. All identified target feature pairs are operated in this way to generate the exchanged feature.

[0116] In step S1534, the cross-modal maximum pooling processing is performed on the exchanged feature, and the maximum value in each feature dimension of the disease feature segment prediction feature, the treatment feature segment prediction feature and the prognosis feature segment prediction feature is extracted to generate the pooled feature vector.

[0117] In the exchanged feature, for each feature dimension of the disease feature segment prediction feature, the treatment feature segment prediction feature and the prognosis feature segment prediction feature, compare their values in the three feature segments, and extract the maximum value. For example, in a certain feature dimension, the value of the disease feature segment prediction feature is 5, the value of the treatment feature segment prediction feature is 7, and the value of the prognosis feature segment prediction feature is 3. After cross-modal maximum pooling processing, the output value of this dimension is 7. Perform such operations on all dimensions to generate a pooled feature vector.

[0118] In step S1535, the pooled feature vector is spliced into a multi-channel fusion matrix along the feature channel dimension, and a channel attention mechanism is applied to the multi-channel fusion matrix. The channel weight is dynamically adjusted according to the activation frequency of each channel in the historical training, and the multi-modal fusion prediction vector is generated.

[0119] Suppose the pooled feature vector is a vector of length 15, which is arranged along the feature channel dimension according to certain rules to form a matrix. For example, the first 5 elements are taken as the first channel, the middle 5 elements are taken as the second channel, and the last 5 elements are taken as the third channel to form a multi-channel fusion matrix.

[0120] During the historical training process, the activation frequency of each channel is recorded. Suppose in the cardiovascular disease diagnosis and treatment data training, the activation frequency of the channel related to the degree of cardiovascular stenosis is high, which is 0.8; the activation frequency of the channel related to the treatment method is 0.6; and the activation frequency of the channel related to the prognosis evaluation is 0.7. According to these activation frequencies, the channel weight is dynamically adjusted. For example, the weight of the channel related to the degree of cardiovascular stenosis with high activation frequency is adjusted to 0.4; the weight of the channel related to the treatment method is adjusted to 0.3; and the weight of the channel related to the prognosis evaluation is adjusted to 0.3. Through such adjustment, a multi-modal fusion prediction vector is generated.

[0121] In step S154, the multi-modal fusion prediction vector is input into a fully connected layer network to calculate the recommended priority score. The error gradient between the recommended priority score and the true diagnosis and treatment record label is back propagated to the dilated convolutional neural network and the fully connected layer network through the back propagation algorithm, and the convolution kernel parameters and the fully connected layer weights of the medical recommendation model are updated.

[0122] Assuming that the multi-modal fusion prediction vector is input into the full connection layer network, after a series of weight calculations and nonlinear transformations, the output recommendation priority score is 0.6. While the real diagnosis and treatment record label corresponds to a score of 0.7, there is an error of 0.1. Through the back propagation algorithm, the error gradient is propagated from the full connection layer network to the dilated convolutional neural network. During the back propagation process, the error is adjusted according to the convolution kernel parameters and the full connection layer weights. For example, for a certain convolution kernel parameter, according to the direction and size of the error, adjust it according to a certain learning rate. Assuming that the convolution kernel parameter is originally 0.5, the learning rate is 0.1, and the error gradient indicates that the parameter needs to be increased, then the adjusted convolution kernel parameter is 0.5+0.1x0.1=0.51. The full connection layer weights are also adjusted in a similar manner. By repeatedly this process, the medical recommendation model can output more accurate recommendation priority scores, optimize the performance of the model, and better provide accurate recommendations for the patient's subsequent diagnosis and treatment process.

[0123] In one possible implementation, after step S140, the method further includes:

[0124] Step S210, obtaining a new medical record data unit in the current diagnosis and treatment environment, and extracting a real-time feature vector in the new medical record data unit.

[0125] In the diagnosis and treatment process of the patient, a new medical record data unit appears in the current diagnosis and treatment environment. For example, the patient has just undergone a latest heart ultrasound examination, and the examination report is a new medical record data unit. The real-time feature vector is extracted from this report, which may include the accurate value of the newly measured cardiovascular stenosis degree, the latest state indicator of the myocardium, and other information.

[0126] Step S220, similarity matching the real-time feature vector with the comprehensive feature expression, and triggering the online update mechanism of the medical recommendation model when the output feature exceeds the dynamic threshold.

[0127] The online update mechanism includes: inputting the real-time feature vector and the historical feature vector into the incremental training module, fine-tuning the weight distribution ratio in the attention mechanism based on the original model parameters, and calculating the importance score of the historical training data during the fine-tuning process. Parameters with an importance score greater than a set score are subject to update constraints, and a fine-tuned medical recommendation model is obtained.

[0128] In this embodiment, the similarity between the real-time feature vector and the previously generated comprehensive feature expression can be calculated. For example, using the cosine similarity calculation method, first calculate the dot product of the two vectors, then calculate their module lengths respectively, and then get the similarity value by dividing the dot product by the product of the module lengths. Assuming that the dynamic threshold is set to 0.7. When the calculated similarity value exceeds 0.7, it indicates that the current real-time situation has a greater correlation with the situation represented by the previous comprehensive feature expression and changes significantly, at which time the online updating mechanism of the medical recommendation model is triggered.

[0129] The online updating mechanism includes inputting the real-time feature vector and the historical feature vector into the incremental training module together, and fine-tuning the weight distribution ratio in the attention mechanism based on retaining the original model parameters. In the incremental training module, for the real-time feature vector and the historical feature vector, the weight distribution ratio in the attention mechanism is fine-tuned according to their performance in different neighbor data units and their relationship with the core feature vector. For example, in the previous calculation, the attention weight of the cardiologist diagnosis record is 0.3, and through the analysis of the incremental training module, it is found that the current real-time feature vector is more closely related to the cardiologist diagnosis record, and the attention weight may be fine-tuned to 0.35.

[0130] During the fine-tuning process, the importance score of the historical training data is calculated, and an update constraint is applied to the parameters with an importance score greater than a set score. For each data point in the historical training data, the importance score is calculated according to the degree of influence on the model performance, the relevance to the current real-time situation, and other factors. Assuming that the set score is 0.5. If the importance score of a certain historical data point is greater than 0.5, for example, 0.6, it indicates that the data point is important to the model, and an update constraint is applied to the parameters related to the data point during parameter updating, so that they will not be adjusted too much, to ensure the stability and accuracy of the model. After such fine-tuning, the fine-tuned medical recommendation model is obtained.

[0131] Step S230, deploy the fine-tuned medical recommendation model to the real-time recommendation engine, and synchronize the calculation logic of the recommendation priority score.

[0132] In this embodiment, the adjusted and optimized medical recommendation model can be deployed to the real-time recommendation engine, so that it can play a role in real-time during actual diagnosis and treatment. At the same time, according to the change of the model, the calculation logic of the recommendation priority score is synchronized. For example, before calculating the recommendation priority score, the weight of a certain feature is 0.2, and after the model is updated, the weight of the feature may be adjusted to 0.25, accordingly, the calculation formula and calculation process of the recommendation priority score will also be adjusted to ensure that more accurate recommendation priority scores can be provided according to the latest patient situation.

[0133] In a possible implementation, after step S220, the method further includes:

[0134] Step S310, constructing a verification dataset containing normal diagnosis and treatment mode samples and abnormal operation samples, the abnormal operation samples containing records of off-label use of drugs and operation sequences not conforming to diagnosis and treatment paths.

[0135] In this embodiment, for the cardiovascular disease patients mentioned above, the normal diagnosis and treatment mode samples are collected from a large number of cases successfully treating such diseases and following standard diagnosis and treatment processes. For example, in these cases, the doctors reasonably select drug treatment programs according to the degree of cardiovascular stenosis and the condition of myocardial ischemia of the patients, such as for patients with mild cardiovascular stenosis and not serious myocardial ischemia, standard anti-platelet drugs and appropriate lipid-lowering drugs are prescribed, and regular reviews are arranged. The review period is usually set to one month, during which the patient's symptoms and physiological indicators such as blood pressure and blood lipids are closely monitored. The operation records in these cases, including the time of each diagnosis and treatment, the treatment methods adopted, the types and dosages of drugs used, and other detailed information, constitute the normal diagnosis and treatment mode samples.

[0136] The abnormal operation samples include records of off-label use of drugs and operation sequences not conforming to diagnosis and treatment paths. For example, in the sample with records of off-label use of drugs, the doctor may have incorrectly prescribed contraindicated drugs without considering the patient's specific condition and physical condition. For such cardiovascular disease patients, certain drugs may exacerbate the symptoms of myocardial ischemia, but the doctor ignored this risk factor and prescribed such drugs. In terms of operation sequences not conforming to diagnosis and treatment paths, under normal circumstances, for such cardiovascular disease patients, rehabilitation training is arranged after a period of drug treatment and the patient's condition is stable, but in the abnormal operation sample, high-intensity rehabilitation training may be arranged too early when the patient's condition has not reached the appropriate stage, thereby adversely affecting the patient's condition. These normal diagnosis and treatment mode samples and abnormal operation samples are integrated together to construct a verification dataset, which is used for subsequent evaluation and training of the medical recommendation model.

[0137] Step S320, in the incremental training process, the normal diagnosis and treatment mode samples and the abnormal operation samples are alternately input into the medical recommendation model, and the difference in the recommended priority score of the medical recommendation model for the normal diagnosis and treatment mode samples and the abnormal operation samples is recorded.

[0138] Specifically, when a normal diagnosis and treatment mode sample is input, the medical recommendation model analyzes and evaluates each operation in the sample according to its internal algorithm and learned knowledge, and gives a recommended priority score. For example, for a standard drug treatment plan sample, the model may give a higher recommended priority score, for example, 0.8 points (full score 1 point), according to the efficacy, safety and matching degree of the drug to the patient's condition. When an abnormal operation sample is input, such as a sample containing a record of illegal drug use, the model will also evaluate and give a score. Since illegal drug use may cause potential harm to the patient and does not conform to the normal diagnosis and treatment logic, the model may give a lower score, for example, 0.2 points. In this way, the difference in recommended priority scores between the normal diagnosis and treatment mode sample and the abnormal operation sample is recorded, and the difference this time is 0.8-0.2=0.6 points. During the entire incremental training process, different normal diagnosis and treatment mode samples and abnormal operation samples are alternately input, and the score difference between them is continuously recorded to timely discover the changes in the model's ability to identify abnormal operations.

[0139] Step S330, when it is detected that the score difference of the medical recommendation model for the abnormal operation sample is lower than the safety threshold, an adversarial training mechanism is started, which includes generating an adversarial sample similar to the features of the abnormal operation sample but adding hidden perturbation features.

[0140] Suppose the safety threshold is set to 0.5 points, if in a certain record, the model's score for a normal diagnosis and treatment mode sample is 0.7 points, and the score for a new abnormal operation sample is 0.3 points, the score difference is 0.7-0.3=0.4 points, which is lower than the safety threshold of 0.5 points. At this time, the adversarial training mechanism is started, and an adversarial sample similar to the features of the abnormal operation sample but adding hidden perturbation features is generated. For example, for the previously mentioned abnormal operation sample of early scheduling of high-intensity rehabilitation training, the generated adversarial sample makes hidden perturbations to the intensity and time arrangement of rehabilitation training while keeping the overall operation framework similar. For example, the intensity of rehabilitation training is slightly increased, and the training time is advanced to a more unreasonable stage, but these changes do not make the sample appear too obvious abnormality, thereby forming an adversarial sample with hidden perturbation features.

[0141] Step S340, in the adversarial training phase, the output score difference of the medical recommendation model for the normal diagnosis and treatment mode sample and the adversarial sample is forced to be greater than a preset safety interval.

[0142] The preset safety interval is 0.6. During the adversarial training process, the parameters of the model are constantly adjusted to enable the model to more accurately distinguish between normal diagnosis and treatment patterns and abnormal operations. For example, by adjusting the parameters in the model related to disease assessment, treatment plan selection, etc., the model's score for normal diagnosis and treatment pattern samples is more reasonably increased, and the score for adversarial samples is more reasonably decreased. After multiple training and parameter adjustment, the model's score for normal diagnosis and treatment pattern samples is stabilized at about 0.85, and the score for adversarial samples is stabilized at about 0.2, with a score difference of 0.85-0.2=0.65, which is greater than the preset safety interval of 0.6, thereby improving the model's ability to identify abnormal operations.

[0143] In step S350, whether the fine-tuned medical recommendation model version is put into the actual application environment by monitoring the stability indicators of the medical recommendation model after adversarial training.

[0144] The stability indicators include the consistency of the model's score for the same type of samples within a period of time, the adaptability of the model to new samples, etc. For example, within a period of time after adversarial training, similar normal diagnosis and treatment pattern samples and adversarial samples are input multiple times, and it is observed whether the scores given by the model are relatively stable. If the model's score for similar normal diagnosis and treatment pattern samples always remains between 0.8-0.85, and the score for similar adversarial samples always remains between 0.15-0.2, it indicates that the model has good consistency in scoring. At the same time, when some new, unseen samples are input, the model can reasonably give scores, and the score trend is consistent with the previous training results, indicating that the model has good adaptability. When these stability indicators all meet certain standards, it is considered that the model is stable enough, and the fine-tuned medical recommendation model version can be put into the actual application environment.

[0145] For example, in one possible implementation, after step S150, the method further includes:

[0146] In step S410, a set of real-time diagnosis and treatment operation records in the current diagnosis and treatment cycle is obtained, the timestamp and operation type code of each operation event in the set of real-time diagnosis and treatment operation records are extracted, and the set of real-time diagnosis and treatment operation records and the set of historical medical record data units are aligned according to the preset time window based on the timestamp, generating an aligned operation sequence that contains time continuity and carries operation type codes.

[0147] For example, in the current diagnosis and treatment cycle, the patient has a new heart examination, and the real-time diagnosis and treatment operation record set records the detailed information of this examination, including the examination time (time stamp), examination type (operation type code), etc. Assuming that the preset time window is one week, the current real-time diagnosis and treatment operation record is aligned with the historical medical record data unit set in the past week. The historical medical record data unit set contains the patient's previous diagnosis and treatment information, such as drug taking records, rehabilitation training records, etc. Through the matching of the time stamp, the heart examination operation in the real-time diagnosis and treatment operation record is associated with the related operations in the historical medical record data unit set in the same time period, generating a continuous alignment operation sequence containing different operation type codes, which shows the operation sequence of the patient in the current diagnosis and treatment cycle and the association with the historical operation.

[0148] In step S420, the alignment operation sequence is input into the optimized medical recommendation model, the recommendation priority score of each operation event in the real-time diagnosis and treatment operation record set is recalculated, a new recommendation priority score set is generated, and based on the difference distribution between the new recommendation priority score set and the historical recommendation priority score set, a target operation event set with a score difference exceeding a dynamic tolerance threshold is screened out.

[0149] For example, after inputting the generated alignment operation sequence into the optimized medical recommendation model, the model will reevaluate each operation event in it. For the heart examination operation performed before, the model gives a new recommendation priority score according to the patient's current condition, the necessity of examination, etc., assuming it is 0.7 points. In the historical recommendation priority score set, the score of a similar heart examination operation under the condition at that time may be 0.6 points. The score difference is calculated as 0.7-0.6=0.1 points. Assuming that the dynamic tolerance threshold is 0.05 points, since 0.1 points is greater than 0.05 points, the heart examination operation event is screened as a target operation event. All operation events are calculated and screened in this way to obtain the target operation event set.

[0150] In step S430, the diagnosis and treatment context feature vector and the disease classification code corresponding to each abnormal operation event are extracted from the target operation event set, and the diagnosis and treatment context feature vector and the disease classification code are matched with each rule in the pre-stored compliance diagnosis and treatment rule library to generate a deviation score of each rule corresponding to the current abnormal operation event.

[0151] For example, in the target operation event set, it is found that a doctor did not increase the drug dosage or adjust the treatment plan as usual when the patient's myocardial ischemia was more serious. The diagnosis and treatment context feature vector of the abnormal operation event is extracted, which contains the specific indicators of the patient's myocardial ischemia at that time, the degree of cardiovascular stenosis, the types of drugs used, and other information, and the disease classification code is clearly coded as the myocardial ischemia related code in cardiovascular diseases. Then match the information with each rule in the pre-stored compliance diagnosis and treatment rule library. A rule in the compliance diagnosis and treatment rule library stipulates that when the patient's myocardial ischemia index reaches a certain range, the dosage of a certain drug should be increased accordingly. Compare the abnormal operation event with this rule, and calculate the deviation score based on the deviation degree of the myocardial ischemia index and the failure to adjust the drug dosage. Assuming that through a series of complex assessments and calculations, the deviation score of the rule corresponding to the current abnormal operation event is 0.8 points (full score 1 point, the higher the score, the greater the deviation). Each abnormal operation event in the target operation event set is matched and scored with all rules in the compliance diagnosis and treatment rule library.

[0152] In step S440, the target rule with the highest deviation degree is selected from the compliance diagnosis and treatment rule library according to the deviation score, the mandatory constraint condition in the target rule is extracted, the mandatory constraint condition is converted into a constraint vector matching the output layer dimension of the medical recommendation model, and the constraint vector is superimposed on the score calculation node of the output layer to generate a priority score modification value after constraint enhancement.

[0153] For example, after matching and scoring all abnormal operation events with the compliance diagnosis and treatment rule library, it is found that a rule has the highest deviation score of 0.9 points for a certain abnormal operation event. The mandatory constraint condition of this rule is that the dosage of a specific drug must be increased when the patient's myocardial ischemia is severe. The mandatory constraint condition is converted into a constraint vector matching the output layer dimension of the medical recommendation model. Assuming that the output layer dimension of the medical recommendation model is a vector space containing multiple score factors, the mandatory constraint condition is converted into a vector whose value in the corresponding dimension represents the degree of influence on the score. For example, a large value is set in the dimension related to the drug dosage to highlight the importance of the constraint condition. Then the constraint vector is superimposed on the score calculation node of the output layer to adjust the original score calculation. Assuming that the original recommended priority score calculation value is 0.6 points, and after the superposition and adjustment of the constraint vector, the constraint enhanced priority score modification value is 0.4 points, so that the score of the abnormal operation event is more in line with the requirements of compliance diagnosis and treatment.

[0154] Step S450, adjust the parameter update gradient direction of the medical recommendation model according to the priority score correction value, suppress the weight proportion of the score error corresponding to the abnormal operation event in back propagation, and deploy the adjusted medical recommendation model to the real-time recommendation engine to update the position of the target medical entity in the recommendation priority ranking list.

[0155] For example, according to the difference between the priority score correction value 0.4 and the original score 0.6, it is analyzed that the model has an error in the score of the abnormal operation event. By adjusting the model parameter update gradient direction, the model reduces the weight allocation of the factors leading to the abnormal score in subsequent training and calculation. In the back propagation process, the weight proportion of the features and parameters related to the abnormal operation event is reduced, avoiding the recurrence of similar errors. After these adjustments, the medical recommendation model is deployed to the real-time recommendation engine, so that the model can run in real time in the actual diagnosis and treatment process. At the same time, according to the update of the model, the position of the target medical entity in the recommendation priority ranking list is recalculated. For example, due to the adjustment of the score of the abnormal operation event, a certain treatment plan originally ranked higher in the recommendation priority ranking list may have its position in the list decreased because the associated abnormal operation event is adjusted in score, thereby updating the entire recommendation priority ranking list to provide more accurate and more compliant diagnosis and treatment recommendations for doctors.

[0156] Step S460, real-time collection of the operation adoption rate and the misoperation trigger rate of the recommendation priority ranking list in the diagnosis and treatment decision interface, when the misoperation trigger rate exceeds the preset safety threshold, triggering the model parameter rollback instruction, loading the medical recommendation model parameter snapshot with the lowest misoperation trigger rate in the historical version according to the parameter rollback instruction, replacing the model parameters of the current version, and re-executing the score calculation and constraint vector superposition process of the alignment operation sequence.

[0157] For example, in the diagnosis and treatment decision interface, the adoption of the recommended scheme in the recommended priority list by the doctor is monitored in real time, and the operation adoption rate is calculated. At the same time, the misoperation situation caused by various reasons is counted, and the misoperation trigger rate is calculated. Assuming that the preset safety threshold is 5%. If in a period of time, it is found that the misoperation trigger rate has reached 7%, which exceeds the preset safety threshold. At this time, the model parameter rollback instruction is triggered, and from the historical version of the model parameter record, the parameter snapshot with the lowest misoperation trigger rate is found. Assuming that there are multiple parameter snapshots in the historical version, after comparison, it is found that the model of a certain version has a misoperation trigger rate of only 3% in the running process, and the parameter snapshot of this version is selected. Replace the model parameters of the current version with the model parameters of the historical version, and then re-execute the score calculation and constraint vector superposition process of the alignment operation sequence. Process the real-time diagnosis and treatment operation record set again, calculate the recommended priority score according to the new model parameters, and select the abnormal operation event again, and perform the constraint vector superposition operation, so as to ensure that the model can provide more reliable and accurate diagnosis and treatment recommendations, reduce the occurrence of misoperation, and improve the quality and safety of medical services.

[0158] Figure 2 A schematic diagram of exemplary hardware and software components of a medical record data processing system 100 based on a medical large model that can implement the idea of the present application is shown. For example, the processor 120 can be used in the medical record data processing system 100 based on a medical large model and used to perform the functions in the present application.

[0159] The medical record data processing system 100 based on a medical large model can be a general server or a special-purpose server, both of which can be used to implement the medical record data processing method based on a medical large model of the present application. Although only one server is shown in the present application, for the sake of convenience, the functions described in the present application can be implemented in a distributed manner on multiple similar platforms to balance the processing load.

[0160] For example, the medical record data processing system 100 based on a medical large model can include a network port 110 connected to a network, one or more processors 120 for executing program instructions, a communication bus 130, and different forms of storage media 140, such as a disk, a ROM, or a RAM, or any combination thereof. Exemplarily, the medical record data processing system 100 based on a medical large model can also include program instructions stored in a ROM, a RAM, or other types of non-transitory storage media, or any combination thereof. The method of the present application can be implemented according to these program instructions. The medical record data processing system 100 based on a medical large model also includes an input / output (I / O) interface 150 between the computer and other input / output devices.

[0161] For the convenience of description, only one processor is described in the medical big model-based medical record data processing system 100. However, it should be noted that the medical big model-based medical record data processing system 100 in the present application can also include multiple processors, so the steps performed by one processor described in the present application can also be jointly performed or separately performed by multiple processors. For example, if the processor of the medical big model-based medical record data processing system 100 performs steps A and B, it should be understood that steps A and B can also be jointly performed by two different processors or separately performed in one processor. For example, a first processor performs step A, a second processor performs step B, or a first processor and a second processor jointly perform steps A and B.

[0162] In addition, the embodiment of the present application also provides a readable storage medium, wherein computer executable instructions are preset, and when a processor executes the computer executable instructions, the medical big model-based medical record data processing method is realized.

[0163] It should be noted that, in order to simplify the description of the present application and to help understand one or more embodiments of the present application, in the foregoing description of the embodiments of the present application, various features are sometimes combined into one embodiment, figure or description thereof.

Claims

1.A medical record data processing method based on a medical large model, characterized in that, The method comprises: obtaining a set of historical medical record data units corresponding to a target medical entity, the set of historical medical record data units comprising a plurality of associated medical entity features and corresponding diagnosis and treatment record features; extracting a core feature vector corresponding to the target medical entity in the set of historical medical record data units, and selecting a neighbor data unit set having diagnosis and treatment association with the core feature vector from the set of historical medical record data units based on a preset association rule; performing feature weight distribution on each neighbor data unit in the neighbor data unit set through a multi-layer attention mechanism, and outputting a corresponding weighted feature vector, wherein each layer of the attention mechanism adjusts the weight distribution proportion according to a dynamic association score between the core feature vector and the corresponding neighbor data unit; cross-layer fusion of the weighted feature vector output by the multi-layer attention mechanism and the core feature vector to generate a comprehensive feature expression of the target medical entity; calling a pre-trained medical recommendation model to perform time series prediction on the comprehensive feature expression, outputting a recommendation priority score of the target medical entity in a subsequent diagnosis and treatment process, and optimizing parameters of the medical recommendation model according to the recommendation priority score; the method comprises: in the first layer of attention mechanism, generating initial attention weight according to the cosine similarity between the core feature vector and the feature vector of each neighbor data unit; multiplying the initial attention weight and the diagnosis and treatment time decay factor of each neighbor data unit to generate a time-aware primary weight distribution result, wherein the diagnosis and treatment time decay factor is dynamically adjusted according to the interval length between the record time of the medical record data unit and the current time; in the middle layer attention mechanism, the severity of the disease feature is introduced to correct the primary weight distribution result, specifically including: analyzing the number of complications, the length of treatment period and the medication intensity index recorded in each neighbor data unit to generate a disease severity score, and weighting and superimposing the disease severity score and the primary weight distribution result to generate a corrected intermediate weight distribution result; in the last layer of attention mechanism, the department attribute feature of the medical entity is combined to finally adjust the intermediate weight distribution result, specifically including: detecting the consistency of the department to which each neighbor data unit belongs and the department where the target medical entity currently locates, and when the department attribute is inconsistent, a cross-department penalty coefficient is applied to the intermediate weight distribution result; normalizing the weight distribution result after multi-layer adjustment to obtain the final attention weight value of each neighbor data unit, and outputting the corresponding weighted feature vector according to the final attention weight value of each neighbor data unit. 2.The medical record data processing method based on a medical large model according to claim 1, wherein, the method comprises: constructing a global association network of the set of historical medical record data units according to the occurrence frequency and co-occurrence relationship of the target medical entity in historical diagnosis and treatment records; identifying a direct correlation node set of the target medical entity in the global correlation network, each node in the direct correlation node set representing a correlation medical entity having at least one common medical record with the target medical entity; calculating a medical record path matching degree between each node in the direct correlation node set and the target medical entity based on a medical record time sequence feature and a disease type feature of each node; sorting the direct correlation node set in descending order of the medical record path matching degree, and selecting a medical record data unit corresponding to a node having a matching degree higher than a preset threshold to form an initial neighbor data unit set; performing cross-department correlation expansion on the initial neighbor data unit set, and determining a medical record data unit set containing multi-department medical record features after expansion as a final neighbor data unit set. 3.The medical record data processing method based on a medical large model according to claim 2, wherein, The cross-department correlation expansion on the initial neighbor data unit set comprises: analyzing department identifier features and disease classification codes contained in each medical record data unit in the initial neighbor data unit set; constructing a medical record path transfer matrix between departments according to the department identifier features, each element in the medical record path transfer matrix representing a probability value of correlation transfer between two departments in historical medical treatment; finding a highest transfer probability path between a department to which the target medical entity belongs and other departments in the medical record path transfer matrix for a disease classification code corresponding to the target medical entity; taking department identifiers corresponding to the highest transfer probability path as an expanded department set, and retrieving medical record data units containing the target medical entity and at least one expanded department identifier from the historical medical record data unit set; merging the retrieved medical record data units with the initial neighbor data unit set, and generating an expanded set of cross-department correlation after removing duplicate data units. 4.The medical record data processing method based on a medical large model according to claim 1, wherein, The cross-layer fusion of the weighted feature vector output by the multi-layer attention mechanism and the core feature vector to generate the comprehensive feature expression of the target medical entity comprises: performing feature dimension reduction processing on the primary weighted feature vector output by the first layer attention mechanism to retain key dimensions related to disease classification; inputting the reduced primary weighted feature vector into a bidirectional gated recurrent unit to capture forward and reverse dependency relationships of medical record features in time series; extracting a hidden state of the last time step of the bidirectional gated recurrent unit as a time series fusion feature, and performing dot product operation on the time series fusion feature and the intermediate weighted feature vector output by the intermediate layer attention mechanism to generate an intermediate fusion result; splicing the intermediate fusion result and the final weighted feature vector output by the last layer attention mechanism to form a cross-layer spliced feature vector; adding the cross-layer spliced feature vector and the original core feature vector through residual connection, and eliminating feature scale difference by layer normalization method to generate the comprehensive feature expression. 5.The medical record data processing method based on a medical large model according to claim 1, wherein, The time series prediction of the comprehensive feature expression by the pre-trained medical recommendation model outputs a recommended priority score of the target medical entity in a subsequent medical treatment process, and optimizes parameters of the medical recommendation model according to the recommended priority score, comprising: The comprehensive feature expression is divided into a disease feature segment, a treatment feature segment, and a prognosis feature segment, and is input into the time series prediction branches of the medical recommendation model arranged in parallel; In each time series prediction branch, an expanded convolutional neural network is used to capture feature change patterns at different time scales, wherein the expansion factor of the expanded convolution is dynamically set according to the historical data sampling frequency of the corresponding feature segment; The prediction features output by each time series prediction branch are aligned in mode and spliced to generate a multi-modal fusion prediction vector; The multi-modal fusion prediction vector is input into a fully connected layer network to calculate the recommendation priority score, and the error gradient between the recommendation priority score and the true diagnosis and treatment record label is back-propagated to the expanded convolutional neural network and the fully connected layer network to update the convolution kernel parameters and the fully connected layer weights of the medical recommendation model. 6.The medical record data processing method based on a medical large model according to claim 5, wherein, The method further comprises: detecting the dimension differences of the disease feature segment prediction features, the treatment feature segment prediction features, and the prognosis feature segment prediction features output by each time series prediction branch, and when the dimensions are inconsistent, mapping the disease feature segment prediction features, the treatment feature segment prediction features, and the prognosis feature segment prediction features to a unified dimension space through a shared linear projection matrix to generate unified dimension space features; calculating a cosine similarity matrix between the disease feature segment prediction features and the treatment feature segment prediction features in the unified dimension space features, and identifying a target feature pair with a similarity higher than a preset threshold from the cosine similarity matrix; performing a bidirectional feature exchange operation on the target feature pair, replacing the feature elements at the corresponding positions in the disease feature segment prediction features with the corresponding elements of the treatment feature segment prediction features, and inversely replacing the feature elements at the corresponding positions in the treatment feature segment prediction features with the original elements of the disease feature segment prediction features to generate exchanged features; performing cross-modal maximum pooling processing on the exchanged features to extract the maximum values of each feature dimension in the disease feature segment prediction features, the treatment feature segment prediction features, and the prognosis feature segment prediction features to generate a pooled feature vector; splicing the pooled feature vector into a multi-channel fusion matrix along the feature channel dimension, applying a channel attention mechanism to the multi-channel fusion matrix, dynamically adjusting the channel weights according to the activation frequency of each channel in historical training, and generating the multi-modal fusion prediction vector. 7.The medical record data processing method based on a medical large model according to claim 1, wherein, After the weighted feature vector output by the multi-layer attention mechanism is cross-layer fused with the core feature vector to generate the comprehensive feature expression of the target medical entity, the method further comprises: obtaining a new medical record data unit in the current diagnosis and treatment environment, and extracting a real-time feature vector from the new medical record data unit; performing similarity matching between the real-time feature vector and the comprehensive feature expression, and when the output feature exceeds a dynamic threshold, triggering an online updating mechanism of the medical recommendation model; The online updating mechanism comprises: inputting the real-time feature vector and historical feature vector into an incremental training module together, fine-tuning the weight distribution ratio in the attention mechanism on the basis of retaining original model parameters, calculating the importance score of historical training data in the fine-tuning process, applying an updating constraint to parameters with an importance score greater than a set score, and obtaining a fine-tuned medical recommendation model. The fine-tuned medical recommendation model is deployed to a real-time recommendation engine to update the calculation logic of the recommendation priority score synchronously. 8.The medical record data processing method based on a medical large model according to claim 7, wherein, After triggering the online updating mechanism of the medical recommendation model, the method further comprises: constructing a verification data set containing normal diagnosis and treatment mode samples and abnormal operation samples, the abnormal operation samples containing irregular medication records and operation sequences not conforming to diagnosis and treatment paths; in the incremental training process, the normal diagnosis and treatment mode samples and the abnormal operation samples are input alternately into the medical recommendation model, and the difference in the recommendation priority score of the medical recommendation model for the normal diagnosis and treatment mode samples and the abnormal operation samples is recorded; when it is detected that the score difference of the medical recommendation model for the abnormal operation samples is lower than a safety threshold, an adversarial training mechanism is started, the adversarial training mechanism comprising: generating an adversarial sample similar to the feature of the abnormal operation sample but adding a hidden disturbance feature; in the adversarial training stage, the output score difference of the medical recommendation model for the normal diagnosis and treatment mode samples and the adversarial sample is forced to be greater than a preset safety interval; the stability index of the medical recommendation model after adversarial training is monitored to determine whether to put the model version of the fine-tuned medical recommendation model into an actual application environment. 9.A medical record data processing system based on a medical large model, characterized by, The medical record data processing system based on the medical large model comprises a processor and a memory, the memory and the processor are connected, the memory is used to store programs, instructions or codes, and the processor is used to execute the programs, instructions or codes in the memory to realize the medical record data processing method based on the medical large model in any one of claims 1-8.

Citation Information

Patent Citations

  • Hospitalization behavior prediction method and device based on time-varying attention improved Bi-LSTM

    CN110334843A

  • Medical decision-oriented multi-modal data dynamic fusion and labeling method and system

    CN119377894A