Routing request method and device, electronic equipment and storage medium
By acquiring the traffic and semantic features of financial business requests and using predictive models and reinforcement learning to dynamically allocate resources, the problem of node overload or idleness in traditional gateways is solved, realizing intelligent request routing with high concurrency and low latency, and reducing operation and maintenance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- INDUSTRIAL AND COMMERCIAL BANK OF CHINA
- Filing Date
- 2026-02-24
- Publication Date
- 2026-04-21
AI Technical Summary
Traditional gateways rely on static load balancing and rule engines for request routing, which can lead to some request processing nodes being overloaded or idle, making it difficult to effectively meet the needs of high concurrency and low latency in financial scenarios.
By acquiring time-series data of traffic metrics and semantic features of business requests, predictive models are used to predict future traffic, and reinforcement learning is combined to dynamically allocate resources, thereby achieving intelligent request routing.
It achieves dynamic resource allocation with business semantic awareness, accurately adapts to high concurrency and low latency requirements, reduces redundant server deployment, lowers operation and maintenance costs, and ensures the success rate and low latency of high-priority services.
Smart Images

Figure CN121907799A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology, and in particular to a request routing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the acceleration of digital transformation in the financial sector, gateways, as the core hub connecting internal and external systems, face stringent challenges such as high concurrency, low latency, and strong compliance.
[0003] Currently, traditional gateways rely on static load balancing and rule engines to route user requests. The drawback of this approach is that some request processing nodes may be overloaded while others remain idle. Therefore, a new request routing method is urgently needed. Summary of the Invention
[0004] This invention provides a request routing method, apparatus, electronic device, storage medium, and computer program product.
[0005] According to one aspect of the present invention, a request routing method is provided, comprising: In response to receiving a service request in the current time window, the system obtains the time-series data of traffic metrics for historical service requests, as well as the service layer semantic features and network layer traffic metrics features of the service requests in the current time window. Based on the time-series data of the traffic metrics of the historical service requests, the request traffic prediction result for the prediction interval is determined; wherein, the prediction interval refers to the interval of a preset duration after the current time window; Based on the request traffic prediction results of the prediction interval, the business layer semantic features and network layer traffic indicator features of the service request, the target computing node is determined; Based on the target computing node, the service requests for the current time window are routed.
[0006] According to another aspect of the present invention, a request routing apparatus is provided, comprising: The data acquisition module is used to acquire, in response to receiving a service request in the current time window, the time-series data of traffic metrics of historical service requests, as well as the service layer semantic features and network layer traffic metrics features of the service requests in the current time window. The first prediction module is used to determine the prediction result of the request traffic for a prediction interval based on the time-series data of the traffic indicators of the historical service requests; wherein, the prediction interval refers to the interval of a preset duration after the current time window. The second prediction module is used to determine the target computing node based on the request traffic prediction results of the prediction interval, the business layer semantic features of the service request, and the network layer traffic indicator features. The routing module is used to route service requests for the current time window based on the target computing node.
[0007] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: At least one processor; and A memory that is communicatively connected to at least one processor; wherein, The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to execute the request routing method of the present invention.
[0008] According to another aspect of the present invention, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to execute and implement the request routing method of the embodiments of the present invention.
[0009] According to another aspect of the present invention, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the steps in the above-described method.
[0010] The technical solution of this invention breaks through the limitations of traditional gateway static routing, realizes an intelligent upgrade of business semantic awareness, future traffic prediction and dynamic resource allocation, accurately adapts to the high concurrency and low latency requirements of financial scenarios; it can respond to sudden traffic in advance through traffic prediction, and combine reinforcement learning decision-making to ensure the success rate and low latency of high-priority businesses; dynamic weight allocation balances node load, reduces redundant server deployment, and reduces overall operation and maintenance costs.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] Figure 1 This is a flowchart illustrating the request routing method provided in an embodiment of the present invention; Figure 2 This is a flowchart illustrating another request routing method provided in an embodiment of the present invention; Figure 3This is a schematic diagram of the structure of the request routing device provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of an electronic device that implements the request routing method of this invention. Detailed Implementation
[0014] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0015] Example 1 Figure 1 This is a flowchart of a request routing method provided in an embodiment of the present invention. This embodiment is applicable to scenarios where smart gateways route financial business requests. The method can be executed by a request routing device, which can be implemented in hardware and / or software. The request routing device can be configured in an electronic device, which may be a gateway device.
[0016] like Figure 1 As shown, the request routing methods applied to smart gateways include: S101. In response to receiving a service request in the current time window, obtain the time-series data of traffic indicators of historical service requests, as well as the service layer semantic features and network layer traffic indicator features of the service requests in the current time window.
[0017] The current time window refers to a preset short time period (e.g., 1-5 seconds) used to aggregate business requests in batches, avoiding the inefficiency and noise interference of single request processing. Historical business request traffic metrics time-series data refers to traffic data aggregated at a fixed granularity (e.g., 5 minutes) over a continuous historical period, including time-series sequences such as query rate per second (total number of requests received by the gateway per second), transactions per second (number of valid transaction requests completing a full business loop per second), and concurrent connections. Business layer semantic features refer to features reflecting core business attributes, such as user level (VIP / regular), transaction type (large transfer / cross-border payment), transaction amount range, and high-frequency transaction markers. Network layer traffic metrics refer to real-time indicators describing network transmission status, such as network latency, concurrent connections, transactions per second, and data packet transmission rate.
[0018] In some embodiments, historical traffic time-series data is aggregated offline at a fixed granularity and stored in a feature warehouse, and updated according to a preset period. Thus, when the smart gateway receives a service request in the current time window, it can retrieve the traffic metric time-series data of the historical service request from the feature warehouse. Simultaneously, the smart gateway can call the network monitoring module to obtain network layer traffic metric features such as average network latency, peak concurrent connections, query rate per second, and transactions per second within the current time window. Obtaining the business layer semantic features of the service request includes step A or step B: Step A: Parse the interface classification identifier of the business request to obtain at least one business layer semantic feature among the user level, transaction type, and transaction amount.
[0019] In specific implementation, an interface classification identifier (api_type) and a business feature mapping library are pre-built to clarify the correspondence between the identifier and business attributes. For example, the encoding type of a business request is api_type=VIP_PAY, and its corresponding business features are user level=VIP and transaction type=payment. Furthermore, after receiving a business request, the smart gateway extracts the interface classification identifier api_type from the request path and request body fields. The extracted interface classification identifier is matched with the pre-set mapping library, and the business layer semantic features are directly output. For example, if the interface classification identifier api_type=VIP_PAY and amount=50000 in the request body, the output business layer semantic features are: user level=VIP, transaction type=payment, transaction amount=50000 yuan.
[0020] Step B: Perform intent analysis on the path of the business request, and determine at least one business layer semantic feature among the user level, transaction type, and transaction amount based on the intent analysis results.
[0021] This step primarily targets ambiguous request paths without explicit interface classification identifiers. A pre-trained text classification model is used to parse the path semantics, uncover the underlying business intent, and deduce features such as user level and transaction type, adapting to the scenario coverage requirements of non-standard interfaces. Specifically, a text classification model is pre-trained based on historical business request path data to map path semantics to business features. This involves collecting business request path samples from the past six months. During model training using these samples, the model's convolutional layers capture the combined semantics of path keywords, and the fully connected layers output business feature predictions based on these combined semantics. Model parameters are adjusted based on the loss between the prediction results and the ground truth labels. During prediction, the business request path is first standardized, semantic keywords are extracted, and these keywords are encoded into path feature vectors, providing acceptable input for the text classification model. The processed path feature vectors are then input into the text classification model for further processing to deduce the semantic features of the business layer. For example, if the path is / user / vip / finance / transfer / 10000, the model recognizes the keywords vip, transfer, and 10000, the intent is VIP user large transfer, and the final output is: user level = VIP, transaction type = transfer, transaction amount = 10000 yuan.
[0022] In this embodiment of the invention, dual perception of business semantics and network status is achieved, breaking through the limitation of traditional gateways relying solely on network indicators; batch processing reduces the frequency of data collection and feature extraction, ensuring low-latency response of the gateway; historical data and cached features are reused to improve data processing efficiency and reduce system resource consumption.
[0023] S102. Based on the time-series data of the traffic indicators of the historical service requests, determine the request traffic prediction result for the prediction interval.
[0024] The prediction interval refers to a preset duration (e.g., 30 seconds) after the current time window ends; the request traffic prediction result refers to the traffic quantification indicators (e.g., the predicted value of the query rate per second) and trend labels (e.g., traffic growth of 15%, capacity expansion warning) within the prediction interval.
[0025] In some embodiments, this step can be based on the time-series data of traffic metrics from historical business requests. A pre-trained traffic prediction model learns traffic change patterns, optimizes prediction accuracy by combining scenario characteristics, and outputs traffic quantification and trend results for the prediction interval, providing future traffic references for dynamic routing. The traffic prediction model is trained based on a Long Short-Term Memory (LSTM) network. The training process is as follows: Obtain the time-series data of traffic metrics from the past six months of historical business requests; aggregate the time-series data of traffic metrics in 5-minute time windows to form continuous time-series segments of traffic metrics; calculate the moving average and standard deviation of the query rate per second or transactions per second for each 5-minute time window and for N historical windows; perform standardization operations on all data points within each 5-minute time window based on the moving average and standard deviation to eliminate differences in traffic volume across different time periods. A binary / multi-dimensional labeling system is constructed, including holiday labels (statutory holidays = 1, working days = 0) and business activity day labels (financial management festivals / stock market opening days = 1, non-activity days = 0). Based on the timestamp of each 5-minute time series segment, corresponding scenario labels are added to the standardized time series data, forming a combined feature of standardized traffic indicator values and scenario labels, helping the model learn the correlation between scenarios and traffic. The processed feature-labeled data is then segmented into input sequences in chronological order, with each input sequence containing 20 consecutive 5-minute time series segment features. The training process is as follows: Sample data is divided into a training set (70%, used for model learning), a validation set (20%, used for parameter tuning), and a test set (10%, used for performance validation) in a 7:2:1 ratio. Forward propagation: The training set sequence is input into the model, and the gating mechanism of the Long Short-Term Memory network captures long-term dependencies (such as traffic fluctuations during holidays and correlations during peak periods), outputting predicted traffic metrics. Backward propagation: The prediction error is calculated based on the loss function, and the weights and biases of each layer are updated through gradient descent to optimize the gating mechanism's ability to capture key temporal features. Validation and adjustment: After each training round, the loss value is evaluated using the validation set, and the learning rate and the number of neurons in the hidden layers are dynamically adjusted to ensure the model's generalization ability. After training, the model parameters are solidified into a deployment file and connected to the gateway's real-time decision module. Online incremental training: Every hour, the model is incrementally trained using the latest routing performance data (actual traffic metrics and prediction deviations) to continuously optimize prediction accuracy and adapt to dynamic changes in traffic patterns.
[0026] Based on the above, the step of determining the request traffic prediction result for the prediction interval according to the time-series data of the traffic indicators of the historical service requests includes S1021-S1023: S1021. According to the preset time window, extract a preset number of traffic indicator time series segments from the traffic indicator time series data of the historical service requests.
[0027] The time window can be selected as 5 minutes, with each time window corresponding to one traffic metric data point (such as the average query rate per second for that window). The preset quantity can be selected as 20, meaning each input sequence contains 20 consecutive 5-minute traffic metric time series segments, covering 100 minutes of historical traffic. The traffic metric can be the query rate per second, with the number of transactions per second as an auxiliary metric optional. In practice, the preset number of traffic metric time series segments are continuously extracted from the traffic metric time series data of historical business requests in chronological order, ensuring that the segments are uninterrupted and non-overlapping. For example, if the request traffic from 9:00:00 to 9:00:30 needs to be predicted, then 20 consecutive 5-minute time slices of traffic metric time series from 7:20:00 to 7:25:00 to 8:55:00 to 9:00:00 are extracted to form one time series segment sequence. S1022. Standardize each of the flow index time series segments and use a preset number of standardized flow index time series segments as input sequences.
[0028] Optionally, the moving average and standard deviation are calculated, and then each time series segment of the traffic indicator is standardized based on the moving average and standard deviation. Then, the 20 standardized time series segments of the traffic indicator are arranged in chronological order to form a one-dimensional feature sequence. The one-dimensional sequence is converted into a three-dimensional tensor format (number of samples × time step × feature dimension) required by the Long Short-Term Memory network model. For example, the number of samples = 1 (single prediction), the time step = 20 (20 time series segments), and the feature dimension = 1 (queries per second). If transactions per second are added as an auxiliary indicator, the feature dimension is adjusted to 2, and the standardization process is completed simultaneously.
[0029] S1023. The input sequence is input into a traffic prediction model pre-trained based on a long short-term memory network, so that the traffic prediction model extracts long-term dependency features from the input sequence based on a built-in gating mechanism, and predicts the long-term dependency features according to the built-in fully connected layer, and outputs the request traffic prediction result of the prediction interval; wherein, the request traffic prediction result includes the predicted value and trend of traffic indicators.
[0030] Specifically, the gating mechanism of the traffic prediction model extracts long-term dependency features as follows: Forget gate filtering: The traffic prediction model traverses 20 time series segments and uses the forget gate weights (pre-trained parameters) to determine whether to retain historical information (such as retaining the steady growth trend of the first 10 segments and discarding the random fluctuations of a single segment). Input gate update: Combine the standardized features of each time segment with the hidden state of the previous time segment to generate candidate memory information, and filter effective features through input gate weights (e.g., if the query rate of a segment suddenly increases by 20% per second, and it meets the characteristics of the activity day, it will be included in the memory). Output gate generation: After each time segment is processed, the output gate filters the key information in the memory unit to generate the hidden state at the current time. After the 20 segments are processed, the final hidden state containing the long-term dependencies of the entire sequence is formed.
[0031] The process of prediction and result output in a fully connected layer includes: Feature mapping: The final hidden state (high-dimensional dependent features) is input into the fully connected layer built into the model, and the features are linearly mapped to specific numerical values through a pre-trained weight matrix; Result generation: Traffic metric prediction: Outputs the predicted query rate per second for the next 30 seconds, and restores the true value through denormalization; Trend analysis: Combine the predicted value with the average of the last 5 time series segments to calculate the growth / decline rate (e.g., the predicted value increases by 15% compared to the average) and generate trend labels (e.g., traffic growth, capacity expansion warning). Ultimately, it returns the predicted query rate per second, the growth rate, and the trend label, providing input for reinforcement learning routing decisions.
[0032] In this embodiment, step S102 realizes proactive traffic prediction, replacing the traditional passive response mechanism, and reserves buffer time to deal with sudden traffic (such as stock market opening, activity peaks); standardized processing and model optimization improve prediction accuracy, avoid resource waste or node overload caused by trend misjudgment; output trend labels facilitate rapid adaptation to subsequent decisions and reduce model interaction complexity.
[0033] S103. Determine the target computing node based on the request traffic prediction results of the prediction interval, the business layer semantic features of the service request, and the network layer traffic indicator features.
[0034] Among them, target computing nodes refer to routing nodes (such as physical servers and edge node clusters) that are adapted to current business characteristics and future traffic trends, can maximize business value (such as VIP success rate) and ensure system stability.
[0035] In some embodiments, a routing decision model can be pre-trained, and the request traffic prediction results of the prediction interval, the business layer semantic features of the service request, and the network layer traffic indicator features can be input into the pre-trained routing decision model for processing, and the target computing node can be output.
[0036] In other embodiments, the predicted request traffic within the prediction range (e.g., predicted query rate per second, growth rate) can be quantified into scoring items. For example, predicted query rate per second ≤ 500 (low load) = 1 point, 500-1000 (medium load) = 2 points, > 1000 (high load) = 3 points; growth rate ≤ 10% = 1 point, 10%-20% = 2 points, > 20% = 3 points. Semantic features of the business layer are quantified according to priority, such as user level (VIP = 3 points, ordinary = 1 point), transaction type (large transfer = 3 points, cross-border payment = 2 points, ordinary query = 1 point), and transaction amount (> 100,000 = 3 points, 10,000-100,000 = 2 points, < 10,000 = 1 point). The characteristics of network layer traffic metrics are quantified, for example, average network latency ≤300ms = 3 points, 300-500ms = 2 points, >500ms = 1 point; peak concurrent connections ≤5000 = 3 points, 5000-8000 = 2 points, >8000 = 1 point; transactions per second ≥400 = 3 points, 200-400 = 2 points, <200 = 1 point.
[0037] A candidate node attribute database is maintained in advance, recording the core attributes of each node (such as resource capabilities, business compatibility, etc.). Specifically, it records the node's maximum CPU load capacity (e.g., node A supports high load = 3 points, node B supports medium load = 2 points, node C supports low load = 1 point), available bandwidth (≥100Mbps = 3 points, 50-100Mbps = 2 points, <50Mbps = 1 point); supported transaction types (e.g., node A supports large amount + cross-border = 3 points, node B only supports ordinary = 1 point), and VIP service priority (dedicated node = 3 points, shared node = 1 point).
[0038] Furthermore, based on the correspondence between feature requirements and node capabilities, a basic matching score is calculated for each candidate node. The scoring rule is the sum of the products of the quantitative score for each feature dimension and the corresponding attribute score for the node. For example, the input feature quantitative scores are: traffic load = 2 points (medium load), growth rate = 2 points (15%), user level = 3 points (VIP), transaction type = 2 points (cross-border payment), latency = 3 points (220ms); node A attribute scores are: support for medium load = 2 points, cross-border compliance = 2 points, VIP exclusive = 3 points, latency adaptation = 3 points; node A matching score = (2×2) + (2×2) + (3×3) + (2×2) + (3×3) = 4 + 4 + 9 + 4 + 9 = 30 points; similarly, the matching scores for other nodes B, C, and D are calculated. Finally, the node with the highest score is selected as the target calculation node. Understandably, this decision-making process takes into account business priorities, system resources, and future traffic, avoiding the rigid allocation of static routes.
[0039] S104. Based on the target computing node, route the service requests for the current time window.
[0040] Routing refers to the process of forwarding a batch of business requests within the current time window to the target computing node according to preset rules.
[0041] In some embodiments, based on the target computing node, traffic allocation weights are dynamically adjusted and combined with a service classification strategy to reasonably forward batch service requests to the target node, achieving optimal matching of traffic and resources. Specifically, service requests in the current time window are routed according to the target computing node, including S1041-S1042: S1041. Adjust the traffic weight of the target computing node according to the preset traffic weight adjustment rules.
[0042] Traffic weight is a proportional coefficient for the traffic handled by each computing node, used to quantify traffic allocation rules. In some embodiments, this step is specifically implemented as follows: obtaining the target computing node (e.g., node A) and the current scenario tag (e.g., VIP cross-border + traffic growth of 15%); matching preset rules to determine the target computing node's weight adjustment target (e.g., 8) and the weight allocation of other nodes; generating weight adjustment instructions and updating them in batches to the gateway's traffic scheduling rule base according to smooth transition rules (e.g., node A's weight = 5 in the 1st second, 7 in the 3rd second, and 8 in the 5th second).
[0043] For example, the initial weights are: Node A=1, Node B=1, Node C=1 (total weight 3); Scenario matching: the target calculation node A is in the scenario of VIP cross-border + traffic growth of 15%, matching the high-priority scenario rules; the adjusted weights are: Node A=8, Node B=1, Node C=1 (total weight 10), with node A accounting for 80%; the adjustment is completed in 3 steps within 5 seconds to avoid node A being overloaded at any moment.
[0044] S1042. Based on the adjusted traffic weight of the target computing node, perform routing processing on the service requests in the current time window. Optionally, the gateway traffic scheduling module forwards batch business requests within the current time window to the corresponding nodes according to the new weight ratio, for example, 80% of the request traffic is routed to node A.
[0045] For example, there are 1200 requests in the current time window, the target computing node is A, and the weight configuration is updated to A:8, B:1, C:1; according to the weight ratio, 960 requests (80%) are routed to node A, 120 requests (10%) are routed to node B, and 120 requests (10%) are routed to node C. Dynamic adjustment of traffic weights enables precise resource allocation, allowing the optimal node to handle core traffic and improving resource utilization; a smooth transition mechanism avoids node overload caused by sudden traffic changes, ensuring system stability.
[0046] The advantages of this invention are that it breaks through the limitations of traditional gateway static routing, realizes intelligent upgrades with business semantic awareness, future traffic prediction, and dynamic resource allocation, accurately adapts to the high concurrency and low latency requirements of financial scenarios; it can respond to sudden traffic surges in advance through traffic prediction, and combine reinforcement learning decision-making to ensure the success rate and low latency of high-priority services; dynamic weight allocation balances node load, reduces redundant server deployment, and lowers overall operation and maintenance costs.
[0047] Example 2 Figure 2 A flowchart of a request routing method is provided for an embodiment of the present invention. See also... Figure 2 The method includes the following steps: S201. In response to receiving a service request in the current time window, obtain the time-series data of traffic indicators of historical service requests, as well as the service layer semantic features and network layer traffic indicator features of the service requests in the current time window.
[0048] S202. Based on the time-series data of the traffic indicators of the historical service requests, determine the request traffic prediction result for the prediction interval; wherein, the prediction interval refers to the interval of a preset duration after the current time window.
[0049] S203. Input the prediction results of the request traffic in the prediction interval, the business layer semantic features and network layer traffic indicator features of the service request into the pre-trained routing decision model for processing, and output the target computing node.
[0050] In some embodiments, this step includes: the routing decision model determining the current business scenario characteristics corresponding to the business request in the current time window based on the request traffic prediction results of the input prediction interval, the business layer semantic features of the business request, and the network layer traffic indicator features; the routing decision model performing matching retrieval in the historical database constructed during the pre-training phase of the routing decision model based on the current business scenario characteristics; wherein, each historical routing record in the historical database includes historical business scenario characteristics, routing actions, and reward scores; If the similarity between the historical business scenario features of multiple historical routing records and the current business scenario features is greater than or equal to a preset threshold, then the target historical routing record is determined based on the reward score of each historical routing record; and the target computing node is output based on the routing action of the target historical routing record.
[0051] S204. Based on the target computing node, route the service requests for the current time window.
[0052] S205. Record the success rate of processing business requests of users of preset levels in the target computing node, the rate of meeting the business request response time, and the utilization rate of the central processing unit of the target computing node.
[0053] Among them, the preset level users refer to predefined high-priority users (such as VIP users and enterprise users), which are the core objects to ensure service quality in financial scenarios; the success rate refers to the proportion of business requests from preset level users that complete the full business loop on the target computing node; the request response time compliance rate refers to the proportion of requests processed by the target computing node whose response time meets the preset threshold; and the central processing unit (CPU) utilization rate refers to the average CPU usage ratio of the target computing node during the processing of requests in the current time window.
[0054] In some embodiments, all requests routed to the target node within the current time window are traversed, requests from users of a preset level are filtered out, and the number of successfully processed requests and the total number of requests are counted. The response time of these requests is extracted, and the number of requests with a time ≤ a threshold is counted. The average CPU utilization of the target node within this time window is retrieved. The collected data is stored in a time-series database in a fixed format. By monitoring node status in real time using metrics such as CPU utilization and success rate, problems such as node overload and abnormal business processing can be detected in a timely manner.
[0055] S206. Calculate the reward score for routing the business request to the target computing node for processing based on the success rate of processing the business request of the user at the preset level, the request response time compliance rate of the business request, and the utilization rate of the central processing unit of the target computing node.
[0056] Among them, the reward score is the core indicator for quantitatively evaluating the effectiveness of this routing decision. It reflects the comprehensive performance of the target computing node in terms of business value, processing efficiency, and resource load, and is the core basis for the iteration of the routing decision model.
[0057] In some embodiments, a linear weighted formula is used to prioritize high-priority user experiences while also considering resource load: Reward score = 0.7 × Preset level user success rate + 0.2 × Response time compliance rate - 0.1 × CPU utilization; 0.7 (Success Rate): Prioritize the completion rate of business for high-value users, meeting the core reliability requirements of financial scenarios; 0.2 (Response Time Compliance Rate): Ensure user experience and avoid situations with high success rates but high latency; -0.1 (CPU Utilization): A negative constraint to prevent node overload from causing subsequent service crashes.
[0058] S207. Store the current business scenario characteristics, selected target computing node, and reward score of the business request in the current time window for incremental learning of the routing decision model.
[0059] Among them, the current business scenario features are the feature set that characterizes the core attributes of this routing request (such as VIP cross-border payment + predicted query rate of 1100 per second + network latency of 220ms); incremental learning refers to updating the pre-trained routing decision model in small batches based on new routing effect data, without the need for full retraining, and adapting to dynamic changes in business traffic.
[0060] In some embodiments, the following data is concatenated into a complete incremental learning sample according to a fixed dimension: Scenario characteristics: Traffic prediction results (predicted query rate per second, growth rate) + business layer semantic characteristics (user level, transaction type) + network layer characteristics (latency, concurrency). Routing action: The target computing node selected this time (e.g., node A); Bonus score: The score calculated in step S206.
[0061] Incremental samples are stored in batches hourly (to avoid high-frequency writes), with one sample batch generated every hour (containing routing data for all time windows within that hour); stored in a distributed database to support efficient model retrieval. Triggering conditions: cumulative sample count ≥ 100 per hour, or score fluctuation ≥ 10 points in a single scenario (e.g., routing score in a scenario drops from 85 to 70 points). Learning process: Load the latest batch of samples into the model; fine-tune the model's strategy weights using scenario features, routing actions, and reward scores as samples (e.g., strengthen the mapping relationship between VIP cross-border and node A); verify the accuracy of the model's score prediction after fine-tuning, and if it meets the standard, update the online model; if it does not meet the standard, roll back and analyze data anomalies.
[0062] In this embodiment of the invention, incremental learning allows the model to be continuously optimized as business traffic and node status change, avoiding the problem of pre-trained models becoming outdated; small-batch incremental learning eliminates the need for full retraining, reducing computational resource consumption and adapting to real-time requirements; and continuous storage of new scenario data gradually covers rare scenarios, improving the model's generalization ability.
[0063] Example 3 Figure 3 This is a schematic diagram of a request routing apparatus provided in an embodiment of the present invention. This apparatus can execute any of the request routing methods of the present invention. For example... Figure 3 As shown, the request routing device includes: Data acquisition module 301 is used to acquire, in response to receiving a service request in the current time window, the time-series data of traffic indicators of historical service requests, as well as the service layer semantic features and network layer traffic indicator features of the service requests in the current time window. The first prediction module 302 is used to determine the prediction result of the request traffic for a prediction interval based on the time-series data of the traffic indicators of the historical service requests; wherein, the prediction interval refers to the interval of a preset duration after the current time window. The second prediction module 303 is used to determine the target computing node based on the request traffic prediction results of the prediction interval, the business layer semantic features of the service request, and the network layer traffic indicator features. The routing module 304 is used to route the service requests of the current time window according to the target computing node.
[0064] In some embodiments, regarding the determination of the request traffic prediction result for the prediction interval based on the time-series data of the traffic metrics of the historical service requests, the first prediction module 302 is specifically used for: According to a preset time window, a preset number of traffic indicator time-series segments are extracted from the traffic indicator time-series data of the historical service requests. Each of the traffic index time series segments is standardized, and a preset number of standardized traffic index time series segments are used as the input sequence. The input sequence is fed into a traffic prediction model pre-trained on a long short-term memory network, which extracts long-term dependency features from the input sequence based on a built-in gating mechanism, and predicts the long-term dependency features based on a built-in fully connected layer, outputting the request traffic prediction result for the prediction interval; wherein, the request traffic prediction result includes the predicted value and trend of the traffic index.
[0065] In some embodiments, the second prediction module 303 is specifically used for determining the target computing node based on the request traffic prediction results of the prediction interval, the service layer semantic features of the service request, and the network layer traffic indicator features: The prediction results of the request traffic in the prediction interval, the business layer semantic features of the service request, and the network layer traffic indicator features are input into the pre-trained routing decision model for processing, and the target computing node is output.
[0066] In some embodiments, regarding the input of the request traffic prediction results of the prediction interval, the service layer semantic features and network layer traffic indicator features of the service request into a pre-trained routing decision model for processing, and the output of the target computing node, the second prediction module 303 is specifically used for: The routing decision model determines the current business scenario characteristics corresponding to the business request in the current time window based on the request traffic prediction results of the input prediction interval, the business layer semantic features of the business request, and the network layer traffic indicator features. The routing decision model performs matching and retrieval in the historical database constructed during the pre-training phase of the routing decision model based on the characteristics of the current business scenario; wherein, each historical routing record in the historical database includes historical business scenario characteristics, routing actions, and reward scores; If the similarity between the historical business scenario features of multiple historical routing records and the current business scenario features is greater than or equal to a preset threshold, then the target historical routing record is determined based on the reward score of each historical routing record. Based on the routing actions recorded in the target's historical routing history, the target computing node is output.
[0067] In some embodiments, in the process of routing service requests for the current time window based on the target computing node, the routing module 304 is specifically used for: Adjust the traffic weight of the target computing node according to the preset traffic weight adjustment rules; Based on the adjusted traffic weight of the target computing node, the service requests in the current time window are routed.
[0068] In some embodiments, the apparatus further includes an incremental training module for: Record the success rate of processing business requests from users of a preset level in the target computing node, the rate of meeting the business request response time target, and the utilization rate of the central processing unit of the target computing node; Based on the success rate of processing business requests from users of the preset level, the rate of meeting the business request response time target, and the utilization rate of the central processing unit of the target computing node, calculate the reward score for routing the business request to the target computing node for processing. The current business scenario characteristics, selected target computing node, and reward score of the business request in the current time window are stored for incremental learning of the routing decision model.
[0069] In some embodiments, the network layer traffic metrics include at least one of the network latency of the service request, the number of concurrent connections, and the number of transactions per second; the service layer semantic features include at least one of the user level, transaction type, and transaction amount. The data acquisition module 301 is specifically used for: The interface classification identifier of the business request is parsed to obtain at least one business-layer semantic feature among the user level, transaction type, and transaction amount; or, The path of the business request is subjected to intent analysis processing, and at least one business layer semantic feature among the user level, transaction type and transaction amount is determined based on the intent analysis results.
[0070] The request routing apparatus provided in the embodiments of the present invention can execute the request routing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0071] According to embodiments of the present invention, the present invention also provides an electronic device, a readable storage medium, and a computer program product.
[0072] Example 4 Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the invention described and / or claimed herein.
[0073] like Figure 4 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory 12 or a random access memory 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the read-only memory 12 or loaded from storage unit 18 into the random access memory 13. The random access memory 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, read-only memory 12, and random access memory 13 are interconnected via a bus 14. An input / output interface 15 is also connected to the bus 14.
[0074] Multiple components in electronic device 10 are connected to input / output interface 15, including: input unit 16; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disks, optical disks, etc.; and communication unit 19, such as network interface cards, modems, wireless transceivers, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0075] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, central processing units, graphics processing units, various special-purpose artificial intelligence computing chips, various processors running machine learning model algorithms, digital signal processors, and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as performing request routing methods.
[0076] In some embodiments, the request routing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via read-only memory 12 and / or communication unit 19. When the computer program is loaded into random access memory 13 and executed by processor 11, one or more steps of the request routing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the request routing method by any other suitable means (e.g., by means of firmware).
[0077] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays, application-specific integrated circuits (ASICs), application-specific standard products (ASICs), systems-on-a-chip (SoCs), complex programmable logic devices, computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0078] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable request routing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0079] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0080] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device or liquid crystal display for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0081] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet. The computing system can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having client-server relationships with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, a host product within the cloud computing service system, addressing the shortcomings of traditional physical hosts and virtual private servers, such as high management difficulty and weak business scalability.
[0082] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0083] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A request routing method, characterized in that, include: In response to receiving a service request in the current time window, the system obtains the time-series data of traffic metrics for historical service requests, as well as the service layer semantic features and network layer traffic metrics features of the service requests in the current time window. Based on the time-series data of the traffic metrics of the historical service requests, the request traffic prediction result for the prediction interval is determined; wherein, the prediction interval refers to the interval of a preset duration after the current time window; Based on the request traffic prediction results of the prediction interval, the business layer semantic features and network layer traffic indicator features of the service request, the target computing node is determined; Based on the target computing node, the service requests for the current time window are routed.
2. The method according to claim 1, characterized in that, The step of determining the request traffic prediction result for the prediction interval based on the time-series data of the traffic indicators of the historical service requests includes: According to a preset time window, a preset number of traffic indicator time-series segments are extracted from the traffic indicator time-series data of the historical service requests. Each of the aforementioned traffic indicator time series segments is standardized, and a preset number of standardized traffic indicator time series segments are used as the input sequence. The input sequence is fed into a traffic prediction model pre-trained on a long short-term memory network, which extracts long-term dependency features from the input sequence based on a built-in gating mechanism, and predicts the long-term dependency features based on a built-in fully connected layer, outputting the request traffic prediction result for the prediction interval; wherein, the request traffic prediction result includes the predicted value and trend of the traffic index.
3. The method according to claim 1, characterized in that, Based on the request traffic prediction results for the prediction interval, the business layer semantic features of the service request, and the network layer traffic indicator features, the target computing node is determined, including: The prediction results of the request traffic in the prediction interval, the business layer semantic features of the service request, and the network layer traffic indicator features are input into the pre-trained routing decision model for processing, and the target computing node is output.
4. The method according to claim 3, characterized in that, The step of inputting the request traffic prediction results of the prediction interval, the business layer semantic features of the service request, and the network layer traffic indicator features into a pre-trained routing decision model for processing, and outputting the target computing node, includes: The routing decision model determines the current business scenario characteristics corresponding to the business request in the current time window based on the request traffic prediction results of the input prediction interval, the business layer semantic features of the business request, and the network layer traffic indicator features. The routing decision model performs matching and retrieval in the historical database constructed during the pre-training phase of the routing decision model based on the characteristics of the current business scenario; wherein, each historical routing record in the historical database includes historical business scenario characteristics, routing actions, and reward scores; If the similarity between the historical business scenario features of multiple historical routing records and the current business scenario features is greater than or equal to a preset threshold, then the target historical routing record is determined based on the reward score of each historical routing record. Based on the routing actions recorded in the target's historical routing history, the target computing node is output.
5. The method according to claim 3, characterized in that, The step of routing service requests for the current time window based on the target computing node includes: Adjust the traffic weight of the target computing node according to the preset traffic weight adjustment rules; Based on the adjusted traffic weight of the target computing node, the service requests in the current time window are routed.
6. The method according to claim 3, characterized in that, After routing the business requests for the current time window, the method further includes: Record the success rate of processing business requests from users of a preset level in the target computing node, the rate of meeting the business request response time target, and the utilization rate of the central processing unit of the target computing node; Based on the success rate of processing business requests from users of the preset level, the rate of meeting the business request response time target, and the utilization rate of the central processing unit of the target computing node, calculate the reward score for routing the business request to the target computing node for processing. The current business scenario characteristics, selected target computing node, and reward score of the business request in the current time window are stored for incremental learning of the routing decision model.
7. The method according to claim 1, characterized in that, The network layer traffic metrics include at least one of the network latency of the service request, the number of concurrent connections, and the number of transactions per second; the service layer semantic features include at least one of the user level, transaction type, and transaction amount. Obtaining the business layer semantic features of the business request includes: The interface classification identifier of the business request is parsed to obtain at least one business layer semantic feature among the user level, transaction type and transaction amount; or, The path of the business request is subjected to intent analysis processing, and at least one business layer semantic feature among the user level, transaction type and transaction amount is determined based on the intent analysis results.
8. A request routing apparatus, characterized in that, include: The data acquisition module is used to acquire, in response to receiving a service request in the current time window, the time-series data of traffic metrics of historical service requests, as well as the service layer semantic features and network layer traffic metrics features of the service requests in the current time window. The first prediction module is used to determine the prediction result of the request traffic for a prediction interval based on the time-series data of the traffic indicators of the historical service requests; wherein, the prediction interval refers to the interval of a preset duration after the current time window. The second prediction module is used to determine the target computing node based on the request traffic prediction results of the prediction interval, the business layer semantic features of the service request, and the network layer traffic indicator features. The routing module is used to route service requests for the current time window based on the target computing node.
9. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the method of any one of claims 1-7.
11. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-7.