Heterogeneous graph neural network-based medical resource prediction method, device and equipment

By constructing a heterogeneous graph neural network model and combining hierarchical attributes and survival factors, the problem of multi-source heterogeneous data processing for medical resource prediction in emergency response was solved, enabling accurate prediction of medical resource consumption and improving the reliability of emergency decision-making.

CN121812092APending Publication Date: 2026-04-07ACADEMY OF MILITARY MEDICAL SCIENCES
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing medical resource prediction technologies struggle to effectively handle multi-source heterogeneous data in emergency response, neglect the functional differences between different types of medical institutions, lack tiered transportation standards, and fail to consider losses during transit, resulting in low prediction accuracy and an inability to meet the needs of refined emergency decision-making.

Method used

A heterogeneous graph reflecting the hierarchical treatment structure of the medical system is constructed. The information of adjacent nodes is aggregated using a heterogeneous graph neural network model. Combined with the masking rules of hierarchical attributes and the survival rate factor, the transfer ratio is generated, and the expected number of wounded patients received and the resource consumption of medical institutions are calculated.

Benefits of technology

It enables accurate prediction of medical resource consumption, improves the rationality and accuracy of prediction results, avoids resource redundancy or insufficiency, and provides reliable emergency decision support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121812092A_ABST
    Figure CN121812092A_ABST
Patent Text Reader

Abstract

The invention provides a medical resource prediction method, device and equipment based on a heterogeneous graph neural network, and relates to the technical field of emergency medical management. The prediction method comprises the following steps: constructing a heterogeneous graph; performing coding to obtain initial embedding representation, and inputting the initial embedding representation into a heterogeneous graph neural network model; updating the initial embedding representation into a final node embedding representation; constraining the transfer relevancy to generate a transfer ratio; and calculating the expected wounded receiving amount and the medical resource consumption amount. According to the method, multi-source heterogeneous information is effectively fused by constructing the heterogeneous graph reflecting the layered treatment structure and the neural network model; the mask rule constraint and the survival rate factor are utilized, so that the transfer path is ensured to conform to the hierarchical service logic, and the flow prediction deviation caused by neglecting the loss on the way of the traditional model is also corrected; therefore, the accurate prediction of the medical resource consumption of the mechanisms at all levels is realized, and the scientificity and reliability of emergency decision making are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of emergency medical management technology, and in particular to a medical resource prediction device and equipment based on heterogeneous graph neural networks. Background Technology

[0002] In emergency responses to major natural disasters, large-scale industrial accidents, or various public emergencies, the precise planning and dynamic allocation of medical resources are crucial for ensuring efficient treatment of the injured and sick, and reducing mortality and disability rates. Emergency medical rescue systems typically involve a complex flow of resources from the disaster or accident site to medical institutions at various levels. This process encompasses not only the dynamic changes in the number of people awaiting treatment but also the real-time consumption and replenishment of various medical resources such as beds, operating tables, medicines, and emergency equipment. Therefore, accurately predicting the number of injured and sick arriving at different levels of medical institutions and their corresponding resource needs based on the real-time situation of the emergency has become one of the core tasks of intelligent emergency management and public safety systems.

[0003] Existing medical resource forecasting technologies mostly employ statistical analysis methods based on historical data or classic time series forecasting models. Some technologies attempt to introduce graph neural networks to model the spatial relationships between medical sites, treating various medical institutions as nodes in a graph and predicting traffic flow by learning the topological connections between nodes. These methods have achieved some success in handling single-type nodes or relatively simple logistics and transportation scenarios, enabling preliminary predictions of future overall trends.

[0004] However, the aforementioned existing technologies have significant limitations when dealing with complex emergency triage scenarios. First, traditional prediction methods typically treat graph structures as homogeneous graphs, ignoring the fundamental differences in functional positioning, carrying capacity, and business logic among different entities such as on-site emergency points, primary medical institutions, and advanced specialized hospitals, making it difficult to capture high-order dependencies between different types of nodes. Second, existing prediction models often lack embedded mechanisms for strict triage procedures, easily producing prediction results that contradict actual medical treatment processes, such as incorrectly predicting that patients will bypass primary triage points and directly enter higher-level central hospitals. Furthermore, general flow prediction models usually assume that the number of transported objects remains constant during the transfer process, ignoring the potential loss of critically ill patients during long-distance transport due to worsening conditions, road obstructions, or delayed treatment. This leads to overestimation of the actual number of patients received by subsequent medical institutions, resulting in redundant occupation or misallocation of valuable emergency resources.

[0005] In summary, due to the failure to effectively solve the problem of unified modeling of multi-source heterogeneous data, and the lack of comprehensive consideration of the logical constraints of hierarchical diagnosis and treatment flow and the loss factors during the process, the existing technology is unable to achieve high-precision prediction of medical resource consumption in multi-level, highly dynamic emergency environments, and cannot meet the needs of refined emergency command and decision-making. Summary of the Invention

[0006] In a first aspect, the present invention provides a method for predicting medical resources based on heterogeneous graph neural networks, comprising: Construct a heterogeneous graph that reflects the hierarchical treatment structure of the medical system; the heterogeneous graph includes wounded patient nodes, medical institution nodes with different hierarchical attributes, and transit edges that connect the wounded patient nodes and the medical institution nodes or the medical institution nodes at different levels to represent the flow relationship; The attribute features of the wounded node, the medical institution node, and the transfer edge are obtained, encoded to obtain an initial embedding representation, and input into a heterogeneous graph neural network model. Using the heterogeneous graph neural network model, the information of adjacent nodes is aggregated based on the topological structure of the heterogeneous graph, and the initial embedding representation is updated to the final node embedding representation; The transit correlation between nodes is calculated based on the final node embedding representation, and the transit correlation is constrained by the masking rules constructed based on the hierarchical attributes to generate the transit ratio. Based on the transfer ratio and in conjunction with the survival rate factor that reflects the risks during transportation, the expected number of wounded patients received by the medical institution node is calculated. Calculate the medical resource consumption of the medical institution node based on the expected number of wounded patients received.

[0007] In an optional implementation, the attribute features of the wounded soldier node, the medical institution node, and the transfer edge are obtained, and encoded to obtain an initial embedding representation, which is calculated using the following formula: ; in, , and These represent the original attribute characteristics of the wounded node, the medical institution node, and the transfer edge, respectively. , and These represent the feature encoding functions corresponding to the wounded node, the medical institution node, and the transfer edge, respectively, and the output dimension of each feature encoding function is configured to a uniform dimension d; , and These represent the initial embedded representation after encoding.

[0008] In an optional implementation, the medical institution node includes primary medical institution nodes and advanced medical institution nodes; The construction of the heterogeneous graph reflecting the hierarchical treatment structure of the medical system includes: Define a first type of transfer edge from the wounded node to the primary medical institution node, and a second type of transfer edge from the primary medical institution node to the advanced medical institution node; The masking rule is specifically configured as follows: only paths corresponding to the first type of transfer edge and the second type of transfer edge are allowed to connect, and paths from the wounded node to the advanced medical institution node are prohibited.

[0009] In an optional implementation, the heterogeneous graph neural network model is trained using supervised learning, and the optimization objective of the training is to minimize the joint loss function; the joint loss function is calculated using the following formula: ; in, and Represents the weighting coefficient; Represents the predicted loss from transshipment; Represents the predicted loss from resource consumption; The predicted loss of the transfer The calculation formula is: ; The predicted loss of resource consumption The calculation formula is: ; in, Represents the set of wounded nodes; Represents a set of nodes representing primary healthcare institutions; Represents a set of nodes representing high-level medical institutions; The vector representing the transfer ratio of node v as predicted by the model under the injury category k-line. This represents the corresponding true distribution; This represents the resource consumption of institution v as predicted by the model. Represents actual consumption; Represents the cross-entropy loss function; This represents the mean squared error loss function.

