Application proxy routing and forwarding method and system in cluster environment

By employing a two-layer adaptive filtering detection and a multi-level tree index structure, the application proxy routing and forwarding method solves the problems of resource manager selection and path optimization in a cluster environment, achieving efficient and stable resource management and request forwarding.

CN120675926BActive Publication Date: 2025-11-04北京科杰科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511141911.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-15
Publication Date
2025-11-04
Estimated Expiration
2045-08-15

AI Technical Summary

Technical Problem

Existing technologies cannot effectively cope with dynamic changes in a cluster environment. The resource manager selection mechanism lacks filtering and detection, which leads to request forwarding failures or increased latency. Traditional routing decision-making methods fail to dynamically select the optimal path, and hash mapping technology affects system performance when nodes change.

Method used

A two-layer adaptive filtering detection mechanism is used to screen available resource managers. A multi-level tree index structure is constructed and a dynamic path planning algorithm is used to map the path to a ring hash space through a hash algorithm to generate redirection URLs, thereby achieving efficient resource manager selection and path optimization.

Benefits of technology

It improves resource utilization, reduces network latency, enhances system scalability and fault tolerance, and ensures stable operation in a cluster environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120675926B_ABST
    Figure CN120675926B_ABST
Patent Text Reader

Abstract

The application provides an application proxy routing forwarding method and system in a cluster environment, relates to the technical field of computer networks, and comprises the following steps: acquiring a list of available resource managers by adopting a double-layer adaptive filtering detection mechanism; constructing a multi-level tree index structure based on an application program identifier and a target subset cluster identifier, and selecting an optimal resource manager by applying a dynamic path planning algorithm; and generating a redirection URL by ring-shaped hash space mapping and virtual node positioning. The application improves system response speed, enhances routing forwarding efficiency, optimizes load balancing capability, and improves stability and reliability of application access in a cluster environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer network technology, and in particular to an application proxy routing and forwarding method and system in a cluster environment. Background Technology

[0002] With the rapid development of distributed computing and cloud computing technologies, application deployment and management in cluster environments have become increasingly complex. In large-scale cluster environments, multiple applications run in parallel in different sub-clusters, and clients need to access these applications through resource managers. Traditional application proxy routing and forwarding technologies mainly rely on static configuration or simple load balancing strategies for request distribution, which cannot effectively cope with dynamically changing cluster environments.

[0003] In a clustered environment, application access requests need to be forwarded through an appropriate resource manager to ensure that requests are correctly routed to the sub-cluster where the target application resides. As a key component of the cluster, the resource manager is responsible for managing cluster resources and providing the application's access point. With the expansion of application scale and the increase in user requests, how to efficiently select a suitable resource manager and build reliable proxy forwarding rules has become a pressing issue in the current technological field.

[0004] Existing application proxy routing and forwarding methods still have some shortcomings. The existing resource manager selection mechanism lacks effective filtering and detection methods, and cannot identify and exclude unavailable resource managers in a timely manner, which may cause requests to be forwarded to unavailable nodes, resulting in access failures or increased latency. Traditional routing decision methods usually adopt static allocation strategies or simple load balancing algorithms, which lack consideration of network topology and path costs, and cannot dynamically select the optimal path based on the actual network conditions between the client and the resource manager, thus reducing the efficiency of request forwarding and user experience. Existing hash mapping technology has stability issues when dealing with changes in resource manager nodes. The addition or removal of nodes will cause a large number of hash mapping relationships to be redistributed, affecting the overall system performance and potentially causing service interruptions, making it difficult to adapt to dynamically changing cluster environments. Summary of the Invention

[0005] This invention provides an application proxy routing and forwarding method and system in a cluster environment, which can solve the problems in the prior art.

[0006] A first aspect of this invention provides an application proxy routing and forwarding method in a clustered environment, comprising:

[0007] Receive an access request from a client and obtain the application identifier from the access request;

[0008] A two-layer adaptive filtering detection mechanism is adopted. The candidate resource manager set is filtered by dynamic counting, and a secondary filtering is performed based on the time-series status to obtain a list of available resource managers. The list of available resource managers is then written into the address mapping table.

[0009] Query the application registration information based on the application identifier to obtain the target sub-cluster identifier where the application is located;

[0010] Based on the target sub-cluster identifier, the list of available resource managers is read from the address mapping table, a multi-level tree index structure is constructed, a dynamic path planning algorithm is used to calculate the path cost to the client, and the path cost is dynamically evaluated through a real-time updated heuristic function to select the resource manager with the lowest path cost as the target resource manager.

[0011] The application identifier is mapped to a ring hash space using a hash algorithm. The target resource manager identifier is located in the ring hash space through virtual nodes. A proxy forwarding rule table is constructed, and a redirect URL is generated.

[0012] The redirect URL is sent to the client.

[0013] In one optional embodiment, a two-layer adaptive filtering detection mechanism is employed. This involves dynamically counting and filtering the candidate resource manager set, performing secondary filtering based on temporal states to obtain a list of available resource managers, and writing the list of available resource managers into an address mapping table, including:

[0014] Obtain multiple sets of continuous response times from the resource manager, construct a response time distribution sequence, and calculate the load fluctuation factor of the resource manager based on the response time distribution sequence;

[0015] The response reliability is obtained by weighting the number of response timeouts of the resource manager based on the load fluctuation factor, and the performance counting threshold is dynamically adjusted according to the response reliability.

[0016] Collect multi-dimensional performance indicators of resource managers within the performance counting threshold range, combine the multi-dimensional performance indicators to calculate the stability score, and select resource managers whose stability score is greater than the preset stability benchmark value to form a first candidate set.

[0017] A state transition matrix is ​​constructed based on the historical performance data of each resource manager in the first candidate set, and the state transition probability of the resource manager is calculated based on the state transition matrix.

[0018] Based on the state transition probability, the stability of the resource managers in the first candidate set is predicted, and resource managers whose state transition probability is greater than the preset stable operation threshold and whose state retention time exceeds the minimum stable period are selected to form a list of available resource managers.

[0019] Write each identifier and network address information in the available resource manager list into the address mapping table, record the version information of the address mapping table, and save the version information before the update when the address mapping table is updated for rollback operation.

[0020] In an optional embodiment, predicting the stability of resource managers in the first candidate set based on the state transition probabilities includes:

[0021] Obtain the network topology connection relationship of the resource managers in the first candidate set, and determine the set of adjacent resource managers directly connected to the resource managers based on the network topology connection relationship;

[0022] Collect the performance fluctuation sequence of each adjacent resource manager and calculate the performance fluctuation intensity value of each adjacent resource manager; based on the timestamp information of the performance fluctuation sequence, calculate the propagation delay of the performance fluctuation from each adjacent resource manager to the resource manager, and construct a performance fluctuation propagation feature vector according to the propagation delay and the performance fluctuation intensity value.

[0023] A performance fluctuation propagation model is constructed using the performance fluctuation propagation feature vector, and the performance impact coefficient of each adjacent resource manager on the resource manager is calculated based on the performance fluctuation propagation model.

[0024] The state transition probability is corrected based on the performance impact coefficient to obtain a corrected state transition probability value that incorporates network topology propagation effects.

[0025] Substitute the corrected state transition probability value into the Markov prediction model to output the state sequence of the resource manager within a preset time window;

[0026] The stable state percentage of the resource manager is calculated based on the state sequence. When the stable state percentage is greater than a preset stable operation threshold and the duration of consecutive stable states exceeds the minimum stable period, the resource manager is determined to meet the stability prediction requirements.

[0027] In an optional embodiment, reading the list of available resource managers from the address mapping table based on the target sub-cluster identifier and constructing a multi-level tree index structure includes:

[0028] Based on the target sub-cluster identifier, the resource manager list is read from the address mapping table, and the resource manager identifier information, network topology information and service type information in the resource manager list are obtained to obtain the resource manager information set to be processed.

[0029] Based on the resource manager identification information, spatial clustering method is used to divide the resource manager into regions and establish a region connection graph to obtain a first-level index hierarchical region structure.

[0030] Based on the hierarchical regional structure and network topology information of the first-level index, the resource managers in the region are divided into subnets according to network prefixes and weighted connection relationships are established to obtain the second-level index layer network structure.

[0031] Based on the network structure and service type information of the second-level index layer, the resource managers in the network layer are grouped according to service quality indicators and service dependencies are established to obtain the service structure of the third-level index layer.

