Application proxy routing forwarding method and system in cluster environment

Through the application proxy routing forwarding method of double-layer adaptive filtering detection and multi-level tree index structure, the problems of resource manager selection and path optimization in cluster environment are solved, and efficient and stable resource management and request forwarding are achieved.

CN120675926AActive Publication Date: 2025-09-19北京科杰科技有限公司

Patent Information

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

AI Technical Summary

Technical Problem

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

Method used

A double-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. The hash algorithm is used to map the structure to a circular hash space, and a redirection URL is generated to achieve 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 large-scale cluster environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120675926A_ABST
    Figure CN120675926A_ABST
Patent Text Reader

Abstract

The invention provides an application proxy routing forwarding method and system in a cluster environment, and relates to the technical field of computer networks, and the method comprises the steps: obtaining an available resource manager list through employing a double-layer adaptive filtering detection mechanism, and carrying out the routing forwarding of an application program based on an application program identifier and a target sub-cluster identifier; and constructing a multi-layer tree index structure, selecting an optimal resource manager by applying a dynamic path planning algorithm, and generating a redirection URL through annular hash space mapping and virtual node positioning. According to the invention, the system response speed is improved, the routing forwarding efficiency is enhanced, the load balancing capability is optimized, and the stability and reliability of application access in a cluster environment are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer networks, and in particular to an application proxy routing forwarding method and system in a cluster environment. Background Art

[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 concurrently in different subclusters, and clients need to access these applications through resource managers. Traditional application proxy routing and forwarding technologies rely primarily on static configuration or simple load balancing strategies to distribute requests, which cannot effectively cope with dynamically changing cluster environments.

[0003] In a cluster environment, application access requests must be forwarded through an appropriate resource manager to ensure they are correctly routed to the subcluster where the target application resides. As a key component in a cluster, the resource manager is responsible for managing cluster resources and providing access to applications. As applications scale and user requests increase, efficiently selecting the appropriate resource manager and building reliable proxy forwarding rules have become pressing challenges in the technology landscape.

[0004] The application proxy routing forwarding method in the existing technology still has some defects. The existing resource manager selection mechanism lacks effective filtering and detection means, and cannot promptly identify and exclude unavailable resource managers, resulting in requests being forwarded to unavailable nodes, causing access failures or increased delays; traditional routing decision methods usually adopt static allocation strategies or simple load balancing algorithms, which lack consideration of network topology and path overhead, and cannot dynamically select the optimal path based on the actual network conditions between the client and the resource manager, reducing the efficiency of request forwarding and user experience; existing hash mapping technology has stability issues when processing 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 performance of the system and may cause service interruptions, making it difficult to adapt to dynamically changing cluster environments. Summary of the Invention

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

[0006] A first aspect of an embodiment of the present invention provides an application proxy routing forwarding method in a cluster environment, comprising: Receive an access request from a client, and obtain an application identifier in the access request; A double-layer adaptive filtering detection mechanism is adopted to screen the candidate resource manager set through dynamic counting, and a secondary filtering is performed based on the timing state to obtain a list of available resource managers, which is then written into the address mapping table. Query application registration information according to the application identifier to obtain the target subcluster identifier where the application is located; Reading a list of available resource managers from an address mapping table according to the target subcluster identifier, constructing a multi-level tree index structure, calculating the path cost to the client using a dynamic path planning algorithm, dynamically evaluating the path cost using a real-time updated heuristic function, and selecting the resource manager with the smallest path cost as the target resource manager; Mapping the application identifier to a circular hash space through a hash algorithm, locating the target resource manager identifier through a virtual node in the circular hash space, building a proxy forwarding rule table, and generating a redirection URL; Send the redirect URL to the client.

[0007] In an optional embodiment, a two-layer adaptive filtering detection mechanism is adopted to screen a set of candidate resource managers through dynamic counting, perform secondary filtering based on the timing state, obtain a list of available resource managers, and write the list of available resource managers into the address mapping table, including: Obtaining multiple sets of continuous response times of the resource manager, constructing a response time distribution sequence, and calculating a load fluctuation factor of the resource manager based on the response time distribution sequence; Performing weighted calculation on the number of response timeouts of the resource manager based on the load fluctuation factor to obtain response reliability, and dynamically adjusting the performance counting threshold according to the response reliability; Collecting multi-dimensional performance indicators of resource managers within the performance count threshold range, performing combined calculation on the multi-dimensional performance indicators to obtain a stability score, and selecting resource managers whose stability scores are greater than a preset stability reference value to form a first candidate set; Building a state transition matrix based on historical performance data of each resource manager in the first candidate set, and calculating the state transition probability of the resource manager according to the state transition matrix; Predicting the stability of resource managers in the first candidate set based on the state transition probability, selecting resource managers whose state transition probability is greater than a preset stable operation threshold and whose state retention time exceeds a minimum stable period, and forming a list of available resource managers; The identification information and network address information in the available resource manager list are written into the address mapping table, the version information of the address mapping table is recorded, and when the address mapping table is updated, the version information before the update is saved for rollback operation.

[0008] In an optional embodiment, predicting the stability of the resource managers in the first candidate set according to the state transition probability includes: Acquire a network topology connection relationship of resource managers in the first candidate set, and determine a set of adjacent resource managers directly connected to the resource manager based on the network topology connection relationship; Collecting performance fluctuation sequences of each adjacent resource manager and calculating the performance fluctuation intensity value of each adjacent resource manager; calculating the propagation delay of the performance fluctuation from each adjacent resource manager to the resource manager based on the timestamp information of the performance fluctuation sequence, and constructing a performance fluctuation propagation feature vector based on the propagation delay and the performance fluctuation intensity value; constructing a performance fluctuation propagation model using the performance fluctuation propagation feature vector, and calculating a performance impact coefficient of each adjacent resource manager on the resource manager based on the performance fluctuation propagation model; Correcting the state transition probability according to the performance impact coefficient to obtain a corrected state transition probability value that takes into account the network topology propagation effect; Substituting the modified state transition probability value into a Markov prediction model to output a state sequence of the resource manager within a preset time window; The stable state ratio of the resource manager is calculated according to the state sequence. When the stable state ratio is greater than a preset stable operation threshold and the duration of the continuous stable state exceeds a minimum stable period, it is determined that the resource manager meets the stability prediction requirement.

[0009] In an optional embodiment, reading the available resource manager list from the address mapping table according to the target subcluster identifier, and constructing the multi-level tree index structure includes: Read the resource manager list from the address mapping table according to the target subcluster identifier, obtain the resource manager identifier information, network topology information and service type information in the resource manager list, and obtain the resource manager information set to be processed; Based on the resource manager identification information, a spatial clustering method is used to divide the resource managers into regions and establish a regional connection relationship graph to obtain a first-level index hierarchical regional 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 the network prefix 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 secondary index layer, the resource managers in the network layer are grouped according to the service quality indicators and service dependencies are established to obtain the service structure of the third-level index layer; Assigning a globally unique identifier to the resource manager node in the three-level index layer service structure and establishing a node attribute table to obtain a resource manager node attribute set; Based on the resource manager node attribute set, monitoring the node status through heartbeat detection and triggering node splitting or merging operations to obtain an optimized node distribution structure; Based on the optimized node distribution structure, the relationship and distance measurement between nodes are updated and the hotspot access path information is written to determine the final tree index structure and obtain a multi-level tree index structure.

[0010] In an 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 real-time updated heuristic function, and the resource manager with the smallest path cost is selected as the target resource manager, including: Based on a multi-level tree index structure, the path cost is decomposed into node cost and edge cost. The processing capacity and load status information of each node are collected, and the network quality and transmission delay information of each edge are collected to obtain the path cost matrix. A heuristic function is established based on the deviation between the current path cost and the historical optimal path cost in the path cost matrix. The evaluation weight is adjusted based on the real-time path congestion status to obtain a path evaluation vector. Obtain node performance indicators and link status parameters from a multi-level tree index structure, mark nodes that exceed a preset load threshold as trigger points, and construct a local update subgraph centered around the trigger point; In the local update subgraph, the nodes at the level where the trigger point is located are traversed first to obtain a path set at the same level. When the path set at the same level is empty, the set is expanded to the adjacent level to obtain an extended path set. The path set at the same level and the extended path set are pruned based on the path evaluation vector to determine the candidate path set. The path with the smallest path cost and node load that meets the 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.

[0011] In an optional embodiment, mapping the application identifier to a ring hash space using a hash algorithm, locating the target resource manager identifier using a virtual node in the ring hash space, constructing a proxy forwarding rule table, and generating a redirection URL includes: Based on a multi-level tree index structure, the characteristic field of the application identifier is mapped to a ring hash space through an MD5 hash algorithm, and the application identifier is calculated to obtain a first hash value; Determine the application node position in the annular hash space according to the first hash value, combine the resource manager identifier with the incrementing sequence number to generate a virtual node code, and calculate the virtual node code using the MD5 hash algorithm to obtain a second hash value; Determine a virtual node position in a ring hash space based on the second hash value, and write a correspondence between the virtual node position and the resource manager identifier into a virtual node mapping table; Taking the application node position as the starting point, search for the nearest virtual node position in the annular hash space in a clockwise direction, and obtain the target resource manager identifier through the virtual node mapping table; The correspondence between the application identifier and the target resource manager identifier is written into an application mapping table, a forwarding address is constructed based on the application mapping table, and authentication parameters are written into the forwarding address to generate a redirection URL.

[0012] In an optional embodiment, the method further includes: Monitor the running status of the resource manager and obtain the resource manager identifier when detecting changes in the online and offline status of the resource manager; Searching for a corresponding virtual node position from a virtual node mapping table according to the resource manager identifier, and writing a correspondence between the virtual node position and the resource manager identifier into a historical mapping record; Establish a new mapping table buffer and an old mapping table buffer, write all correspondences of the virtual node mapping table into the new mapping table buffer, recalculate the corresponding virtual node position according to the state change of the resource manager identifier, write the correspondence between the new virtual node position and the resource manager identifier into the new virtual node mapping table buffer, and after completing all calculations, replace the old mapping table buffer with the new mapping table buffer; When an exception occurs during the recalculation process, the corresponding relationship in the virtual node mapping table is restored according to the historical mapping record.

[0013] A second aspect of an embodiment of the present invention provides an application proxy routing and forwarding system in a cluster environment, comprising: The first unit is configured to receive an access request from a client and obtain an application identifier in the access request; The second unit is configured to adopt a double-layer adaptive filtering detection mechanism, screen a set of candidate resource managers by dynamic counting, perform secondary filtering based on a timing state, obtain a list of available resource managers, and write the list of available resource managers into an address mapping table; The third unit is configured to query application registration information according to the application identifier and obtain a target subcluster identifier where the application is located; a fourth unit, configured to read a list of available resource managers from an address mapping table according to the target subcluster identifier, construct a multi-level tree index structure, calculate a path cost to the client using a dynamic path planning algorithm, dynamically evaluate the path cost using a real-time updated heuristic function, and select the resource manager with the smallest path cost as the target resource manager; A fifth unit is configured to map the application identifier to a ring hash space through a hash algorithm, locate the target resource manager identifier in the ring hash space through a virtual node, construct a proxy forwarding rule table, and generate a redirection URL; The sixth unit is configured to send the redirection URL to the client.

[0014] According to a third aspect of an embodiment of the present invention, an electronic device is provided, including: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0015] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.