[0010] In an optional implementation, the step of aggregating adjacent node information based on the topological structure of the heterogeneous graph using the heterogeneous graph neural network model includes: For the target node, select the corresponding edge type information aggregation matrix according to the type of the connecting edge; Obtain the adjacent nodes of the target under a specific edge type, and concatenate the embedded representation of the adjacent nodes with the embedded representation of the connecting edges; The concatenated features are linearly transformed using the edge type information aggregation matrix, and combined with the self-connection information of the target node, an updated node embedding representation is obtained through a nonlinear activation function.

[0011] In an optional implementation, the concatenated features are linearly transformed using the edge type information aggregation matrix, and combined with the self-connection information of the target node, an updated node embedding representation is obtained through a nonlinear activation function, calculated using the following expression: ; in, σ represents the embedding representation of the target node v at layer l+1; σ represents the nonlinear activation function; R represents the set of edge types; This represents the set of neighboring nodes of the target node v under edge type r; This represents the adjacency normalization weight coefficient; This represents the information aggregation matrix for edge type r in the l-th layer; This represents a vector concatenation operation; This represents the transformation matrix of the self-connected information in layer l; This represents the embedding representation of the target node v at layer l.

[0012] In an optional implementation, the adjacency normalization weight coefficient The calculation formula is: ; in, It represents the modulus of the set of neighboring nodes of the target node v under edge type r.

[0013] In an optional implementation, the formula for calculating the transfer ratio matrix is: ; in, This represents the transfer rate from node u to node v for the k-th type of injury. This represents the degree of correlation between node u and node v in the transport of the k-th type of injury; This represents an element in the mask matrix, when the mask rules allow node u to transfer to node v. =1, otherwise =0.

[0014] In an optional implementation, the formula for calculating the transport relevance is: ; in, This represents the output layer function for injury category k; and These represent the final node embedding representations of node u and node v, respectively. The edge features between node u and node v; This represents the transport relevance of the output.

[0015] In an optional implementation, the expression for calculating the expected number of wounded patients received by the medical facility node is: ; in, This represents the number of type k injured persons received by medical institution node v. This represents the set of upstream nodes that are allowed to transfer wounded personnel to node v according to the masking rules. This represents the number of type k injuries awaiting transfer from upstream node u. This represents the transfer rate from node u to node v; The survival factor represents the survival rate from node u to node v.

[0016] In an optional implementation, the medical institution nodes are divided into primary medical institution nodes and advanced medical institution nodes; The set of upstream nodes that are allowed to transfer wounded personnel to node v according to the masking rule includes: When the medical institution node v is a primary medical institution node At that time, the upstream node set For the set of wounded nodes The expected number of wounded soldiers to be received is calculated according to the following formula: ; When the medical institution node v is a high-level medical institution node At that time, the upstream node set For the set of primary healthcare institution nodes The expected number of wounded soldiers to be received is calculated according to the following formula: ; in, exist The initial number of wounded is known at that time; The time represents the expected number of wounded patients received, calculated by this node as a medical institution node.

[0017] In an optional implementation, the medical resource consumption of the medical institution node is calculated using the following formula: ; in, The medical resource consumption of the medical institution node v; k represents the injury category; The expected number of patients receiving the k-th type of injury at medical institution node v; The final node embedding representation representing the medical institution node v; This represents a resource consumption estimation function for a specific resource type.

[0018] In an optional implementation, the attribute features of the wounded node are selected from at least one of spatial location features, the number of wounded under different injury levels, and waiting time for treatment; and / or, The attribute characteristics of the medical institution node are selected from at least one of the following: geographical location characteristics, institution type identifier, specialty capability characteristics, medical and nursing staff characteristics, material reserve characteristics, and institution load status characteristics; and / or, The attribute features of the transfer edge are selected from at least one of the following: spatial distance between nodes, estimated transfer time, road traffic flow level, and transfer priority coefficient.

[0019] Secondly, the present invention provides a medical resource prediction device based on heterogeneous graph neural networks, comprising: A construction module is used to construct a heterogeneous graph that reflects the hierarchical treatment structure of the medical system; the heterogeneous graph includes wounded patient nodes, medical institution nodes with different hierarchical attributes, and transit edges connecting the wounded patient nodes and the medical institution nodes or the medical institution nodes at different levels to represent the flow relationship; The input module is used to obtain the attribute features of the wounded node, the medical institution node and the transfer edge, encode them to obtain an initial embedding representation, and input them into the heterogeneous graph neural network model; The update module is used to utilize the heterogeneous graph neural network model to aggregate the information of adjacent nodes based on the topological structure of the heterogeneous graph, and update the initial embedding representation to the final node embedding representation; The constraint module is used to calculate the transit correlation between nodes based on the embedded representation of the final node, and to constrain the transit correlation using the masking rules constructed based on the hierarchical attributes to generate a transit ratio. The calculation module is used to calculate the expected number of wounded patients to be received by the medical institution node based on the transfer ratio and in combination with a survival rate factor that reflects the risks during transportation. The calculation module is also used to calculate the medical resource consumption of the medical institution node based on the expected number of wounded patients received.

[0020] Thirdly, the present invention provides a computer device including a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the medical resource prediction method based on heterogeneous graph neural networks as described in any of the foregoing embodiments.

[0021] Fourthly, the present invention provides a computer storage medium storing a computer program, which, when executed on a processor, implements the medical resource prediction method based on heterogeneous graph neural networks according to any one of the foregoing embodiments.

[0022] The embodiments of this application have the following beneficial effects: This method constructs a heterogeneous graph reflecting the hierarchical medical treatment structure, providing a refined structural model of the injured, medical institutions at different levels, and the flow relationships between them within the healthcare system. This modeling approach effectively distinguishes the essential differences in functional positioning and carrying capacity among different entities, overcoming the shortcomings of traditional methods that simplify complex medical networks into homogeneous networks and fail to capture specific dependencies between nodes. This lays a solid data structure foundation for accurately describing the complex flow processes in emergency scenarios. Furthermore, by utilizing a heterogeneous graph neural network to aggregate adjacency information, it is possible to deeply mine and learn the high-order association features between the injured and institutions at various levels, achieving effective fusion and feature representation of multi-source heterogeneous information.

[0023] In the flow prediction stage, this method introduces a masking rule constraint mechanism based on hierarchical attributes and a survival rate factor reflecting transportation risks. The masking rule constraint ensures that the predicted transfer paths strictly follow the business logic of tiered medical treatment, effectively avoiding the probability allocation of illegal paths such as bypassing tiers for transfer, and significantly improving the rationality of the prediction results in terms of tactical or management rules. At the same time, the expected reception volume is calculated by combining the survival rate factor, which fully considers the travel time, traffic conditions, and losses during the journey due to the deterioration of the injury, correcting the problem of overestimation of reception volume caused by the assumption of flow conservation in traditional models, and ensuring the authenticity of the arrival data.