[0032] Assign globally unique identifiers to resource manager nodes in the three-level index layer service structure and establish a node attribute table to obtain the resource manager node attribute set;

[0033] Based on the resource manager node attribute set, the node status is monitored by heartbeat detection and node splitting or merging operations are triggered to obtain an optimized node distribution structure.

[0034] Based on the optimized node distribution structure, the relationships and distance metrics between nodes are updated and hotspot access path information is written to determine the final tree index structure, resulting in a multi-level tree index structure.

[0035] In one optional embodiment, a dynamic path planning algorithm is used to calculate the path cost to the client. The path cost is dynamically evaluated using a heuristic function that is updated in real time, and the resource manager with the lowest path cost is selected as the target resource manager.

[0036] Based on a multi-level tree index structure, the path cost is decomposed into node cost and edge cost. Processing capacity and load status information are collected for each node, and network quality and transmission delay information are collected for each edge to obtain the path cost matrix.

[0037] A heuristic function is established based on the deviation between the current path cost and the historical best path cost in the path cost matrix. The evaluation weights are then adjusted in conjunction with the real-time path congestion status to obtain the path evaluation vector.

[0038] Node performance metrics and link status parameters are obtained from a multi-level tree index structure. Nodes that exceed the preset load threshold are marked as trigger points, and a local update subgraph is constructed with the trigger points as the center.

[0039] In the local update subgraph, the nodes at the level where the trigger point is located are traversed first to obtain the set of paths at the same level. When the set of paths at the same level is empty, it is expanded to the adjacent level to obtain the set of extended paths. Based on the path evaluation vector, the set of paths at the same level and the set of extended paths are pruned to determine the set of candidate paths.

[0040] The path with the minimum cost and node load balance constraint is selected from the candidate path set as the access path. The search status information corresponding to the access path is written into the path cache table, and the heuristic function is updated based on the status information in the path cache table.

[0041] In one optional embodiment, the application identifier is mapped to a ring hash space using a hash algorithm. Within this ring hash space, the target resource manager identifier is located using virtual nodes. A proxy forwarding rule table is constructed, and a redirect URL is generated, including:

[0042] Based on a multi-level tree index structure, the feature fields of the application identifier are mapped to a circular hash space using the MD5 hash algorithm, and the application identifier is calculated to obtain a first hash value.

[0043] The application node position is determined in the circular hash space based on the first hash value. The resource manager identifier is combined with the incrementing sequence number to generate a virtual node code. The second hash value is calculated by the MD5 hash algorithm on the virtual node code.

[0044] The location of the virtual node is determined in the circular hash space based on the second hash value, and the correspondence between the virtual node location and the resource manager identifier is written into the virtual node mapping table;

[0045] Starting from the application node location, the nearest virtual node location is found in the circular hash space in a clockwise direction, and the target resource manager identifier is obtained through the virtual node mapping table;

[0046] Write the correspondence between the application identifier and the target resource manager identifier into the application mapping table, construct a forwarding address based on the application mapping table, and write the authentication parameters into the forwarding address to generate a redirect URL.

[0047] In an optional embodiment, it further includes:

[0048] Monitor the running status of the resource manager, and when a change in the online / offline status of the resource manager is detected, obtain the resource manager identifier;

[0049] The corresponding virtual node location is found in the virtual node mapping table based on the resource manager identifier, and the correspondence between the virtual node location and the resource manager identifier is written into the historical mapping record.

[0050] Establish a new mapping table buffer and an old mapping table buffer. Write all the correspondences of the virtual node mapping table into the new mapping table buffer. Recalculate the corresponding virtual node positions according to the status changes of the resource manager identifier. Write the correspondence between the new virtual node positions and the resource manager identifier into the new virtual node mapping table buffer. After completing all calculations, replace the old mapping table buffer with the new mapping table buffer.

[0051] If an anomaly occurs during the recalculation process, the corresponding relationship in the virtual node mapping table is restored based on the historical mapping records.

[0052] A second aspect of this invention provides an application proxy routing and forwarding system in a cluster environment, comprising:

[0053] The first unit is used to receive access requests from clients and obtain the application identifier in the access requests;

[0054] The second unit is used to employ a two-layer adaptive filtering detection mechanism to filter the candidate resource manager set through dynamic counting, complete secondary filtering based on time-series status, obtain a list of available resource managers, and write the list of available resource managers into an address mapping table.

[0055] The third unit is used to query application registration information based on the application identifier and obtain the target sub-cluster identifier where the application is located.

[0056] The fourth unit is used to read the list of available resource managers from the address mapping table according to the target sub-cluster identifier, construct a multi-level tree index structure, use a dynamic path planning algorithm to calculate the path cost to the client, dynamically evaluate the path cost through a real-time updated heuristic function, and select the resource manager with the minimum path cost as the target resource manager.

[0057] The fifth unit is used to map the application identifier to a ring hash space using a hash algorithm, locate the target resource manager identifier in the ring hash space through virtual nodes, construct a proxy forwarding rule table, and generate a redirect URL;

[0058] The sixth unit is used to send the redirect URL to the client.

[0059] A third aspect of the present invention provides an electronic device, comprising:

[0060] processor;

[0061] Memory used to store processor-executable instructions;

[0062] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0063] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0064] In this embodiment of the invention, a two-layer adaptive filtering detection mechanism is used to dynamically filter available resource managers, achieving efficient resource manager selection in a cluster environment, effectively reducing system load and improving resource utilization. By constructing a multi-level tree index structure and adopting a dynamic path planning algorithm, this invention can accurately evaluate the path cost from the client to the resource manager, achieve optimal route selection, significantly reduce network latency, and improve the user access experience. By mapping the application identifier to a ring hash space and utilizing virtual node technology, balanced distribution and efficient forwarding of requests are achieved, enhancing the system's scalability and fault tolerance, and ensuring stable operation in a large-scale cluster environment. Attached Figure Description

[0065] Figure 1 This is a flowchart illustrating the application proxy routing and forwarding method in a cluster environment according to an embodiment of the present invention.

[0066] Figure 2 A flowchart of an application proxy routing and forwarding method under a multi-level tree index structure;

[0067] Figure 3 This is a simulation diagram of the distribution of various types of nodes in a ring hash space. Detailed Implementation

[0068] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and 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.

[0069] The technical solution of the present invention will be described in detail below with reference to specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0070] Figure 1 This is a flowchart illustrating the application proxy routing and forwarding method in a cluster environment according to an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes:

[0071] Receive an access request from a client and obtain the application identifier from the access request;

[0072] A two-layer adaptive filtering detection mechanism is adopted. The candidate resource manager set is filtered by dynamic counting, and a secondary filtering is performed based on the time-series status to obtain a list of available resource managers. The list of available resource managers is then written into the address mapping table.

[0073] Query the application registration information based on the application identifier to obtain the target sub-cluster identifier where the application is located;

[0074] Based on the target sub-cluster identifier, the list of available resource managers is read from the address mapping table, a multi-level tree index structure is constructed, a dynamic path planning algorithm is used to calculate the path cost to the client, and the path cost is dynamically evaluated through a real-time updated heuristic function to select the resource manager with the lowest path cost as the target resource manager.

[0075] The application identifier is mapped to a ring hash space using a hash algorithm. The target resource manager identifier is located in the ring hash space through virtual nodes. A proxy forwarding rule table is constructed, and a redirect URL is generated.

[0076] The redirect URL is sent to the client.

[0077] In one optional implementation, a two-layer adaptive filtering detection mechanism is employed. This involves dynamically counting and filtering the candidate resource manager set, performing secondary filtering based on temporal states to obtain a list of available resource managers, and writing the list of available resource managers into an address mapping table.

[0078] Obtain multiple sets of continuous response times from the resource manager, construct a response time distribution sequence, and calculate the load fluctuation factor of the resource manager based on the response time distribution sequence;

[0079] The response reliability is obtained by weighting the number of response timeouts of the resource manager based on the load fluctuation factor, and the performance counting threshold is dynamically adjusted according to the response reliability.

[0080] Collect multi-dimensional performance indicators of resource managers within the performance counting threshold range, combine the multi-dimensional performance indicators to calculate the stability score, and select resource managers whose stability score is greater than the preset stability benchmark value to form a first candidate set.

[0081] A state transition matrix is ​​constructed based on the historical performance data of each resource manager in the first candidate set, and the state transition probability of the resource manager is calculated based on the state transition matrix.