[0016] In an embodiment of the present invention, a double-layer adaptive filtering detection mechanism is used to dynamically screen available resource managers, thereby 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, the present invention can accurately evaluate the path overhead from the client to the resource manager, achieve optimal routing selection, significantly reduce network latency, and improve user access experience; mapping application identifiers to a ring hash space and utilizing virtual node technology achieves balanced distribution and efficient forwarding of requests, enhances the scalability and fault tolerance of the system, and ensures stable operation in a large-scale cluster environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 This is a flow chart of an application proxy routing and forwarding method in a cluster environment according to an embodiment of the present invention; Figure 2 It is a flow chart of the application proxy routing forwarding method under the multi-level tree index structure; Figure 3 This is a simulation diagram of the distribution of various nodes in the ring hash space. DETAILED DESCRIPTION

[0018] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0019] The following specific embodiments are used to describe the technical solution of the present invention in detail. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0020] Figure 1 FIG. 1 is a flow chart of an application proxy routing and forwarding method in a cluster environment according to an embodiment of the present invention. Figure 1 As shown, the method includes: Receive an access request from a client, and obtain an application identifier in the access request; A double-layer adaptive filtering detection mechanism is adopted to screen the candidate resource manager set through dynamic counting, and a secondary filtering is performed based on the timing state to obtain a list of available resource managers, which is then written into the address mapping table. Query application registration information according to the application identifier to obtain the target subcluster identifier where the application is located; Reading a list of available resource managers from an address mapping table according to the target subcluster identifier, constructing a multi-level tree index structure, calculating the path cost to the client using a dynamic path planning algorithm, dynamically evaluating the path cost using a real-time updated heuristic function, and selecting the resource manager with the smallest path cost as the target resource manager; Mapping the application identifier to a circular hash space through a hash algorithm, locating the target resource manager identifier through a virtual node in the circular hash space, building a proxy forwarding rule table, and generating a redirection URL; Send the redirect URL to the client.