[0024] Ultimately, through the precise quantification of the effective flow of wounded personnel described above, this method can map the number of arriving wounded personnel to the specific consumption of medical resources. This prediction method, which comprehensively considers heterogeneous structural dependence, hierarchical flow logic constraints, and the risk of loss during transit, can significantly improve the accuracy and robustness of predicting the demand for key medical resources such as beds, operating tables, and medicines. This effectively avoids excessive redundancy or under-allocation of resources, providing reliable decision support for the scientific planning and precise scheduling of medical resources in emergency situations. Attached Figure Description

[0025] To more clearly illustrate the technical solutions of this application, the accompanying drawings used in the embodiments will be briefly described below. It should be understood that the following drawings only show some embodiments of this application and therefore should not be considered as a limitation on the scope of protection of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0026] Figure 1 This is a schematic diagram of the hardware operating environment involved in an embodiment of the medical resource prediction method based on heterogeneous graph neural networks of the present invention; Figure 2 This is a flowchart illustrating Embodiment 1 of the medical resource prediction method based on heterogeneous graph neural networks of the present invention; Figure 3 This is a detailed flowchart of step S300 in Embodiment 2 of the medical resource prediction method based on heterogeneous graph neural network of the present invention; Figure 4 This is a schematic diagram of the module connections of the medical resource prediction device based on heterogeneous graph neural networks of the present invention. Detailed Implementation

[0027] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments.

[0028] The components of the embodiments of this application described and illustrated in the accompanying drawings can be arranged and designed in a variety of different configurations. Therefore, the following detailed description of the embodiments of this application provided in the drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0029] In the following, the terms “comprising,” “having,” and their cognates, which may be used in various embodiments of this application, are intended only to indicate a particular feature, number, step, operation, element, component, or combination thereof, and should not be construed as excluding, firstly, the presence of one or more other features, numbers, steps, operations, elements, components, or combinations thereof, or adding the possibility of one or more features, numbers, steps, operations, elements, components, or combinations thereof.

[0030] Furthermore, the terms "first," "second," and "third" are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0031] Unless otherwise specified, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which the various embodiments of this application pertain. Terms (such as those defined in commonly used dictionaries) shall be interpreted as having the same meaning as in their contextual meaning in the relevant technical field and shall not be construed as having an idealized or overly formal meaning, unless clearly defined in the various embodiments of this application.

[0032] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0033] like Figure 1 The diagram shown is a structural schematic of the hardware operating environment of the terminal involved in an embodiment of the present invention.

[0034] This invention relates to a medical resource prediction system (device) based on heterogeneous graph neural networks. This system can be a PC, or a mobile terminal device such as a smartphone, tablet, or laptop. The visual navigation optimization system may include: a processor 1001 (e.g., a CPU), a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. The communication bus 1002 is used to establish communication between these components. The user interface 1003 may include a display screen, an input unit such as a keyboard, or a remote control; optionally, the user interface 1003 may also include a standard wired interface or a wireless interface. The network interface 1004 may optionally include a standard wired interface or a wireless interface (e.g., a Wi-Fi interface). The memory 1005 may be a high-speed RAM or a stable memory, such as a disk drive. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001. Optionally, the medical resource prediction system based on heterogeneous graph neural networks may also include RF (Radio Frequency) circuitry, audio circuitry, a Wi-Fi module, etc. In addition, the visual navigation optimization system can also be equipped with other sensors such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, which will not be described in detail here.

[0035] Those skilled in the art will understand that Figure 1 The visual navigation optimization system shown is not intended to limit it and may include more or fewer components than illustrated, or combine certain components, or have different component arrangements. Figure 1 As shown, the memory 1005, which is a computer-readable storage medium, may include an operating system, a data interface control program, a network connection program, and a visual navigation optimization program.

[0036] In summary, the method provided by this invention utilizes heterogeneous graph neural networks combined with masking rules and survival factors to effectively solve the problems of flow logic constraints and in-transit loss correction in tiered treatment scenarios, achieving accurate prediction of medical resource consumption and significantly improving the reliability of emergency decision-making.

[0037] Example 1 Reference Figure 2 This embodiment provides a medical resource prediction method based on heterogeneous graph neural networks, including: Step S100: Construct a heterogeneous graph reflecting the hierarchical treatment structure of the medical system; the heterogeneous graph includes wounded patient nodes, medical institution nodes with different hierarchical attributes, and transfer edges connecting the wounded patient nodes and the medical institution nodes or the medical institution nodes at different levels to represent the flow relationship.

[0038] This step involves abstracting real-world medical rescue scenarios into a computer-processable mathematical model (graph structure).

[0039] The term "heterogeneous graph" refers to a graph that contains nodes of different types (such as wounded soldiers and institutions) or edges of different types.

[0040] The aforementioned "tiered treatment structure" refers to a hierarchical relationship (such as primary and advanced) between medical institutions, rather than a flat network.

[0041] The specific processing can be as follows: Define a set of nodes V and a set of edges E; instantiate the objects to be treated as "injured persons nodes"; instantiate hospitals or ambulances at all levels as "medical institution nodes," and mark the hierarchical attribute of each institution node (e.g., level 0 represents a primary institution, level 1 represents a senior institution). Then, define edges: establish connections according to the actual transfer path. "Transfer edges" are only established between the injured person and the institution, or between institutions at different levels (e.g., from lower to higher level), to represent potential transfer relationships, thus obtaining a static graph G=(V, E) containing topological information, clarifying who can flow to whom.

[0042] This step enables the structured representation of a complex healthcare system, distinguishes the functional roles of different entities, and lays the foundation for subsequent algorithms to differentiate and process different objects.

[0043] For example, an adjacency matrix or adjacency list can be used to store the graph structure, and a type vector can be used to label the category and level of the nodes.

[0044] Step S200: Obtain the attribute features of the wounded node, the medical institution node, and the transfer edge, encode them to obtain an initial embedding representation, and input them into the heterogeneous graph neural network model.

[0045] This step is the data preprocessing and feature extraction stage. It transforms real-world multidimensional data into a uniform-dimensional numerical vector that can be understood by neural networks.

[0046] Specifically, the following processing can be performed: First, feature acquisition is performed, collecting the original attribute features of the injured person nodes (such as location, number of injured persons), medical institution nodes (such as location, medical capacity, level), and transfer edges (such as distance, road conditions); then, encoding is performed, using a feature encoding function (such as a multilayer perceptron MLP or a linear transformation layer) to map the original features with different physical meanings; then, input processing is performed, using the mapped vector as the "initial embedding representation" to input into the subsequent neural network, thereby obtaining feature vectors (Embeddings) of a unified dimension for all nodes and edges.

[0047] This step solves the problem of the difficulty in directly jointly calculating multi-source heterogeneous data (such as discrete injury categories and continuous distance values), and provides standardized input for the model.

[0048] For example, three independent MLP networks can be designed for the wounded, the institution, and the edge respectively, with the same number of nodes in the output layer, thereby achieving dimension alignment.

[0049] Step S300: Using the heterogeneous graph neural network model, aggregate the information of adjacent nodes based on the topological structure of the heterogeneous graph, and update the initial embedding representation to the final node embedding representation; This step is the core model inference stage. The model uses a graph structure to allow nodes to "exchange information" and thus understand the context (for example, a primary institution may have limited resources but connects a large number of seriously injured patients, so its feature representation should change).

[0050] The processing can include: using the hierarchical structure of Heterogeneous Graph Neural Networks (HGNNs): aggregation: for each node in the graph, find its neighboring nodes; then, according to the topology, aggregate the feature information of the neighboring nodes to the current node according to certain weights or transformation rules; further combine the initial information of the current node itself with the aggregated neighboring information to generate a new feature representation, namely the "final node embedding representation", so that each node obtains a high-order feature vector that integrates its own attributes and its surrounding environment (such as supply and demand relationships).