[0082] Based on the state transition probability, the stability of the resource managers in the first candidate set is predicted, and resource managers whose state transition probability is greater than the preset stable operation threshold and whose state retention time exceeds the minimum stable period are selected to form a list of available resource managers.

[0083] Write each identifier and network address information in the available resource manager list into the address mapping table, record the version information of the address mapping table, and save the version information before the update when the address mapping table is updated for rollback operation.

[0084] In one specific implementation, the response time distribution analysis of resource managers is fundamental to achieving high reliability in routing and forwarding. A network probing module sends heartbeat packets to each resource manager in the cluster every 5 seconds, acquiring 100 consecutive response time data points. Taking a certain resource manager as an example, the acquired response time sequence is [12ms, 15ms, 13ms, 18ms, 14ms, 25ms, 16ms, 13ms, 14ms, 19ms…], etc. These response times are divided into intervals of 5ms, and the number of responses in each interval is counted, resulting in a response time distribution sequence [0-5ms: 0 times, 5-10ms: 0 times, 10-15ms: 60 times, 15-20ms: 35 times, 20-25ms: 4 times, 25-30ms: 1 time]. Based on this distribution sequence, a load fluctuation factor of 0.18 is calculated. This value represents the stability of the resource manager's response time; the smaller the value, the smaller the response time fluctuation and the higher the stability.

[0085] The application of the load fluctuation factor is reflected in the weighted processing of response timeout events. For the above resource manager, two response timeouts were detected in the past hour. Based on the load fluctuation factor of 0.18, a response reliability of 0.96 is obtained. The closer the response reliability is to 1, the higher the response stability of the resource manager. The performance counting threshold is dynamically adjusted based on the response reliability. When the response reliability is greater than 0.95, the performance counting threshold is set to [CPU utilization < 80%, memory utilization < 75%, network throughput < 800 Mbps]; when the response reliability is between 0.9 and 0.95, the performance counting threshold is adjusted to [CPU utilization < 70%, memory utilization < 65%, network throughput < 600 Mbps]; when the response reliability is less than 0.9, the performance counting threshold is further reduced to [CPU utilization < 60%, memory utilization < 55%, network throughput < 400 Mbps].

[0086] After determining the performance counting threshold, multi-dimensional performance metrics of the resource manager are obtained through a performance acquisition agent. Taking the resource manager mentioned above as an example, the collected performance metrics include CPU utilization of 62%, memory utilization of 58%, network throughput of 420Mbps, disk I / O latency of 15ms, and the number of connections of 485. Combining these metrics yields a stability score of 0.83. The preset stability benchmark value is 0.75. Since the stability score of this resource manager is greater than the preset value, it is included in the first candidate set.

[0087] For resource managers in the first candidate set, constructing a state transition matrix based on historical performance data is a key step in predicting their future stability. This method categorizes the resource manager's operating states into three types: stable state, fluctuating state, and overload state. By analyzing the hourly state records of the resource manager over the past 7 days, the number of transitions between states is counted, and a 3×3 state transition matrix is ​​constructed. Taking a certain resource manager as an example, its state transition matrix is ​​[[0.92, 0.07, 0.01], [0.15, 0.80, 0.05], [0.05, 0.35, 0.60]], where 0.92 in the first row and first column indicates a 92% probability of continuing from a stable state.

[0088] Based on the state transition matrix, the state transition probability of the resource manager is calculated. For the above resource manager, assuming it is currently in a stable state, matrix operations predict a probability of 0.85 that it will remain stable for the next 24 hours, with an expected state retention time of 18 hours. The preset stable operation threshold is 0.80, and the minimum stable period is 12 hours. Since the state transition probability of this resource manager is greater than the preset stable operation threshold and the state retention time exceeds the minimum stable period, it is included in the list of available resource managers.

[0089] After the list of available resource managers is built, its information needs to be written to an address mapping table for routing forwarding. The address mapping table contains the resource manager's identification information and network address information. For example, a resource manager might have the identification information "RM-Node-025" and the network address information "192.168.10.25:8080". The address mapping table uses a version control mechanism, generating a new version number each time it is updated, such as "MapTable-v20250612-01". Simultaneously, it saves the version information from before the update, such as "MapTable-v20250611-03", for rollback operations in case of problems with the new version.

[0090] In practical applications, when a client requests access to a cluster application, the routing and forwarding module first queries the latest version of the address mapping table, selects an available resource manager, and forwards the request to that resource manager for processing. If the selected resource manager is found to be unresponsive during request processing, the routing and forwarding module will select another resource manager from the address mapping table to forward the request, and temporarily mark the unresponsive resource manager as unavailable, triggering a re-evaluation process.

[0091] Through the above implementation, this method can dynamically construct a list of available resource managers based on the multi-dimensional performance indicators and state transition probabilities of resource managers, and achieve highly reliable routing forwarding through an address mapping table, effectively improving the stability and availability of application proxy routing forwarding in a cluster environment.

[0092] In one optional implementation, predicting the stability of resource managers in the first candidate set based on the state transition probabilities includes:

[0093] Obtain the network topology connection relationship of the resource managers in the first candidate set, and determine the set of adjacent resource managers directly connected to the resource managers based on the network topology connection relationship;

[0094] Collect the performance fluctuation sequence of each adjacent resource manager and calculate the performance fluctuation intensity value of each adjacent resource manager; based on the timestamp information of the performance fluctuation sequence, calculate the propagation delay of the performance fluctuation from each adjacent resource manager to the resource manager, and construct a performance fluctuation propagation feature vector according to the propagation delay and the performance fluctuation intensity value.

[0095] A performance fluctuation propagation model is constructed using the performance fluctuation propagation feature vector, and the performance impact coefficient of each adjacent resource manager on the resource manager is calculated based on the performance fluctuation propagation model.

[0096] The state transition probability is corrected based on the performance impact coefficient to obtain a corrected state transition probability value that incorporates network topology propagation effects.

[0097] Substitute the corrected state transition probability value into the Markov prediction model to output the state sequence of the resource manager within a preset time window;

[0098] The stable state percentage of the resource manager is calculated based on the state sequence. When the stable state percentage is greater than a preset stable operation threshold and the duration of consecutive stable states exceeds the minimum stable period, the resource manager is determined to meet the stability prediction requirements.

[0099] In one specific implementation, obtaining the network topology connections of resource managers is fundamental to predicting the propagation of performance fluctuations. The topology discovery module collects network connection information from resource managers in the first candidate set, including both physical and logical connections. Physical connections are obtained through switch port mapping and network tracing, while logical connections are obtained through application-layer communication relationship analysis. Taking resource manager RM-Node-025 as an example, its directly connected neighboring resource managers are {RM-Node-018, RM-Node-023, RM-Node-026, RM-Node-032}. These neighboring nodes are connected to the target resource manager via network switches or direct network links, forming a first-order neighborhood topology.

[0100] Collecting performance fluctuation sequences from adjacency resource managers is crucial for analyzing propagation effects. The performance acquisition agent collects key performance indicators of adjacency resource managers every 10 seconds, including CPU utilization, memory usage, and network throughput, forming time-series data. Taking adjacency resource manager RM-Node-018 as an example, its CPU utilization fluctuation sequence is [45%, 47%, 53%, 68%, 72%, 65%, 58%, 52%, 48%, 46%...], with each data point accompanied by a timestamp. By calculating the standard deviation and rate of change of these sequences, the performance fluctuation intensity value is obtained. The performance fluctuation intensity value of RM-Node-018 is 0.28, indicating relatively significant performance fluctuation; the performance fluctuation intensity value of RM-Node-023 is 0.12, indicating relatively small performance fluctuation; the performance fluctuation intensity value of RM-Node-026 is 0.33, indicating very large performance fluctuation; and the performance fluctuation intensity value of RM-Node-032 is 0.19, indicating moderate performance fluctuation.

[0101] The calculation of performance fluctuation propagation delay reflects the temporal characteristics of the fluctuation impact. By analyzing the time series of performance metrics of adjacent resource managers and target resource managers, similar fluctuation patterns are identified, and the propagation time required for the fluctuation is calculated. Taking RM-Node-026 as an example, when its CPU utilization suddenly increases from 50% to 85%, the CPU utilization of the target resource manager RM-Node-025 also changes from 45% to 65% after 12 seconds. Therefore, the propagation delay between the two is 12 seconds. Similarly, the propagation delays from RM-Node-018, RM-Node-023, and RM-Node-032 to RM-Node-025 are 18 seconds, 25 seconds, and 15 seconds, respectively. Combining the propagation delay and the performance fluctuation intensity value, a performance fluctuation propagation feature vector is constructed. The feature vector of RM-Node-025 is [0.28:18s, 0.12:25s, 0.33:12s, 0.19:15s].