[0021] In an optional embodiment, a two-layer adaptive filtering detection mechanism is adopted to screen a set of candidate resource managers by dynamic counting, perform secondary filtering based on the timing state, obtain a list of available resource managers, and write the list of available resource managers into the address mapping table, including: Obtaining multiple sets of continuous response times of the resource manager, constructing a response time distribution sequence, and calculating a load fluctuation factor of the resource manager based on the response time distribution sequence; Performing weighted calculation on the number of response timeouts of the resource manager based on the load fluctuation factor to obtain response reliability, and dynamically adjusting the performance counting threshold according to the response reliability; Collecting multi-dimensional performance indicators of resource managers within the performance count threshold range, performing combined calculation on the multi-dimensional performance indicators to obtain a stability score, and selecting resource managers whose stability scores are greater than a preset stability reference value to form a first candidate set; Building a state transition matrix based on historical performance data of each resource manager in the first candidate set, and calculating the state transition probability of the resource manager according to the state transition matrix; Predicting the stability of resource managers in the first candidate set based on the state transition probability, selecting resource managers whose state transition probability is greater than a preset stable operation threshold and whose state retention time exceeds a minimum stable period, and forming a list of available resource managers; The identification information and network address information in the available resource manager list are written into the address mapping table, the version information of the address mapping table is recorded, and when the address mapping table is updated, the version information before the update is saved for rollback operation.

[0022] In one specific embodiment, analyzing the response time distribution of resource managers is fundamental to achieving high-reliability routing and forwarding. A network detection module sends heartbeat packets to each resource manager in the cluster every 5 seconds, acquiring 100 consecutive response time data points. For one resource manager, for example, the acquired response time sequence is [12ms, 15ms, 13ms, 18ms, 14ms, 25ms, 16ms, 13ms, 14ms, 19ms…]. 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 of [0-5ms: 0, 5-10ms: 0, 10-15ms: 60, 15-20ms: 35, 20-25ms: 4, 25-30ms: 1]. Based on this distribution sequence, the load fluctuation factor is calculated to be 0.18, which represents the stability of the resource manager's response time. A smaller value indicates less response time fluctuation and higher stability.

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

[0024] After determining the performance counter threshold, the performance collection agent is used to obtain multi-dimensional performance metrics for the resource manager. For the aforementioned resource manager, the collected performance metrics include 62% CPU utilization, 58% memory usage, 420Mbps network throughput, 15ms disk I / O latency, and 485 connections. These metrics are combined and calculated to obtain a stability score of 0.83. The preset stability baseline value is 0.75. Since this resource manager's stability score exceeds this threshold, it is included in the first candidate set.

[0025] 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 state into three categories: stable, fluctuating, and overloaded. By analyzing the resource manager's hourly state records over the past seven days and counting the number of transitions between states, a 3×3 state transition matrix is ​​constructed. For one resource manager, its state transition matrix is ​​[[0.92, 0.07, 0.01], [0.15, 0.80, 0.05], [0.05, 0.35, 0.60]], where the value 0.92 in the first row and first column indicates a 92% probability of remaining stable after a stable state.

[0026] 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 that its probability of remaining stable within the next 24 hours is 0.85, and the expected state retention time is 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 added to the list of available resource managers.

[0027] After the list of available resource managers is constructed, their information needs to be written to the address mapping table for routing. The address mapping table contains the resource manager's identification information and network address information. For example, a resource manager's identification information is "RM-Node-025" and its network address information is "192.168.10.25:8080." The address mapping table uses a versioning mechanism, generating a new version number with each update, such as "MapTable-v20250612-01." The previous version information, such as "MapTable-v20250611-03," is also saved for rollback in case of issues with the new version.

[0028] In practice, when a client requests access to a cluster application, the routing 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 becomes unresponsive during the request processing, the routing module selects another resource manager from the address mapping table for forwarding and temporarily marks the unresponsive resource manager as unavailable, triggering a re-evaluation process.

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

[0030] In an optional implementation, predicting the stability of the resource managers in the first candidate set based on the state transition probability includes: Acquire a network topology connection relationship of resource managers in the first candidate set, and determine a set of adjacent resource managers directly connected to the resource manager based on the network topology connection relationship; Collecting performance fluctuation sequences of each adjacent resource manager and calculating the performance fluctuation intensity value of each adjacent resource manager; calculating the propagation delay of the performance fluctuation from each adjacent resource manager to the resource manager based on the timestamp information of the performance fluctuation sequence, and constructing a performance fluctuation propagation feature vector based on the propagation delay and the performance fluctuation intensity value; constructing a performance fluctuation propagation model using the performance fluctuation propagation feature vector, and calculating a performance impact coefficient of each adjacent resource manager on the resource manager based on the performance fluctuation propagation model; Correcting the state transition probability according to the performance impact coefficient to obtain a corrected state transition probability value that takes into account the network topology propagation effect; Substituting the modified state transition probability value into a Markov prediction model to output a state sequence of the resource manager within a preset time window; The stable state ratio of the resource manager is calculated according to the state sequence. When the stable state ratio is greater than a preset stable operation threshold and the duration of the continuous stable state exceeds a minimum stable period, it is determined that the resource manager meets the stability prediction requirement.

[0031] In a specific embodiment, obtaining the network topology connection relationship of the resource manager is the basis for predicting the propagation of performance fluctuations. The network connection information of the resource managers in the first candidate set is collected by the topology discovery module, including the physical connection and logical connection levels. The physical connection is obtained through switch port mapping and network tracing, and the logical connection is obtained through application layer communication relationship analysis. Taking the resource manager RM-Node-025 as an example, its directly connected adjacent resource manager set is {RM-Node-018, RM-Node-023, RM-Node-026, RM-Node-032}. These adjacent nodes are connected to the target resource manager through a network switch or a direct network link, forming a first-order neighborhood topology structure.

[0032] Collecting performance fluctuation sequences of neighboring resource managers is crucial for analyzing propagation effects. The performance collection agent collects key performance indicators of neighboring resource managers, including CPU utilization, memory usage, and network throughput, every 10 seconds, generating time series data. For example, for neighboring resource manager RM-Node-018, 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 series, we obtain performance fluctuation intensity values. RM-Node-018's performance fluctuation intensity is 0.28, indicating significant performance fluctuations; RM-Node-023's is 0.12, indicating minimal performance fluctuations; RM-Node-026's is 0.33, indicating significant performance fluctuations; and RM-Node-032's is 0.19, indicating moderate performance fluctuations.

[0033] The calculation of performance fluctuation propagation delay reflects the temporal characteristics of fluctuation impacts. By analyzing the performance metrics time series of adjacent resource managers and the target resource manager, similar fluctuation patterns are identified and the propagation time required for fluctuations is calculated. For example, when the CPU utilization of RM-Node-026 suddenly increases from 50% to 85%, the CPU utilization of the target resource manager, RM-Node-025, also increases from 45% to 65% 12 seconds later. 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 propagation delays with performance fluctuation intensity values, a performance fluctuation propagation feature vector is constructed. The feature vector for RM-Node-025 is [0.28:18s, 0.12:25s, 0.33:12s, 0.19:15s].