[0051] This step can capture the dependencies between nodes (such as the impact of casualty distribution on institutional pressure), which is more accurate than predictions based solely on the characteristics of the nodes themselves.

[0052] For example, attention-based mechanisms or specific types of graph convolution algorithms can be used.

[0053] Step S400: Calculate the transit correlation between nodes based on the final node embedding representation, and constrain the transit correlation using the masking rules constructed based on the hierarchical attributes to generate a transit ratio.

[0054] This step is crucial for predicting the flow of wounded. It not only involves predicting where the wounded "want to go" (relevance), but also restricting where they "can go" according to rules (mask constraints).

[0055] The process can include: first, calculating the relevance; based on the final node embedding representation obtained in the previous step, calculating the matching degree between the source node (e.g., the wounded) and the target node (e.g., the institution), obtaining a scalar score (relevance); then, applying mask constraints to construct a mask based on hierarchical attributes. For example, if the rule prohibits the wounded from going directly to a higher-level institution, the mask value for the corresponding position is 0 (or negative infinity); subsequently, generating a ratio; combining the relevance with the mask (e.g., multiplying or superimposing), and after normalization (e.g., Softmax), obtaining the transfer ratio, thus obtaining a transfer ratio matrix, in which the transfer probability of paths that do not conform to the hierarchical transfer rules is forced to 0 or an extremely low value.

[0056] This step forcibly embeds the business logic (tiered treatment rules) into the algorithm to prevent the model from outputting predictions that violate common sense or tactical rules (such as skipping levels for treatment). Implementation method: Relevance can be calculated using vector dot products or neural network layers.

[0057] The transfer ratio P = Softmax(relevance + mask bias), where the mask bias for illegal paths is set to -∞.

[0058] Step S500: Based on the transfer ratio and in conjunction with a survival rate factor that reflects the risks during transport, calculate the expected number of wounded patients to be received by the medical facility node.

[0059] This step calculates how many wounded will actually be treated at each medical facility. The introduction of a "survival rate factor" is a modification of the traditional flow conservation model, taking into account losses during transport.

[0060] The process may include, for each medical institution node, finding all upstream nodes (injured persons or lower-level institutions) pointing to that node; obtaining the number of patients to be transferred from the upstream nodes; then calculating: number to be transferred × transfer ratio (probability of flow) × survival rate factor (proportion of patients not lost en route); summing the calculation results from all sources. Result: obtaining the expected number of effective injured persons arriving at each level of medical institution (i.e., the actual number received).

[0061] This step improves the realism of the prediction. Ignoring survival rates (i.e., assuming all shipments arrive on time) would lead to overestimating the number of patients received by hospitals, resulting in wasted resources.

[0062] For example, the formula logic can be: The survival rate factor w can be a preset constant or a variable learned based on edge features (distance, time).

[0063] Step S600: Calculate the medical resource consumption of the medical institution node based on the expected number of wounded patients received.

[0064] This step transforms the number of "people" into the demand for "materials," which is the ultimate goal of the method. Specifically, it establishes a mapping relationship between the number of wounded and resource consumption.