[0102] The construction of a performance fluctuation propagation model is the core technology for predicting the impact of adjacent nodes. This method employs a weighted attenuation model, considering both propagation delay and performance fluctuation intensity. Shorter propagation delays result in greater impact; higher performance fluctuation intensity also leads to greater impact. Based on the feature vectors, the performance impact coefficients of each adjacent resource manager on RM-Node-025 are calculated: RM-Node-018 has an impact coefficient of 0.18, RM-Node-023 has an impact coefficient of 0.09, RM-Node-026 has an impact coefficient of 0.35, and RM-Node-032 has an impact coefficient of 0.22. The sum of these impact coefficients is 0.84, indicating that the performance fluctuations of adjacent nodes have a significant impact on the target node.

[0103] Correcting the state transition probability is a key step in improving prediction accuracy. Without considering network topology propagation effects, the probability of RM-Node-025 remaining stable from a stable state is 0.92. Considering the sum of the performance influence coefficients of neighboring nodes, which is 0.84, the corrected state transition probability is 0.84. Specifically, the correction process involves multiplying the original stable state probability of 0.92 by a correction factor calculated based on the influence coefficients to obtain the corrected probability value. Similarly, the transition probabilities of fluctuating and overload states are also corrected accordingly, resulting in the corrected state transition matrix [[0.84, 0.14, 0.02], [0.12, 0.75, 0.13], [0.03, 0.29, 0.68]].

[0104] The application of Markov prediction models is a key step in generating state sequences. This method, based on a modified state transition matrix, sets the prediction time window to 24 hours and the time granularity to 1 hour, outputting the resource manager's state sequence over 24 hours. Assuming RM-Node-025 is currently in a stable state, its predicted state sequence for the next 24 hours, based on the modified state transition matrix, is [stable, stable, stable, fluctuating, fluctuating, stable, stable, stable, stable, stable, fluctuating, stable, stable, stable, stable, stable, stable, stable, stable, stable, stable, fluctuating, fluctuating, stable, stable, stable].

[0105] The calculation of the percentage of stable states is the final step in evaluating the stability of the resource manager. For the above state sequence, stable states occurred 20 times, accounting for 83.3% of the total time. The preset stable operation threshold is 80%, and since 83.3% is greater than 80%, the stability requirement is met. Furthermore, the longest consecutive stable state in this sequence lasted for 8 hours, and the preset minimum stable period is 6 hours; therefore, the duration of consecutive stable states also meets the requirement. The comprehensive evaluation results indicate that RM-Node-025 meets the stability prediction requirements and can be included in the list of available resource managers.

[0106] In existing technologies, resource manager stability prediction is mainly based on the analysis of historical data of a single node, using time series analysis or simple threshold judgment methods, without considering the mutual influence between nodes in a cluster environment. These methods are effective in predicting short-term performance changes of a single node, but their accuracy is low in complex cluster environments, especially when load fluctuations propagate, with a prediction inaccuracy rate as high as 40%.

[0107] This embodiment recognizes that the performance state of a resource manager in a cluster environment is not only affected by its own historical performance but also significantly influenced by the propagation of performance fluctuations from neighboring nodes. The method in this embodiment introduces network topology propagation effect analysis. By calculating the performance fluctuation sequences, propagation delays, and influence coefficients of neighboring nodes, the state transition probability is corrected, and a more accurate Markov prediction model is constructed. Therefore, this embodiment introduces network topology analysis to identify neighboring nodes directly connected to the target resource manager; establishes a performance fluctuation propagation model to quantify the impact of neighboring nodes on the target node; corrects the state transition probability based on the influence coefficient to improve prediction accuracy; and introduces state sequence analysis to assess the proportion and duration of stable states, comprehensively determining the stability of the resource manager.

[0108] In this embodiment, by introducing network topology propagation effect analysis, the impact of adjacent node performance fluctuations on the target resource manager is accurately quantified, improving the accuracy of stability prediction and significantly reducing the false prediction rate. Based on the performance impact coefficient calculated using the performance fluctuation propagation feature vector and propagation delay, the state transition probability is precisely corrected, effectively identifying potentially unstable resource managers and improving service availability. By combining the corrected state transition probability with the application of a Markov prediction model, accurate prediction of the future state of the resource manager is achieved, reducing average response time and user request failure rate. Through a dual evaluation mechanism of stable state ratio and continuous stable time, the stability of the resource manager is comprehensively judged, avoiding the misselection of resource managers that are stable in the short term but unreliable in the long term as available nodes, thus enhancing the overall reliability of application proxy routing forwarding in a cluster environment.

[0109] In one optional implementation, reading the list of available resource managers from the address mapping table based on the target sub-cluster identifier and constructing a multi-level tree index structure includes:

[0110] Based on the target sub-cluster identifier, the resource manager list is read from the address mapping table, and the resource manager identifier information, network topology information and service type information in the resource manager list are obtained to obtain the resource manager information set to be processed.

[0111] Based on the resource manager identification information, spatial clustering method is used to divide the resource manager into regions and establish a region connection graph to obtain a first-level index hierarchical region structure.

[0112] Based on the hierarchical regional structure and network topology information of the first-level index, the resource managers in the region are divided into subnets according to network prefixes and weighted connection relationships are established to obtain the second-level index layer network structure.

[0113] Based on the network structure and service type information of the second-level index layer, the resource managers in the network layer are grouped according to service quality indicators and service dependencies are established to obtain the service structure of the third-level index layer.

[0114] Assign globally unique identifiers to resource manager nodes in the three-level index layer service structure and establish a node attribute table to obtain the resource manager node attribute set;

[0115] Based on the resource manager node attribute set, the node status is monitored by heartbeat detection and node splitting or merging operations are triggered to obtain an optimized node distribution structure.

[0116] Based on the optimized node distribution structure, the relationships and distance metrics between nodes are updated and hotspot access path information is written to determine the final tree index structure, resulting in a multi-level tree index structure.

[0117] In one specific implementation, after obtaining the target sub-cluster identifier, a list of resource managers corresponding to that sub-cluster is read from an address mapping table. The address mapping table is a key-value pair structure, where the key is the sub-cluster identifier and the value is a set of information about all resource managers in that sub-cluster. For example, for the sub-cluster identifier "SC-01", a list containing 10 resource managers can be read from the address mapping table. For each resource manager, its identifier information (e.g., RM-001), network topology information (e.g., IP address 192.168.1.10 / 24), and service type information (e.g., computing service, storage service, etc.) are extracted to form a resource manager information set to be processed.

[0118] Based on resource manager identification information, the DBSCAN spatial clustering algorithm is used to divide resource managers into regions. The algorithm calculates the geographical distance between resource managers and groups those that are close together into the same region. For example, with a distance parameter set to 50 kilometers and a minimum number of points set to 3, the system may divide 10 resource managers into 3 regions: Region A (RM-001, RM-002, RM-003), Region B (RM-004, RM-005, RM-006, RM-007), and Region C (RM-008, RM-009, RM-010). A connection graph between regions is established, recording the connectivity and distance information between each region, forming a hierarchical region structure with a first-level index.

[0119] Based on the primary index, resource managers within each region are subnetted according to network topology information. The network prefix of the IP addresses is extracted, and resource managers with the same network prefix are grouped into the same subnet. For example, the three resource managers in region A might be divided into two subnets: subnet A1 (RM-001, RM-002, network prefix 192.168.1.0 / 24) and subnet A2 (RM-003, network prefix 192.168.2.0 / 24). Weighted connections are established between subnets, with weights representing network transmission latency or bandwidth. For example, the weight from subnet A1 to subnet A2 is 5ms latency and 10Gbps bandwidth. This forms the secondary index layer network structure.

[0120] Based on a two-tier index layer network structure, resource managers within each subnet are grouped by service type information according to their quality of service (QS) metrics. QS indicators include availability, response time, and throughput. For example, RM-001 in subnet A1 provides high-availability computing services (99.99% availability, response time <10ms), while RM-002 provides standard storage services (99.9% availability, throughput 500MB / s). The system groups resource managers with the same type and service level together and establishes a service dependency graph to record the call dependencies between different service groups. This forms a three-tier index layer service structure.