[0034] The construction of a performance fluctuation propagation model is a core technology for predicting the impact of neighboring nodes. This method uses a weighted attenuation model, taking into account both propagation delay and performance fluctuation intensity. Shorter propagation delays increase the impact; higher performance fluctuation intensity also increases the impact. Based on the eigenvectors, the performance impact coefficients of each neighboring 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 neighboring nodes have a significant impact on the target node.

[0035] Correcting the state transition probability is a key step in improving prediction accuracy. Without considering the effects of network topology propagation, the probability of RM-Node-025 remaining stable after a transition from a stable state is 0.92. Considering the sum of the performance impact coefficients of adjacent nodes (0.84), the corrected state transition probability is 0.84. The correction process multiplies the original stable state probability of 0.92 by a correction factor calculated based on the impact coefficients to obtain the corrected probability value. Similarly, the transition probabilities for the fluctuating and overloaded 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]].

[0036] Applying a Markov prediction model is a key step in generating state sequences. This method, based on a modified state transition matrix, sets a 24-hour prediction window and a 1-hour time granularity, and outputs the state sequence of the resource manager over that 24-hour period. Assuming RM-Node-025 is currently stable, the modified state transition matrix predicts its state sequence for the next 24 hours as [stable, stable, stable, fluctuating, fluctuating, stable, stable, stable, stable, stable, stable, stable, stable, fluctuating, fluctuating, stable, stable, stable, stable].

[0037] Calculating the percentage of stable states is the final step in evaluating resource manager stability. For the aforementioned state sequence, the stable state occurred 20 times, accounting for 83.3% of the total time. The preset stable operation threshold is 80%. Since 83.3% is greater than 80%, it meets the stability requirement. Furthermore, the longest continuous stable state duration in this sequence is 8 hours, and the preset minimum stable period is 6 hours, so the duration of continuous stable states also meets the requirement. The comprehensive evaluation results show that RM-Node-025 meets the stability prediction requirements and can be included in the list of available resource managers.

[0038] Existing technologies for resource managers predict stability primarily based on historical data analysis of individual nodes, using time series analysis or simple thresholding methods without considering the inter-node interactions within a cluster. While these methods are somewhat effective in predicting short-term performance changes in individual nodes, they are less accurate in complex cluster environments, particularly when load fluctuations are propagating, with prediction errors reaching as high as 40%.

[0039] This embodiment recognizes that the performance state of the resource manager in a cluster environment is not only affected by its own historical performance, but also significantly affected by the propagation of performance fluctuations of adjacent nodes. The method of this embodiment introduces network topology propagation effect analysis, and through the performance fluctuation sequence, propagation delay and influence coefficient calculation of adjacent nodes, corrects the state migration probability and constructs a more accurate Markov prediction model. Therefore, this embodiment introduces network topology structure analysis to identify adjacent nodes directly connected to the target resource manager; establishes a performance fluctuation propagation model to quantify the degree of influence of adjacent nodes on the target node; corrects the state migration probability based on the influence coefficient to improve the accuracy of the prediction; introduces state sequence analysis to evaluate the proportion and duration of stable states and comprehensively judge the stability of the resource manager.

[0040] 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, thereby improving the accuracy of stability prediction and significantly reducing the error prediction rate; based on the performance fluctuation propagation feature vector and the performance impact coefficient calculated by propagation delay, the state transition probability is accurately corrected, and potentially unstable resource managers are effectively identified, thereby improving service availability; combining the application of the corrected state transition probability with the Markov prediction model, accurate prediction of the future state of the resource manager is achieved, reducing the average response time and user request failure rate; through the dual evaluation mechanism of stable state proportion and continuous stable time, the stability of the resource manager is comprehensively judged, avoiding the short-term stable but long-term unreliable resource manager from being mistakenly selected as an available node, thereby enhancing the overall reliability of application proxy routing forwarding in a cluster environment.

[0041] In an optional implementation, reading the available resource manager list from the address mapping table according to the target subcluster identifier, and constructing the multi-level tree index structure includes: Read the resource manager list from the address mapping table according to the target subcluster identifier, obtain the resource manager identifier information, network topology information and service type information in the resource manager list, and obtain the resource manager information set to be processed; Based on the resource manager identification information, a spatial clustering method is used to divide the resource managers into regions and establish a regional connection relationship graph to obtain a first-level index hierarchical regional 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 the network prefix 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 secondary index layer, the resource managers in the network layer are grouped according to the service quality indicators and service dependencies are established to obtain the service structure of the third-level index layer; Assigning a globally unique identifier to the resource manager node in the three-level index layer service structure and establishing a node attribute table to obtain a resource manager node attribute set; Based on the resource manager node attribute set, monitoring the node status through heartbeat detection and triggering node splitting or merging operations to obtain an optimized node distribution structure; Based on the optimized node distribution structure, the relationship and distance measurement between nodes are updated and hotspot access path information is written to determine the final tree index structure and obtain a multi-level tree index structure.

[0042] In one specific implementation, after obtaining the target subcluster identifier, a list of resource managers corresponding to that subcluster is retrieved from an address mapping table. The address mapping table is a key-value pair structure, where the key is the subcluster identifier and the value is a collection of information about all resource managers in that subcluster. For example, for subcluster identifier "SC-01," a list of 10 resource managers can be retrieved from the address mapping table. For each resource manager, its identifier (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 set of resource manager information to be processed.

[0043] Based on resource manager identification information, the DBSCAN spatial clustering algorithm is used to divide resource managers into regions. The algorithm calculates the geographic distance between resource managers and groups those with similar distances into the same region. For example, if the distance parameter is set to 50 kilometers and the minimum number of points is set to 3, the system may divide 10 resource managers into three 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 connectivity graph is established between regions, recording connectivity and distance information between regions, forming a hierarchical region structure with a first-level index.

[0044] Based on the primary index, resource managers within each region are subnetted based on network topology information. The network prefix of the IP address is extracted, and resource managers with the same network prefix are grouped into the same subnet. For example, three resource managers in region A might be divided into two subnets: subnet A1 (RM-001 and RM-002, with a network prefix of 192.168.1.0 / 24) and subnet A2 (RM-003, with a network prefix of 192.168.2.0 / 24). Weighted connections are established between subnets, with the weight 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 network structure of the secondary index layer.

[0045] Based on the secondary index layer network structure, resource managers within each subnet are grouped according to service type information. Quality of service metrics 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, 500MB / s throughput). The system groups resource managers of the same type and level of service together and creates a service dependency graph to record the call dependencies between different service groups. This forms a three-level index layer service structure.

[0046] Each resource manager node in the three-level index layer service structure is assigned a globally unique identifier. This identifier consists of 20 hexadecimal characters in the format of "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." A property table is created for each node, recording information such as the node's hardware configuration, load, and health status, forming the resource manager node attribute set.