[0065] The input is the expected number of wounded patients to be received by the institution (which may also take into account the institution's own characteristics); the corresponding resource requirements (such as how many beds, surgical kits, etc.) are calculated through a mapping function, and the specific predicted values ​​of medical resource consumption for medical institutions at all levels are output.

[0066] This step directly serves logistical support and command decision-making, realizing a closed loop from situational awareness to resource planning.

[0067] For example, it could be a simple linear regression model (consumption = coefficient × number of people) or a nonlinear neural network (consumption = Net(number of people, organizational characteristics)) to fit scale effects or complex consumption patterns.

[0068] In summary, this embodiment provides a medical resource prediction method based on heterogeneous graph neural networks. The method first constructs a heterogeneous graph reflecting the hierarchical treatment structure of the medical system, abstracting the injured, medical institutions with different hierarchical attributes, and their flow relationships as nodes and transfer edges in the graph. Then, the attribute features of each node and edge are acquired and encoded, and input into the heterogeneous graph neural network model. The graph topology is used to aggregate adjacent node information to update the node feature representations. In the flow prediction stage, the method calculates the transfer relevance based on the updated node representations and introduces a masking rule based on hierarchical attributes to constrain the transfer relationships to generate transfer ratios that conform to business logic. Furthermore, by combining a survival rate factor reflecting the risks during transportation, the expected number of injured received by each level of medical institution is corrected and calculated. Finally, based on this expected number of received patients, accurate prediction of the medical resource consumption of each medical institution is achieved.

[0069] Example 2 Based on the foregoing embodiments, this embodiment provides a medical resource prediction method based on heterogeneous graph neural networks. In step S200, the attribute features of the wounded node, the medical institution node, and the transfer edge are obtained, encoded to obtain an initial embedding representation, and calculated using the following formula (Formula 1): .

[0070] in, , and These represent the original attribute features of the wounded node, the medical institution node, and the transfer edge (such as specific latitude and longitude values, number of wounded, etc.). , and These represent the feature encoding functions corresponding to the wounded node, the medical institution node, and the transfer edge, respectively, and the output dimension of each feature encoding function is configured to a uniform dimension d; , and These represent the initial embedded representations (vectors) after encoding.

[0071] The above calculations are specific mathematical implementation constraints for the "feature encoding" step.

[0072] Because the wounded, the institution, and the perimeter have completely different physical properties (e.g., "injury severity" and "number of beds" have different physical meanings), they cannot be directly compared. Therefore, this step uses three independent functions ( , and Process these three types of data separately. Dimension alignment: Force the output vectors of these three functions to have the same length (dimension d).

[0073] These encoding functions ( This can be implemented using a multilayer perceptron (MLP) or a linear transformation layer. For example, if It is a 5-dimensional vector. It is a 10-dimensional vector, let d=64. Then... It is a neural network with 5→64 layers. It is a neural network layer with 10→64 layers, thus mapping heterogeneous original data to the same semantic space.

[0074] This computational method is a prerequisite for heterogeneous graph neural networks to function. Only when the features of different types of nodes are aligned to the same dimension d can the information aggregation in subsequent steps (such as vector addition and concatenation) be mathematically feasible.

[0075] In some implementations, the medical institution nodes include primary medical institution nodes and advanced medical institution nodes; The abstract medical institution is subdivided into two specific levels: primary institutions (usually referring to front-line or grassroots treatment units) and advanced institutions (usually referring to rear or specialized central hospitals).

[0076] When constructing graph data, each institution node can be labeled or categorized based on its actual functional positioning, treatment capabilities, or geographical location. For example, institutions with triage and initial emergency care capabilities can be labeled as "primary," while institutions with general surgery and critical care capabilities can be labeled as "advanced." This divides the set of medical institutions into two non-overlapping subsets or subsets with a clear hierarchical relationship.

[0077] The aforementioned tiered approach enables the model to differentiate the resource characteristics and carrying capacity of institutions at different levels, providing a data foundation for subsequent logical judgments regarding "tiered treatment" and avoiding prediction bias caused by treating all hospitals the same. For example, a "Type" field can be added to the node's data structure, such as using 0 to represent primary and 1 to represent advanced; or two different node lists can be directly created when constructing the graph.

[0078] Step S100 involves constructing a heterogeneous graph reflecting the tiered treatment structure of the medical system, including: Step S110: Define a first type of transfer edge from the wounded node to the primary medical institution node, and a second type of transfer edge from the primary medical institution node to the advanced medical institution node.

[0079] This step explicitly defines the "edge connection rules" in the graph topology. It stipulates that the flow between entities is unidirectional and hierarchical, thus defining the legal physical paths.

[0080] The specific processing can be as follows: When constructing the adjacency relationship of the graph, traverse all nodes: establish "Type I transit edges": create connections only between the wounded node (starting point) and the primary medical institution node (ending point). Establish "Type II transit edges": create connections only between the primary medical institution node (starting point) and the advanced medical institution node (ending point), thereby generating a directed graph structure with specific flow constraints, forming a cascaded topological channel of "wounded → primary institution → advanced institution".

[0081] This step accurately maps the physical flow mechanism of "step-by-step transfer" in the real medical system, ensuring that the graph structure itself contains the logic of the business process.

[0082] For example, when constructing an adjacency matrix or adjacency list, only the two specific node pair combinations mentioned above are populated with connection values ​​or edge objects, and no edges are created for other combinations (such as high-level pointing to primary, or high-level pointing to wounded).

[0083] Step S120, the masking rule is specifically configured as follows: only the paths corresponding to the first type of transfer edge and the second type of transfer edge are allowed to connect, and the path from the wounded node to the advanced medical institution node is prohibited.

[0084] This step sets "soft constraints" in the algorithm's reasoning process. A mask is a filter used to forcibly block paths that, while mathematically possible, are not permitted by business rules (i.e., "skipping levels for transfers") when calculating transfer probabilities.

[0085] The process can be as follows: Construct a mask matrix (or logical judgment function) corresponding to the relationships between nodes. For paths belonging to "Type 1 transport edges" (injured person to primary level) and "Type 2 transport edges" (primary level to advanced level), set the mask value to "allowed" (e.g., a value of 1, or 0 in the logarithmic field). For paths where "injured person nodes directly point to advanced medical institution nodes," set the mask value to "prohibited" (e.g., a value of 0, or negative infinity -∞ in the logarithmic field), thus obtaining a constraint matrix that clarifies which transport relationships are legal and which are illegal.

[0086] This step prevents neural network models from assigning probabilities to "transferring to higher-level facilities" during training or prediction in pursuit of better data fit—a violation of regulations. It forces the model's output transfer plan to strictly adhere to the tiered medical service system (processing must first be handled by a primary care facility; direct transfer to higher-level facilities is prohibited), thereby significantly improving the compliance and reliability of prediction results in practical applications.

[0087] For example, construct a matrix M where row indices represent source nodes and column indices represent target nodes. Iterate through the matrix elements; if the source node is a wounded soldier and the target node is a high-level organization (i.e., a forbidden path), set the element at that position Mij = -∞ (negative infinity); for edges that satisfy the first and second categories defined above (i.e., allowed paths), set Mij = 0. Before calculating the Softmax probability, this mask matrix is ​​superimposed (added) onto the relevance score.

[0088] In some implementations, the heterogeneous graph neural network model is trained using supervised learning, and the optimization objective of the training is to minimize the joint loss function. The joint loss function is calculated using the following formula (Formula 2): ; in, and Represents the weighting coefficient; Represents the predicted loss from transshipment; This represents the predicted loss from resource consumption.

[0089] The predicted loss of the transfer The calculation formula (Formula 3) is as follows: ; The predicted loss of resource consumption The calculation formula (Formula 4) is as follows: ; in, Represents the set of wounded nodes; Represents a set of nodes representing primary healthcare institutions; Represents a set of nodes representing high-level medical institutions; The vector representing the transfer ratio of node v as predicted by the model under the injury category k-line. This represents the corresponding true distribution; This represents the resource consumption of institution v as predicted by the model. Represents actual consumption; Represents the cross-entropy loss function; This represents the mean squared error loss function.

[0090] The aforementioned "heterogeneous graph neural network model is trained using supervised learning, and its optimization objective is to minimize the joint loss function" represents the overall training strategy of the model. "Supervised learning" means that the model training uses known real labels (i.e., historical real casualty flow directions and real resource consumption) as "standard answers" to guide model learning. The "joint loss function" indicates that the model optimizes for both tasks simultaneously (flow direction prediction and resource prediction), rather than training two separate models. The process involves calculating the total error (i.e., joint loss) between the model's predicted output and the real labels in each training iteration, and using backpropagation to adjust the parameters (weights) in the neural network to minimize this total error. Result: A trained model capable of accurately predicting both transport flow direction and resource consumption simultaneously is obtained. Advantages: Through a multi-task learning mechanism, the model learns transport logic while simultaneously learning resource prediction; the two mutually reinforce each other, avoiding overfitting that might occur with a single task and improving the model's generalization ability.

[0091] Formula 2 above is the specific mathematical definition of the joint loss function. It consists of two weighted parts: transfer prediction loss. and resource consumption prediction loss . and These are weighting coefficients that are set manually.

[0092] Formula 2 yields a single scalar value, Loss, which serves as the sole objective for model optimization. The calculation of Formula 2 allows for adjusting the importance of the two tasks based on actual needs. For example, if greater emphasis is placed on the accuracy of resource prediction, the value can be appropriately increased. It balances the gradient contributions of two tasks with different characteristics, preventing one task from dominating the training process.

[0093] Formula 3 above is the formula for calculating the "transfer prediction loss". It measures the difference between the model's predicted flow direction (probability distribution) of casualties and the actual flow direction. Specifically, for each node with a transfer task and for each type of injury, the cross-entropy between its predicted flow direction distribution and the actual distribution is calculated. Then, the errors of all nodes are summed to quantify the accuracy of the flow direction prediction. The smaller this value, the closer the model's predicted transfer plan is to the actual historical record.

[0094] The calculation of Formula 3 forces the model to learn the correct transfer rules and preferences (e.g., learning that seriously injured patients are more likely to go to high-level hospitals), ensuring that the predicted transfer matrix conforms to real-world logic.

[0095] Formula 4 above is the formula for calculating the "resource consumption prediction loss." It measures the difference between the quantity of resources predicted by the model and the actual quantity consumed. The square of the difference between the predicted and actual consumption for each medical institution is calculated and then summed to quantify the accuracy of the resource prediction. The smaller the value, the more accurate the prediction.

[0096] Formula 4 optimizes the calculation directly for the final business objective (resource quantity), ensuring that the model not only flows correctly but also calculates the correct specific material quantity.

[0097] refer to Figure 3 In some embodiments, step S300, utilizing the heterogeneous graph neural network model, aggregates information about adjacent nodes based on the topological structure of the heterogeneous graph, including: Step S310: For the target node, select the corresponding edge type information aggregation matrix according to the type of the connecting edge.

[0098] This step is crucial for processing heterogeneous graphs. In heterogeneous graphs, different edges represent different physical meanings (e.g., the edge E representing "wounded soldier → primary facility"). PH0 Edge E with "Primary Institution → Advanced Institution" H0H1 (These have different business logics). This step aims to assign dedicated parameter matrices to connections of different natures to differentiate the processing of information from different sources.

[0099] The specific processing steps may include: determining the node currently updating features (i.e., the "target node" v); identifying the type r of the edges connected to this node (e.g., whether it's a connection from a wounded person or a connection from a subordinate organization); and indexing and retrieving the weight matrix W specifically trained for this edge type r from the model parameter set. r l (where l represents the number of network layers), thus determining a specific linear transformation operator for subsequent mathematical operations.

[0100] This step enables differentiated modeling of different business relationships. Compared to homogeneous graph networks where all edges share the same weight, this method can more accurately capture the different impact weights of resource consumption on the flow relationships at different levels.

[0101] For example, the program maintains a parameter dictionary where the key is the edge type and the value is the corresponding tensor matrix.

[0102] Step S320: Obtain the adjacent nodes of the target under a specific edge type, and concatenate the embedded representation of the adjacent nodes with the embedded representation of the connecting edges.

[0103] This step is the preparation stage for information fusion. It combines "who the neighbors are" (node ​​features) with "how the connections are" (edge ​​features) to form a complete contextual information package.

[0104] The specific processing steps may include first obtaining adjacent nodes, finding all neighbors u of the target node v under a specific edge type r (e.g., all wounded patients awaiting transfer in a primary institution), and obtaining the current embedding representation h of the neighbors. u l Then, obtain the edge features, that is, obtain the edge features g connecting the two nodes. uv (For example, embedding vectors of road conditions and distance); then concatenate these two vectors end to end, merging them into a longer vector, thus generating a composite feature vector containing "entity attributes + environment attributes".

[0105] This step explicitly introduces edge features (such as distance and travel time). In medical resource prediction, simply knowing "how many wounded people there are" is not enough; "how far away the wounded people are and how good the road is" directly affect arrival time and survival rate. The concatenation operation ensures that these environmental factors directly participate in feature learning.

[0106] For example, using the vector concatenation operator || (such as torch.cat in PyTorch), a vector concatenation operation of dimension d can be performed. node The node vector and dimension are d edge The edge vectors are merged into a single vector of dimension d. node +d edge The vector.

[0107] Step S330: The concatenated features are linearly transformed using the edge type information aggregation matrix, and combined with the self-connection information of the target node, the updated node embedding representation is obtained through a nonlinear activation function.

[0108] This step is the core computational step for the update. It processes (transforms) the information gathered from the surrounding environment and integrates the historical memory of the nodes themselves (self-connection), ultimately generating new higher-order features. Processing procedure (what it does): Linear transformation: Multiply the concatenated vector obtained in step S320 by the aggregation matrix W selected in step 1. r l This is equivalent to weighting and extracting features from composite features; then, aggregation (an implicit step) is performed, typically by summing or weighting the transformation results of all neighbors; further, a self-join is performed, that is, calculating the feature transformation W0 of the target node itself. l h v l (i.e., self-connection information), and add it to the information aggregated from neighbors; this step ensures that the node does not forget its original attributes (such as the inherent number of beds in the hospital) when updating; perform non-linear activation, and pass the above addition result through the activation function σ (such as ReLU or Tanh) to obtain the final node embedding representation h of the target node in layer l+1. v l+1 .

[0109] In this step, linear transformation maps the high-dimensional spliced ​​features to a feature space suitable for the next layer of processing; self-connection maintains the stability of node features and prevents excessive smoothing of information in multiple aggregations; and nonlinear activation gives the model the ability to handle complex nonlinear relationships (for example, resource consumption and the number of wounded may not be a simple direct proportional relationship).

[0110] Furthermore, the concatenated features are linearly transformed using the edge type information aggregation matrix, and combined with the self-connection information of the target node, an updated node embedding representation is obtained through a nonlinear activation function, which is calculated using the following expression (Formula 5): ; in, σ represents the embedding representation of the target node v at layer l+1; σ represents a nonlinear activation function, such as ReLU, Tanh, etc.; R represents the set of edge types (e.g., PH0, H0H1). This represents the set of neighboring nodes of the target node v under edge type r; This represents the adjacency normalization weight coefficient; This represents the information aggregation matrix (weight parameters) for edge type r in the l-th layer. This represents a vector concatenation operation; This represents the transformation matrix of the self-connected information in layer l; This represents the embedding representation (feature vector) of the target node v at layer l (before the update).

[0111] The processing logic in neighbor information aggregation is as follows: traverse each type of edge r and each neighbor u under that type of edge; then concatenate them, first combining the features of neighbor nodes. Features of connecting edges These are pieced together to form a complete information package containing "who connected" and "the connection status". Transformation: using a matrix specific to this edge type. Perform a linear transformation (feature extraction) on the concatenated vector; normalization: multiply by a coefficient. To prevent feature values ​​from becoming excessively large (exploding) due to an excessive number of neighbors, a summation is performed: all processed neighbor information is accumulated. Self-information preservation refers to the features of the node itself at the next higher level. Perform a linear transformation, preserving the node's historical memory. Fusion and activation. (...) adds "aggregated external information" to "its own internal information." This is achieved through a nonlinear function. Mapped to a new feature space.

[0112] The algorithm in Formula 5 uses different methods for different r. The model learned to differentiate information from different sources (e.g., information from wounded soldiers and information from lower-level hospitals have different weights). Multimodal fusion: through The operation explicitly incorporates edge features (such as road conditions and distance) into the node update process, making the impact of injured people who are far away on the hospital different from those who are close by.

[0113] Furthermore, the adjacency normalization weight coefficient The calculation formula (Formula 6) is as follows: ; in, Represents a set The "modulus" or "cardinality" of the target node v is the modulus of the set of neighboring nodes of edge type r, that is, the number (degree) of the neighbors of the target node v under edge type r.

[0114] The processing logic is as follows: calculate how many specific types of neighbors the target node is connected to. Take the reciprocal of this number as a weight coefficient, thus obtaining a weight value that is inversely proportional to the number of neighbors.

[0115] Its advantage lies in the fact that if a hospital connects to 1000 wounded patients, the summation value would be 100 times larger than that of a hospital connecting only 10 wounded patients, leading to gradient explosion or model bias towards highly connected nodes. Dividing by This is equivalent to calculating the "average impact," ensuring that the characteristics of nodes of different scales are on the same order of magnitude, thus guaranteeing numerical stability.

[0116] Example 3 Based on the foregoing embodiments, this embodiment provides a medical resource prediction method based on heterogeneous graph neural networks, wherein the calculation formula for the transport ratio matrix (Formula 7) is: ; in, This represents the transfer rate (probability value, range 0~1) from node u to node v for the k-th type of injury. The original score (Score) is calculated by the transport correlation model of nodes u and v for the k-th type of injury. The elements (0 or 1) in the mask matrix represent the elements that allow node u to move to node v according to the masking rules. =1, otherwise =0. exp(·) represents the exponential function, used to map the correlation to the positive number domain.

[0117] Formula 7 generates a normalized probability distribution P, where the sum of the probabilities of all compliant paths is 1, and the probability of all non-compliant paths is strictly 0. Unlike general regularization, this multiplicative mask is a "hard constraint," completely preventing the model from predicting paths that violate the tiered medical treatment rules (such as injured people going directly to rear hospitals). After denominator normalization, the output P value can be directly interpreted as the "transfer ratio" (e.g., 30% to Hospital A, 70% to Hospital B), which is convenient for subsequent calculation of the number of people.

[0118] For example, in deep learning frameworks, operations are typically performed in the logarithmic field for numerical stability. That is: P = Softmax(z + Mask_Bias). Mask_Bias is 0 when M = 1 and -∞ (negative infinity) when M = 0. This is mathematically equivalent to the multiplication mask in the formula.

[0119] Furthermore, the formula for calculating the transport relevance (Formula 8) is as follows: ; in, This represents the output layer function for injury category k, used to integrate node embeddings and edge feature information (prediction head). and These represent the final node embedding representations of node u and node v (the final node embedding representations after HGNN updates). Represents the edge characteristics (such as distance and road conditions) between node u and node v. The output represents the transport relevance (scalar value).

[0120] The calculation method of Formula 8 does not only consider distance ( ), and it's not just about the size of the hospital ( Instead of relying solely on individual factors, this approach comprehensively considers the patient's condition, hospital capacity, and transportation risks, achieving a multi-factor integrated decision-making process. Personalized prediction: It outputs different correlations for different injury categories k, simulating differentiated transfer logics in reality such as "prioritizing the transfer of seriously injured patients" and "treating lightly injured patients at the nearest facility."

[0121] Furthermore, the expression for calculating the expected number of wounded patients received by the medical institution node (Formula 9) is as follows: ; in, The number of type k injured persons received by medical institution node v (prediction result); This represents the set of upstream nodes that are allowed to transfer wounded to node v according to the masking rules (e.g., for a high-level hospital, the upstream is a primary hospital). This represents the number of type k injuries awaiting transfer from upstream node u. This represents the transfer rate (flow probability) from node u to node v. The survival factor (coefficient, between 0 and 1) represents the survival rate from node u to node v.

[0122] The most significant contribution of the calculation method in Formula 9 above lies in the introduction of... Traditional models often assume w=1 (flow conservation), but in emergency medical scenarios, deaths en route are significant. This formula ensures that the predicted number is the number of people who "arrive alive and require medical resources," rather than simply the number "sent out," thus avoiding over-preparation of resources; furthermore, through... The limitation on the summation range echoes the rules governing tiered medical treatment.

[0123] In some implementations, the medical institution nodes are divided into primary medical institution nodes and advanced medical institution nodes; The set of upstream nodes that are allowed to transfer wounded to node v according to the masking rule. Includes (specific definition): When the medical institution node v is a primary medical institution node At that time, the upstream node set For the set of wounded nodes The expected number of wounded soldiers to be received is calculated according to the following formula (Formula 10): .

[0124] When the medical institution node v is a high-level medical institution node At that time, the upstream node set For the set of primary healthcare institution nodes The expected number of wounded soldiers to be received is calculated according to the following formula (Formula 11): .

[0125] in, exist The initial number of wounded is known at that time; The time represents the expected number of wounded patients received, calculated by this node as a medical institution node.

[0126] The calculation methods of formulas 9 and 10 above map the real-world operational process of "tiered evacuation and treatment." By breaking down the general formula into two step-by-step formulas, accurate mathematical modeling of the complex process is achieved, ensuring that the consumption prediction of medical resources at each level is based on the actual and effective number of injured people arriving.

[0127] In some implementations, the medical resource consumption of the medical institution node is calculated using the following formula (Formula 12): ; in, This represents the medical resource consumption of the medical institution node v (e.g., the hospital needs to prepare 10 surgical kits or open 50 beds). This is a comprehensive value that can be calculated for a specific resource type (such as beds); k represents the injury category. The expected number of casualties received by medical institution node v for the k-th type of injury (this is a core intermediate result calculated through previous steps). The final node embedding representation of the medical institution node v (the high-order feature vector updated by HGNN). This represents a resource consumption estimation function for a specific resource type.

[0128] Compared to the traditional simple linear conversion (number of people multiplied by a coefficient), the introduction of institutional embedding features... It can capture individual differences between institutions (some hospitals are more efficient and consume less). Flexibility: through... The function can learn to automatically adapt to different consumption patterns of different resource types (such as beds, medicines, and blood) without the need for manually setting complex consumption rules.

[0129] In some implementations, the attribute features of the wounded node are selected from at least one of spatial location features, the number of wounded under different injury levels, and the waiting time for treatment.

[0130] In some implementations, the attribute characteristics of the medical institution node are selected from at least one of the following: geographical location characteristics, institution type identifier, specialty capability characteristics, medical and nursing staff characteristics, material reserve characteristics, and institution load status characteristics.

[0131] In some implementations, the attribute features of the transfer edge are selected from at least one of the following: spatial distance between nodes, estimated transfer time, road traffic flow level, and transfer priority coefficient.

[0132] refer to Figure 4 This application also provides a medical resource prediction device based on heterogeneous graph neural networks, comprising: Module 10 is used to construct a heterogeneous graph that reflects the hierarchical treatment structure of the medical system. The heterogeneous graph includes wounded patient nodes, medical institution nodes with different hierarchical attributes, and transit edges that connect the wounded patient nodes and the medical institution nodes or the medical institution nodes at different levels to represent the flow relationship. Input module 20 is used to obtain the attribute features of the wounded node, the medical institution node and the transfer edge, encode them to obtain an initial embedding representation, and input them into the heterogeneous graph neural network model; Update module 30 is used to utilize the heterogeneous graph neural network model to aggregate the information of adjacent nodes based on the topological structure of the heterogeneous graph, and update the initial embedding representation to the final node embedding representation; The constraint module 40 is used to calculate the transit correlation between nodes based on the embedded representation of the final node, and to constrain the transit correlation using the masking rules constructed based on the hierarchical attributes to generate a transit ratio. The calculation module 50 is used to calculate the expected number of wounded patients to be received by the medical institution node based on the transfer ratio and in combination with a survival rate factor that reflects the risks during transportation. The calculation module 50 is also used to calculate the medical resource consumption of the medical institution node based on the expected number of wounded patients received.

[0133] It is understood that the device in this embodiment corresponds to the medical resource prediction method based on heterogeneous graph neural networks in the above embodiments, and the options in the above embodiments are also applicable to this embodiment, so they will not be described again here.

[0134] This application also provides a computer device, which includes a processor and a memory. The memory stores a computer program, and the processor executes the computer program to implement the medical resource prediction method based on heterogeneous graph neural networks as described in any of the foregoing embodiments.

[0135] The processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including at least one of a Central Processing Unit (CPU), Graphics Processing Unit (GPU), Network Processor (NP), Digital Signal Processor (DSP), Application-Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application.

[0136] The memory can be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory is used to store computer programs, and the processor can execute the computer programs accordingly after receiving execution instructions.

[0137] This application also provides a computer storage medium storing a computer program, which, when executed on a processor, implements the medical resource prediction method based on heterogeneous graph neural networks according to any one of the foregoing embodiments.

[0138] The computer storage medium can be a readable storage medium, a non-volatile storage medium, or a volatile storage medium. For example, the computer storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0139] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that, in alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and combinations of blocks in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0140] In addition, the functional modules or units in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0141] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a smartphone, personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0142] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for predicting medical resources based on heterogeneous graph neural networks, characterized in that, include: Construct a heterogeneous graph that reflects the hierarchical treatment structure of the medical system; the heterogeneous graph includes wounded patient nodes, medical institution nodes with different hierarchical attributes, and transit edges that connect the wounded patient nodes and the medical institution nodes or the medical institution nodes at different levels to represent the flow relationship; The attribute features of the wounded node, the medical institution node, and the transfer edge are obtained, encoded to obtain an initial embedding representation, and input into a heterogeneous graph neural network model. Using the heterogeneous graph neural network model, the information of adjacent nodes is aggregated based on the topological structure of the heterogeneous graph, and the initial embedding representation is updated to the final node embedding representation; The transit correlation between nodes is calculated based on the final node embedding representation, and the transit correlation is constrained by the masking rules constructed based on the hierarchical attributes to generate the transit ratio. Based on the transfer ratio and in conjunction with the survival rate factor that reflects the risks during transportation, the expected number of wounded patients received by the medical institution node is calculated. Calculate the medical resource consumption of the medical institution node based on the expected number of wounded patients received.