[0121] For each resource manager node in the three-level index layer service structure, a globally unique identifier is assigned. The identifier consists of 20 hexadecimal characters, formatted as "region code (4 digits) - subnet code (4 digits) - service type code (4 digits) - node sequence number (8 digits)". For example, the globally unique identifier for RM-001 might be "A001-A100-C001-00000001". An attribute table is created for each node, recording information such as hardware configuration, load, and health status, forming a resource manager node attribute set.

[0122] The system monitors node status by periodically sending heartbeat packets, with a default heartbeat interval of 5 seconds. When a change in node status is detected, the system triggers node splitting or merging operations. For example, when the load in subnet A1 exceeds 80%, the system will trigger node splitting, splitting RM-001 into two logical nodes, RM-001a and RM-001b; when the load in subnet A2 is below 20% for more than 30 minutes, the system will trigger node merging, merging RM-003 with a low-load node from an adjacent subnet. By dynamically adjusting the node distribution, the system achieves an optimized node distribution structure.

[0123] Based on the optimized node distribution structure, the relationships and distance metrics between nodes are updated. The distance metric comprehensively considers geographical distance, network latency, and service quality, and is calculated using a weighted summation method. Hotspot access path information is recorded; for example, the access frequency from "A001-A100-C001-00000001" to "B001-B100-S001-00000004" is 100 times per second. The index structure is updated accordingly, optimizing hotspot paths, such as adding direct connections or adjusting route weights. The resulting multi-level tree index structure comprises three layers: a region layer, a network layer, and a service layer. Each node records its parent and child node information, as well as node attributes and connection relationships, facilitating rapid resource location and access by the system.

[0124] The multi-level tree index structure constructed using the above methods can efficiently manage and schedule resources in a distributed environment, significantly improving the efficiency of resource lookup and allocation, while ensuring the scalability and fault tolerance of the system.

[0125] In one optional implementation, a dynamic path planning algorithm is used to calculate the path cost to the client. The path cost is dynamically evaluated using a heuristic function that is updated in real time, and the resource manager with the lowest path cost is selected as the target resource manager.

[0126] Based on a multi-level tree index structure, the path cost is decomposed into node cost and edge cost. Processing capacity and load status information are collected for each node, and network quality and transmission delay information are collected for each edge to obtain the path cost matrix.

[0127] A heuristic function is established based on the deviation between the current path cost and the historical best path cost in the path cost matrix. The evaluation weights are then adjusted in conjunction with the real-time path congestion status to obtain the path evaluation vector.

[0128] Node performance metrics and link status parameters are obtained from a multi-level tree index structure. Nodes that exceed the preset load threshold are marked as trigger points, and a local update subgraph is constructed with the trigger points as the center.

[0129] In the local update subgraph, the nodes at the level where the trigger point is located are traversed first to obtain the set of paths at the same level. When the set of paths at the same level is empty, it is expanded to the adjacent level to obtain the set of extended paths. Based on the path evaluation vector, the set of paths at the same level and the set of extended paths are pruned to determine the set of candidate paths.

[0130] The path with the minimum cost and node load balance constraint is selected from the candidate path set as the access path. The search status information corresponding to the access path is written into the path cache table, and the heuristic function is updated based on the status information in the path cache table.

[0131] In one specific implementation, the construction of a multi-level tree index structure is fundamental to achieving efficient path selection in the application proxy routing and forwarding method within a clustered environment. This structure organizes resource nodes in the cluster into a multi-level tree structure according to network topology, with each level representing a resource manager at a different level. Taking a three-level tree structure as an example, the first level is the root node, representing the entry proxy server; the second level is the area management node, responsible for resource scheduling within a specific area; and the third level is the specific application service node, directly providing business services. Each node has a unique identifier and level information, such as node "N2-3" representing the third node in the second level. The connecting edges between nodes represent network links, and each edge carries direction attributes and weight information.

[0132] Path cost decomposition is crucial for accurately assessing routing and forwarding overhead. Node cost reflects processing capacity and load status. A performance acquisition module collects node metrics such as CPU utilization, memory usage, and processing queue length every 5 seconds. For example, node "N2-3" currently has a CPU utilization of 65%, memory usage of 72%, and a processing queue length of 28, resulting in a calculated node cost of 0.68. Edge cost reflects network quality and transmission latency. A network probing module collects link metrics such as transmission latency, packet loss rate, and bandwidth utilization every 3 seconds. For example, the edge connecting nodes "N2-3" and "N3-5" currently has a transmission latency of 15ms, a packet loss rate of 0.2%, and a bandwidth utilization of 45%, resulting in a calculated edge cost of 0.35. The node and edge costs of all possible paths are summed to form a path cost matrix. Taking the three possible paths from the entry proxy to the target service node "N3-5" as an example, the cost of path 1 (N1-1→N2-2→N3-5) is 2.15, the cost of path 2 (N1-1→N2-3→N3-5) is 1.78, and the cost of path 3 (N1-1→N2-4→N3-5) is 2.32.

[0133] The establishment of the heuristic function relies on historical path data analysis. The path cost deviation is calculated by comparing the current path cost with the historical best path cost. For path 2 (N1-1→N2-3→N3-5), its historical best cost is 1.65, the current cost is 1.78, and the deviation is 0.13. The path congestion status is obtained through real-time monitoring, including the node processing queue growth rate and the link transmission delay change rate. The node processing queue growth rate of path 2 is 5%, and the link transmission delay change rate is 3%, so its congestion status is judged as "mild congestion". The evaluation weights are adjusted according to the deviation and congestion status. For the "mild congestion" status, the evaluation weights for latency-sensitive services are adjusted to [processing capacity: 0.3, load status: 0.2, network quality: 0.3, transmission delay: 0.2]; for throughput-sensitive services, the evaluation weights are adjusted to [processing capacity: 0.2, load status: 0.3, network quality: 0.3, transmission delay: 0.2]. Based on the adjusted weights, the path evaluation vector is recalculated. The evaluation vector for path 2 is [0.3×0.7, 0.2×0.65, 0.3×0.75, 0.2×0.8], and the overall score is 0.725.

[0134] The determination of trigger points and the construction of local update subgraphs optimize path search efficiency. When the CPU utilization of node "N2-3" suddenly increases from 65% to 88%, exceeding the preset load threshold of 85%, it is marked as a trigger point. A local update subgraph, centered on trigger point "N2-3," is constructed, containing its directly connected nodes. This subgraph includes nodes "N1-1," "N2-3," "N3-5," "N3-6," and "N3-7," and the connecting edges between them. The scope of the local update subgraph is much smaller than the global graph, significantly reducing the search space.

[0135] The traversal strategy of same-level paths and extended paths improves the accuracy of path selection. First, nodes in the level where the trigger point is located (level 2) are traversed to obtain alternative paths. Assuming the trigger point "N2-3" has same-level nodes "N2-2" and "N2-4", paths N1-1→N2-2→N3-5 and N1-1→N2-4→N3-5 are constructed respectively, forming a set of same-level paths. If the set of same-level paths is empty, or the cost of all same-level paths exceeds a threshold, the system expands to adjacent levels (level 1 and level 3) to find possible alternative paths, forming an extended path set. The path set is pruned based on the path evaluation vector, removing paths with scores below 0.6. After pruning, a candidate path set is obtained, containing path 1 (N1-1→N2-2→N3-5) and path 3 (N1-1→N2-4→N3-5).

[0136] The selection of the optimal access path comprehensively considers path cost and load balancing. From the candidate path set, path 1 has a cost of 2.15, while path 3 has a cost of 2.32, indicating that path 1 has a lower cost. Further checking the node load balancing constraints, the current load of node "N2-2" is 65%, and the current load of node "N2-4" is 75%, both meeting the load threshold requirement (<85%). Therefore, path 1 (N1-1→N2-2→N3-5) is selected as the final access path. The search status information of this access path is written to the path cache table, including the path identifier "P1-N3-5", the path node sequence "N1-1, N2-2, N3-5", the path cost "2.15", the selection timestamp "2025-07-16 10:35:42", and the validity period "300 seconds". Based on the status information in the cache table, the heuristic function parameters are updated, and the weights of each evaluation factor are adjusted to provide more accurate guidance for the next path selection.

[0137] Existing routing and forwarding methods primarily employ static configuration or simple load balancing strategies, such as round-robin, random selection, and least connections. These methods do not adequately consider network topology and dynamically changing load conditions, easily leading to uneven resource allocation, increased response latency, and decreased service quality in complex cluster environments. Especially in high-concurrency scenarios, simple load balancing strategies cannot quickly respond to sudden traffic surges and hotspot loads in the cluster, resulting in some nodes being overloaded while others remain idle.