[0047] Node status is monitored by periodically sending heartbeat packets, with a default heartbeat interval of 5 seconds. When a node status change is detected, the system triggers a node split or merge operation. For example, when the load on subnet A1 exceeds 80%, the system triggers a node split, splitting RM-001 into two logical nodes, RM-001a and RM-001b. When the load on subnet A2 falls below 20% for more than 30 minutes, a node merge is triggered, merging RM-003 with a lower-load node in an adjacent subnet. By dynamically adjusting node distribution, the system achieves an optimized node distribution structure.

[0048] Based on the optimized node distribution structure, inter-node relationships and distance metrics are updated. Distance metrics take into account geographic distance, network latency, and service quality, using a weighted summation approach. Hotspot access paths are recorded, for example, the access frequency from "A001-A100-C001-00000001" to "B001-B100-S001-00000004" is 100 times per second. Based on this information, the index structure is updated and hotspot paths are optimized, such as adding direct connections or adjusting routing weights. The resulting multi-level tree-like index structure comprises three layers: the regional layer, the network layer, and the service layer. Each node records its parent and child node information, as well as node attributes and connection relationships, enabling the system to quickly locate and access resources.

[0049] The multi-level tree index structure constructed by the above method can efficiently manage and schedule resources in a distributed environment, significantly improve the efficiency of resource search and allocation, and at the same time ensure the scalability and fault tolerance of the system.

[0050] In an 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 real-time updated heuristic function, and the resource manager with the smallest path cost is selected as the target resource manager, including: Based on a multi-level tree index structure, the path cost is decomposed into node cost and edge cost. The processing capacity and load status information of each node are collected, and the network quality and transmission delay information of each edge are collected to obtain the path cost matrix. A heuristic function is established based on the deviation between the current path cost and the historical optimal path cost in the path cost matrix. The evaluation weight is adjusted based on the real-time path congestion status to obtain a path evaluation vector. Obtain node performance indicators and link status parameters from a multi-level tree index structure, mark nodes that exceed a preset load threshold as trigger points, and construct a local update subgraph centered around the trigger point; In the local update subgraph, the nodes at the level where the trigger point is located are traversed first to obtain a path set at the same level. When the path set at the same level is empty, the set is expanded to the adjacent level to obtain an extended path set. The path set at the same level and the extended path set are pruned based on the path evaluation vector to determine the candidate path set. The path with the smallest path cost and node load that meets the 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.

[0051] In one specific embodiment, in an application proxy routing and forwarding method in a cluster environment, the construction of a multi-level tree index structure is the foundation for achieving efficient path selection. This structure organizes the resource nodes in the cluster into a multi-level tree structure based on the network topology, with each layer of nodes 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 regional management node, responsible for resource scheduling within a specific area; and the third level is the specific application service node, which directly provides business services. Each node has a unique identifier and hierarchical information, such as node "N2-3" representing the third node in the second level. The edges connecting the nodes represent network links, and each edge has a direction attribute and weight information.

[0052] Path cost decomposition is key to accurately assessing routing and forwarding overhead. Node cost reflects processing capacity and load status. The performance collection module collects metrics such as CPU utilization, memory usage, and processing queue length every 5 seconds. For node "N2-3," for example, its current CPU utilization is 65%, memory usage is 72%, and processing queue length is 28. The calculated node cost is 0.68. Edge cost reflects network quality and transmission delay. The network detection module collects link metrics such as transmission delay, packet loss rate, and bandwidth utilization every 3 seconds. For example, the edge connecting nodes "N2-3" and "N3-5" has a current transmission delay of 15ms, a packet loss rate of 0.2%, and a bandwidth utilization of 45%. The calculated edge cost is 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 ingress 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.

[0053] The heuristic function is established based on historical path data analysis. The path cost deviation is calculated by comparing the current path cost with the historical optimal path cost. For path 2 (N1-1→N2-3→N3-5), the historical optimal cost is 1.65, the current cost is 1.78, and the deviation is 0.13. 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 for path 2 is 5%, and the link transmission delay change rate is 3%, resulting in a comprehensive assessment of "mild congestion." Evaluation weights are adjusted based on the deviation and congestion status. For "mild congestion," the evaluation weights for delay-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]. According to the adjusted weights, the path evaluation vector is recalculated. The evaluation vector of path 2 is [0.3×0.7, 0.2×0.65, 0.3×0.75, 0.2×0.8], and the comprehensive score is 0.725.

[0054] The determination of trigger points and the construction of a local update subgraph 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 is constructed, centered around trigger point "N2-3," encompassing its directly connected nodes. This subgraph includes nodes "N1-1," "N2-3," "N3-5," "N3-6," and "N3-7," along with the edges connecting them. The scope of the local update subgraph is much smaller than the global graph, significantly reducing the search space.

[0055] The same-level path and extended path traversal strategy improves path selection accuracy. Nodes at the trigger point's level (the second level) are prioritized for traversal to obtain alternative paths. Assuming that trigger point "N2-3" has "N2-2" and "N2-4" at the same level, paths N1-1→N2-2→N3-5 and N1-1→N2-4→N3-5 are constructed, respectively, to form 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 algorithm expands to adjacent levels (the first and third levels) to search for possible alternative paths, forming an extended path set. The path set is pruned based on the path evaluation vector, removing paths with a score below 0.6. After pruning, a set of candidate paths is obtained, including path 1 (N1-1→N2-2→N3-5) and path 3 (N1-1→N2-4→N3-5).

[0056] The optimal access path is selected based on a comprehensive consideration of path cost and load balancing. Among the candidate paths, path 1 has a cost of 2.15, while path 3 has a cost of 2.32, making path 1 the less expensive. Further checking the node load balancing constraints reveals that the current load of node "N2-2" is 65%, and that 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 for 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 the evaluation factors are adjusted to provide more accurate guidance for the next path selection.

[0057] Existing routing and forwarding methods primarily rely on static configuration or simple load balancing strategies, such as round-robin, random selection, and least connections. These methods fail to fully consider network topology and dynamically changing load conditions, and in complex cluster environments, they can easily lead to uneven resource allocation, increased response latency, and reduced service quality. In particular, in high-concurrency scenarios, simple load balancing strategies cannot quickly respond to sudden traffic bursts and hotspot loads within the cluster, resulting in some nodes being overloaded and others being idle.

[0058] This embodiment believes that routing and forwarding in a cluster environment need to consider multiple factors at the same time. A multi-level tree index structure and a heuristic path search strategy are introduced, and efficient and accurate routing and forwarding are achieved through path cost decomposition, local update subgraph construction and adaptive weight adjustment. The method of this embodiment introduces a multi-level tree index structure to reduce the complexity of path search; decomposes the path cost into node cost and edge cost to achieve more refined path evaluation; constructs a local update subgraph based on the trigger point to avoid the high overhead of global path recalculation; combines the same-layer priority traversal and extended path strategy to balance the search efficiency and path quality; and improves the processing efficiency of continuous requests through path caching and dynamic adjustment of heuristic functions.