2. The medical resource prediction method based on heterogeneous graph neural networks as described in claim 1, characterized in that, The attribute features of the wounded soldier node, the medical institution node, and the transfer edge are obtained and encoded to obtain an initial embedding representation, which is calculated using the following formula: ; in, , and These represent the original attribute characteristics of the wounded node, the medical institution node, and the transfer edge, respectively. , and These represent the feature encoding functions corresponding to the wounded node, the medical institution node, and the transfer edge, respectively, and the output dimension of each feature encoding function is configured to a uniform dimension d; , and These represent the initial embedded representation after encoding; and / or, The medical institution nodes include primary medical institution nodes and advanced medical institution nodes; The construction of the heterogeneous graph reflecting the hierarchical treatment structure of the medical system includes: Define a first type of transfer edge from the wounded node to the primary medical institution node, and a second type of transfer edge from the primary medical institution node to the advanced medical institution node; The masking rules are specifically configured as follows: only paths corresponding to the first type of transfer edge and the second type of transfer edge are allowed to connect, and paths directly pointing from the wounded node to the advanced medical institution node are prohibited; and / or, The heterogeneous graph neural network model is trained using supervised learning, and its optimization objective is to minimize the joint loss function. The joint loss function is calculated using the following formula: ; in, and Represents the weighting coefficient; Represents the predicted loss from transshipment; Represents the predicted loss from resource consumption; The predicted loss of the transfer The calculation formula is: ; The predicted loss of resource consumption The calculation formula is: ; in, Represents the set of wounded nodes; Represents a set of nodes representing primary healthcare institutions; Represents a set of nodes representing high-level medical institutions; The vector representing the transfer ratio of node v as predicted by the model under the injury category k-line. This represents the corresponding true distribution; This represents the resource consumption of institution v as predicted by the model. Represents actual consumption; Represents the cross-entropy loss function; Represents the mean squared error loss function; and / or, The process of aggregating neighboring node information based on the topological structure of the heterogeneous graph using the heterogeneous graph neural network model includes: For the target node, select the corresponding edge type information aggregation matrix according to the type of the connecting edge; Obtain the adjacent nodes of the target under a specific edge type, and concatenate the embedded representation of the adjacent nodes with the embedded representation of the connecting edges; The concatenated features are linearly transformed using the edge type information aggregation matrix, and combined with the self-connection information of the target node, an updated node embedding representation is obtained through a nonlinear activation function; and / or, The formula for calculating the expected number of wounded patients received by the medical institution node is as follows: ; in, This represents the number of type k injured persons received by medical institution node v. This represents the set of upstream nodes that are allowed to transfer wounded personnel to node v according to the masking rules. This represents the number of type k injuries awaiting transfer from upstream node u. This represents the transfer rate from node u to node v; The survival factor representing the survival rate from node u to node v; and / or, The medical institution nodes are divided into primary medical institution nodes and advanced medical institution nodes; The set of upstream nodes that are allowed to transfer wounded personnel to node v according to the masking rule includes: When the medical institution node v is a primary medical institution node At that time, the upstream node set For the set of wounded nodes The expected number of wounded soldiers to be received is calculated according to the following formula: ; When the medical institution node v is a high-level medical institution node At that time, the upstream node set For the set of primary healthcare institution nodes The expected number of wounded soldiers to be received is calculated according to the following formula: ; in, exist The initial number of wounded is known at that time; The time represents the expected number of wounded patients received, calculated by this node as a medical institution node; and / or, The medical resource consumption of the medical institution node is calculated using the following formula: ; in, The medical resource consumption of the medical institution node v; k represents the injury category; The expected number of patients receiving the k-th type of injury at medical institution node v; The final node embedding representation representing the medical institution node v; This represents a resource consumption estimation function for a specific resource type.