[0138] This embodiment argues that routing and forwarding in a cluster environment requires consideration of multiple factors simultaneously. It introduces a multi-level tree index structure and a heuristic path search strategy, achieving efficient and accurate routing and forwarding through path cost decomposition, local update subgraph construction, and adaptive weight adjustment. The method in this embodiment introduces a multi-level tree index structure, reducing the complexity of path search; decomposes path cost into node cost and edge cost, enabling more refined path evaluation; constructs a local update subgraph based on trigger points, avoiding the high overhead of global path recalculation; combines same-level priority traversal and path expansion strategies to balance search efficiency and path quality; and improves the processing efficiency of continuous requests through path caching and dynamic adjustment using heuristic functions.

[0139] like Figure 2As shown, the complete logical flow of the application proxy routing and forwarding method under a multi-level tree index structure is demonstrated. The process involves constructing a multi-level tree index structure, collecting node processing capacity and load status information, collecting network quality and transmission delay information, and finally calculating the path cost matrix. The process also includes calculating the cost deviation between the current path and the historical best path, obtaining the real-time path congestion status, adjusting evaluation weights, and generating a path evaluation vector. Next, the process involves monitoring node load status, determining if thresholds are exceeded, marking trigger points, and constructing a local update subgraph. Finally, the process involves traversing the nodes at the trigger point's level, obtaining the set of paths at the same level, determining if it is empty, expanding to adjacent levels if necessary, pruning based on the path evaluation vector, selecting the optimal path, and updating the path cache table and heuristic function.

[0140] In one optional implementation, the application identifier is mapped to a ring hash space using a hash algorithm. Within this ring hash space, the target resource manager identifier is located using virtual nodes. A proxy forwarding rule table is constructed, and a redirect URL is generated, including:

[0141] Based on a multi-level tree index structure, the feature fields of the application identifier are mapped to a circular hash space using the MD5 hash algorithm, and the application identifier is calculated to obtain a first hash value.

[0142] The application node position is determined in the circular hash space based on the first hash value. The resource manager identifier is combined with the incrementing sequence number to generate a virtual node code. The second hash value is calculated by the MD5 hash algorithm on the virtual node code.

[0143] The location of the virtual node is determined in the circular hash space based on the second hash value, and the correspondence between the virtual node location and the resource manager identifier is written into the virtual node mapping table;

[0144] Starting from the application node location, the nearest virtual node location is found in the circular hash space in a clockwise direction, and the target resource manager identifier is obtained through the virtual node mapping table;

[0145] Write the correspondence between the application identifier and the target resource manager identifier into the application mapping table, construct a forwarding address based on the application mapping table, and write the authentication parameters into the forwarding address to generate a redirect URL.

[0146] In one specific implementation, the application identifier can be a unique identifier for the application, such as the application name, application ID, or application domain name. To map the application identifier to a ring hash space, the characteristic fields of the application identifier need to be processed. The characteristic fields can include a combination of information such as the application name, version number, and deployment environment. For example, for an application named "PaymentService" with version number "v2.1" deployed in a "production" environment, this information can be concatenated into "PaymentService_v2.1_production" as the characteristic field.

[0147] The feature field is hashed using the MD5 algorithm to obtain the first hash value. The MD5 algorithm converts a string of any length into a 128-bit (16-byte) hash value. For example, performing an MD5 hash on "PaymentService_v2.1_production" might yield the hash value "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6". This hash value is then mapped to a number between 0 and 2. 128 The location of the application node is determined within a ring-shaped hash space in the range of -1.

[0148] To achieve load balancing and high availability, the concept of a resource manager is introduced. A resource manager is an actual server or container instance that handles application requests. Each resource manager has a unique identifier, such as "ResourceManager001". To make resource managers more evenly distributed on the hash ring, virtual node technology is used. Multiple virtual nodes are generated for each resource manager, with virtual node codes generated by combining the resource manager identifier with an incrementing sequence number. For example, for "ResourceManager001", 100 virtual nodes can be generated, with virtual node codes "ResourceManager001-1", "ResourceManager001-2", and so on up to "ResourceManager001-100".

[0149] Each virtual node is encoded using the MD5 hash algorithm to obtain a second hash value. For example, performing an MD5 hash on "ResourceManager001-1" yields the hash value "q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2". Based on the second hash value, the virtual node's position is determined in the ring hash space, and the correspondence between the virtual node's position and the resource manager identifier is written into a virtual node mapping table. The virtual node mapping table can be stored in key-value pair format, where the key is the virtual node's position on the hash ring, and the value is the corresponding resource manager identifier.

[0150] When a resource manager needs to be assigned to an application, the nearest virtual node is searched clockwise within the circular hash space, starting from the application node location. For example, the hash value of the application "PaymentService_v2.1_production" corresponds to the location "3476891234". Searching clockwise from this location, the nearest virtual node is found to be "3476892567", which corresponds to "ResourceManager001-37". The virtual node mapping table shows that the resource manager identifier corresponding to this virtual node is "ResourceManager001".

[0151] The mapping between application identifiers and target resource manager identifiers is written to the application mapping table. The application mapping table is also stored in key-value pair format, where the key is the application identifier and the value is the corresponding resource manager identifier. For example, the application mapping table stores {"PaymentService_v2.1_production": "ResourceManager001"}.

[0152] The forwarding address is constructed based on the application mapping table. The forwarding address contains the network address of the resource manager and the access path of the application. For example, if the network address of ResourceManager001 is "192.168.1.100:8080" and the access path of the application is " / api / payment", then the forwarding address is "http: / / 192.168.1.100:8080 / api / payment".

[0153] To ensure security, authentication parameters need to be written to the forwarding address. Authentication parameters can include information such as access tokens, timestamps, and signatures. For example, if you need to add an access token "token=xyz123" and a timestamp "timestamp=1626782400", you can add these parameters to the forwarding address, generating a redirect URL of "http: / / 192.168.1.100:8080 / api / payment?token=xyz123×tamp=1626782400".

[0154] In practical applications, when resource manager nodes change, such as adding or removing nodes, only the mapping relationships of the affected applications need to be recalculated, without the need to reassign all applications. This significantly reduces the cost of cluster reconfiguration. For example, when a new resource manager "ResourceManager005" is added, a virtual node is generated for it, its hash value is calculated, and it is inserted into the hash ring. Only applications whose virtual nodes have changed most recently clockwise on the hash ring need to be remapped.

[0155] When a resource manager node becomes temporarily unavailable, it can be marked as unavailable through a health check mechanism, and the application it is responsible for can be remapped to the next available resource manager node in a clockwise direction in the circular hash space. For example, if "ResourceManager001" becomes unavailable, the application "PaymentService_v2.1_production" that was originally mapped to it may be remapped to "ResourceManager003".

[0156] This embodiment also supports dynamic scaling. When the cluster load increases, new resource manager nodes can be added; when the load decreases, some resource manager nodes can be removed. Thanks to the use of consistent hashing and virtual node technology, adding or removing nodes only affects the application mapping of adjacent parts on the hash ring, while the routing relationships of most applications remain unchanged, ensuring the stability and scalability of the system.

[0157] In high-concurrency scenarios, the accuracy of load balancing can be improved by increasing the number of virtual nodes. For example, more virtual nodes can be allocated to critical resource manager nodes, allowing them to handle more application request processing tasks. By adjusting the number of virtual nodes for different resource managers, weighted load distribution can be achieved.

[0158] In one alternative implementation, it further includes:

[0159] Monitor the running status of the resource manager, and when a change in the online / offline status of the resource manager is detected, obtain the resource manager identifier;

[0160] The corresponding virtual node location is found in the virtual node mapping table based on the resource manager identifier, and the correspondence between the virtual node location and the resource manager identifier is written into the historical mapping record.

[0161] Establish a new mapping table buffer and an old mapping table buffer. Write all the correspondences of the virtual node mapping table into the new mapping table buffer. Recalculate the corresponding virtual node positions according to the status changes of the resource manager identifier. Write the correspondence between the new virtual node positions and the resource manager identifier into the new virtual node mapping table buffer. After completing all calculations, replace the old mapping table buffer with the new mapping table buffer.

[0162] If an anomaly occurs during the recalculation process, the corresponding relationship in the virtual node mapping table is restored based on the historical mapping records.

