Method and system for intelligent matching of doctors for internet diagnosis and treatment
Patent Information
- Application Number
- CN202611403793.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-10-13
AI Technical Summary
[0003]目前,线上医师推荐主要分为统计加权排序、单一目标深度排序、简易多目标模型三类,大多依托线上平台数据构建,仅侧重推荐准确率
1.本发明构建医患匹配与患者复杂度识别协同进行的多任务学习机制,使模型在学习患者医生选择关系的同时,识别患者的诊疗需求层级,为后续医疗资源匹配提供患者侧需求依据。相较于仅以患者历史选择行为为目标的单一任务推荐方法,本发明增强了推荐结果对患者实际诊疗需求的刻画能力。
Smart Images

Figure CN122907276A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent physician matching technology, specifically to an intelligent physician matching method and system for internet-based medical consultations. Background Technology
[0002] With the widespread adoption of internet hospitals, online consultations have become an important vehicle for tiered medical services. Disease-matched multi-target doctor recommendation is an intelligent matching technology designed for online consultation scenarios, taking into account multiple dimensions such as patient condition matching, real-time doctor workload, and hospital resource allocation. This technology can accurately allocate patients of varying severity to corresponding levels of physicians, balancing the overall hospital's patient load and considering both patient experience and hospital operational management. It is a core means to solve the mismatch of online medical resources and optimize outpatient scheduling.
[0003] Currently, online doctor recommendations are mainly divided into three categories: statistically weighted ranking, single-objective deep ranking, and simplified multi-objective models. Most rely on data from online platforms and focus solely on recommendation accuracy. Existing solutions have significant shortcomings: they do not employ econometric methods to screen effective features, resulting in poor model interpretability; they fail to differentiate between disease severity and physician qualifications, leading to a waste of expert resources; they rely solely on static patient volume to measure physician workload, failing to balance consultation orders in real time; general semantic models struggle to interpret colloquial medical conditions; they focus solely on algorithmic metrics, lacking hospital operational constraints; and their data processing and architecture design are not adapted to hospital HIS systems, making implementation difficult.
[0004] Based on this, this application proposes a physician intelligent matching technology for internet-based medical consultations, which aims to solve one or more of the aforementioned technical problems. Summary of the Invention
[0005] (a) Technical problems to be solved To address the shortcomings of existing technologies, this invention provides a method and system for intelligent physician matching for internet-based medical consultations, solving one or more of the aforementioned technical problems.
[0006] (II) Technical Solution To achieve the above objectives, the present invention provides the following technical solution: Firstly, this application proposes a physician intelligent matching method for internet-based medical consultations, the method comprising: Acquire consultation data and perform time consistency preprocessing, wherein the consultation data includes online internet consultation data; Based on the preprocessed consultation data, a doctor-patient matching feature is constructed, which includes: doctor workload and resource level features; Based on the characteristics of physician load and resource level, the real-time load of physicians and the degree of mismatch of medical resources between patients and physicians are quantified respectively, and corresponding load penalty scores and resource mismatch penalty scores are generated. Semantic alignment enhancement in medical scenarios is achieved through query-query contrastive learning for doctor-patient matching scenarios. The three-branch model recommendation results are integrated to output an unconstrained initial recommendation score; the three-branch model includes: a basic matching cross-branch model, a doctor's recent temporal attention branch model, and a CQM semantic matching branch model; wherein, the CQM semantic matching branch model calculates the similarity of doctor and patient demands based on the aligned medical scene semantics and generates a semantic enhancement correction score; Based on the initial recommendation score, multiple penalties are fused to complete the secondary ranking of resource balancing, and the corrected physician recommendation results are output; wherein, the multiple penalties include load penalty score and resource mismatch penalty score.
[0007] In one embodiment, the doctor-patient matching features further include: patient's past consultation record features, candidate doctor's basic information and historical service statistics features, patient and candidate doctor's past consultation relationship features, patient's first chief complaint text and candidate doctor's historical text features, and candidate doctor's recent historical order sequence features.
[0008] In one embodiment, quantifying the real-time workload of doctors based on physician load and resource level characteristics to generate a load penalty score includes: in, This represents the final load penalty score; This represents the load signal after log compression; Indicates the original load signal; , , , These represent the number of patients seen by the doctor in the past 3 days. Patient volume in the past 7 days The weights of currently unfinished orders (Nunfin) and currently unreplied orders (Nunrep); This indicates that the normalized denominator comes from the 95th quantile of the training set.
[0009] In one embodiment, the degree of medical resource mismatch between patients and doctors is quantified based on physician workload and resource level characteristics to generate a resource mismatch penalty score, including: Patients are classified into different levels based on the complexity of their condition, and doctors are classified into different levels based on their qualification level. Resource mismatch calculation includes: Advanced resource penalty items: Patient complexity and doctor level gap: Penalty for consuming advanced medical resources for mild cases: ; Penalty for assigning low-level doctors to critical care cases: ;in, Indicates the doctor's qualification level; Indicates the level of complexity of the patient's condition; The resource mismatch penalty score is the sum of the high-level resource penalty item, the gap between patient complexity and doctor level, the penalty for using high-level doctor resources for mild cases, and the penalty for assigning low-level doctors to severe cases.
[0010] In one embodiment, the alignment and enhancement of medical scenario semantics based on query-query contrastive learning for doctor-patient matching scenarios includes: Construct a dedicated sample pair for Query-Query doctor-patient consultation comparison learning. The sample pair includes: positive samples with the patient's current consultation content as the anchor point, the patient's historical consultation content with selected doctors as the positive samples, and non-paired samples within the batch as negative samples. The text encoder maps the text corresponding to the sample pairs into vector representations, which are then stacked into a matrix. The similarity of all samples within a batch is obtained based on matrix operations; The text encoder is trained based on similarity calculation loss and symmetric bidirectional contrast loss. The symmetric bidirectional contrast loss includes: the average training loss for identifying the correct corresponding text from the doctor's historical consultation question texts when the patient's current question text is used as the query object, and the average training loss for identifying the correct corresponding text from the patient's current question text when the doctor's historical consultation question texts are used as the query object. Generate semantic alignment enhancement results based on the trained text encoder.
[0011] In one embodiment, the basic matching cross-branching model utilizes a basic cross network to learn explicit high-order cross relationships and implicit nonlinear combination relationships between basic doctor-patient matching features; wherein: The basic doctor-patient matching features include patient's past consultation records, candidate doctor's basic information and historical service statistics, and the relationship between the patient and the candidate doctor in past consultations. The basic cross-connect network includes the DCN-V2 cross-connect network.
[0012] In one embodiment, the doctor's recent temporal attention branch model uses a multi-head attention mechanism to match the patient's current needs with the types of cases recently treated by the doctor, based on the candidate doctor's recent historical order sequence features, to generate a temporal correction score.
[0013] In one embodiment, the CQM semantic matching branch model calculates the similarity of doctor-patient demands based on the aligned medical scenario semantics and generates a semantic enhancement correction score, including: The semantically aligned current patient question vector and the doctor's historical patient question profile vector are used as the original inputs to the CQM semantic matching branch; Construct element-wise matching features to show the interaction between patient problems and doctors' historical problem profiles; The matching features are mapped to CQM semantic matching representations based on a multilayer perceptron.
[0014] In one embodiment, the method further includes: The physician recommendation results are evaluated based on a comprehensive assessment of multi-dimensional indicators to iteratively optimize parameters; the multi-dimensional indicators include matching accuracy indicators, disease resource adaptation indicators, load balancing indicators, and traffic fairness indicators.
[0015] Secondly, this application also proposes a physician intelligent matching system for internet-based medical consultations, the system comprising: The data acquisition and preprocessing module is configured to acquire consultation data and perform time-consistency preprocessing, wherein the consultation data includes online internet consultation data. The feature construction module is configured to construct doctor-patient matching features based on preprocessed consultation data, the doctor-patient matching features including: doctor workload and resource level features; The real-time load calculation module is configured to quantify the real-time load of doctors and the degree of mismatch between medical resources between patients and doctors based on doctor load and resource level characteristics, and generate corresponding load penalty scores and resource mismatch penalty scores. The semantic alignment enhancement module is configured to perform semantic alignment enhancement on medical scenarios based on query-query contrastive learning for doctor-patient matching scenarios. The initial recommendation score acquisition module is configured to output an unconstrained initial recommendation score by fusing the recommendation results of the three-branch model. The three-branch model includes: a basic matching cross-branch model, a doctor's recent temporal attention branch model, and a CQM semantic matching branch model. The CQM semantic matching branch model calculates the similarity of doctor-patient demands based on the aligned medical scene semantics and generates a semantic enhancement correction score. The resource balancing secondary ranking module is configured to perform resource balancing secondary ranking based on the initial recommendation score and multiple penalties, and output the corrected physician recommendation results; wherein, the multiple penalties include load penalty score and resource mismatch penalty score.
[0016] (III) Beneficial Effects This invention provides a method and system for intelligent physician matching in internet-based medical consultations. Compared with existing technologies, this invention has at least the following advantages: 1. This invention constructs a multi-task learning mechanism that coordinates doctor-patient matching and patient complexity identification. This mechanism enables the model to learn the relationship between patients and doctors while simultaneously identifying the hierarchy of patients' treatment needs, providing a basis for subsequent medical resource matching based on patient-side requirements. Compared to single-task recommendation methods that only target patients' historical selection behavior, this invention enhances the ability of recommendation results to characterize patients' actual treatment needs.
[0017] 2. This invention addresses the characteristics of internet-based medical consultation scenarios, which involve the coexistence of structured data, unstructured consultation texts, and dynamic service events. It unifies and aligns multi-source heterogeneous data, including patient behavior, doctor services, doctor-patient interactions, consultation semantics, and recent consultation status, to form a multi-layered doctor-patient matching representation. By constructing historical information prior to the current consultation time, it improves the temporal consistency and usability of medical data in recommendation scenarios.
[0018] 3. This invention establishes a bilateral resource matching mechanism between patient complexity and physician qualification level, while simultaneously considering patient-side treatment needs, physician-side service capabilities, and the current resource status of the hospital. Compared to unilateral recommendations based solely on patient preferences or physician historical popularity, this invention enables recommendations to balance patient needs with the coordinated allocation of hospital physician resources, helping to reduce the misallocation of medical resources.
[0019] 4. This invention constructs a doctor-patient semantic alignment mechanism for online medical consultation scenarios, mapping the patient's current chief complaint and the doctor's historical consultation issues to a unified semantic space for diagnosis and treatment matching, thereby enhancing the model's ability to identify the relationship between disease symptoms, treatment requests, and the doctor's historical service direction. Compared to directly using general text similarity for matching, this invention improves the specificity of the semantic representation of consultation text for doctor-patient matching tasks.
[0020] 5. This invention employs a two-stage recommendation mechanism combining initial matching and ranking with resource balancing and reordering. First, an initial ranking of candidate doctors is generated based on the doctor-patient matching relationship. Then, the ranking is adjusted based on the real-time workload of doctors and the patient-doctor resource matching relationship. This mechanism incorporates both patient matching needs and hospital resource coordination needs into the recommendation process, helping to reduce the excessive concentration of recommendation results on high-load and advanced doctors, improving doctor load balancing and resource allocation rationality in internet-based medical scenarios. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart of a physician intelligent matching method for internet-based medical services in an embodiment of the present invention. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are described clearly and completely. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] Currently, the doctor recommendation technologies for internet hospitals, online consultations, and offline outpatient clinics can be mainly divided into three categories: 1) Traditional statistical recommendation: relying on a simple weighted ranking based on the number of doctor visits, positive review rate, and patient's historical repurchase behavior, using only basic doctor-patient behavior statistical indicators; 2) Classic deep learning ranking models (WideDeep, DCN, DCN-V2, etc.): with the single optimization goal of improving the accuracy of patient clicks and selections, relying on high-dimensional features to fit the doctor-patient matching relationship; 3) Lightweight multi-objective recommendation models: a few solutions add doctor load constraints, simply adding penalties based on the number of visits, without combining disease classification and medical resource misallocation management.
[0025] Existing technologies primarily rely on data from purely online consultation platforms, and modeling is solely driven by algorithmic metrics. They are geared towards R&D for internet technology companies and lack a management perspective encompassing the operations of physical tertiary hospitals, tiered healthcare systems, and human resource allocation. Specifically, existing technologies suffer from the following shortcomings: 1) The recommendation modeling has a single objective, making it difficult to simultaneously identify the doctor-patient matching relationship and the level of patient treatment needs. Some existing doctor recommendation methods mainly learn patients' preferences for doctors based on their historical selection behavior or click and ranking tags, without incorporating patient complexity identification as a collaborative task into the recommendation modeling process. This makes it difficult for the model to distinguish the levels of treatment needs of different patients, and thus makes it difficult to provide patient-side demand-based information for subsequent medical resource matching.
[0026] 2) There is a lack of a bilateral resource matching mechanism between patient needs and physician service capabilities. Some existing recommendation methods mainly rank physicians based on patient preferences, physician historical popularity, or a single matching score, without simultaneously depicting the relationship between patient complexity, physician qualification level, and physician current service status. This can easily lead to resource mismatches, such as low-complexity patients using high-level physician resources and high-complexity patients being matched with low-level physicians.
[0027] 3) The quantification of physician workload uses a single dimension, making it difficult to reflect the current service pressure. Some existing workload indicators mainly use static statistical data such as historical total number of patients, without comprehensively considering real-time operational status such as recent new patient volume, orders being processed, and orders awaiting replies. This makes it difficult to accurately represent the actual service pressure of candidate physicians at the current recommendation point, which may lead to the recommendation results continuing to concentrate on physicians with high workloads.
[0028] 4) There is a discrepancy between general text semantic representation and doctor-patient matching semantics. General text vectors mainly learn general text similarity, which makes it difficult to directly characterize the diagnosis and treatment matching relationship between the patient's current chief complaint and the doctor's historical consultation issues; for colloquial and symptom-based patient descriptions, the model has difficulty accurately identifying the association between them and the candidate doctor's historical service direction, thus affecting the doctor-patient semantic matching effect.
[0029] 5) Existing recommendation processes lack a resource-aware two-stage ranking adjustment mechanism. Some methods directly generate the final recommendation list based on the model's output scores, without further adjusting the initial matching ranking results based on the real-time workload of doctors and the patient-doctor resource level matching relationship. Therefore, it is difficult to take into account patient matching relevance, doctor service pressure, and the rational allocation of medical resources.
[0030] 6) Multi-source heterogeneous medical data lacks a unified time alignment and collaborative modeling mechanism. Internet-based medical data simultaneously includes patient behavior data, doctor service data, doctor-patient interaction data, unstructured consultation texts, and dynamic service event data. These different data types vary in generation frequency, time granularity, and business meaning. If historical statistics, semantic profiles, and recent event representations are not built using the current consultation initiation time as a unified node, inconsistencies in the timeline between data from different sources can easily occur, affecting the reliability of recommendation results.
[0031] This application proposes a physician intelligent matching technology for internet-based medical consultations, which aims to solve one or more of the aforementioned technical problems.
[0032] Example 1: Firstly, this invention proposes an intelligent physician matching method for internet-based medical consultations, see [link to relevant documentation]. Figure 1 This method mainly includes: S1. Obtain consultation data and perform time consistency preprocessing, wherein the consultation data includes online internet consultation data; S2. Construct doctor-patient matching features based on the preprocessed consultation data, the doctor-patient matching features including: doctor workload and resource level features; S3. Based on the characteristics of doctor load and resource level, quantify the real-time load of doctors and the degree of medical resource mismatch between patients and doctors, and generate corresponding load penalty scores and resource mismatch penalty scores. S4. Semantic alignment enhancement of medical scenarios based on query-query contrastive learning for doctor-patient matching scenarios; S5. The three-branch model recommendation results are integrated to output an unconstrained initial recommendation score; the three-branch model includes: a basic matching cross-branch model, a doctor's recent temporal attention branch model, and a CQM semantic matching branch model; wherein, the CQM semantic matching branch model calculates the similarity of doctor and patient demands based on the aligned medical scene semantics and generates a semantic enhancement correction score. S6. Based on the initial recommendation score, perform a secondary reordering of resource balancing by fusing multiple penalties, and output the corrected physician recommendation result; wherein, the multiple penalties include load penalty score and resource mismatch penalty score.
[0033] The method proposed in this embodiment filters out key features for doctor-patient matching based on the original consultation data. Then, it calculates the doctor's real-time load penalty score and resource mismatch penalty score from these key features. Next, it uses a three-branch fusion recommendation backbone model to output an unconstrained initial recommendation score. Finally, it integrates multiple penalties such as the doctor's real-time load penalty and resource mismatch penalty to complete a secondary reordering of resource balance based on the initial recommendation score, outputting a corrected recommendation score. Based on the corrected recommendation score, it generates doctor recommendation results, realizing scientific and intelligent matching for different patients. This not only ensures accurate patient-doctor matching results but also ensures balanced doctor load and reasonable resource allocation.
[0034] The following is in conjunction with the appendix Figure 1 The following details the implementation process of an embodiment of the present invention, including explanations of the specific steps S1-S6.
[0035] S1. Obtain consultation data and perform time consistency preprocessing, wherein the consultation data includes online internet consultation data.
[0036] In this embodiment, the primary source of raw data is online internet consultation data. When a reliable correlation between patient identification and consultation time is established, offline outpatient consultation data can also be obtained. Both types of data use patient identification and time fields as the basis for correlation and time alignment.
[0037] Online consultation data sources include a consultation order table and a doctor-patient dialogue table, which are uniquely linked by an order identifier. The consultation order table includes at least an order identifier, patient identifier, actual attending physician identifier, physician's department, physician's title, consultation initiation time, physician's start reply time, and consultation end time. The doctor-patient dialogue table includes at least an order identifier, message sender identifier, message text, and message timestamp. Following the message time sequence within the same order, the first valid message sent by the patient is extracted as the patient's first main complaint text, and the physician's reply messages within that order are summarized to obtain the physician's reply text and reply round. Offline outpatient data sources mainly include patients' offline medical records, including at least an offline medical record identifier, patient identifier, and offline medical record time. Online consultation data and offline outpatient data are linked by the patient identifier; for any online consultation order, only offline records with offline medical records whose offline medical record time is earlier than the consultation initiation time of that order are used, and offline records after the current consultation initiation time are not used.
[0038] After obtaining the above data, the consultation initiation time, doctor's start reply time, consultation end time, and offline consultation time are converted to a standardized format. Orders with missing consultation initiation time, doctor's start reply time, or consultation end time, as well as abnormal orders where the doctor's start reply time is earlier than the consultation initiation time or the consultation end time is earlier than the doctor's start reply time, are removed. Orders where the patient's first complaint is empty, too short, or invalid are removed or marked as empty text.
[0039] For any current consultation order, the consultation initiation time is used as the cutoff point for calculating historical information. Only doctor historical orders that occurred before this time point are used to calculate statistical values such as the doctor's historical consultation count, initial call duration, consultation duration, response text length, and dialogue rounds. The number of historical orders in the 3 days and 7 days prior to this time point is counted to obtain the doctor's recent consultation volume. The number of orders that started but have not yet ended before this time point is counted to obtain the number of incomplete orders. The number of orders that were initiated but have not yet been responded to before this time point is counted to obtain the number of orders awaiting response. For each candidate doctor, the most recent historical consultation orders that occurred before this time point are selected in reverse chronological order, with the most recent 8 being retained for subsequent time-series modeling.
[0040] For missing data in the above statistics, first, fill the missing data in the preset doctor profile window by calculating the median of historical statistics for each doctor and department; if no valid historical statistics exist, use the median of the corresponding field for all doctors; if still no data can be obtained, fill with 0. Missing values in discrete fields such as patient identifier, doctor identifier, doctor title, and department are uniformly mapped to unknown category codes; missing text is uniformly filled with empty text; and the doctor level corresponding to a missing doctor title is uniformly mapped to Level 1.
[0041] After the above processing, we obtain unified consultation order records, doctor-patient dialogue records, offline historical consultation records, and historical query indexes built according to the consultation initiation time, all associated with the order identifier.
[0042] Furthermore, in order to train and test the physician intelligent matching model Med-ResBalance-CQM (Med-ResBalance: a medical resource balancing model for recommending doctors in internet hospitals; CQM = Contrastive Query Matching, i.e., enhanced doctor-patient semantic matching based on query-query contrastive learning) ultimately constructed according to the method of the embodiments of this application, the model is divided into time sequences according to the order initiation time: historical orders from January 2024 to May 2024 are selected to initialize the doctor's historical service statistics and doctor's historical consultation semantic profile; consultation orders from June 2024 to October 2024 constitute the training set, which is used to train the Med-ResBalance-CQM model and determine training period statistics such as load normalization; consultation orders from November 2024 constitute the test set, which is only used to test the recommendation effect of the model after training. For any consultation order, all statistical values, semantic profiles, and recent status information calculated based on historical records are generated only from orders and dialogue records that occurred before the consultation was initiated, and data generated after that time is not used.
[0043] It should be noted that in this step, time consistency preprocessing is used to unify the time format of multi-source diagnosis and treatment data from online consultations and offline outpatient clinics, eliminate orders with missing time and contradictory time sequences, and use the time of initiation of online consultation as the time cutoff point, only using offline medical records and doctors' historical consultation data before the cutoff point, to ensure that the modeling data follows the causal sequence of diagnosis and treatment and does not introduce future information.
[0044] S2. Construct doctor-patient matching features based on preprocessed consultation data.
[0045] Based on the consultation order records and doctor-patient dialogue records obtained through time consistency preprocessing in S1, this embodiment constructs doctor-patient matching features according to information subject, time range, and generation method. Specifically, the information subject distinguishes between patients, candidate doctors, combinations of patients and candidate doctors, and candidate doctor historical consultation events; the time range distinguishes between the current order field, cumulative historical records before the current consultation initiation time, short-term window records before the current consultation initiation time, and recent historical consultation events; and the generation method distinguishes between original field encoding, historical statistical aggregation, patient-candidate doctor association calculation, text vector conversion, time-sorted event sequence construction, and doctor service pressure calculation.
[0046] In one embodiment, based on the above rules, the doctor-patient matching features are divided into the following six categories: patient's past consultation record features, candidate doctor's basic information and historical service statistics features, patient and candidate doctor's past consultation relationship features, patient's first chief complaint text and candidate doctor's historical text features, candidate doctor's recent historical order sequence features, and doctor's workload and resource level features.
[0047] This feature construction method generates cumulative historical statistics, short-term service pressure statistics, recent historical order sequences, and historical text aggregation results for the same batch of historical consultation orders. This allows patient current needs, doctor's long-term service status, doctor-patient relationship history, doctor's recent consultation status, and doctor resource level to enter the subsequent doctor matching process at a unified time point. All features can be traced back to corresponding fields and their calculation rules in the consultation order table or dialogue data table. The specific construction method is as follows: 1) Patient's Past Medical Consultation Records. These features are derived from the patient identifier, consultation initiation time, actual attending physician identifier, department, and physician title in the consultation order table. For the current patient, the number of historical orders prior to the current consultation initiation time is counted to obtain the patient's historical consultation count; the number of orders previously placed in the current candidate department and the number of orders previously placed selecting the current candidate physician title are counted to obtain the patient's historical selection counts for the current candidate department and the current candidate physician title; these are then divided by the patient's historical consultation count to obtain the corresponding historical selection ratio; the time interval since the patient's last consultation in the current candidate department is calculated. These features are used for subsequent basic matching calculations.
[0048] 2) Basic Information and Historical Service Statistical Features of Candidate Doctors. These features are derived from the actual attending physician's identifier, department, title, consultation initiation time, doctor's start reply time, and consultation end time in the consultation order table, as well as the doctor's reply text and message timestamps in the doctor-patient dialogue table. Among these, the doctor's identifier, department, and title are used directly as discrete fields. The doctor's title is further mapped to a three-tiered doctor level: Chief Physician corresponds to Level 3, Associate Chief Physician to Level 2, and other doctors, nurses, and pharmacists to Level 1. Based on the consultation initiation time, doctor's start reply time, and consultation end time of historical orders, the historical first-response duration and historical consultation duration are calculated; based on the historical doctor's reply text and the number of reply messages, the historical reply text length and historical dialogue rounds are calculated. Within the preset doctor profile window, the above historical records are summarized by doctor and department to obtain the mean, median, and standard deviation of the first-response duration, consultation duration, reply text length, and dialogue rounds; simultaneously, the number of consultations the candidate doctor has received before the current consultation initiation time is counted. These features are used for basic matching calculations.
[0049] 3) Patient-Doctor Past Consultation Relationship Characteristics. These characteristics are derived from the patient identifier, the actual attending physician identifier, and the consultation initiation time in the consultation order table. For the current patient and the current candidate doctor, the historical number of times the patient selected this candidate doctor before the current consultation initiation time is counted; this number is divided by the patient's historical consultation count to obtain the historical proportion of the patient selecting this candidate doctor; the time interval between the current consultation initiation time and the patient's last selection of this candidate doctor is calculated. This type of characteristic represents the existing consultation relationship between the patient and the candidate doctor and is input into the basic matching calculation along with the aforementioned patient historical consultation count.
[0050] 4) Patient's First Chief Complaint Text and Candidate Doctor's Historical Text Features. These features are derived from the doctor-patient dialogue table. The patient's first chief complaint text is obtained from the first valid message sent by the patient in the current order and converted into a vector of the patient's current chief complaint text. For each candidate doctor, the patient's first chief complaint texts in the doctor's historical orders prior to the month of the current order are converted into text vectors and averaged to obtain the text features of the candidate doctor's past patient complaints; the doctor's reply texts in historical orders with doctor responses are converted into text vectors and averaged to obtain the text features of the candidate doctor's past doctor responses. The patient's current chief complaint text vector, the text features of the candidate doctor's past patient complaints, and the text features of the candidate doctor's past doctor responses are used for basic matching calculations. Among them, the patient's current chief complaint text and the text features of the candidate doctor's past patient complaints are also used for subsequent doctor-patient semantic matching calculations.
[0051] 5) Recent Historical Order Sequence Features of Candidate Doctors. This type of feature is derived from the candidate doctor's historical orders prior to the current consultation initiation time and their corresponding doctor-patient dialogue records. For each candidate doctor, the most recent historical orders are selected in reverse chronological order of consultation initiation time; for example, the most recent 8 orders are preferred. Each historical order includes the patient's first chief complaint text vector, the doctor's reply text vector, the time interval between the historical order and the current order, the number of doctor replies for the historical order, and a historical complexity marker. The historical complexity marker is obtained from the doctor's reply text in the historical order: when the doctor's reply contains explicit suggestions for escalation treatment such as offline consultation, face-to-face consultation, outpatient, emergency, hospitalization, or admission, it is marked as 1; otherwise, it is marked as 0. The aforementioned recent historical order sequence is used for subsequent time-series modeling.
[0052] 6) Doctor Load and Resource Level Characteristics. These characteristics are derived from the candidate doctor's historical order initiation time, doctor's start time for replying, consultation end time, and doctor's professional title. The number of historical orders for the candidate doctor in the 3 days and 7 days prior to the current consultation initiation time is calculated to obtain the consultation volume in the past 3 days and the consultation volume in the past 7 days. The number of orders that started but have not yet ended before the current consultation initiation time is calculated to obtain the number of incomplete orders. The number of orders that started but have not yet started replying before the current consultation initiation time is calculated to obtain the number of orders awaiting reply. The consultation volume in the past 3 days, the consultation volume in the past 7 days, the number of incomplete orders, and the number of orders awaiting reply are weighted and summed according to preset weights, and then logarithmically compressed and normalized to obtain the doctor load score. The doctor's three-level rating is obtained from the aforementioned doctor professional title mapping results. The doctor load score is used to reduce the recommendation priority of high-load doctors, and the doctor's three-level rating is used for subsequent resource level matching calculations.
[0053] Based on the six types of features mentioned above, S2 transforms the patient's basic information and first chief complaint text in the current consultation order, the candidate doctor's basic information and historical service statistics, the patient's past consultation relationship with the candidate doctor, the candidate doctor's historical text summary results, the candidate doctor's recent historical order sequence, and the basic fields for calculating doctor resources into a doctor-patient matching input with a unified time boundary. Specifically, the patient's past consultation record features, the candidate doctor's basic information and historical service statistics features, the patient's past consultation relationship features, the patient's first chief complaint text and the candidate doctor's historical text features, as well as the candidate doctor's consultation volume in the past 3 days, consultation volume in the past 7 days, number of incomplete orders, number of orders awaiting response, and doctor's professional title, are used together for subsequent basic matching calculations. The patient's first chief complaint text and the candidate doctor's historical consultation problem text, after semantic alignment, are used for CQM semantic matching; the candidate doctor's recent historical order sequence is used for doctor's recent state modeling; the consultation volume in the past 3 days, consultation volume in the past 7 days, number of incomplete orders, and number of orders awaiting response are also used by S3 to calculate the doctor's workload score, and the doctor's professional title is also used to map the doctor's three-level system.
[0054] S3. Based on the characteristics of doctor load and resource level, quantify the real-time load of doctors and the degree of medical resource mismatch between patients and doctors, and generate corresponding load penalty scores and resource mismatch penalty scores.
[0055] S31. Quantify the real-time load of doctors based on doctor load and resource level characteristics, and generate a load penalty score.
[0056] Based on the candidate doctor's recent consultation and order processing status at the current consultation initiation time, calculate the doctor's busy value and generate a doctor load penalty score with a value range of [0,1].
[0057] In one embodiment, four real-time service pressure indicators are selected: the number of patients seen by doctors in the past 3 days, the number of patients seen in the past 7 days, the number of currently incomplete orders, and the number of currently pending orders. These indicators are then weighted according to preset weights to synthesize a basic load score. Specifically, the number of patients seen by doctors in the past 3 days is recorded as follows: The number of patients seen by the doctor in the past 7 days is recorded as follows: The number of currently incomplete orders is denoted as Nunfin, and the number of currently pending orders is denoted as Nunrep.
[0058] First, construct the original load signal: in, , , , These represent the number of patients seen by the doctor in the past 3 days. Patient volume in the past 7 days The weights of currently unfinished orders (Nunfin) and currently unreplied orders (Nunrep).
[0059] In one embodiment, the weights of each real-time load metric can be adjusted according to the hospital's operational goals at different times. For example, during peak periods, the weights of unfinished and unanswered orders can be appropriately increased to prioritize alleviating immediate service pressure; during normalized operations, the weight of recent patient volume can be appropriately increased to balance the continuous patient volume pressure on doctors. For example, short-term patient volume (patient volume in the past 3 days)... The weight can be set to fluctuate between 0.3 and 0.6, and the weight of unfinished orders (current unfinished orders Nunfin) can be set to fluctuate between 0.2 and 0.4.
[0060] Preferably, taking into account the short-term pressure of new patient arrivals, the backlog of pending consultations, the continuous trend of patient arrivals, and the pressure of waiting for responses, the default weight is set as: the number of patients received in the past 3 days. Weighted at 0.45, number of patients received in the past 7 days The weight is 0.15, and the current number of unfinished orders is... The weight is 0.30, and the number of orders that have not yet been responded to is [number missing]. The weight of is 0.10; the sum of the above weights is 1. Therefore, the above formula can be expressed as: Then perform log compression: The normalized denominator is derived from the 95th percentile of the training set, which consists of the collection of consultation orders from June to October 2024. The test set is not used in the calculation of the load normalization denominator, model parameters, or weights. The final load penalty score is expressed as: in, Indicates the original load signal. This represents the signal after log compression.
[0061] In some embodiments, to more accurately calculate physician workload, additional real-time data can be added based on physician work activity to expand the workload metrics. For example, metrics such as new daily appointments, offline outpatient registrations, and pending follow-up orders can be added to expand the multi-dimensional workload system. Then, for each new data point, its weight is determined, and a weighted composite workload base score is finally calculated. .
[0062] It should be noted that smoothing normalization, using logarithmic compression to eliminate extreme high load interference, normalizes to the 95th quantile of the training set, and obtains a load penalty score of 0-1 through interval truncation. ; A value closer to 1 indicates a higher current patient load for the doctor, and the system will automatically lower the doctor's ranking priority in subsequent recommendations. Of course, in some embodiments, in addition to the 95th quantile, normalization can be performed using the 90th or 99th quantile, training set mean and variance standardization, maximum and minimum values, etc.; in addition to logarithmic smoothing, square root smoothing and piecewise linear compression functions can also be used.
[0063] S32. Based on the characteristics of physician workload and resource level, quantify the degree of medical resource mismatch between patients and doctors, and generate a resource mismatch penalty score.
[0064] This step involves classifying patients' condition levels and doctors' qualification levels, and then calculating the degree of mismatch between medical resources between patients and doctors. The purpose of this step is to intelligently match doctors to patients based on the complexity of their conditions, prioritizing the handling of complex and severe cases by doctors with higher qualifications, thus ensuring the rational allocation of medical resources.
[0065] 1) Patient Condition Complexity Classification. In one embodiment, patients' conditions are classified according to their complexity as follows: Level 1 Low Complexity, including: follow-up visits for medication refill, routine report interpretation, and simple health consultations; Level 2 Medium Complexity, including: routine symptom consultations and medication adjustments for common chronic diseases; Level 3 High Complexity, including: tumors, organ failure, major post-operative conditions, critical illnesses, and doctor-recommended offline emergency / hospitalization. Specifically, the patient condition classification method is as follows: initial screening is conducted based on the hospital's complex disease dictionary rules; samples that do not match the initial screening are then further labeled using a large medical model (such as a medical LLM) combined with dialogue-based classification. Specifically: Let the patient complexity level be: In offline experiments, This represents the pre-constructed patient complexity labels: first, rule matching is performed using a high-complexity disease dictionary; those matching are labeled as 3, and those not matching are then labeled as 1, 2, or 3 by the medical large language model based on the consultation dialogue. These labels are used for resource matching index calculation and also for complexity constraints in offline rearrangement experiments.
[0066] Of course, in actual implementation, patients' conditions can be divided into two levels (mild / severe, primary / advanced) or four levels of subdivision, depending on the actual situation. The specific classification logic remains unchanged, while the judgment rules can be set according to specific needs: relying solely on complex disease dictionary rules, relying solely on medical big data models, and combining structured medical record fields to jointly determine the complexity of the condition.
[0067] 2) Classification of physician qualification levels. In one embodiment, physicians are divided into three levels: Level 1 is general physicians, including resident physicians, attending physicians, nurses, pharmacists, etc.; Level 2 is physicians with associate senior professional titles, that is, associate chief physicians; Level 3 is physicians with senior professional titles, that is, chief physicians.
[0068] Let the doctor resource level be: ;in: , Indicates chief physician, Indicates associate chief physician, This refers to other resident physicians, attending physicians, nurses, pharmacists, etc.
[0069] 3) Calculation of resource mismatch degree. The resource mismatch degree is calculated based on the patient's condition level and the doctor's qualification level. Two core mismatch quantification methods include: Severe mismatch: Highly complex patients are assigned to primary (general physician) or intermediate (associate chief physician) doctors. Wasteful misallocation of resources: Mild cases are being assigned to senior specialists (chief physicians).
[0070] Three quantitative indicators—the gap in treatment levels, the occupancy rate of mild cases, and the mismatch rate of severe cases—are calculated as the basis for subsequent equilibrium optimization. Specifically: To reduce the over-concentration of recommendations on senior specialist physician resources, physician levels will be normalized as a penalty for accessing higher-level resources. in: ,when hour, ;when hour, .
[0071] In addition, the definition is: Patient complexity and doctor level gap: ; Penalty for consuming advanced medical resources for mild cases: ; Penalty for assigning low-level doctors to critical care cases: .
[0072] The three penalties mentioned above are used to measure the degree of mismatch between patients' treatment needs and the qualification levels of candidate physicians in different directions. Among them, Measure the overall grade difference in any direction; When the doctor's level is higher than the patient's condition requirement level, a positive value is taken to identify situations where low-complexity patients occupy high-level doctor resources; A positive value is taken when the patient's condition needs are higher than the doctor's level, which is used to identify the risk of matching highly complex patients with lower-level doctors.
[0073] S4. Based on query-query contrastive learning for doctor-patient matching scenarios, the semantics of medical scenarios are aligned and enhanced.
[0074] Since general text embedding models primarily learn general semantic similarity and can only understand general text, while doctor recommendation tasks focus on whether a patient's current question matches a doctor's historically proficient questions, the two are not entirely equivalent. Therefore, before training the recommendation model Med-ResBalance-CQM, a query-query contrastive learning semantic alignment module for doctor-patient matching scenarios is introduced to map patient questions and doctors' historical consultation questions to a more consistent doctor-patient matching semantic space.
[0075] Specifically, let's set up patient orders The current problem text is The actual doctor they choose is .doctor At the current order time The collection of questions from previously treated patients is recorded as follows: Sampling historical patient issues from this collection Construct positive sample pairs: This means that if the patient Ultimately, I chose the doctor. So, what is the patient's current problem? You should consult with a doctor Patient problems that have been addressed in the past are more closely related in the semantic space.
[0076] 1) Using a basic text encoder Mapping text to a vector representation: in, .
[0077] In this embodiment, the basic text encoder is a general-purpose Chinese text vector encoder, such as bge-large-zh-v1.5. In some embodiments, the basic encoder may also use MedBERT, ChineseBERT, medical-specific pre-trained vector models, etc.
[0078] 2) Constructing a dedicated comparative learning sample pair for doctor-patient matching: Using the patient's current consultation content as the anchor point, the patient's historical consultation content with the selected doctors is the positive sample, and the unpaired samples within the batch are the negative samples (e.g., when constructing negative samples by doctor ID, the consultation content of other doctors is the negative sample).
[0079] To make the vector space more suitable for doctor-patient matching tasks, one implementation employs in-batch contrastive learning. For a single batch... One positive sample pair: We obtain the anchor representation matrix A (i.e., the anchor point matrix or the reference sample matrix) and the positive representation matrix P (the positive sample matrix): Calculate pairwise similarity within a batch: in, This is a temperature coefficient used to control the smoothness of the similarity distribution.
[0080] In some embodiments, when constructing samples, cross-departmental negative samples and cross-disease negative samples can be added to expand the sample set for comparative learning.
[0081] 3) A shared-parameter Chinese text semantic encoding model with BAAI or bge-large-zh-v1.5 pre-trained model as initial parameters is used to vectorize the patient's current first chief complaint text and the doctor's historical patient question texts; the text semantic encoding model is trained by symmetric bidirectional contrastive loss so that the encoded text vectors highlight the doctor-patient matching semantics such as disease, symptoms and treatment needs.
[0082] For the The correct positive value of the nth anchor in the batch is the nth anchor. There are [number] samples, therefore the supervision label is: .
[0083] The loss for one-way contrastive learning is: in, , represents exponentiation with base e. This represents the semantic similarity, adjusted for temperature coefficient, between the current question text vector of the i-th patient and the historical consultation question text vector of the j-th doctor. This represents the semantic similarity between the i-th positive sample text pairs; This represents the average training loss for identifying the correct corresponding text from a small batch of doctors' historical consultation texts, using the patient's current question text as the query object.
[0084] To simultaneously constrain the bidirectional matching relationship between "patient problem to doctor's historical problem" and "doctor's historical problem to patient problem," a symmetric contrastive learning loss is employed. in: in, , The meanings of the symbols are respectively with , Correspondingly, This represents the semantic similarity, adjusted for temperature coefficient, between the current question text vector of the j-th patient and the historical question text vector of the ith doctor. This represents the average training loss for identifying the correct corresponding text from the current question texts of patients in this small batch, using the doctor's historical question texts as the query object.
[0085] After this phase of training, the encoder It no longer simply expresses general semantic similarity, but focuses more on the matching relationship between "current patient problems" and "physician's historical treatment problems".
[0086] In some embodiments, in addition to symmetric bidirectional contrast loss, the loss function may also employ InfoNCE, triplet loss, multi-batch contrast loss, etc.
[0087] 4) Output the aligned and standardized semantic vector, which is used for subsequent semantic matching branch scoring to improve the accuracy of doctor-patient symptom matching.
[0088] In subsequent recommendation models, the semantically aligned encoder is used to regenerate two types of semantic representations: in, This represents the semantically aligned current question vector of the patient. This represents a semantic profile of the candidate doctor's historical patient issues.
[0089] S5. The three-branch model recommendation results are integrated to output an unconstrained initial recommendation score; the three-branch model includes: a basic matching cross-branch model, a doctor's recent temporal attention branch model, and a CQM semantic matching branch model; wherein, the CQM semantic matching branch model calculates the similarity of doctor and patient demands based on the aligned medical scene semantics and generates a semantic enhancement correction score.
[0090] In this step, a three-branch model is constructed to score the data, and the scores are then combined to generate an initial recommendation list that does not consider hospital resource limitations. The three-branch model includes a basic cross-branch model, a temporal attention branch model, and a medical semantic branch model.
[0091] 1) Basic Matching Cross-Branch: Integrates patient's past order information, candidate doctor's basic information and historical service statistics, patient and candidate doctor's past consultation relationship information, patient's current chief complaint and candidate doctor's historical text semantic information, as well as candidate doctor's recent order processing status information, to learn the high-order combination relationship between patient needs, doctor's service capabilities, past doctor-patient relationship and recent service status, and outputs basic matching score.
[0092] The input to the basic matching cross-branch includes discrete identity fields, continuous numerical fields, and text semantic vectors, corresponding to features such as patient past consultation records, candidate doctor basic information and historical service statistics, and patient-candidate doctor past consultation relationships. Since the three types of fields have different data formats and processing methods, they are encoded or standardized separately before being concatenated into the cross-network: discrete identity fields are mapped to dense vectors through an embedding layer; continuous numerical fields are normalized to retain their numerical magnitude and relative differences; and text fields are converted into semantic vectors by a text encoder.
[0093] In one embodiment, the discrete fields include four: Patient ID, Doctor ID, Doctor Title, and Department, i.e., M=4. Each discrete field is mapped through an embedding layer as follows: The current discrete embedding dimension is: Therefore, the concatenated discrete features are: The numerical features comprise 27 dimensions, which can be divided into four groups according to their generation method: 1 dimension of current patient information; 9 dimensions of patient history and past consultation relationships between patients and candidate doctors; 13 dimensions of long-term service statistics for candidate doctors; and 4 dimensions of recent order processing status for candidate doctors. Among these, the long-term service statistics for candidate doctors include historical patient volume, as well as average first response time, median first response time, standard deviation of first response time, average consultation time, median consultation time, standard deviation of consultation time, average number of characters per reply, median number of characters per reply, standard deviation of number of characters per reply, average number of dialogue rounds, median number of dialogue rounds, and standard deviation of dialogue rounds.
[0094] Therefore, numerical features Total Wei, then .
[0095] The discrete features and numerical features are concatenated to obtain the basic matching input vector: ,in, .
[0096] To learn explicit higher-order cross relationships between basic matching features, a DCN-V2 cross network is used to learn higher-order combination relationships between multiple fields. Let the initial input to the cross network be: in, . No. Layer cross calculation is as follows: ; ; in, This indicates element-wise multiplication. Indicates the first l The trainable full-rank weight matrix of the layer cross network is used to represent the current layer cross network. Mapped to an interaction coefficient vector with the same dimension as the original input; This represents the corresponding trainable bias vector, used to learn the basic interaction bias that is independent of specific input values. During model training, and All losses are automatically updated through backpropagation based on the matching and sorting of doctor and patient.
[0097] For clarity, in subsequent formulas, the uppercase letter W represents the weight matrix learned during model training, used to map the input vector to the target feature space. The letter b represents the corresponding trainable bias term, used to adjust the base offset of the linear mapping or scoring result. For a general linear transformation u = Wv + b, if the dimension of the input vector v is m and the dimension of the output vector u is n, then W ∈ Rn×m b∈R n Each weight matrix, weight vector, and bias term is updated during model training using backpropagation based on the doctor-patient matching ranking loss. Subscripts are used to distinguish the branch, network layer, or functional module to which the parameter belongs, while superscripts are used to distinguish the parameter type or specific purpose.
[0098] This structure is passed through the original input. Intersection with each layer The explicit interaction learns the combined relationships between patients, doctors, departments, professional titles, historical behavior, service quality, and load status layer by layer.
[0099] Meanwhile, in order to learn the implicit nonlinear combination relationship between basic matching features, the same input is used... Input a deep network. Command: No. The calculation of deep network layers is as follows: ; ; ; in, Represents a non-linear activation function. This represents the input to the first layer of the neural network.
[0100] go through After applying the DCN-V2 crossover network, the explicit crossover representation is obtained: ,in, This represents the output of the last layer of the cross-connect network. It contains discrete identity fields, continuous numerical fields, and three raw text semantic vectors. After... After creating deep networks, an implicit nonlinear representation is obtained: ,in, This represents the output of the last layer of the deep network. This represents the hidden dimension of the layer. Finally, the explicit cross representation and the implicit nonlinear representation are concatenated to obtain the output of the basic matching cross branch: in, Orders for patients With candidate doctors The basic matching cross representation. This representation integrates explicit high-order cross relationships and implicit nonlinear combination relationships between discrete identities, continuous numerical values, and original text semantic information. Subsequently, The CQM semantic matching branch output and the doctor's recent event time sequence branch output are combined into the multi-branch fusion process.
[0101] In some embodiments, when learning explicit higher-order cross relationships between basic matching features, the basic cross network can be replaced by any explicit feature cross ranking model such as DCN, DeepFM, xDeepFM, AutoInt, etc., in addition to the DCN-V2 cross network.
[0102] 2) Doctor's recent temporal attention branch: Construct a temporal sequence for multiple recent historical consultation events of the doctor, and use a multi-head attention mechanism to match the patient's current needs with the types of cases the doctor has recently treated (to determine what diseases the doctor has recently been treating) to generate a temporal correction score.
[0103] The doctor's recent events time-series branch is used to model the candidate doctor's recent consultation status before the current order, after inputting several recent historical consultation events of the candidate doctor before the current order (corresponding to the candidate doctor's recent historical order sequence features). Unlike the doctor's historical semantic profile, the doctor's recent events time-series branch not only focuses on the doctor's long-term average profile, but also further depicts the dynamic changes in the doctor's consultation content, response behavior, and service pressure over a recent period of time.
[0104] For patient orders and candidate doctors Let the current time be: Candidate doctors exist Recently Each historical consultation event is represented as follows: In one embodiment, take This refers to the doctor's eight most recent consultation records. If the doctor's historical records are insufficient... For bars, zero vectors are used for padding, and masks are used to distinguish between real events and padding events.
[0105] For the historical events Its inputs include historical patient question embeddings, doctor response embeddings, and structured event features: ; ; in, This represents the semantic vector of the patient's question for this historical order. This represents the semantic vector of the doctor's response. This represents the structured characteristics of the event, including time intervals. Historical complex markers and number of response rounds Information such as historical complex markers. This represents a binary feature at the historical event level. If the doctor's reply in the historical order clearly shows an upgrade or complex signal such as offline, face-to-face consultation, outpatient, emergency, inpatient, or hospital admission, then it is 1; otherwise, it is 0.
[0106] First, the multi-source information of a single historical event is concatenated into an event input vector: Then, the event input is projected onto the unified hidden space using a linear mapping: in: ; ; ; This represents a non-linear activation function.
[0107] Will After encoding the historical events, a sequence of recent events representing the doctor is obtained: To adaptively focus on more relevant parts of the physician's historical events based on the current patient's problem, an attention mechanism is used to aggregate the physician's recent event sequence.
[0108] Let the current patient's problem be represented as: First, map the current patient problem to the event attention space: .in: ; .
[0109] Then, the attention score between the current patient problem and each doctor's recent event is calculated: in: .
[0110] For invalid events that are filled in, their attention scores are set to a minimum using a mask. Let the event mask be: . =1 indicates Based on true historical events, =0 means This is a zero-filling event.
[0111] The masked attention weights are: in: Finally, a weighted summation of the doctors' recent event representations is performed to obtain the candidate doctor's recent state representation relative to the current patient's problem, i.e., the time-ordered score: This indicates the candidate doctor's recent patient history prior to the current order and dynamically tracks more relevant historical events based on the current patient's issue. (Follow-up...) It will be combined with CQM semantic matching representation and structured feature cross representation and enter into the fusion layer.
[0112] In some embodiments, in addition to multi-head attention, LSTM, GRU, and Transformer temporal encoders can also be used to model recent doctor consultation events.
[0113] 3) CQM Semantic Matching Branch: A two-layer multilayer perceptron matching network based on explicit semantic interaction features is adopted. This branch takes into input the semantically aligned current patient complaint vector and the candidate doctor's historical consultation problem profile vector, and constructs the original vector, element-wise product, element-wise absolute difference, cosine similarity, and vector validity label. The above matching features are sequentially passed through 256-dimensional and 128-dimensional fully connected layers, non-linear activation, and Dropout, and then output the semantic matching correction score through linear layering.
[0114] The CQM semantic matching branch is used to characterize the degree of match between the patient's current questions and the candidate physician's historical areas of expertise. For patient orders... and candidate doctors The input is the semantically aligned current question vector of the patient. Doctor's historical patient problem profile vector .
[0115] First, concatenate the two to obtain the original input for the CQM semantic matching branch: .
[0116] To reveal the interaction between the modeled patient's problems and the physician's historical problem profile, we further constructed element-wise matching features: in, This represents element-wise multiplication. Represents the element-wise absolute difference. Represents cosine similarity. These indicate whether the two embeddings are valid. Element-wise product is used to characterize the consistency of two semantic vectors in the same dimension, while absolute difference is used to characterize the degree of deviation between them in the semantic space.
[0117] Subsequently, a multilayer perceptron is used to map the matching features to a CQM semantic matching representation, i.e., a semantic enhancement correction score: in: ; ; ; ; It is a non-linear activation function. This indicates regularization operations such as normalization and Dropout.
[0118] Finally, the CQM branch output The outputs of the patient-doctor semantic matching representation, along with the outputs of the structured feature cross-branch and the doctor's recent event time-series branch, will enter the subsequent fusion layer.
[0119] 4) Merge the residuals of each score: superimpose the base score with the temporal correction score and the semantic enhancement correction score to obtain the original recommendation probability and initial ranking without resource constraints.
[0120] After the aforementioned three representation branches, the model yields: ; ; ;in, This represents the semantic matching information between the patient's current problem and the doctor's historical areas of expertise (i.e., CQM semantic matching representation). It represents the explicit cross and implicit nonlinear combination information between basic matching features (i.e., basic matching cross representation). This indicates the candidate doctor's recent patient care status before the current order (i.e., a timeline representation of the doctor's recent events).
[0121] First, the basic matching cross branch serves as the main sorting branch, outputting the basic recommendation score: in: ; ; , Let represent the basic cross-feature fusion vector between patient i and candidate doctor d. Represents a learnable weight vector. This represents the bias scalar. This score reflects the relative matching degree obtained solely from basic doctor-patient matching information. It is subsequently fused with temporal correction scores and semantic matching correction scores, and converted into the final recommendation probability.
[0122] The formula above packages the basic identities, numerical values, and cross-features of the patient and doctor into a set of numerical vectors. Through a linear weighted calculation, it calculates an initial matching score. The higher the score, the better the match between the doctor and the current patient is based solely on the basic features; the lower the score, the worse the match. However, this score is not a matching probability of 0 to 1; it is only an intermediate initial score (logit) that will be fed into an activation function to convert it into a probability.
[0123] Secondly, the doctor's recent event timeline branch outputs a timeline correction score: in: ; ; . This represents the time-adjusted raw score corresponding to the doctor's recent service status. This score reflects the impact of the doctor's recent patient care content, service pace, and dynamic workload on the current doctor-patient matching result.
[0124] To control the influence of doctors' recent event information on different samples, the model further learns a sample-level gating coefficient. The gating input consists of information such as the current patient semantics, the doctor's recent state, the difference in their interaction, and the doctor's dynamic workload, denoted as: The gating factor is calculated as follows: in: Gating coefficient The time-series correction score controls the actual impact of different patient-doctor samples. A value closer to 1 indicates that the model considers the candidate doctor's recent service status more valuable for the current recommendation; a value closer to 0 indicates that the model primarily relies on the basic matching information for ranking. Ultimately, the time-series branch supplements the original basic matching score using the formula "gating coefficient × time-series correction score," rather than replacing it.
[0125] Therefore, the actual contribution of the doctor's recent event time series branch to the recommendation score is: in, As the time-series residual weights, the model in this embodiment takes: .
[0126] Next, the CQM semantic matching branch outputs a semantic matching correction score: in: ; ; .
[0127] The actual contribution of the CQM branch to the recommendation score is: in, For CQM residual weights, the following values are used in the current model: .
[0128] Finally, the model uses residual summation to fuse the scores from the three branches, obtaining the original recommendation logit before resource equilibrium constraints: Right now: ,in: .
[0129] For a binary classification ranking task, the original recommendation logit is input into a sigmoid function to obtain the predicted probability of the patient choosing a candidate doctor: in: , This indicates that before resource balancing constraints are imposed, patient orders... Select candidate doctor The predicted probability. The subsequent resource balancing constraint module will... or Based on this, doctor workload and doctor resource level constraints are introduced to obtain the final ranking score.
[0130] In some embodiments, the temporal correction weight and semantic enhancement weight can be adaptively adjusted in the range of 0.05 to 0.5 without changing the three-branch fusion architecture.
[0131] S7. Based on the initial recommendation score, perform a secondary reordering of resource balancing by fusing multiple penalties, and output the corrected physician recommendation result; wherein, the multiple penalties include load penalty score and resource mismatch penalty score.
[0132] This step adds multiple penalty terms to the initial recommendation score to perform a secondary re-ranking of physician matching recommendations, outputting a corrected recommendation score. Specifically, the total penalty value corresponding to the multiple penalty terms is subtracted from the original recommendation probability, and the candidate doctors are re-ranked to output a final Top-K recommendation list that takes into account matching accuracy, disease suitability, load balancing, and traffic fairness. The multiple penalty terms include five types of management constraints: real-time physician load penalty, advanced resource penalty, patient complexity and physician level difference penalty, penalty for mild cases occupying advanced physician resources, and penalty for severe cases being assigned to low-level physicians.
[0133] The resource balancing constraint module is used after the model has obtained patient orders through multi-branch fusion. With candidate doctors The original recommendation for Logit: And the corresponding original choice probability: As described in S3 above, for candidate doctors Its time The load penalty score is: .in, , The larger the value, the higher the doctor's current workload.
[0134] As mentioned in S4 above, the advanced resource penalty item is... Patient complexity and doctor level gap Punishment for consuming advanced medical resources in cases of mild illness ; Punishment for assigning low-level doctors to critical care cases The total resource penalty term, combining the doctor load penalty and resource mismatch penalty, is: + in: ; These represent the weights of the physician workload penalty and the advanced physician resource penalty, respectively. The weight parameters for each penalty were determined and selected during a grid search on the validation set in October 2024, and then fixed for use on the test set in November 2024, selected under the aforementioned validation target and candidate grid.
[0135] In one embodiment, the physician load penalty weight Overall penalty weight for high-level doctors The weighting of penalties based on patient complexity and doctor level The penalty weight for consuming advanced medical resources for mild cases The penalty weight for low-level doctors is assigned to critical care cases. =0.100.
[0136] In this implementation, resource constraints are applied to the probability space.
[0137] First, as described in S6 above, the original selection probability is obtained based on the original recommendation logit: Then, subtracting the total resource penalty, we obtain the calibrated selection probability: in: , It is a very small constant used to avoid probabilities of 0 or 1.
[0138] Finally, the calibrated probabilities are remapped to the final sorted logit: in: .
[0139] Ultimately, regarding patient orders candidate doctor set ,according to Sort from highest to lowest: The computational mechanism in this embodiment maintains the accuracy of patient-doctor matching while suppressing excessive resource consumption by overloaded and advanced doctors, thereby improving doctor load balancing and the rationality of resource allocation. It reduces the phenomenon of recommendations being overly concentrated on overloaded or advanced doctors while ensuring recommendation accuracy.
[0140] In one embodiment, the rearrangement can also be implemented in other ways, such as: in addition to the post-score subtraction penalty, the balance loss can be directly embedded into the end-to-end optimization of model training, and the linear weighted fusion of matching score and resource balance score can be used.
[0141] In some embodiments, load penalties, disease qualification penalties, or some penalty dimensions may be enabled separately as needed.
[0142] In some embodiments, the selection of the Top-K target number of rearrangements can be, according to actual needs, including but not limited to selecting Top1, Top3, Top5, Top10, etc.
[0143] This completes the entire process of the intelligent physician matching method for internet-based medical services described in Embodiment 1 and its preferred embodiments.
[0144] To verify the superiority of the intelligent physician matching method for internet-based medical services described in the above embodiments, the following experiments will demonstrate this.
[0145] 1) Comparison of Physician Recommendation Accuracy. The recommendation model Med-ResBalance-CQM constructed using the method described in this application will be compared with other common models in the prior art. The comparison metrics include: NDCG@3: Measures the quality of the actual selection of doctors in the Top-3 recommendation list; a higher metric is better. Recall@3: Measures whether the actual chosen doctors appear in the Top-3 recommendation list; the higher the better. MRR: Measured by the average of the last few doctors in the actual selection ranking; the higher the better.
[0146] Table 1 Comparison of Model Recommendation Accuracy Referring to Table 1, in terms of recommendation accuracy, Med-ResBalance-CQM achieved the highest NDCG@3, Recall@3, and MRR values among all compared models. Specifically, NDCG@3 reached 0.7524, an improvement of 0.0202 compared to the strongest baseline DCN-V2's 0.7322; MRR increased from 0.7276 to 0.7478, indicating that Med-ResBalance-CQM not only effectively recalled the actual selected doctors to the Top-3, but also further improved the ranking of the actual doctors in the recommendation list.
[0147] 2) Comparison of resource balance indicators. The following indicators are selected for comparison: LevelGap@3: The average gap between patient complexity and physician resource level in Top-3 recommendations; a lower level is better. OverMatch@3: The degree to which low-complexity patients require high-level physician resources; the lower this indicator, the better; UnderMatch@3: The degree to which highly complex patients are referred to lower-level physicians; a lower value is better. AvgLoad@3: The average load score of the top-3 recommended physicians; a lower score is better. HighLoadShare@3: The percentage of doctors with high workloads among the top-3 recommended doctors; the lower this indicator, the better. ExposureGini@3: Gini coefficient of doctor exposure distribution; the lower the value, the better. ExposureJain@3: Jain fairness index of doctor exposure distribution; the higher the index, the better.
[0148] Table 2 Comparison of Resource Balance Indicators Referring to Table 2, from the perspective of resource balancing results, Med-ResBalance-CQM is optimal in LevelGap@3, OverMatch@3, AvgLoad@3, HighLoadShare@3, ExposureGini@3, and ExposureJain@3; UnderMatch@3 is not the lowest, but it shows the most significant improvement in overall resource mismatch and excessive occupation of advanced doctors.
[0149] Table 3 Comparison of Med-ResBalance-CQM and DCN-V2 in various indicators Referring to Table 3, compared to the basic recommendation model DCN-V2 (currently the most powerful basic recommendation model), Med-ResBalance-CQM achieves the highest NDCG@3, Recall@3, and MRR among all models in terms of recommendation accuracy. Regarding resource balancing results, Med-ResBalance-CQM is optimal in LevelGap@3, OverMatch@3, AvgLoad@3, and HighLoadShare@3; it only slightly lags behind in UnderMatch@3, but shows the most significant improvement in overall resource mismatch and over-utilization of advanced physicians.
[0150] Considering both recommendation accuracy and resource balancing results, Med-ResBalance-CQM has two core advantages over traditional recommendation models. First, the model improves patient-doctor matching through semantic pairing and multi-branch modeling, resulting in doctors with genuine preferences appearing higher in the recommendation list. Second, the model reduces the excessive concentration of senior and heavily overloaded doctors through resource balancing constraints, making the recommendation results more aligned with the resource allocation needs of internet hospitals.
[0151] Unlike methods that improve resource metrics solely through post-processing rearrangement, Med-ResBalance-CQM first enhances the quality of the original ranking through basic matching cross-validation, physician recent event time-series modeling, and CQM semantic matching residuals. Then, it applies lightweight resource balancing constraints during the ranking stage, thus simultaneously improving recommendation accuracy and resource balancing metrics.
[0152] Example 2: This embodiment, based on Embodiment 1 and its preferred embodiments described above, further includes the following steps: S7. The physician recommendation results are evaluated based on multi-dimensional indicators and the parameters are optimized iteratively.
[0153] This step optimizes the model involved in the intelligent physician matching method for internet-based diagnosis and treatment described in Embodiment 1 and its preferred embodiments by comprehensively evaluating multiple dimensions, iterating backward on features, model weights, and balancing penalty parameters.
[0154] The multi-dimensional indicators include four main categories of evaluation metrics, simultaneously measuring algorithm performance and hospital management effectiveness: 1) Matching accuracy metrics: NDCG@K, Recall@K, MRR; 2) Disease resource matching indicators: average grade difference, mild case resource occupancy rate, severe case mismatch rate; 3) Load balancing metrics: Recommended average workload for doctors, percentage of doctors with high workload; 4) Traffic fairness indicators: Gini coefficient for doctor exposure, Jain fairness index; based on the evaluation results, iterate the features, model branch weights, and balance penalty parameters to continuously adapt to changes in outpatient business.
[0155] The four categories of indicators are used to evaluate the accuracy of doctor-patient matching, the degree of resource matching between patient complexity and doctor qualification level, the degree of dynamic load balancing for doctors, and the fairness of doctor exposure allocation, respectively. Specifically, the patient-resource matching indicator corresponds to the patient-doctor bilateral resource matching mechanism of this application; the load balancing indicator corresponds to doctor load modeling based on multi-dimensional real-time business signals; and the traffic fairness indicator is used to evaluate the distribution of doctor recommendation opportunities after resource balancing rearrangement. The parameters in the resource balancing rearrangement are determined on the validation set, and the test set is only used to verify the final recommendation effect.
[0156] Example 3: Secondly, the present invention also provides a physician intelligent matching system for internet-based medical consultations, the system comprising: The data acquisition and preprocessing module is configured to acquire consultation data and perform time-consistency preprocessing, wherein the consultation data includes online internet consultation data.
[0157] The feature construction module is configured to construct doctor-patient matching features based on preprocessed consultation data, the doctor-patient matching features including: doctor workload and resource level features; The real-time load calculation module is configured to quantify the real-time load of doctors and the degree of mismatch between medical resources between patients and doctors based on doctor load and resource level characteristics, and generate corresponding load penalty scores and resource mismatch penalty scores. The semantic alignment enhancement module is configured to perform semantic alignment enhancement on medical scenarios based on query-query contrastive learning for doctor-patient matching scenarios. The initial recommendation score acquisition module is configured to output an unconstrained initial recommendation score by fusing the recommendation results of the three-branch model. The three-branch model includes: a basic matching cross-branch model, a doctor's recent temporal attention branch model, and a CQM semantic matching branch model. The CQM semantic matching branch model calculates the similarity of doctor-patient demands based on the aligned medical scene semantics and generates a semantic enhancement correction score. The resource balancing secondary ranking module is configured to perform resource balancing secondary ranking based on the initial recommendation score and multiple penalties, and output the corrected physician recommendation results; wherein, the multiple penalties include load penalty score and resource mismatch penalty score.
[0158] In one embodiment, the system further includes: The comprehensive assessment and operational analysis module is configured to output multi-dimensional indicator reports, providing data support for outpatient resource allocation, doctor scheduling, and hierarchical medical treatment policies.
[0159] In some embodiments, the above-mentioned modules of the system can be deployed independently or multiple modules can be deployed together. For example, only the real-time load calculation module or only the semantic alignment enhancement module can be deployed; or multiple modules can be merged into an integrated terminal.
[0160] It is understood that the intelligent physician matching system for internet-based medical treatment provided in this embodiment of the invention corresponds to the intelligent physician matching method for internet-based medical treatment described above. The explanations, examples, and beneficial effects of the relevant content can be referred to the corresponding content in the intelligent physician matching method for internet-based medical treatment, and will not be repeated here.
[0161] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0162] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for intelligent physician matching for internet-based medical consultations, characterized in that, The method includes: Acquire consultation data and perform time consistency preprocessing, wherein the consultation data includes online internet consultation data; Based on the preprocessed consultation data, a doctor-patient matching feature is constructed, which includes: doctor workload and resource level features; Based on the characteristics of physician load and resource level, the real-time load of physicians and the degree of mismatch of medical resources between patients and physicians are quantified respectively, and corresponding load penalty scores and resource mismatch penalty scores are generated. Semantic alignment enhancement in medical scenarios is achieved through query-query contrastive learning for doctor-patient matching scenarios. The three-branch model recommendation results are integrated to output an unconstrained initial recommendation score; the three-branch model includes: a basic matching cross-branch model, a doctor's recent temporal attention branch model, and a CQM semantic matching branch model; wherein, the CQM semantic matching branch model calculates the similarity of doctor and patient demands based on the aligned medical scene semantics and generates a semantic enhancement correction score; Based on the initial recommendation score, multiple penalties are fused to complete the secondary ranking of resource balancing, and the corrected physician recommendation results are output; wherein, the multiple penalties include load penalty score and resource mismatch penalty score.
2. The method as described in claim 1, characterized in that, The doctor-patient matching features also include: patient's past consultation records, candidate doctor's basic information and historical service statistics, patient and candidate doctor's past consultation relationship, patient's first chief complaint text and candidate doctor's historical text, and candidate doctor's recent historical order sequence.
3. The method as described in claim 1, characterized in that, Based on physician workload and resource level characteristics, real-time physician workload is quantified to generate a workload penalty score, including: in, This represents the final load penalty score; This represents the load signal after log compression; Indicates the original load signal; , , , These represent the number of patients seen by the doctor in the past 3 days. Patient volume in the past 7 days The weights of currently unfinished orders (Nunfin) and currently unreplied orders (Nunrep); This indicates that the normalized denominator comes from the 95th quantile of the training set.
4. The method as described in claim 1, characterized in that, Based on physician workload and resource level characteristics, the degree of medical resource mismatch between patients and physicians is quantified, and a resource mismatch penalty score is generated, including: Patients are classified into different levels based on the complexity of their condition, and doctors are classified into different levels based on their qualification level. Resource mismatch calculation includes: Advanced resource penalty items: ; Patient complexity and doctor level gap: ; Penalty for consuming advanced medical resources for mild cases: ; Penalty for assigning low-level doctors to critical care cases: ; in, Indicates the doctor's qualification level; Indicates the level of complexity of the patient's condition; The resource mismatch penalty score is the sum of the high-level resource penalty item, the gap between patient complexity and doctor level, the penalty for using high-level doctor resources for mild cases, and the penalty for assigning low-level doctors to severe cases.
5. The method as described in claim 1, characterized in that, The query-query contrastive learning based on doctor-patient matching scenarios aligns and enhances the semantics of medical scenarios, including: Construct a dedicated sample pair for Query-Query doctor-patient consultation comparison learning. The sample pair includes: positive samples with the patient's current consultation content as the anchor point, the patient's historical consultation content with selected doctors as the positive samples, and non-paired samples within the batch as negative samples. The text encoder maps the text corresponding to the sample pairs into vector representations, which are then stacked into a matrix. The similarity of all samples within a batch is obtained based on matrix operations; The text encoder is trained based on similarity calculation loss and symmetric bidirectional contrast loss. The symmetric bidirectional contrast loss includes: the average training loss for identifying the correct corresponding text from the doctor's historical consultation question texts when the patient's current question text is used as the query object, and the average training loss for identifying the correct corresponding text from the patient's current question text when the doctor's historical consultation question texts are used as the query object. Generate semantic alignment enhancement results based on the trained text encoder.
6. The method as described in claim 2, characterized in that, The basic matching cross-branch model utilizes a basic cross network to learn explicit high-order cross relationships and implicit nonlinear combination relationships between basic doctor-patient matching features; wherein: The basic doctor-patient matching features include patient's past consultation records, candidate doctor's basic information and historical service statistics, and the relationship between the patient and the candidate doctor in past consultations. The basic cross-connect network includes the DCN-V2 cross-connect network.
7. The method as described in claim 2, characterized in that, The doctor's recent temporal attention branch model is based on the recent historical order sequence features of candidate doctors. It uses a multi-head attention mechanism to match the patient's current needs with the types of cases recently treated by the doctor, and generates a temporal correction score.
8. The method as described in claim 1, characterized in that, The CQM semantic matching branch model calculates the similarity of doctor-patient demands based on the aligned medical scene semantics and generates a semantic enhancement correction score, including: The semantically aligned current patient question vector and the doctor's historical patient question profile vector are used as the original inputs to the CQM semantic matching branch; Construct element-wise matching features to show the interaction between patient problems and doctors' historical problem profiles; The matching features are mapped to CQM semantic matching representations based on a multilayer perceptron.
9. The method according to any one of claims 1-8, characterized in that, The method further includes: The physician recommendation results are evaluated based on a comprehensive assessment of multi-dimensional indicators to iteratively optimize parameters; the multi-dimensional indicators include matching accuracy indicators, disease resource adaptation indicators, load balancing indicators, and traffic fairness indicators.
10. A physician intelligent matching system for internet-based medical consultations, characterized in that: The system includes a data acquisition and preprocessing module, configured to acquire consultation data and perform time-consistency preprocessing, wherein the consultation data includes online internet consultation data. The feature construction module is configured to construct doctor-patient matching features based on preprocessed consultation data, the doctor-patient matching features including: doctor workload and resource level features; The real-time load calculation module is configured to quantify the real-time load of doctors and the degree of mismatch between medical resources between patients and doctors based on doctor load and resource level characteristics, and generate corresponding load penalty scores and resource mismatch penalty scores. The semantic alignment enhancement module is configured to perform semantic alignment enhancement on medical scenarios based on query-query contrastive learning for doctor-patient matching scenarios. The initial recommendation score acquisition module is configured to output an unconstrained initial recommendation score by fusing the recommendation results of the three-branch model. The three-branch model includes: a basic matching cross-branch model, a doctor's recent temporal attention branch model, and a CQM semantic matching branch model. The CQM semantic matching branch model calculates the similarity of doctor-patient demands based on the aligned medical scene semantics and generates a semantic enhancement correction score. The resource balancing secondary ranking module is configured to perform resource balancing secondary ranking based on the initial recommendation score and multiple penalties, and output the corrected physician recommendation results; wherein, the multiple penalties include load penalty score and resource mismatch penalty score.