[0059] like Figure 2 As shown in the figure, the complete logical process of the application proxy routing forwarding method under the multi-level tree index structure is demonstrated. The multi-level tree index structure is constructed, the node processing capacity and load status information are collected, the network quality and transmission delay information are collected, and the path cost matrix is ​​finally calculated; the deviation value between the current path and the historical optimal path cost is calculated, the real-time path congestion status is obtained, the evaluation weight is adjusted, and the path evaluation vector is generated; the node load status is monitored, whether it exceeds the threshold, the trigger point is marked, and a local update subgraph is constructed; the nodes at the level where the trigger point is located are traversed, the path set at the same level is obtained, and whether it is empty, and if necessary, it is expanded to the adjacent level, and the path evaluation vector is pruned based on the path evaluation vector, the optimal path is selected, and the path cache table and heuristic function are updated.

[0060] In an optional embodiment, mapping the application identifier to a circular hash space using a hash algorithm, locating the target resource manager identifier using a virtual node in the circular hash space, constructing a proxy forwarding rule table, and generating a redirection URL includes: Based on a multi-level tree index structure, the characteristic field of the application identifier is mapped to a ring hash space through an MD5 hash algorithm, and the application identifier is calculated to obtain a first hash value; Determine the application node position in the annular hash space according to the first hash value, combine the resource manager identifier with the incrementing sequence number to generate a virtual node code, and calculate the virtual node code using the MD5 hash algorithm to obtain a second hash value; Determine a virtual node position in a ring hash space based on the second hash value, and write a correspondence between the virtual node position and the resource manager identifier into a virtual node mapping table; Taking the application node position as the starting point, search for the nearest virtual node position in the annular hash space in a clockwise direction, and obtain the target resource manager identifier through the virtual node mapping table; The correspondence between the application identifier and the target resource manager identifier is written into an application mapping table, a forwarding address is constructed based on the application mapping table, and authentication parameters are written into the forwarding address to generate a redirection URL.

[0061] In a specific embodiment, the application identifier can be a unique identifier of the application, such as the application name, application ID, or application domain name. In order to map the application identifier to the 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", its version number is "v2.1", and it is deployed in the "production" environment, this information can be spliced ​​into "PaymentService_v2.1_production" as the characteristic field.

[0062] 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 calculation on "PaymentService_v2.1_production" might yield the hash value "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6". This hash value is mapped to a value between 0 and 2. 128 -1 range in the ring hash space to determine the location of the application node.

[0063] To achieve load balancing and high availability, the concept of resource managers is introduced. A resource manager is the actual server or container instance that processes application requests. Each resource manager has a unique identifier, such as "ResourceManager001." To ensure a more even distribution of resource managers on the hash ring, virtual node technology is used. Multiple virtual nodes are generated for each resource manager, and virtual node numbers are generated by combining the resource manager identifier with an ascending sequence number. For example, for "ResourceManager001," 100 virtual nodes can be generated, with virtual node numbers ranging from "ResourceManager001-1," "ResourceManager001-2," and so on to "ResourceManager001-100."

[0064] The second hash value is calculated for each virtual node code using the MD5 hash algorithm. For example, the MD5 hash calculation is performed on "ResourceManager001-1" to obtain the hash value "q7r8s9t0u1v2w3x4y5z6a7b8c9d0e1f2". The virtual node position is determined in the ring hash space based on the second hash value, and the correspondence between the virtual node position and the resource manager identifier is written into the virtual node mapping table. The virtual node mapping table can be stored in the form of a key-value pair, where the key is the position of the virtual node on the hash ring and the value is the corresponding resource manager identifier.

[0065] When assigning a resource manager to an application, the application node location is used as the starting point, and the nearest virtual node location is searched clockwise in the circular hash space. For example, the hash value of the application "PaymentService_v2.1_production" corresponds to location "3476891234." Starting from this location and searching clockwise, the nearest virtual node is located at location "3476892567," which corresponds to "ResourceManager001-37." The virtual node mapping table shows that the resource manager ID for this virtual node is "ResourceManager001."

[0066] Write the correspondence between the application ID and the target resource manager ID into the application mapping table. The application mapping table also uses key-value pairs, where the key is the application ID and the value is the corresponding resource manager ID. For example, the application mapping table stores {"PaymentService_v2.1_production": "ResourceManager001"}.

[0067] Construct a forwarding address based on the application mapping table. The forwarding address contains the resource manager's network address and the application's access path. For example, if ResourceManager001's network address is "192.168.1.100:8080" and the application's access path is " / api / payment", the forwarding address is "http: / / 192.168.1.100:8080 / api / payment".

[0068] 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."

[0069] In practice, when resource manager nodes change, such as when a node is added or removed, only the affected application mappings need to be recalculated, without having to redistribute 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, a hash value is calculated, and the node is inserted into the hash ring. Only the applications whose virtual nodes have changed nearest to them, clockwise in the hash ring, need to be remapped.

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

[0071] 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 consistent hashing algorithm and virtual node technology, adding or removing nodes only affects the mapping of adjacent applications on the hash ring, while the routing relationships of most applications remain unchanged, ensuring system stability and scalability.

[0072] In high-concurrency scenarios, you can improve load balancing accuracy by increasing the number of virtual nodes. For example, you can assign more virtual nodes to important resource manager nodes to handle more application requests. By adjusting the number of virtual nodes for different resource managers, you can achieve weighted load distribution.

[0073] In an optional embodiment, the method further includes: Monitor the running status of the resource manager and obtain the resource manager identifier when detecting changes in the online and offline status of the resource manager; Searching for a corresponding virtual node position from a virtual node mapping table according to the resource manager identifier, and writing a correspondence between the virtual node position and the resource manager identifier into a historical mapping record; Establish a new mapping table buffer and an old mapping table buffer, write all correspondences of the virtual node mapping table into the new mapping table buffer, recalculate the corresponding virtual node position according to the state change of the resource manager identifier, write the correspondence between the new virtual node position and the resource manager identifier into the new virtual node mapping table buffer, and after completing all calculations, replace the old mapping table buffer with the new mapping table buffer; When an exception occurs during the recalculation process, the corresponding relationship in the virtual node mapping table is restored according to the historical mapping record.

[0074] In one specific embodiment, a virtual node mapping table is established during initialization. This table stores the mapping relationship between resource manager identifiers and corresponding virtual node locations. The virtual node mapping table is implemented using a hash table structure, with the key being the resource manager identifier and the value being the set of virtual node locations corresponding to that resource manager. For example, resource manager RM001 corresponds to virtual node locations [10, 267, 522, 788], and resource manager RM002 corresponds to virtual node locations [145, 401, 657, 923]. A historical mapping record table is also created to store historical mapping relationships, facilitating recovery in the event of an exception.

[0075] The heartbeat detection mechanism continuously monitors the operational status of each resource manager. The heartbeat detection period can be set to 10 seconds. If a resource manager fails to receive a heartbeat response three times in a row, the resource manager is considered offline. When resource manager RM003 is detected to go offline from online, its resource manager identifier "RM003" is obtained.

