An interface call optimization method and system under a micro-service architecture
Patent Information
- Application Number
- CN202610495414.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-15
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2046-04-15
AI Technical Summary
采集到的接口运行数据具有明显的时变性、突发性和非平稳性,现有方法大多仅对请求频次、响应时延和错误率进行阈值判断,难以从状态序列中识别接口节点对扰动的敏感程度,导致在链路拥塞形成前缺乏有效预警;微服务接口之间除直接调用关系外,还存在异常传播关系和资源竞争关系,现有技术通常仅基于单一调用链或局部拓扑进行分析,难以准确刻画复杂网状调用结构中的跨链路耦合影响,导致异常扩散路径和资源争用瓶颈识别不充分;针对接口调用优化问题,传统图神经网络在深层传播时容易出现过平滑现象,纯时序模型又难以同时处理接口节点之间的图结构依赖,导致接口拥塞风险评估与调用收益评估精度不足;现有的调用编排方案多基于单一性能指标进行局部动作调整,缺乏对风险、收益和资源代价的协同约束,且在执行后通常缺少结合反馈结果的快慢双通道更新机制,难以持续适应动态业务场景下的接口调用变化
本发明通过对各接口节点的状态序列执行小波熵联合的扰动敏感编码,并生成接口调用脆弱性视图,解决了现有技术仅依赖静态阈值判断、难以提前识别接口失稳倾向的问题,从而能够在链路拥塞形成前捕获高频异常波动和脆弱节点分布,提高接口风险感知的前瞻性与准确性;通过构建原始调用图和包含异常传播关系、资源竞争关系的多域耦合依赖图,解决了现有技术仅能描述单一调用链、难以刻画复杂网状耦合关系的问题,从而能够更准确地识别异常扩散路径和资源争用瓶颈;通过引入改进型STG-Mamba模型,并在状态空间演化过程中嵌入关系分型依赖传播机制、在图感知选择性扫描过程中嵌入关键路径偏置注入机制,同时增设调用收益输出模块,解决了传统图模型难以兼顾长程时序依赖与复杂图结构、纯时序模型又难以反映调用拓扑差异的问题,从而能够同步输出接口拥塞风险值和调用收益值,为后续决策提供更细粒度依据;通过基于风险收益耦合约束对接口调用动作进行筛选,并对原始调用图执行拓扑重排和时间折叠处理,解决了现有技术仅依据单一性能指标做局部调整、难以兼顾收益与资源代价的问题,从而能够在满足服务等级约束的前提下形成更优的调用编排结果;通过快慢双通道执行更新方式和执行偏差向量反馈机制,解决了现有技术执行后缺少持续更新能力、难以适应动态业务环境的问题,从而使接口调用优化过程具备持续校正和自适应演化能力;因此,本发明不仅能够提升微服务架构下接口调用的稳定性、实时性和资源利用效率,而且对构建面向高并发、强耦合业务系统的智能化服务治理体系具有重要意义。
Smart Images