[0163] In one specific implementation, a virtual node mapping table is established during initialization. This table stores the mapping relationship between resource manager identifiers and their corresponding virtual node locations. The virtual node mapping table is implemented using a hash table structure, where the key is the resource manager identifier and the value is the set of virtual node locations corresponding to that resource manager. For example, resource manager RM001 corresponds to virtual node location [10, 267, 522, 788], and resource manager RM002 corresponds to virtual node location [145, 401, 657, 923]. Simultaneously, a historical mapping record table is created to store historical mapping relationships, facilitating recovery in abnormal situations.

[0164] The running status of each resource manager is continuously monitored through a heartbeat detection mechanism. The heartbeat detection cycle can be set to 10 seconds. If no heartbeat response is received from a resource manager for three consecutive times, the resource manager is determined to be offline. When resource manager RM003 is detected to change from online to offline, its resource manager identifier "RM003" is obtained.

[0165] After obtaining the resource manager identifier, the corresponding virtual node location is found in the virtual node mapping table. Assuming the virtual node location corresponding to RM003 is [89, 345, 601, 867], this mapping relationship <"RM003", [89, 345, 601, 867]> is written to the historical mapping record table, marked as "offline," and appended with the timestamp "2023-05-15 14:30:22". Historical mapping records are persistently stored, using either log files or database table structures, ensuring that the mapping state can be restored after a restart.

[0166] Establish a new mapping table buffer and an old mapping table buffer. The old mapping table buffer holds a complete copy of the current virtual node mapping table, and the new mapping table buffer also initially copies all the contents of the current mapping table. For resource manager RM003, whose state has changed (offline), recalculate the virtual node allocation based on its state change. In this example, the virtual nodes of RM003 are reallocated among the remaining online resource managers.

[0167] Recalculate, remove the mapping record of RM003 from the new mapping table buffer, and count the remaining online resource managers, assuming they are 4 (RM001, RM002, RM004, RM005). Redistribute the original 4 virtual node positions of RM003 [89, 345, 601, 867] using a consistent hashing algorithm. Virtual node 89 is assigned to RM001, virtual node 345 to RM002, virtual node 601 to RM004, and virtual node 867 to RM005. After the allocation, the virtual node positions of RM001 are updated to [10, 89, 267, 522, 788], the virtual node positions of RM002 are updated to [145, 345, 401, 657, 923], and so on.

[0168] The calculation process employs a transaction mechanism to ensure atomicity. The updated mapping relationship is written to the new mapping table buffer, and a mapping table switch operation is performed. The switch operation uses a read-write lock mechanism: first, a write lock is acquired; then, the new mapping table buffer replaces the old mapping table buffer; finally, the write lock is released. This mechanism ensures that during the switch, operations reading the mapping relationship will be briefly blocked, but inconsistent data will not be read.

[0169] If an anomaly occurs during the recalculation process, such as insufficient system memory causing calculation failure when allocating virtual node 601, the corresponding relationship of the virtual node mapping table will be restored based on the historical mapping records. During the restoration process, the record of RM003 in the historical mapping records <"RM003", [89, 345, 601, 867], "Offline", "2023-05-15 14:30:22"> will be read, RM003 and its virtual node position will be added back to the virtual node mapping table, and the reassigned virtual nodes 89 and 345 will be removed from the virtual node lists of RM001 and RM002, restoring the mapping relationship to the state before the change.

[0170] Similarly, when resource manager RM006 is detected to be online, its identifier "RM006" is obtained, a virtual node position [123, 379, 635, 891] is assigned to it, and this mapping relationship is written to the historical mapping record with the record type "online". A new old mapping table buffer is created, and the mapping relationship of RM006 is added to the new buffer. After completion, the mapping table is switched. If an exception occurs, the mapping relationship of RM006 is deleted according to the historical record, restoring the state before it was added.

[0171] The above methods enable real-time monitoring of resource manager status changes, dynamic updates of virtual node mapping relationships, and rapid recovery in abnormal situations, ensuring system reliability and stability.

[0172] In existing technologies, the online / offline status of resource managers is typically handled by directly modifying the mapping table. This means that when a change in resource manager status is detected, add or delete operations are immediately performed on the original mapping table. This approach, which directly modifies the original table, can lead to read / write conflicts, impacting system performance. Furthermore, if an anomaly occurs during the modification process, it can result in inconsistent data in the mapping table, making recovery difficult. The lack of an effective historical record mechanism also makes status backtracking and fault analysis challenging.

[0173] The method in this embodiment achieves atomic switching of the mapping table by introducing a double buffer mechanism (new and old mapping table buffers), avoiding read-write conflicts caused by directly modifying the original table; a historical mapping record table is designed to record detailed information of each change, including resource manager identifier, virtual node location, change type and timestamp, providing a reliable basis for anomaly recovery; a transaction mechanism is adopted to ensure the integrity of the calculation process, and read-write locks are combined to ensure the security of the mapping table switching.

[0174] like Figure 3 The diagram illustrates the distribution and mapping relationships of various nodes within a ring-shaped hash space. In traditional hashing methods, resource manager nodes (red squares) are unevenly distributed; with five actual resource managers, their hash values ​​are located at different positions within the ring space. This leads to an unbalanced mapping of application nodes (blue circles), with some resource managers responsible for larger hash ranges while others handle smaller ranges, resulting in a maximum load difference of 8.5%. In this technical solution, by introducing virtual node technology (green triangles), each resource manager generates multiple virtual nodes (each actual node generates multiple virtual nodes), making the node distribution on the hash ring more even. The yellow lines represent the mapping relationship between application nodes and their assigned virtual nodes. Through this design, the load distribution of each resource manager in this technical solution is more balanced, with a maximum difference of only 0.8%, significantly better than traditional methods, achieving a more balanced resource allocation.

[0175] The application proxy routing and forwarding system in a cluster environment according to embodiments of the present invention includes:

[0176] The first unit is used to receive access requests from clients and obtain the application identifier in the access requests;

[0177] The second unit is used to employ a two-layer adaptive filtering detection mechanism to filter the candidate resource manager set through dynamic counting, complete secondary filtering based on time-series status, obtain a list of available resource managers, and write the list of available resource managers into an address mapping table.

[0178] The third unit is used to query application registration information based on the application identifier and obtain the target sub-cluster identifier where the application is located.

[0179] The fourth unit is used to read the list of available resource managers from the address mapping table according to the target sub-cluster identifier, construct a multi-level tree index structure, use a dynamic path planning algorithm to calculate the path cost to the client, dynamically evaluate the path cost through a real-time updated heuristic function, and select the resource manager with the minimum path cost as the target resource manager.

[0180] The fifth unit is used to map the application identifier to a ring hash space using a hash algorithm, locate the target resource manager identifier in the ring hash space through virtual nodes, construct a proxy forwarding rule table, and generate a redirect URL;

[0181] The sixth unit is used to send the redirect URL to the client.

[0182] A third aspect of the present invention provides an electronic device, comprising:

[0183] processor;

[0184] Memory used to store processor-executable instructions;

[0185] The processor is configured to invoke instructions stored in the memory to execute the aforementioned method.

[0186] A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, implement the aforementioned method.

[0187] This invention can be a method, apparatus, system, and / or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for performing various aspects of the invention.

[0188] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; 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 or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. An application proxy routing and forwarding method in a clustered environment, characterized in that, include: Receive an access request from a client and obtain the application identifier from the access request; A two-layer adaptive filtering detection mechanism is adopted. The candidate resource manager set is filtered by dynamic counting, and a secondary filtering is completed based on the time-series status to obtain a list of available resource managers. The list of available resource managers is then written into the address mapping table. Query the application registration information based on the application identifier to obtain the target sub-cluster identifier where the application is located; Based on the target sub-cluster identifier, the list of available resource managers is read from the address mapping table, a multi-level tree index structure is constructed, a dynamic path planning algorithm is used to calculate the path cost to the client, and the path cost is dynamically evaluated through a real-time updated heuristic function to select the resource manager with the lowest path cost as the target resource manager. The application identifier is mapped to a ring hash space using a hash algorithm. The target resource manager identifier is located in the ring hash space through virtual nodes. A proxy forwarding rule table is constructed, and a redirect URL is generated. The redirect URL is sent to the client.