3. The medical resource prediction method based on heterogeneous graph neural networks as described in claim 2, characterized in that, The concatenated features are linearly transformed using the edge type information aggregation matrix, and combined with the self-connection information of the target node. An updated node embedding representation is then obtained through a nonlinear activation function, calculated using the following expression: ; in, σ represents the embedding representation of the target node v at layer l+1; σ represents the nonlinear activation function; R represents the set of edge types; This represents the set of neighboring nodes of the target node v under edge type r; This represents the adjacency normalization weight coefficient; This represents the information aggregation matrix for edge type r in the l-th layer; This represents a vector concatenation operation; This represents the transformation matrix of the self-connected information in layer l; This represents the embedding representation of the target node v at layer l.

4. The medical resource prediction method based on heterogeneous graph neural networks as described in claim 3, characterized in that, The adjacency normalization weight coefficient The calculation formula is: ; in, It represents the modulus of the set of neighboring nodes of the target node v under edge type r.

5. The medical resource prediction method based on heterogeneous graph neural networks as described in claim 1, characterized in that, The formula for calculating the transfer ratio matrix is: ; in, This represents the transfer rate from node u to node v for the k-th type of injury. This represents the degree of correlation between node u and node v in the transport of the k-th type of injury; This represents an element in the mask matrix, when the mask rules allow node u to transfer to node v. =1, otherwise =0.