Figure CN122372638B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of microservice call optimization and distributed system scheduling and control technology, and in particular to an interface call optimization method and system under a microservice architecture. Background Technology
[0002] With the continuous expansion of cloud-native architectures and microservice systems, API call optimization and link orchestration technologies for high-concurrency business scenarios have received widespread attention. Existing microservice governance solutions mainly rely on API monitoring, rule degradation, static rate limiting, or local scheduling based on call chains for API call control. However, these solutions generally suffer from the following problems in practical applications: The collected interface operation data exhibits significant time-varying, bursty, and non-stationary characteristics. Existing methods mostly rely on threshold judgments for request frequency, response latency, and error rate, making it difficult to identify the sensitivity of interface nodes to disturbances from the state sequence, resulting in a lack of effective early warning before link congestion occurs. In addition to direct call relationships, microservice interfaces also have anomaly propagation relationships and resource contention relationships. Existing technologies typically analyze based on a single call chain or local topology, making it difficult to accurately characterize the cross-link coupling impact in complex mesh call structures, leading to insufficient identification of anomaly propagation paths and resource contention bottlenecks. Regarding interface call optimization, traditional graph neural networks are prone to oversmoothing during deep propagation, while pure time-series models struggle to simultaneously handle graph structure dependencies between interface nodes, resulting in insufficient accuracy in interface congestion risk assessment and call benefit assessment. Existing call orchestration schemes often adjust local actions based on single performance indicators, lacking coordinated constraints on risk, benefit, and resource costs. Furthermore, they typically lack a fast and slow dual-channel update mechanism that incorporates feedback results after execution, making it difficult to continuously adapt to interface call changes in dynamic business scenarios.
[0003] Therefore, how to provide an interface call optimization method and system under a microservice architecture is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0004] One objective of this invention is to propose an interface call optimization method and system under a microservice architecture. This invention fully utilizes wavelet entropy joint perturbation-sensitive coding, multi-domain coupled dependency graph modeling, and the improved STG-Mamba model to jointly evaluate the congestion risk, call benefits, and resource consumption during the interface call process, and dynamically orchestrates and updates the call path. It has the advantages of high call stability, high resource utilization, high service response efficiency, and strong adaptive optimization capability.
[0005] An interface call optimization method under a microservice architecture according to an embodiment of the present invention includes the following steps: Step 1: Collect the runtime data of each interface node in the microservice architecture, perform wavelet entropy joint perturbation sensitive coding on the state sequence corresponding to each interface node, and generate an interface call vulnerability view; Step 2: Construct the original call graph based on the call relationships between each interface node, and construct a multi-domain coupling dependency graph by combining exception propagation relationships and resource contention relationships; Step 3: Input the interface call vulnerability view and multi-domain coupling dependency graph into the improved STG-Mamba model. By introducing the relational classification dependency propagation mechanism and the critical path bias injection mechanism, and adding a call benefit output module, the interface congestion risk value and call benefit value corresponding to each candidate interface call action are generated. Step 4: Construct risk-reward coupling constraints based on interface congestion risk value, call benefit value, and resource consumption cost, and filter interface call actions under the condition of meeting the preset service level constraints to generate a candidate call decision set; Step 5: Map the candidate call decision set back to the original call graph, perform topology rearrangement and time folding on the original call graph, and generate the target call orchestration result; Step 6: Execute the interface call based on the target call orchestration result, and use a fast and slow dual-channel execution update method. Generate an execution deviation vector based on the execution feedback result, and update the next round of interface call optimization process based on the execution deviation vector.
[0006] Optionally, step one specifically includes: Collect runtime data from each interface node in the microservice architecture, align the data with time, and form a status sequence of each interface node within a continuous monitoring time window; Outlier sampling points are removed from the state sequences of each interface node, and missing sampling points are filled in by interpolation of adjacent sampling values. The state sequences are then smoothed by sliding window averaging to generate continuous state sequences. The continuous state sequence of each interface node is input into the wavelet packet decomposition process to generate high-frequency band components, and the information entropy value corresponding to each high-frequency band component is calculated. Arrange the information entropy values of each high-frequency band component corresponding to the same interface node in order from low to high frequency range, and combine them with the absolute amount of amplitude change of the corresponding high-frequency band component to generate the disturbance sensitive feature vector corresponding to the interface node. Based on the upstream and downstream connections of each interface node in the original call graph, the disturbance-sensitive feature vectors corresponding to the adjacent interface nodes of each interface node are extracted, and then sequentially concatenated and aggregated to generate an interface call vulnerability view.
[0007] Optionally, step two specifically includes: Restore the interface call relationship under the same request chain; Using each interface node as a graph node and the restored interface call relationship as directed edges, an original call graph is established. The number of calls corresponding to each directed edge within a preset statistical time window is counted, and the number of calls is written into the edge weight of the corresponding directed edge. Obtain abnormal event records for each interface node within a preset statistical time window, and trace the transmission path of abnormal events between upstream and downstream interface nodes according to the occurrence time, abnormal type, and call propagation order of the abnormal events, and extract the abnormal propagation relationship between the abnormal source interface node and the abnormal propagation interface node. Establish abnormal propagation edges between interface nodes that have abnormal propagation relationships, and calculate the propagation weight of each abnormal propagation edge; Obtain the resource usage records of each interface node within a preset statistical time window, and divide each interface node into resource domains according to the same host machine, the same container orchestration node, or the same processor resource set; Interface nodes within the same resource domain are paired up, and the resource occupancy change sequence of each paired interface node at continuous sampling time is extracted. Based on the overlap ratio and the consistency of the change amplitude of the resource occupancy change sequence of each paired interface node at the same change time, the resource competition relationship between interface nodes is determined. Establish resource competition edges between interface nodes that have resource competition relationships, and determine the competition weight of each resource competition edge based on the overlap ratio and the consistency of the change magnitude of the resource occupation change sequences of each combined interface node. The directed edges, exception propagation edges, and resource contention edges in the original call graph are written into a unified adjacency structure according to their edge types, and the corresponding edge weights, propagation weights, and contention weights are written into a unified edge attribute set to generate a multi-domain coupled dependency graph.
[0008] Optionally, the improved STG-Mamba model includes a spatiotemporal node embedding module, a state space evolution module, a graph-aware selective scanning module, and a call benefit output module. The spatiotemporal node embedding module concatenates the vulnerability features corresponding to each interface node in the interface call vulnerability view with the corresponding relationship type identifiers of each interface node in the multi-domain coupling dependency graph, and then passes them through a multilayer perceptron (MLP) to obtain the initial spatiotemporal embedding sequence of each interface node at each time step. The initial spatiotemporal embedding sequence is input into the state space evolution module. Input projection is performed on the embedding vector corresponding to the current time step, and state projection is performed on the hidden state corresponding to the previous time step. The input projection result and the state projection result are added together and then input into the state update unit to obtain the intermediate state corresponding to each interface node at the current time step. A relational classification dependency propagation mechanism is introduced to perform K-Core decomposition on the multi-domain coupled dependency graph to obtain the topological level value corresponding to each interface node, and calculate the local clustering coefficient corresponding to each interface node. The topological level value and the local clustering coefficient corresponding to each interface node are concatenated to form the node topological feature. The state perturbation term is obtained through linear mapping. The state perturbation term is added to the basic state transition parameter to obtain the corrected state transition parameter corresponding to each interface node. Based on the corrected state transition parameter, state recursion is performed on the intermediate state to obtain the temporal evolution state corresponding to each interface node at each time step. The temporal evolution state is input into the graph-aware selective scanning module. Combined with the association relationship between each interface node in the multi-domain coupling dependency graph, the graph-aware selective scanning is performed to generate the fusion hidden state corresponding to each interface node. A critical path bias injection mechanism is introduced to extract the critical path interface nodes based on the cumulative number of calls, cumulative response latency and upstream and downstream connection depth of each interface node in the original call graph. The state update step size of the critical path interface node during the scanning process is written into the path bias. Based on the fusion hidden state corresponding to each interface node, the interface congestion risk value corresponding to each candidate interface call action is generated. The fusion hidden state of each interface node at the last time step is input into the call benefit output module, and the fusion hidden state of each interface node at the last time step is input into the multilayer perceptron (MLP). After ReLU activation, the business completion contribution value, the complete result return value, and the resource output representation value corresponding to each candidate interface call action are obtained. Then, the business completion contribution value, the complete result return value, and the resource output representation value are weighted and summed to obtain the call benefit value corresponding to each candidate interface call action.
[0009] Optionally, step four specifically includes: Read the interface congestion risk value, call benefit value and resource consumption cost corresponding to each candidate interface call action, and obtain the end-to-end latency threshold and error rate threshold corresponding to the preset service level constraints; The candidate interface call actions are divided into serial call actions, parallel call actions, cache replacement actions, degradation call actions and asynchronous compensation call actions according to the action type. Based on the dependency relationship of each candidate interface call action in the original call graph, the candidate interface call actions with call order constraints are combined sequentially, and the candidate interface call actions without call order constraints are combined in parallel to generate multiple call action groups to be evaluated. Calculate the group-level risk value, group-level benefit value, and group-level resource cost value in the same action group to be evaluated. Use the normalized group-level benefit value as the positive evaluation value and the normalized group-level risk value and normalized group-level resource cost value as the negative constraint value. Calculate the coupling decision value corresponding to each action group to be evaluated for each group. Based on the positional relationship of each call action group to be evaluated in the original call graph, the end-to-end execution path corresponding to each call action group to be evaluated is determined, and the execution time of the actions in each end-to-end execution path is sequentially accumulated. The maximum value of the execution time of the actions in the parallel execution path is taken to obtain the predicted end-to-end latency corresponding to each call action group to be evaluated. At the same time, based on the interface congestion risk value corresponding to each candidate interface call action in each call action group to be evaluated, the prediction error rate corresponding to each call action group to be evaluated is determined. The call action groups to be evaluated that predict end-to-end latency greater than the end-to-end latency threshold are removed, the call action groups to be evaluated that predict error rate greater than the error rate threshold are removed, and the call action groups to be evaluated that are not removed are sorted from high to low according to the coupling decision value. Based on the sorting results, select the top-ranked call action groups to be evaluated, and summarize the corresponding candidate interface call actions in the selected call action groups to generate a candidate call decision set.
[0010] Optionally, step five specifically includes: Map the candidate call decision set back to the original call graph, mark the interface nodes in the original call graph corresponding to cache replacement actions as cache nodes, mark the interface nodes corresponding to degradation call actions as degradation nodes, and mark the interface nodes corresponding to asynchronous compensation call actions as asynchronous nodes; For interface nodes marked as cache nodes, delete the directed edges related to downstream synchronous calls and replace the cache nodes with cache result output edges; For interface nodes marked as degraded nodes, delete the degraded nodes and their associated unnecessary downstream directed edges; For interface nodes marked as asynchronous nodes, the waiting edge between the asynchronous node and the current synchronous execution path is cut off, and the asynchronous node is redirected to the asynchronous execution branch. For interface nodes marked as parallel call actions, the concurrent branch structure is preserved. For interface nodes marked as serial call actions, the original sequential connection relationship is preserved, resulting in a dynamic execution directed acyclic graph. Read the predicted execution time of each interface node in the dynamically executed directed acyclic graph and convert the dynamically executed directed acyclic graph into an active edge network; In the active edge network, based on the predecessor and successor constraints of each active edge, the set of active edges that can be executed in parallel is determined for each node, and the active edges belonging to the same parallel execution layer are subjected to parallel folding processing. The maximum value of the predicted execution time of each active edge in the same parallel execution layer is taken as the hierarchical execution time of the parallel execution layer. Multiple parallelizable execution layers with dependencies are sequentially connected according to topological order, and the total execution time after time folding is calculated. At the same time, the execution order, concurrent branch information, cache replacement information, degradation processing information and asynchronous execution branch information of each interface node in the dynamic execution directed acyclic graph are written into the orchestration result data structure according to topological order. Based on the total execution time after time folding and the orchestration result data structure, the target call orchestration result is generated.
[0011] Optionally, the slow channel processing procedure is as follows: read the runtime data, original call graph and multi-domain coupling dependency graph in the microservice architecture, and execute steps one to five in sequence to generate the target call orchestration result; Read the execution order, branch selection result, cache replacement result, degradation processing result, and asynchronous compensation result from the target call orchestration result, and write them into the routing strategy dictionary according to the call entry point and execution order; The fast channel processing procedure is as follows: After receiving the actual request, the gateway extracts the call entry and path features corresponding to the actual request, and matches them in the routing policy dictionary to obtain the target call orchestration result corresponding to the actual request. Based on the target call orchestration result, execute the interface call, read the actual execution result corresponding to each interface node, compare the actual execution result with the target call orchestration result, and generate the local execution deviation value corresponding to each interface node; The local execution deviation values corresponding to each interface node are concatenated according to the order of the interface nodes to generate an execution deviation vector; The parameter update process of the improved STG-Mamba model will be performed by inputting the deviation vector. Steps one through five will be re-executed using the updated improved STG-Mamba model to generate the routing policy dictionary corresponding to the next update cycle.
[0012] An interface call optimization system under a microservice architecture according to an embodiment of the present invention includes the following modules: Run the data acquisition and processing module to collect the running data of each interface node in the microservice architecture, and perform wavelet entropy joint perturbation sensitive coding on the state sequence corresponding to each interface node to generate an interface call vulnerability view. The call relationship modeling module is used to construct the original call graph based on the call relationships between each interface node, and to construct a multi-domain coupling dependency graph by combining exception propagation relationships and resource contention relationships; The risk-reward assessment module is used to input the interface call vulnerability view and multi-domain coupling dependency graph into the improved STG-Mamba model to generate the interface congestion risk value and call benefit value corresponding to each candidate interface call action. The decision filtering module is used to construct risk-reward coupling constraints based on interface congestion risk value, call benefit value and resource consumption cost, and filter interface call actions under the condition of meeting the preset service level constraints to generate a candidate call decision set. The orchestration generation module is invoked to map the candidate call decision set back to the original call graph, perform topology rearrangement and time folding on the original call graph, and generate the target call orchestration result. The execution feedback update module is used to execute interface calls based on the target call orchestration results, and adopts a fast and slow dual-channel execution update method. It generates an execution deviation vector based on the execution feedback results, and updates the next round of interface call optimization process based on the execution deviation vector.
[0013] The beneficial effects of this invention are: This invention addresses the problem of existing technologies relying solely on static threshold judgments and failing to identify interface instability tendencies in advance by performing wavelet entropy joint perturbation-sensitive coding on the state sequences of each interface node and generating an interface call vulnerability view. This allows for the capture of high-frequency abnormal fluctuations and vulnerable node distributions before link congestion occurs, improving the foresight and accuracy of interface risk perception. Furthermore, by constructing the original call graph and a multi-domain coupled dependency graph containing abnormal propagation relationships and resource contention relationships, it overcomes the limitation of existing technologies that can only describe single call chains and struggle to characterize complex network coupling relationships, enabling more accurate identification of abnormal propagation paths and resource contention bottlenecks. Finally, by introducing an improved STG-Mamba model and embedding a relational classification dependency propagation mechanism during state space evolution and a critical path bias injection mechanism during graph-aware selective scanning, along with an added call benefit output module, it solves the problem that traditional graph models struggle to simultaneously handle long-range temporal dependencies and complex graph structures, as well as pure time-series dependencies. The sequential model struggles to reflect differences in call topology, thus enabling the simultaneous output of interface congestion risk and call benefit values, providing a more granular basis for subsequent decisions. By filtering interface call actions based on risk-benefit coupling constraints and performing topology rearrangement and time folding on the original call graph, this invention solves the problem of existing technologies making only local adjustments based on a single performance indicator and failing to balance benefits and resource costs. This allows for a better call orchestration result while meeting service level constraints. Through a fast and slow dual-channel execution update method and an execution deviation vector feedback mechanism, this invention addresses the lack of continuous update capabilities and difficulty in adapting to dynamic business environments in existing technologies, enabling the interface call optimization process to have continuous correction and adaptive evolution capabilities. Therefore, this invention not only improves the stability, real-time performance, and resource utilization efficiency of interface calls in microservice architectures but also has significant implications for building an intelligent service governance system for high-concurrency, strongly coupled business systems. Attached Figure Description
[0014] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of an interface call optimization method under a microservice architecture proposed in this invention; Figure 2 This is a framework diagram of the improved STG-Mamba model in the interface call optimization method under a microservice architecture proposed in this invention; Figure 3 This is a framework diagram of an interface call optimization system under a microservice architecture proposed in this invention. Detailed Implementation
[0015] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0016] refer to Figures 1-2 An interface call optimization method for a microservice architecture includes the following steps: Step 1: Collect the runtime data of each interface node in the microservice architecture, perform wavelet entropy joint perturbation sensitive coding on the state sequence corresponding to each interface node, and generate an interface call vulnerability view; Step 2: Construct the original call graph based on the call relationships between each interface node, and construct a multi-domain coupling dependency graph by combining exception propagation relationships and resource contention relationships; Step 3: Input the interface call vulnerability view and multi-domain coupling dependency graph into the improved STG-Mamba model. By introducing the relational classification dependency propagation mechanism and the critical path bias injection mechanism, and adding a call benefit output module, the interface congestion risk value and call benefit value corresponding to each candidate interface call action are generated. Step 4: Construct risk-reward coupling constraints based on interface congestion risk value, call benefit value, and resource consumption cost, and filter interface call actions under the condition of meeting the preset service level constraints to generate a candidate call decision set; Step 5: Map the candidate call decision set back to the original call graph, perform topology rearrangement and time folding on the original call graph, and generate the target call orchestration result; Step 6: Execute the interface call based on the target call orchestration result, and use a fast and slow dual-channel execution update method. Generate an execution deviation vector based on the execution feedback result, and update the next round of interface call optimization process based on the execution deviation vector.
[0017] In this embodiment, step one specifically includes: The running data of each interface node in the microservice architecture is collected according to the preset sampling period, and the running data of each interface node is aligned according to the timestamp corresponding to each running data to form the status sequence of each interface node within the continuous monitoring time window. Outlier sampling points are removed from the state sequences of each interface node, and missing sampling points are filled in by interpolation of adjacent sampling values. Then, the state sequences are smoothed by sliding window averaging to generate continuous state sequences. The continuous state sequence of each interface node is input into the wavelet packet decomposition process. The continuous state sequence is decomposed layer by layer according to the preset decomposition level to obtain multiple frequency band components corresponding to different frequency ranges. The frequency band component located in the high frequency range is selected from the multiple frequency band components as the high frequency frequency band component. The range of values of each high-frequency band component within the continuous monitoring time window is divided into multiple statistical intervals. The number of times the sampled value appears in each statistical interval is counted. Based on the proportion of the number of times the sampled value appears in each statistical interval to the total number of samples, the information entropy value corresponding to each high-frequency band component is calculated. Arrange the information entropy values of each high-frequency band component corresponding to the same interface node in order from low to high frequency range, and combine them with the absolute amount of amplitude change of the corresponding high-frequency band component to generate the disturbance sensitive feature vector corresponding to the interface node. Based on the upstream and downstream connections of each interface node in the original call graph, the disturbance-sensitive feature vectors corresponding to the adjacent interface nodes of each interface node are extracted. The disturbance-sensitive feature vectors of the current interface node and the disturbance-sensitive feature vectors of the adjacent interface nodes are then concatenated and aggregated in the order of the call direction to generate an interface call vulnerability view.
[0018] In this embodiment, step two specifically includes: Obtain the call records of each interface node in the microservice architecture within a preset statistical time window, and restore the interface call relationship under the same request chain according to the call initiating interface identifier, call receiving interface identifier and call occurrence time order in the call records; Using each interface node as a graph node and the restored interface call relationship as directed edges, an original call graph is established. The number of calls corresponding to each directed edge within a preset statistical time window is counted, and the number of calls is written into the edge weight of the corresponding directed edge. Obtain abnormal event records for each interface node within a preset statistical time window, and trace the transmission path of abnormal events between upstream and downstream interface nodes according to the occurrence time, abnormal type, and call propagation order of the abnormal events, and extract the abnormal propagation relationship between the abnormal source interface node and the abnormal propagation interface node. Anomaly propagation edges are established between interface nodes that have anomaly propagation relationships. The number of times an anomaly event propagates from the upstream interface node to the downstream interface node is counted. The propagation weight of each anomaly propagation edge is determined based on the proportion of the number of occurrences to the total number of anomalies in the corresponding upstream interface node. Obtain the resource usage records of each interface node within a preset statistical time window, and divide each interface node into resource domains according to the same host machine, the same container orchestration node, or the same processor resource set; Interface nodes within the same resource domain are paired up, and the resource occupancy change sequence of each paired interface node at continuous sampling time is extracted. Based on the overlap ratio and the consistency of the change amplitude of the resource occupancy change sequence of each paired interface node at the same change time, the resource competition relationship between interface nodes is determined. Establish resource competition edges between interface nodes that have resource competition relationships, and determine the competition weight of each resource competition edge based on the overlap ratio and the consistency of the change magnitude of the resource occupation change sequences of each combined interface node. The directed edges, exception propagation edges, and resource contention edges in the original call graph are written into a unified adjacency structure according to their edge types, and the corresponding edge weights, propagation weights, and contention weights are written into a unified edge attribute set to generate a multi-domain coupled dependency graph.
[0019] In this embodiment, the improved STG-Mamba model includes a spatiotemporal node embedding module, a state space evolution module, a graph-aware selective scanning module, and a call benefit output module: The vulnerability view of the interface call and the multi-domain coupling dependency graph are input into the spatiotemporal node embedding module. The vulnerability features corresponding to each interface node in the vulnerability view of the interface call are read in the order of the interface nodes. The call relationship, exception propagation relationship and resource contention relationship corresponding to each interface node in the multi-domain coupling dependency graph are read. The vulnerability features corresponding to each interface node and the corresponding relationship type identifier are concatenated into the node input vector. Then, the node input vector is input into the multilayer perceptron (MLP) to obtain the initial spatiotemporal embedding sequence of each interface node at each time step. The initial spatiotemporal embedding sequence is input into the state space evolution module. The embedding vectors of each interface node at the current time step and the hidden states of the previous time step are read sequentially according to the time step order. Input projection is performed on the embedding vectors at the current time step, and state projection is performed on the hidden states of the previous time step. The input projection result and the state projection result are added together and written into the state update unit to obtain the intermediate states of each interface node at the current time step. A relational dependency propagation mechanism is introduced into the state space evolution module to perform K-Core decomposition on the multi-domain coupled dependency graph, obtaining the topological hierarchy corresponding to each interface node. The numerical values are calculated, and the proportion of closed connections between each interface node and its adjacent interface nodes to the total number of possible closed connections is obtained to obtain the local clustering coefficient corresponding to each interface node. Then, the topological level values and local clustering coefficients corresponding to each interface node are concatenated to form the node topological features, and the node topological features are input into the linear mapping unit to obtain the state perturbation terms corresponding to each interface node. Then, the state perturbation terms are added to the basic state transition parameters to obtain the corrected state transition parameters corresponding to each interface node. Based on the corrected state transition parameters, state recursion is performed on the intermediate states to obtain the temporal evolution state corresponding to each interface node at each time step. The temporal evolution state is input into the graph-aware selective scanning module. Based on the cumulative number of calls, cumulative response latency, and upstream and downstream connection depth of each interface node in the original call graph, the module performs normalization processing on each interface node and then performs weighted summation to obtain the critical path score for each interface node. The nodes are then sorted from high to low according to their critical path scores, and the interface nodes whose ranking results fall within a preset proportion range are selected as critical path interface nodes. In an implementation process, the preset proportion range is set to the top 20%. The reason for this is that in e-commerce settlement microservice links, the interface nodes that truly determine the stability of the transaction backbone are usually concentrated in a few core links. If the proportion range is too small, it is easy to miss important nodes in the actual backbone link. If the proportion range is too large, bypass interfaces will also be included in the critical path, weakening the critical path bias injection effect. Therefore, the preset proportion range is set to the top 20%. Write path mask identifiers to critical path interface nodes. Read the temporal evolution states of each interface node and its adjacent nodes sequentially according to time step order. Perform weighted summations on the adjacent interface node states corresponding to call relationships, exception propagation relationships, and resource contention relationships to obtain aggregated results for call relationships, exception propagation relationships, and resource contention relationships. Then, add these aggregated results together to obtain the current interface node's state at the current time step. Scanning input; during selective scanning, for interface nodes with path mask identifiers, the basic scan step size is added to a preset bias to obtain the bias step size. For interface nodes without path mask identifiers, the basic scan step size is maintained, and graph perception selective scanning is performed according to the corresponding step size and scan input to obtain the fusion hidden state corresponding to each interface node; then, the fusion hidden state corresponding to each interface node at the last time step is extracted, and the fusion hidden state corresponding to each interface node at the last time step is input into the multilayer perceptron (MLP). After Sigmoid activation, the interface congestion risk value corresponding to each candidate interface call action is obtained. The fusion hidden state of each interface node at the last time step is input into the call benefit output module, and the fusion hidden state of each interface node at the last time step is input into the multilayer perceptron (MLP). After ReLU activation, the business completion contribution value, the complete result return value, and the resource output representation value corresponding to each candidate interface call action are obtained. Then, the business completion contribution value, the complete result return value, and the resource output representation value are weighted and summed to obtain the call benefit value corresponding to each candidate interface call action. In this embodiment, the improved STG-Mamba model is similar to the original model in that it retains the backbone structure based on state space recursion to process time series information, and combines graph structure information to propagate and update the node state. Compared to the original model, the improved STG-Mamba model introduces a relational classification dependency propagation mechanism in the state space evolution module, so that call relations, anomaly propagation relations and resource competition relations correspond to different state perturbation terms; it introduces a critical path bias injection mechanism in the graph-aware selective scanning module, so that critical path interface nodes and non-critical path interface nodes adopt different scanning step sizes; at the same time, it adds a call benefit output module, which outputs call benefit values in addition to outputting interface congestion risk values. The above improvements address the issues of the original model's inadequate differentiation of different relationship types, insufficient attention to key business links, and its focus on risk assessment while neglecting business value. This enables the model to more accurately identify the impact of anomaly propagation and resource contention, more effectively highlight high-value nodes in the main call chain, and provide more granular basis for subsequent risk-reward coupling decisions, thereby improving the accuracy and practicality of microservice interface call optimization.
[0020] In this embodiment, step four specifically includes: Read the interface congestion risk value, call benefit value and resource consumption cost corresponding to each candidate interface call action, and obtain the end-to-end latency threshold and error rate threshold corresponding to the preset service level constraints; The candidate interface call actions are divided into serial call actions, parallel call actions, cache replacement actions, degradation call actions and asynchronous compensation call actions according to the action type. Based on the dependency relationship of each candidate interface call action in the original call graph, the candidate interface call actions with call order constraints are combined sequentially, and the candidate interface call actions without call order constraints are combined in parallel to generate multiple call action groups to be evaluated. For each candidate interface call action in each call action group to be evaluated, read the corresponding interface congestion risk value, call benefit value, and resource consumption cost. Then, accumulate the interface congestion risk value, call benefit value, and resource consumption cost in the same call action group to be evaluated to obtain the group-level risk value, group-level benefit value, and group-level resource cost value corresponding to each call action group to be evaluated. Normalize the group-level risk value, group-level benefit value, and group-level resource cost value corresponding to each action group to be evaluated. Use the normalized group-level benefit value as a positive evaluation value and the normalized group-level risk value and normalized group-level resource cost value as negative constraint values. Calculate the coupled decision value corresponding to each action group to be evaluated for each group. Based on the positional relationship of each call action group to be evaluated in the original call graph, the end-to-end execution path corresponding to each call action group to be evaluated is determined, and the execution time of the actions in each end-to-end execution path is sequentially accumulated. The maximum value of the execution time of the actions in the parallel execution path is taken to obtain the predicted end-to-end latency corresponding to each call action group to be evaluated. At the same time, based on the interface congestion risk value corresponding to each candidate interface call action in each call action group to be evaluated, the prediction error rate corresponding to each call action group to be evaluated is determined. The evaluation call action groups with predicted end-to-end latency greater than the end-to-end latency threshold are removed, as are the evaluation call action groups with predicted error rates greater than the error rate threshold. The remaining evaluation call action groups are then sorted from high to low according to their coupling decision values. In one implementation process, the end-to-end latency threshold is set to 300 milliseconds and the error rate threshold is set to 2%. The basis for these values is that in the e-commerce transaction chain, the user's tolerance range for the response of core interfaces such as settlement, payment, and inventory confirmation is usually no more than 300 milliseconds. At the same time, if the error rate exceeds 2%, it will significantly affect the transaction completion rate and user experience. Therefore, the end-to-end latency threshold is set to 300 milliseconds and the error rate threshold is set to 2% to meet the service level requirements of the core business chain. Based on the sorting results, select the top-ranked call action groups to be evaluated, and summarize the corresponding candidate interface call actions in the selected call action groups to generate a candidate call decision set.
[0021] In this embodiment, step five specifically includes: Map the candidate call decision set back to the original call graph, read the node position and edge connection relationship of each candidate interface call action in the candidate call decision set in the original call graph, and mark the interface node corresponding to the cache replacement action in the original call graph as a cache node, the interface node corresponding to the degradation call action as a degradation node, and the interface node corresponding to the asynchronous compensation call action as an asynchronous node. For interface nodes marked as cache nodes, delete the directed edges related to downstream synchronous calls and replace the cache node with cached result output edges; for interface nodes marked as degradation nodes, delete the degradation node and its associated unnecessary downstream directed edges; for interface nodes marked as asynchronous nodes, cut off the waiting edges between the asynchronous node and the current synchronous execution path and redirect the asynchronous node to the asynchronous execution branch; for interface nodes marked as parallel call actions, retain their concurrent branch structure; for interface nodes marked as serial call actions, retain their original sequential connection relationships, resulting in a dynamic execution directed acyclic graph. Read the predicted execution time corresponding to each interface node in the dynamic execution directed acyclic graph, and convert the dynamic execution directed acyclic graph into an active edge network. The interface call start event and interface call end event are used as event nodes, each interface call action is used as an active edge, and the predicted execution time corresponding to each active edge is written into the edge weight. In the active edge network, based on the predecessor and successor constraints of each active edge, the set of active edges that can be executed in parallel is determined for each node, and the active edges belonging to the same parallel execution layer are subjected to parallel folding processing. The maximum value of the predicted execution time corresponding to each active edge in the same parallel execution layer is taken as the level execution time of that parallel execution layer. Multiple parallelizable execution layers with dependencies are sequentially connected according to topological order, and the execution time of each parallelizable execution layer is accumulated layer by layer to obtain the total execution time after time folding. At the same time, the execution order, concurrent branch information, cache replacement information, degradation processing information and asynchronous execution branch information of each interface node in the dynamic execution directed acyclic graph are written into the orchestration result data structure according to topological order. Based on the total execution time after time folding and the orchestration result data structure, the target call orchestration result is generated.
[0022] In this embodiment, step six specifically includes: The slow channel processing is executed according to the preset update cycle. During the slow channel processing, the running data, original call graph and multi-domain coupling dependency graph in the microservice architecture are read, and steps one to five are executed in sequence to generate the target call orchestration result. Read the execution order, branch selection result, cache replacement result, degradation processing result, and asynchronous compensation result from the target call orchestration result, and write them into the routing strategy dictionary according to the call entry point and execution order; During the fast channel processing, after the gateway receives the actual request, it extracts the call entry and path characteristics corresponding to the actual request and matches them in the routing policy dictionary to obtain the target call orchestration result corresponding to the actual request. The interface calls are executed based on the target call orchestration results. Specifically, the interface nodes corresponding to the cache replacement results are cache read, the interface nodes corresponding to the degradation processing results are returned, the interface nodes corresponding to the asynchronous compensation results are asynchronously dispatched, and the remaining interface nodes are executed serially or in parallel according to the target call orchestration results. After the interface call is executed, the actual execution result of each interface node is read, and the actual execution result is compared with the target call orchestration result to generate the local execution deviation value of each interface node. The local execution deviation values corresponding to each interface node are concatenated according to the order of the interface nodes to generate an execution deviation vector; The execution deviation vector is input into the parameter update process of the improved STG-Mamba model. During the parameter update process, the deviation value corresponding to each interface node in the execution deviation vector is read. Interface nodes with deviation values greater than a preset deviation threshold are identified as high deviation nodes, and interface nodes with deviation values no greater than the preset deviation threshold are identified as low deviation nodes. In one implementation process, the preset deviation threshold is set to 0.15. The basis for this value is that the execution deviation vector reflects the relative deviation between the prediction result and the actual execution result. When the deviation value exceeds 0.15, it indicates that the current interface node has deviated significantly in terms of latency, resource consumption, or execution result. Continuing to use the original parameters may easily lead to inaccurate decision-making in the next round. When the deviation value does not exceed 0.15, it indicates that the model prediction and the actual execution result are basically consistent. Therefore, the preset deviation threshold is set to 0.15 to distinguish between high deviation nodes and low deviation nodes. The fusion hidden state and target output results corresponding to high-bias nodes are back-read, and gradient updates are performed on the parameters of the state space evolution module, graph-aware selective scanning module and call benefit output module in the improved STG-Mamba model according to the deviation direction corresponding to the high-bias nodes. The original parameter update step size is kept unchanged or the parameter update step size is reduced for the fusion hidden state and target output results corresponding to low-bias nodes. After completing the parameter update, steps one through five are re-executed using the updated improved STG-Mamba model to generate the routing policy dictionary for the next update cycle.
[0023] refer to Figure 3 An interface call optimization system under a microservice architecture includes the following modules: Run the data acquisition and processing module to collect the running data of each interface node in the microservice architecture, and perform wavelet entropy joint perturbation sensitive coding on the state sequence corresponding to each interface node to generate an interface call vulnerability view. The call relationship modeling module is used to construct the original call graph based on the call relationships between each interface node, and to construct a multi-domain coupling dependency graph by combining exception propagation relationships and resource contention relationships; The risk-reward assessment module is used to input the interface call vulnerability view and multi-domain coupling dependency graph into the improved STG-Mamba model to generate the interface congestion risk value and call benefit value corresponding to each candidate interface call action. The decision filtering module is used to construct risk-reward coupling constraints based on interface congestion risk value, call benefit value and resource consumption cost, and filter interface call actions under the condition of meeting the preset service level constraints to generate a candidate call decision set. The orchestration generation module is invoked to map the candidate call decision set back to the original call graph, perform topology rearrangement and time folding on the original call graph, and generate the target call orchestration result. The execution feedback update module is used to execute interface calls based on the target call orchestration results, and adopts a fast and slow dual-channel execution update method. It generates an execution deviation vector based on the execution feedback results, and updates the next round of interface call optimization process based on the execution deviation vector.
[0024] Example 1: To verify the feasibility of this invention in practice, it was applied to the microservice chain of a promotional event settlement on an e-commerce platform. This platform normally handles product browsing, order placement, payment, discount settlement, inventory deduction, and logistics push notifications. Under normal traffic conditions, the call relationships between these services are relatively stable. However, during promotional events, flash sales, and scenarios with combined discounts, requests can flood core interfaces such as orders, inventory, payment, and coupons within a short period, easily leading to chain-level queuing, abnormal propagation, and resource contention. Especially when sideline services such as recommendation, marketing, and message notifications participate in the calls simultaneously, traditional governance methods relying solely on threshold-based rate limiting or static degradation often fail to distinguish between core transaction chains and non-critical branches in a timely manner, resulting in slower response times for the main business and even localized avalanche effects.
[0025] This embodiment selects an actual call chain of the platform that includes order service, inventory service, coupon service, payment service, marketing service, and recommendation service for testing. The chain covers a total of 120 interface nodes. In the test environment, the peak QPS is set to 18,000, the slow channel update cycle is set to 5 seconds, and the fast channel is executed by looking up the routing policy dictionary on the gateway side. The wavelet packet decomposition level is set to 3 layers, the critical path node extraction ratio is set to the top 20% of the sorted nodes, and the execution deviation threshold is set to 0.15. The comparison methods selected are traditional threshold governance, graph neural network scheme, original STG-Mamba, and the method of this invention. Continuous stress testing is conducted for 30 minutes, and key indicators on the link side are statistically analyzed.
[0026] Table 1 Comparison of Microservice Interface Call Optimization Examples
[0027] As shown in Table 1, traditional threshold governance can only trigger rate limiting or degradation after congestion occurs, resulting in an average P99 latency of 428ms, an error rate of 3.8%, and an orchestration success rate of only 81.4%. While the graph neural network solution utilizes the call topology, it is insufficient in responding to long-term states and dynamic link switching, with a routing policy update time of 6.8s, leading to decision lag in peak jitter scenarios. The original STG-Mamba solution can already handle both time-series modeling and graph structure processing, reducing the average P99 latency to 297ms and the error rate to 2.1%, indicating that state-space recursion has a significant advantage for interface link evolution. However, it does not distinguish between call relationships, anomaly propagation relationships, and resource contention relationships, nor does it perform bias processing on critical path nodes. Therefore, resource contention amplification and path noise interference still exist on the backbone transaction link.
[0028] Under the same number of nodes and peak QPS conditions, the method of this invention further reduces the average P99 latency to 214ms, a further reduction of 83ms compared to the original STG-Mamba, and a reduction of 214ms compared to traditional threshold governance; the error rate is reduced to 1.3%, the service completion rate is increased to 97.4%, and the orchestration success rate reaches 94.6%. Simultaneously, the CPU utilization rate is reduced from 69% of the original STG-Mamba to 63%, indicating that the model's suppression of invalid state propagation and bypass noise is stronger through the relational dependency propagation mechanism and critical path bias injection mechanism. The time folding rate reaches 26.8%, significantly higher than the original STG-Mamba's 17.9%, indicating that the topology reordering and time folding processing in step five of this invention can more effectively compress serial waiting time. The routing policy update time is 3.4s, which is better than the graph neural network scheme and the original STG-Mamba, indicating that the fast and slow dual-channel execution update method takes into account both global optimization and online execution efficiency.
[0029] As can be seen from this embodiment, the present invention can identify vulnerable interface nodes in advance in high-concurrency, tightly coupled microservice business scenarios, accurately characterize the relationship between anomaly propagation and resource competition, and complete better call orchestration under the premise of meeting service level constraints. Therefore, it can not only reduce interface call latency and error rate, but also improve business completion rate, orchestration success rate and resource utilization efficiency, and has strong engineering application value for e-commerce transactions, payment settlement and high-concurrency Internet service governance.
[0030] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for optimizing interface calls in a microservice architecture, characterized in that, Includes the following steps: Step 1: Collect the runtime data of each interface node in the microservice architecture, perform wavelet entropy joint perturbation sensitive coding on the state sequence corresponding to each interface node, and generate an interface call vulnerability view; Step 2: Construct the original call graph based on the call relationships between each interface node, and construct a multi-domain coupling dependency graph by combining exception propagation relationships and resource contention relationships; Step 3: Input the interface call vulnerability view and multi-domain coupling dependency graph into the improved STG-Mamba model. The improved STG-Mamba model includes a spatiotemporal node embedding module, a state space evolution module, a graph-aware selective scanning module, and a call benefit output module. By introducing a relational classification dependency propagation mechanism and a critical path bias injection mechanism, and adding a call benefit output module, the interface congestion risk value and call benefit value corresponding to each candidate interface call action are generated. Step 4: Construct risk-reward coupling constraints based on interface congestion risk value, call benefit value, and resource consumption cost, and filter interface call actions under the condition of meeting the preset service level constraints to generate a candidate call decision set; Step 5: Map the candidate call decision set back to the original call graph, perform topology rearrangement and time folding on the original call graph, and generate the target call orchestration result; Step 6: Execute the interface call based on the target call orchestration result, and use a fast and slow dual-channel execution update method. Generate an execution deviation vector based on the execution feedback result, and update the next round of interface call optimization process based on the execution deviation vector.
2. The method for optimizing interface calls under a microservice architecture according to claim 1, characterized in that, Step one specifically includes: Collect runtime data from each interface node in the microservice architecture, align the data with time, and form a status sequence of each interface node within a continuous monitoring time window; Outlier sampling points are removed from the state sequences of each interface node, and missing sampling points are filled in by interpolation of adjacent sampling values. The state sequences are then smoothed by sliding window averaging to generate continuous state sequences. The continuous state sequence of each interface node is input into the wavelet packet decomposition process to generate high-frequency band components, and the information entropy value corresponding to each high-frequency band component is calculated. Arrange the information entropy values of each high-frequency band component corresponding to the same interface node in order from low to high frequency range, and combine them with the absolute amount of amplitude change of the corresponding high-frequency band component to generate the disturbance sensitive feature vector corresponding to the interface node. Based on the upstream and downstream connections of each interface node in the original call graph, the disturbance-sensitive feature vectors corresponding to the adjacent interface nodes of each interface node are extracted, and then sequentially concatenated and aggregated to generate an interface call vulnerability view.
3. The method for optimizing interface calls in a microservice architecture according to claim 1, characterized in that, Step two specifically includes: Restore the interface call relationship under the same request chain; Using each interface node as a graph node and the restored interface call relationship as directed edges, an original call graph is established. The number of calls corresponding to each directed edge within a preset statistical time window is counted, and the number of calls is written into the edge weight of the corresponding directed edge. Obtain abnormal event records for each interface node within a preset statistical time window, and trace the transmission path of abnormal events between upstream and downstream interface nodes according to the occurrence time, abnormal type, and call propagation order of the abnormal events, and extract the abnormal propagation relationship between the abnormal source interface node and the abnormal propagation interface node. Establish abnormal propagation edges between interface nodes that have abnormal propagation relationships, and calculate the propagation weight of each abnormal propagation edge; Obtain the resource usage records of each interface node within a preset statistical time window, and divide each interface node into resource domains according to the same host machine, the same container orchestration node, or the same processor resource set; Interface nodes within the same resource domain are paired up, and the resource occupancy change sequence of each paired interface node at continuous sampling time is extracted. Based on the overlap ratio and the consistency of the change amplitude of the resource occupancy change sequence of each paired interface node at the same change time, the resource competition relationship between interface nodes is determined. Establish resource competition edges between interface nodes that have resource competition relationships, and determine the competition weight of each resource competition edge based on the overlap ratio and the consistency of the change magnitude of the resource occupation change sequences of each combined interface node. The directed edges, exception propagation edges, and resource contention edges in the original call graph are written into a unified adjacency structure according to their edge types, and the corresponding edge weights, propagation weights, and contention weights are written into a unified edge attribute set to generate a multi-domain coupled dependency graph.
4. The method for optimizing interface calls in a microservice architecture according to claim 1, characterized in that, The improved STG-Mamba model includes a spatiotemporal node embedding module, a state space evolution module, a graph-aware selective scanning module, and a call benefit output module. The spatiotemporal node embedding module concatenates the vulnerability features corresponding to each interface node in the interface call vulnerability view with the corresponding relationship type identifiers of each interface node in the multi-domain coupling dependency graph, and then passes them through a multilayer perceptron (MLP) to obtain the initial spatiotemporal embedding sequence of each interface node at each time step. The initial spatiotemporal embedding sequence is input into the state space evolution module. Input projection is performed on the embedding vector corresponding to the current time step, and state projection is performed on the hidden state corresponding to the previous time step. The input projection result and the state projection result are added together and then input into the state update unit to obtain the intermediate state corresponding to each interface node at the current time step. A relational classification dependency propagation mechanism is introduced to perform K-Core decomposition on the multi-domain coupled dependency graph to obtain the topological level value corresponding to each interface node, and calculate the local clustering coefficient corresponding to each interface node. The topological level value and the local clustering coefficient corresponding to each interface node are concatenated to form the node topological feature. The state perturbation term is obtained through linear mapping. The state perturbation term is added to the basic state transition parameter to obtain the corrected state transition parameter corresponding to each interface node. Based on the corrected state transition parameter, state recursion is performed on the intermediate state to obtain the temporal evolution state corresponding to each interface node at each time step. The temporal evolution state is input into the graph-aware selective scanning module. Combined with the association relationship between each interface node in the multi-domain coupling dependency graph, the graph-aware selective scanning is performed to generate the fusion hidden state corresponding to each interface node. A critical path bias injection mechanism is introduced to extract the critical path interface nodes based on the cumulative number of calls, cumulative response latency and upstream and downstream connection depth of each interface node in the original call graph. The state update step size of the critical path interface node during the scanning process is written into the path bias. Based on the fusion hidden state corresponding to each interface node, the interface congestion risk value corresponding to each candidate interface call action is generated. The fusion hidden state of each interface node at the last time step is input into the call benefit output module, and the fusion hidden state of each interface node at the last time step is input into the multilayer perceptron (MLP). After ReLU activation, the business completion contribution value, the complete result return value, and the resource output representation value corresponding to each candidate interface call action are obtained. Then, the business completion contribution value, the complete result return value, and the resource output representation value are weighted and summed to obtain the call benefit value corresponding to each candidate interface call action.
5. The method for optimizing interface calls in a microservice architecture according to claim 1, characterized in that, Step four specifically includes: Read the interface congestion risk value, call benefit value and resource consumption cost corresponding to each candidate interface call action, and obtain the end-to-end latency threshold and error rate threshold corresponding to the preset service level constraints; The candidate interface call actions are divided into serial call actions, parallel call actions, cache replacement actions, degradation call actions and asynchronous compensation call actions according to the action type. Based on the dependency relationship of each candidate interface call action in the original call graph, the candidate interface call actions with call order constraints are combined sequentially, and the candidate interface call actions without call order constraints are combined in parallel to generate multiple call action groups to be evaluated. Calculate the group-level risk value, group-level benefit value, and group-level resource cost value in the same action group to be evaluated. Use the normalized group-level benefit value as the positive evaluation value and the normalized group-level risk value and normalized group-level resource cost value as the negative constraint value. Calculate the coupling decision value corresponding to each action group to be evaluated for each group. Based on the positional relationship of each call action group to be evaluated in the original call graph, the end-to-end execution path corresponding to each call action group to be evaluated is determined, and the execution time of the actions in each end-to-end execution path is sequentially accumulated. The maximum value of the execution time of the actions in the parallel execution path is taken to obtain the predicted end-to-end latency corresponding to each call action group to be evaluated. At the same time, based on the interface congestion risk value corresponding to each candidate interface call action in each call action group to be evaluated, the prediction error rate corresponding to each call action group to be evaluated is determined. The call action groups to be evaluated that predict end-to-end latency greater than the end-to-end latency threshold are removed, the call action groups to be evaluated that predict error rate greater than the error rate threshold are removed, and the call action groups to be evaluated that are not removed are sorted from high to low according to the coupling decision value. Based on the sorting results, select the top-ranked call action groups to be evaluated, and summarize the corresponding candidate interface call actions in the selected call action groups to generate a candidate call decision set.
6. The method for optimizing interface calls under a microservice architecture according to claim 1, characterized in that, Step five specifically includes: Map the candidate call decision set back to the original call graph, mark the interface nodes in the original call graph corresponding to cache replacement actions as cache nodes, mark the interface nodes corresponding to degradation call actions as degradation nodes, and mark the interface nodes corresponding to asynchronous compensation call actions as asynchronous nodes; For interface nodes marked as cache nodes, delete the directed edges related to downstream synchronous calls and replace the cache nodes with cache result output edges; For interface nodes marked as degraded nodes, delete the degraded nodes and their associated unnecessary downstream directed edges; For interface nodes marked as asynchronous nodes, the waiting edge between the asynchronous node and the current synchronous execution path is cut off, and the asynchronous node is redirected to the asynchronous execution branch. For interface nodes marked as parallel call actions, the concurrent branch structure is preserved. For interface nodes marked as serial call actions, the original sequential connection relationship is preserved, resulting in a dynamic execution directed acyclic graph. Read the predicted execution time of each interface node in the dynamically executed directed acyclic graph and convert the dynamically executed directed acyclic graph into an active edge network; In the active edge network, based on the predecessor and successor constraints of each active edge, the set of active edges that can be executed in parallel is determined for each node, and the active edges belonging to the same parallel execution layer are subjected to parallel folding processing. The maximum value of the predicted execution time of each active edge in the same parallel execution layer is taken as the hierarchical execution time of the parallel execution layer. Multiple parallelizable execution layers with dependencies are sequentially connected according to topological order, and the total execution time after time folding is calculated. At the same time, the execution order, concurrent branch information, cache replacement information, degradation processing information and asynchronous execution branch information of each interface node in the dynamic execution directed acyclic graph are written into the orchestration result data structure according to topological order. Based on the total execution time after time folding and the orchestration result data structure, the target call orchestration result is generated.
7. The method for optimizing interface calls in a microservice architecture according to claim 1, characterized in that, The fast and slow dual-channel execution update method includes a slow channel processing procedure and a fast channel processing procedure; The slow channel processing procedure is as follows: read the runtime data, original call graph and multi-domain coupling dependency graph in the microservice architecture, and execute steps one to five in sequence to generate the target call orchestration result; Read the execution order, branch selection result, cache replacement result, degradation processing result, and asynchronous compensation result from the target call orchestration result, and write them into the routing strategy dictionary according to the call entry point and execution order; The fast channel processing procedure is as follows: After receiving the actual request, the gateway extracts the call entry and path features corresponding to the actual request, and matches them in the routing policy dictionary to obtain the target call orchestration result corresponding to the actual request. Based on the target call orchestration result, execute the interface call, read the actual execution result corresponding to each interface node, compare the actual execution result with the target call orchestration result, and generate the local execution deviation value corresponding to each interface node; The local execution deviation values corresponding to each interface node are concatenated according to the order of the interface nodes to generate an execution deviation vector; The parameter update process of the improved STG-Mamba model will be performed by inputting the deviation vector. Steps one through five will be re-executed using the updated improved STG-Mamba model to generate the routing policy dictionary corresponding to the next update cycle.
8. An interface call optimization system under a microservice architecture, applied to the interface call optimization method under a microservice architecture as described in any one of claims 1-7, characterized in that, Includes the following modules: Run the data acquisition and processing module to collect the running data of each interface node in the microservice architecture, and perform wavelet entropy joint perturbation sensitive coding on the state sequence corresponding to each interface node to generate an interface call vulnerability view. The call relationship modeling module is used to construct the original call graph based on the call relationships between each interface node, and to construct a multi-domain coupling dependency graph by combining exception propagation relationships and resource contention relationships; The risk-reward assessment module is used to input the interface call vulnerability view and multi-domain coupling dependency graph into the improved STG-Mamba model. The improved STG-Mamba model includes a spatiotemporal node embedding module, a state space evolution module, a graph-aware selective scanning module, and a call benefit output module to generate the interface congestion risk value and call benefit value corresponding to each candidate interface call action. The decision filtering module is used to construct risk-reward coupling constraints based on interface congestion risk value, call benefit value and resource consumption cost, and filter interface call actions under the condition of meeting the preset service level constraints to generate a candidate call decision set. The orchestration generation module is invoked to map the candidate call decision set back to the original call graph, perform topology rearrangement and time folding on the original call graph, and generate the target call orchestration result. The execution feedback update module is used to execute interface calls based on the target call orchestration results, and adopts a fast and slow dual-channel execution update method. It generates an execution deviation vector based on the execution feedback results, and updates the next round of interface call optimization process based on the execution deviation vector.
Citation Information
Patent Citations
Hybrid deployment scene-oriented micro-service system root cause positioning method and system
CN116737436A
Optical power prediction method and system based on multi-site spatial-temporal characteristics and dynamic optimization
CN120454027A