[0076] After obtaining the resource manager identifier, the corresponding virtual node location is searched in the virtual node mapping table. Assuming that 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 timestamped "2023-05-15 14:30:22". Historical mapping records are stored persistently, using log files or database tables, to ensure that the mapping status can be restored after a restart.

[0077] A new mapping table buffer and an old mapping table buffer are created. The old mapping table buffer contains a complete copy of the current virtual node mapping table. Initially, the new mapping table buffer also copies the entire contents of the current mapping table. For resource manager RM003, which has undergone a state change, virtual node allocation is recalculated based on its state change (offline). In this example, RM003's virtual nodes are redistributed among the remaining online resource managers.

[0078] Recalculate and remove RM003's mapping record from the new mapping table buffer. Count the remaining online resource managers, assuming there are four (RM001, RM002, RM004, and RM005). Reassign RM003's original four virtual node positions [89, 345, 601, 867] using the 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 assignments are complete, RM001's virtual node positions are updated to [10, 89, 267, 522, 788], RM002's virtual node positions are updated to [145, 345, 401, 657, 923], and so on.

[0079] A transaction mechanism is used during the computation process to ensure atomicity. The updated mapping is written to the new mapping table buffer, and a mapping table switch is performed. The switch uses a read-write lock mechanism: the write lock is first acquired, the new mapping table buffer replaces the old one, and the write lock is finally released. This mechanism ensures that reads of the mapping are briefly blocked during the switch, but inconsistent data is not read.

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

[0081] Similarly, when resource manager RM006 is detected as online, its identifier "RM006" is obtained, and the virtual node position [123, 379, 635, 891] is assigned to it. This mapping relationship is written to the historical mapping record, with the record type set to "online." A new and old mapping table buffer is created, and RM006's mapping relationship is added to the new buffer. After completion, the mapping table is switched. If an exception occurs, RM006's mapping relationship is deleted based on the historical record, restoring the state before the addition.

[0082] Through the above method, it is possible to monitor resource manager status changes in real time, dynamically update virtual node mapping relationships, and quickly recover in abnormal situations to ensure system reliability and stability.

[0083] In existing technologies, resource managers typically log on and off by directly modifying the mapping table. This means that when a resource manager status change is detected, add and delete operations are immediately performed on the original mapping table. This approach, which directly modifies the original table, can lead to read and write conflicts, impacting system performance. If an exception occurs during the modification process, it can cause inconsistent mapping table data, making recovery difficult. The lack of an effective history logging mechanism makes status backtracking and fault analysis difficult.

[0084] The method of this embodiment implements atomic switching of mapping tables by introducing a dual-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 about each change, including the resource manager identifier, virtual node location, change type, and timestamp, providing a reliable basis for abnormal recovery. A transaction mechanism is used to ensure the integrity of the calculation process, and read-write locks are combined to ensure the security of mapping table switching.

[0085] like Figure 3As shown, the distribution of various nodes in the ring hash space and their mapping relationship are shown. In the traditional hashing method, the resource manager nodes (red squares) are unevenly distributed. When there are 5 actual resource managers, their hash values ​​are distributed in different positions in the ring space. This leads to uneven mapping of application nodes (blue circles). Some resource managers are responsible for larger hash intervals, while other resource managers are responsible for smaller intervals, 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 line represents the mapping relationship between the application node and the virtual node it is responsible for. 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%, which is significantly better than the traditional method and achieves a more balanced resource allocation.

[0086] The application proxy routing forwarding system in a cluster environment according to an embodiment of the present invention includes: The first unit is configured to receive an access request from a client and obtain an application identifier in the access request; The second unit is configured to adopt a double-layer adaptive filtering detection mechanism, screen a set of candidate resource managers by dynamic counting, perform secondary filtering based on a timing state, obtain a list of available resource managers, and write the list of available resource managers into an address mapping table; The third unit is configured to query application registration information according to the application identifier and obtain a target subcluster identifier where the application is located; a fourth unit, configured to read a list of available resource managers from an address mapping table according to the target subcluster identifier, construct a multi-level tree index structure, calculate a path cost to the client using a dynamic path planning algorithm, dynamically evaluate the path cost using a real-time updated heuristic function, and select the resource manager with the smallest path cost as the target resource manager; A fifth unit is configured to map the application identifier to a ring hash space through a hash algorithm, locate the target resource manager identifier in the ring hash space through a virtual node, construct a proxy forwarding rule table, and generate a redirection URL; The sixth unit is configured to send the redirection URL to the client.

[0087] According to a third aspect of an embodiment of the present invention, an electronic device is provided, including: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the aforementioned method.

[0088] According to a fourth aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described above is implemented.

[0089] The present invention may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present invention.