6. The medical resource prediction method based on heterogeneous graph neural networks as described in claim 5, characterized in that, The formula for calculating the transit relevance is: ; in, This represents the output layer function for injury category k; and These represent the final node embedding representations of node u and node v, respectively. The edge features between node u and node v; This represents the transport relevance of the output.

7. The medical resource prediction method based on heterogeneous graph neural networks as described in claim 1, characterized in that, The attribute features of the injured node are selected from at least one of the following: spatial location features, number of injured persons under different injury levels, and waiting time for treatment; and / or, The attribute characteristics of the medical institution node are selected from at least one of the following: geographical location characteristics, institution type identifier, specialty capability characteristics, medical and nursing staff characteristics, material reserve characteristics, and institution load status characteristics; and / or, The attribute features of the transfer edge are selected from at least one of the following: spatial distance between nodes, estimated transfer time, road traffic flow level, and transfer priority coefficient.

8. A medical resource prediction device based on heterogeneous graph neural networks, characterized in that, include: A construction module is used to construct a heterogeneous graph that reflects the hierarchical treatment structure of the medical system; the heterogeneous graph includes wounded patient nodes, medical institution nodes with different hierarchical attributes, and transit edges connecting the wounded patient nodes and the medical institution nodes or the medical institution nodes at different levels to represent the flow relationship; The input module is used to obtain the attribute features of the wounded node, the medical institution node and the transfer edge, encode them to obtain an initial embedding representation, and input them into the heterogeneous graph neural network model; The update module is used to utilize the heterogeneous graph neural network model to aggregate the information of adjacent nodes based on the topological structure of the heterogeneous graph, and update the initial embedding representation to the final node embedding representation; The constraint module is used to calculate the transit correlation between nodes based on the embedded representation of the final node, and to constrain the transit correlation using the masking rules constructed based on the hierarchical attributes to generate a transit ratio. The calculation module is used to calculate the expected number of wounded patients to be received by the medical institution node based on the transfer ratio and in combination with a survival rate factor that reflects the risks during transportation. The calculation module is also used to calculate the medical resource consumption of the medical institution node based on the expected number of wounded patients received.

9. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing a computer program, and the processor executing the computer program to implement the medical resource prediction method based on heterogeneous graph neural networks as described in any one of claims 1-7.

10. A computer storage medium, characterized in that, It stores a computer program, which, when executed on a processor, implements the medical resource prediction method based on heterogeneous graph neural networks according to any one of claims 1-7.