2. The method according to claim 1, characterized in that, A two-layer adaptive filtering detection mechanism is adopted. Candidate resource managers are filtered through dynamic counting, and secondary filtering is performed based on temporal status to obtain a list of available resource managers. The list of available resource managers is then written into an address mapping table, including: Obtain multiple sets of continuous response times from the resource manager, construct a response time distribution sequence, and calculate the load fluctuation factor of the resource manager based on the response time distribution sequence; The response reliability is obtained by weighting the number of response timeouts of the resource manager based on the load fluctuation factor, and the performance counting threshold is dynamically adjusted according to the response reliability. Collect multi-dimensional performance indicators of resource managers within the performance counting threshold range, combine the multi-dimensional performance indicators to calculate the stability score, and select resource managers whose stability score is greater than the preset stability benchmark value to form a first candidate set. A state transition matrix is ​​constructed based on the historical performance data of each resource manager in the first candidate set, and the state transition probability of the resource manager is calculated based on the state transition matrix. Based on the state transition probability, the stability of the resource managers in the first candidate set is predicted, and resource managers whose state transition probability is greater than the preset stable operation threshold and whose state retention time exceeds the minimum stable period are selected to form a list of available resource managers. Write each identifier and network address information in the available resource manager list into the address mapping table, record the version information of the address mapping table, and save the version information before the update when the address mapping table is updated for rollback operation.

3. The method according to claim 2, characterized in that, Predicting the stability of resource managers in the first candidate set based on the state transition probabilities includes: Obtain the network topology connection relationship of the resource managers in the first candidate set, and determine the set of adjacent resource managers directly connected to the resource managers based on the network topology connection relationship; Collect the performance fluctuation sequence of each adjacent resource manager and calculate the performance fluctuation intensity value of each adjacent resource manager; based on the timestamp information of the performance fluctuation sequence, calculate the propagation delay of the performance fluctuation from each adjacent resource manager to the resource manager, and construct a performance fluctuation propagation feature vector according to the propagation delay and the performance fluctuation intensity value. A performance fluctuation propagation model is constructed using the performance fluctuation propagation feature vector, and the performance impact coefficient of each adjacent resource manager on the resource manager is calculated based on the performance fluctuation propagation model. The state transition probability is corrected based on the performance impact coefficient to obtain a corrected state transition probability value that incorporates network topology propagation effects. Substitute the corrected state transition probability value into the Markov prediction model to output the state sequence of the resource manager within a preset time window; The stable state percentage of the resource manager is calculated based on the state sequence. When the stable state percentage is greater than a preset stable operation threshold and the duration of consecutive stable states exceeds the minimum stable period, the resource manager is determined to meet the stability prediction requirements.

4. The method according to claim 1, characterized in that, Based on the target sub-cluster identifier, read the list of available resource managers from the address mapping table and construct a multi-level tree index structure, including: Based on the target sub-cluster identifier, the resource manager list is read from the address mapping table, and the resource manager identifier information, network topology information and service type information in the resource manager list are obtained to obtain the resource manager information set to be processed. Based on the resource manager identification information, spatial clustering method is used to divide the resource manager into regions and establish a region connection graph to obtain a first-level index hierarchical region structure. Based on the hierarchical regional structure and network topology information of the first-level index, the resource managers in the region are divided into subnets according to network prefixes and weighted connection relationships are established to obtain the second-level index layer network structure. Based on the network structure and service type information of the second-level index layer, the resource managers in the network layer are grouped according to service quality indicators and service dependencies are established to obtain the service structure of the third-level index layer. Assign globally unique identifiers to resource manager nodes in the three-level index layer service structure and establish a node attribute table to obtain the resource manager node attribute set; Based on the resource manager node attribute set, the node status is monitored by heartbeat detection and node splitting or merging operations are triggered to obtain an optimized node distribution structure. Based on the optimized node distribution structure, the relationships and distance metrics between nodes are updated and hotspot access path information is written to determine the final tree index structure, resulting in a multi-level tree index structure.

5. The method according to claim 1, characterized in that, A dynamic path planning algorithm is used to calculate the path cost to the client. A heuristic function that updates the path cost in real time is used to dynamically evaluate the cost, and the resource manager with the lowest path cost is selected as the target resource manager. This includes: Based on a multi-level tree index structure, the path cost is decomposed into node cost and edge cost. Processing capacity and load status information are collected for each node, and network quality and transmission delay information are collected for each edge to obtain the path cost matrix. A heuristic function is established based on the deviation between the current path cost and the historical best path cost in the path cost matrix. The evaluation weights are then adjusted in conjunction with the real-time path congestion status to obtain the path evaluation vector. Node performance metrics and link status parameters are obtained from a multi-level tree index structure. Nodes that exceed the preset load threshold are marked as trigger points, and a local update subgraph is constructed with the trigger points as the center. In the local update subgraph, the nodes at the level where the trigger point is located are traversed first to obtain the set of paths at the same level. When the set of paths at the same level is empty, it is expanded to the adjacent level to obtain the set of extended paths. Based on the path evaluation vector, the set of paths at the same level and the set of extended paths are pruned to determine the set of candidate paths. The path with the minimum cost and node load balance constraint is selected from the candidate path set as the access path. The search status information corresponding to the access path is written into the path cache table, and the heuristic function is updated based on the status information in the path cache table.

6. The method according to claim 1, characterized in that, The application identifier is mapped to a ring hash space using a hash algorithm. Within this ring hash space, the target resource manager identifier is located using virtual nodes. A proxy forwarding rule table is constructed, and a redirect URL is generated, including: Based on a multi-level tree index structure, the feature fields of the application identifier are mapped to a circular hash space using the MD5 hash algorithm, and the application identifier is calculated to obtain a first hash value. The application node position is determined in the circular hash space based on the first hash value. The resource manager identifier is combined with the incrementing sequence number to generate a virtual node code. The second hash value is calculated by the MD5 hash algorithm on the virtual node code. The location of the virtual node is determined in the circular hash space based on the second hash value, and the correspondence between the virtual node location and the resource manager identifier is written into the virtual node mapping table; Starting from the application node location, the nearest virtual node location is found in the circular hash space in a clockwise direction, and the target resource manager identifier is obtained through the virtual node mapping table; Write the correspondence between the application identifier and the target resource manager identifier into the application mapping table, construct a forwarding address based on the application mapping table, and write the authentication parameters into the forwarding address to generate a redirect URL.

7. The method according to claim 6, characterized in that, Also includes: Monitor the running status of the resource manager, and when a change in the online / offline status of the resource manager is detected, obtain the resource manager identifier; The corresponding virtual node location is found in the virtual node mapping table based on the resource manager identifier, and the correspondence between the virtual node location and the resource manager identifier is written into the historical mapping record. Establish a new mapping table buffer and an old mapping table buffer. Write all the correspondences of the virtual node mapping table into the new mapping table buffer. Recalculate the corresponding virtual node positions according to the status changes of the resource manager identifier. Write the correspondence between the new virtual node positions and the resource manager identifier into the new virtual node mapping table buffer. After completing all calculations, replace the old mapping table buffer with the new mapping table buffer. If an anomaly occurs during the recalculation process, the corresponding relationship in the virtual node mapping table is restored based on the historical mapping records.

8. An application proxy routing and forwarding system in a clustered environment, used to implement the method of any one of claims 1-7, characterized in that, include: The first unit is used to receive access requests from clients and obtain the application identifier in the access requests; The second unit is used to employ a two-layer adaptive filtering detection mechanism to filter the candidate resource manager set through dynamic counting, complete secondary filtering based on time-series status, obtain a list of available resource managers, and write the list of available resource managers into an address mapping table. The third unit is used to query application registration information based on the application identifier and obtain the target sub-cluster identifier where the application is located. The fourth unit is used to read the list of available resource managers from the address mapping table according to the target sub-cluster identifier, construct a multi-level tree index structure, use a dynamic path planning algorithm to calculate the path cost to the client, dynamically evaluate the path cost through a real-time updated heuristic function, and select the resource manager with the minimum path cost as the target resource manager. The fifth unit is used to map the application identifier to a ring hash space using a hash algorithm, locate the target resource manager identifier in the ring hash space through virtual nodes, construct a proxy forwarding rule table, and generate a redirect URL; The sixth unit is used to send the redirect URL to the client.

9. An electronic device, characterized in that, include: processor; Memory used to store processor-executable instructions; The processor is configured to invoke instructions stored in the memory to execute the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that, When the computer program instructions are executed by the processor, they implement the method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Heterogeneous virtual resources management system and method

    CN113326129A

  • Graph theory-based hierarchical adaptive load balancing method and system

    CN115426360A