[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements 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 forwarding method in a cluster environment, characterized in that: include: Receive an access request from a client, and obtain an application identifier in the access request; A double-layer adaptive filtering detection mechanism is adopted to screen the candidate resource manager set through dynamic counting, and a secondary filtering is performed based on the timing state to obtain a list of available resource managers, which is then written into the address mapping table. Query application registration information according to the application identifier to obtain the target subcluster identifier where the application is located; Reading a list of available resource managers from an address mapping table according to the target subcluster identifier, constructing a multi-level tree index structure, calculating the path cost to the client using a dynamic path planning algorithm, dynamically evaluating the path cost using a real-time updated heuristic function, and selecting the resource manager with the smallest path cost as the target resource manager; Mapping the application identifier to a circular hash space through a hash algorithm, locating the target resource manager identifier through a virtual node in the circular hash space, building a proxy forwarding rule table, and generating a redirection URL; Send the redirect URL to the client.

2. The method according to claim 1, characterized in that A double-layer adaptive filtering detection mechanism is adopted to screen the candidate resource manager set through dynamic counting, perform secondary filtering based on the timing state, obtain the available resource manager list, and write the available resource manager list into the address mapping table, including: Obtaining multiple sets of continuous response times of the resource manager, constructing a response time distribution sequence, and calculating a load fluctuation factor of the resource manager based on the response time distribution sequence; Performing weighted calculation on the number of response timeouts of the resource manager based on the load fluctuation factor to obtain response reliability, and dynamically adjusting the performance counting threshold according to the response reliability; Collecting multi-dimensional performance indicators of resource managers within the performance count threshold range, performing combined calculation on the multi-dimensional performance indicators to obtain a stability score, and selecting resource managers whose stability scores are greater than a preset stability reference value to form a first candidate set; Building a state transition matrix based on historical performance data of each resource manager in the first candidate set, and calculating the state transition probability of the resource manager according to the state transition matrix; Predicting the stability of resource managers in the first candidate set based on the state transition probability, selecting resource managers whose state transition probability is greater than a preset stable operation threshold and whose state retention time exceeds a minimum stable period, and forming a list of available resource managers; The identification information and network address information in the available resource manager list are written into the address mapping table, the version information of the address mapping table is recorded, and when the address mapping table is updated, the version information before the update is saved for rollback operation.

3. The method according to claim 2, characterized in that Predicting the stability of the resource managers in the first candidate set according to the state transition probability includes: Acquire a network topology connection relationship of resource managers in the first candidate set, and determine a set of adjacent resource managers directly connected to the resource manager based on the network topology connection relationship; Collecting performance fluctuation sequences of each adjacent resource manager and calculating the performance fluctuation intensity value of each adjacent resource manager; calculating the propagation delay of the performance fluctuation from each adjacent resource manager to the resource manager based on the timestamp information of the performance fluctuation sequence, and constructing a performance fluctuation propagation feature vector based on the propagation delay and the performance fluctuation intensity value; constructing a performance fluctuation propagation model using the performance fluctuation propagation feature vector, and calculating a performance impact coefficient of each adjacent resource manager on the resource manager based on the performance fluctuation propagation model; Correcting the state transition probability according to the performance impact coefficient to obtain a corrected state transition probability value that takes into account the network topology propagation effect; Substituting the modified state transition probability value into a Markov prediction model, and outputting a state sequence of the resource manager within a preset time window; The stable state ratio of the resource manager is calculated according to the state sequence. When the stable state ratio is greater than a preset stable operation threshold and the duration of the continuous stable state exceeds a minimum stable period, it is determined that the resource manager meets the stability prediction requirement.

4. The method according to claim 1, wherein Reading a list of available resource managers from an address mapping table according to the target subcluster identifier, and constructing a multi-level tree index structure includes: Read the resource manager list from the address mapping table according to the target subcluster identifier, obtain the resource manager identifier information, network topology information and service type information in the resource manager list, and obtain the resource manager information set to be processed; Based on the resource manager identification information, a spatial clustering method is used to divide the resource managers into regions and establish a regional connection relationship graph to obtain a first-level index hierarchical regional 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 the network prefix 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 secondary index layer, the resource managers in the network layer are grouped according to the service quality indicators and service dependencies are established to obtain the service structure of the third-level index layer; Assigning a globally unique identifier to the resource manager node in the three-level index layer service structure and establishing a node attribute table to obtain a resource manager node attribute set; Based on the resource manager node attribute set, monitoring the node status through heartbeat detection and triggering node splitting or merging operations to obtain an optimized node distribution structure; Based on the optimized node distribution structure, the relationship and distance measurement between nodes are updated and the hotspot access path information is written to determine the final tree index structure and obtain a multi-level tree index structure.

5. The method according to claim 1, wherein A dynamic path planning algorithm is used to calculate the path cost to the client. The path cost is dynamically evaluated through a real-time updated heuristic function. The resource manager with the smallest path cost is selected as the target resource manager. The resource managers include: Based on a multi-level tree index structure, the path cost is decomposed into node cost and edge cost. The processing capacity and load status information of each node are collected, and the network quality and transmission delay information of each edge are collected to obtain the path cost matrix. A heuristic function is established based on the deviation between the current path cost and the historical optimal path cost in the path cost matrix. The evaluation weight is adjusted based on the real-time path congestion status to obtain a path evaluation vector. Obtain node performance indicators and link status parameters from a multi-level tree index structure, mark nodes that exceed a preset load threshold as trigger points, and construct a local update subgraph centered around the trigger point; In the local update subgraph, the nodes at the level where the trigger point is located are traversed first to obtain a path set at the same level. When the path set at the same level is empty, the set is expanded to the adjacent level to obtain an extended path set. The path set at the same level and the extended path set are pruned based on the path evaluation vector to determine the candidate path set. The path with the smallest path cost and node load that meets the 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 Mapping the application identifier to a ring hash space using a hash algorithm, locating the target resource manager identifier in the ring hash space using a virtual node, building a proxy forwarding rule table, and generating a redirection URL include: Based on a multi-level tree index structure, the characteristic field of the application identifier is mapped to a ring hash space through an MD5 hash algorithm, and the application identifier is calculated to obtain a first hash value; Determine the application node position in the annular hash space according to the first hash value, combine the resource manager identifier with the incrementing sequence number to generate a virtual node code, and calculate the virtual node code using the MD5 hash algorithm to obtain a second hash value; Determine a virtual node position in a ring hash space based on the second hash value, and write a correspondence between the virtual node position and the resource manager identifier into a virtual node mapping table; Taking the application node position as the starting point, search for the nearest virtual node position in the annular hash space in a clockwise direction, and obtain the target resource manager identifier through the virtual node mapping table; The correspondence between the application identifier and the target resource manager identifier is written into an application mapping table, a forwarding address is constructed based on the application mapping table, and authentication parameters are written into the forwarding address to generate a redirection URL.

7. The method according to claim 6, characterized in that Also includes: Monitor the running status of the resource manager and obtain the resource manager identifier when detecting changes in the online and offline status of the resource manager; Searching for a corresponding virtual node position from a virtual node mapping table according to the resource manager identifier, and writing a correspondence between the virtual node position and the resource manager identifier into a historical mapping record; Establish a new mapping table buffer and an old mapping table buffer, write all correspondences of the virtual node mapping table into the new mapping table buffer, recalculate the corresponding virtual node position according to the state change of the resource manager identifier, write the correspondence between the new virtual node position and the resource manager identifier into the new virtual node mapping table buffer, and after completing all calculations, replace the old mapping table buffer with the new mapping table buffer; When an exception occurs during the recalculation process, the corresponding relationship in the virtual node mapping table is restored according to the historical mapping record.

8. An application proxy routing and forwarding system in a cluster environment, used to implement the method according to any one of claims 1 to 7, characterized in that: include: The first unit is configured to receive an access request from a client and obtain an application identifier in the access request; The second unit is configured to adopt a double-layer adaptive filtering detection mechanism, screen a set of candidate resource managers by dynamic counting, perform secondary filtering based on a timing state, obtain a list of available resource managers, and write the list of available resource managers into an address mapping table; The third unit is configured to query application registration information according to the application identifier and obtain a target subcluster identifier where the application is located; a fourth unit, configured to read a list of available resource managers from an address mapping table according to the target subcluster identifier, construct a multi-level tree index structure, calculate a path cost to the client using a dynamic path planning algorithm, dynamically evaluate the path cost using a real-time updated heuristic function, and select the resource manager with the smallest path cost as the target resource manager; A fifth unit is configured to map the application identifier to a ring hash space through a hash algorithm, locate the target resource manager identifier in the ring hash space through a virtual node, construct a proxy forwarding rule table, and generate a redirection URL; The sixth unit is configured to send the redirection URL to the client.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to call the 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 a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Flexible data transmission system based on SINET

    CN108600102A

  • Heterogeneous virtual resources management system and method

    CN113326129A

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

    CN115426360A

  • PCFarm resource scheduling method and system based on dynamic load prediction

    CN120104355A

  • Methods and apparatus for resource management in cluster computing

    US8640137B1

Cited By

  • Calculation network resource identifier management method and system

    CN121743066A