Service route optimization method, device, equipment, medium and product

CN122120185APending Publication Date: 2026-05-29LIAONING MOBILE COMM +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
LIAONING MOBILE COMM
Filing Date
2026-01-27
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing service routing optimization technologies rely on simple polling mechanisms and static detection, resulting in low response efficiency. Furthermore, data stored in centralized databases is easily tampered with, and the low efficiency of blockchain consensus makes it difficult to meet the needs of efficient on-chain processing and querying.

Method used

By deploying service registration nodes to collect resource status information in real time, using artificial intelligence models to dynamically evaluate service quality, generating an optimal routing table, and storing it in a high-efficiency blockchain system, an improved consensus mechanism is adopted for decentralized storage and rapid consensus.

Benefits of technology

It enables intelligent decision-making and decentralized storage in the service routing process, improving response efficiency and data security, and ensuring the efficiency of service discovery and the integrity and reliability of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122120185A_ABST
    Figure CN122120185A_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of wireless transmission, and particularly relates to a service route optimization method and device, equipment, medium and product. The method comprises the following steps: collecting resource state information of each service instance based on a service registration node deployed on each service instance; generating a response time prediction value of each service instance based on the resource state information and a pre-trained quality analysis model; calculating a quality score of each service instance based on the response time prediction value; and generating an optimal service instance routing table according to k service instances with the highest quality scores. Through the service registration node deployed on each service instance, resource state information can be collected in real time, and the quality of service of the service instance is dynamically evaluated by using the quality analysis model, which is conducive to dynamically generating the current optimal service instance routing table, and realizes the fully-automatic dynamic updating process of "collecting data-predicting analysis-generating routing table", thereby improving the response efficiency of service routing and the quality of service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of wireless transmission technology, and in particular to a service routing optimization method, apparatus, device, medium, and product. Background Technology

[0002] Service routing optimization refers to the selection and adjustment of data transmission paths in computer networks or communication systems through algorithms and strategies to improve network performance, reduce bandwidth consumption, increase transmission efficiency, and enhance network stability and reliability. Its core objective is to achieve optimal data transmission path planning and resource allocation in complex and ever-changing network environments.

[0003] However, currently commonly used service routing optimization techniques mainly rely on simple polling mechanisms and static service availability detection techniques to select the most suitable service instance (such as a server), resulting in low service response efficiency. Summary of the Invention

[0004] In view of the above problems, this disclosure is made to provide a service routing optimization method, apparatus, device, medium and product.

[0005] According to one aspect of this disclosure, a service routing optimization method is provided, comprising: Based on the service registration nodes deployed on each service instance, resource status information of each service instance is collected; where a service instance represents a device that can provide service capabilities, and resource status information is used to characterize resource usage. Based on resource status information and a pre-trained quality analysis model, the predicted response time values ​​for each service instance are generated. Calculate the quality score for each service instance based on the predicted response time. Generate an optimal service instance routing table based on the k service instances with the highest quality scores, where k ≥ 1.

[0006] The beneficial effects of this solution are as follows: By deploying service registration nodes on each service instance, resource status information can be collected in real time, and the service quality of service instances can be dynamically evaluated using a quality analysis model. This facilitates the dynamic generation of the current optimal service instance routing table, realizing a fully automated dynamic update process of "data collection - predictive analysis - routing table generation", thereby improving the response efficiency and service quality of service routing.

[0007] Furthermore, according to one aspect of the service routing optimization method disclosed herein, the process of constructing and training the quality analysis model includes: Construct an artificial intelligence model, which includes an input layer, an intermediate layer, and an output layer. The intermediate layer adopts a fully connected structure. Based on the historical operation logs of each service instance, the gradient descent algorithm is used to train the artificial intelligence model until the artificial intelligence model converges, thus obtaining the quality analysis model.

[0008] In one or more embodiments, the beneficial effect of this solution is that by constructing a quality analysis model through artificial intelligence, the quality of service instances can be dynamically evaluated, and high-quality service instances can be selected based on real-time status.

[0009] Furthermore, according to a service routing optimization method of one aspect of this disclosure, a quality score for each service instance is calculated based on the predicted response time, including: Obtain the average and maximum resource utilization of each service instance, as well as the average and maximum network latency of each service instance; The first evaluation index is obtained by taking the reciprocal of the predicted response time; the second evaluation index is obtained by calculating the ratio of the average resource utilization rate to the maximum resource utilization rate; and the third evaluation index is obtained by calculating the ratio of the average network latency to the maximum network latency. The quality score for each service instance is obtained by weighted summation of the first, second, and third evaluation indicators.

[0010] In one or more embodiments, the beneficial effect of this solution is that multi-factor analysis of resource utilization, network latency, and response time helps to ensure the accuracy of quality scoring.

[0011] Furthermore, the service routing optimization method according to one aspect of this disclosure also includes: Calculate the correlation strength between any two nodes based on the historical consensus records of each node in the blockchain. By connecting two nodes with an edge whose association strength is greater than a preset threshold, an association graph can be obtained; Calculate the total association strength of each node in the association graph, and select the N nodes with the highest total association strength as the initial nodes; where N is determined based on the number of node groups. Each initial node is used as the starting point for each node group. Based on the correlation strength between each node and each starting point, each node is assigned to a node group. Each node exists in only one node group. When the optimal service instance routing table request is stored in the blockchain, blockchain consensus is performed based on node grouping. After consensus is passed, the optimal service instance routing table is stored in the blockchain.

[0012] In one or more embodiments, the beneficial effects of this solution are as follows: By constructing a correlation graph through calculating the correlation strength between nodes, blockchain node grouping is achieved, downgrading the time-consuming "global consensus" to an efficient "local consensus." Consensus only needs to be completed within the node group, without waiting for all nodes, which facilitates the rapid determination of accounting permissions and improves consensus efficiency and the speed of service routing table on-chaining and querying. Through the deep integration of quality analysis models and blockchain technology, intelligent decision-making and decentralized storage in the service routing process are realized, significantly improving service discovery efficiency and data security.

[0013] Furthermore, according to one aspect of the service routing optimization method of this disclosure, each node is assigned to a node group based on the association strength between each node and each starting point, including: The breadth-first search algorithm is used to traverse the strongly related nodes of each starting point in turn. The strongly related nodes include the nodes that are directly connected to the starting point and have the strongest association. Strongly related nodes are assigned to the node group corresponding to the starting point, until all nodes directly connected to the starting point have been grouped. Using a depth-first search algorithm, ungrouped nodes are assigned to corresponding node groups based on their association strength.

[0014] In one or more embodiments, the beneficial effects of this solution are as follows: by traversing all nodes using breadth-first search and depth-first search algorithms, nodes can be assigned to corresponding node groups. Nodes already assigned to a node group do not undergo secondary assignment, ensuring that each node exists in only one group. Whenever a new optimal service instance routing table needs to be added to the chain, only the corresponding node group needs to be selected for calculation, which helps improve the efficiency of adding the node to the chain.

[0015] Furthermore, according to one aspect of the service routing optimization method disclosed herein, blockchain consensus is achieved based on node grouping. After consensus is reached, the optimal service instance routing table is stored in the blockchain, including: Each node performs calculations according to a preset algorithm, and the target node that generates the calculation results the fastest is obtained. The target node then obtains the accounting authority for the routing table of the optimal service instance. If the number of target nodes is equal to 1, the nodes where the target node is located will form a blockchain consensus group. After the consensus is passed, the optimal service instance routing table will be stored in the blockchain. If the number of target nodes is greater than 1, the target node group to which each target node belongs is confirmed. The calculation results of each target node are cross-validated through each node in each target node group. The target node that passes the cross-validation first is taken as the final node. The node group to which the final node belongs conducts blockchain consensus. After the consensus is passed, the optimal service instance routing table is stored in the blockchain.

[0016] In one or more embodiments, the beneficial effects of this solution are as follows: storing the optimal service instance routing table in a high-efficiency consensus blockchain helps improve the security and query efficiency of routing data during service routing. Compared to traditional relational or non-relational databases, blockchain has characteristics such as immutability and distributed storage, effectively ensuring the integrity and reliability of service routing information.

[0017] According to another aspect of this disclosure, a service routing optimization apparatus is provided, comprising: The data collection module is used to collect resource status information of each service instance based on the service registration nodes deployed on each service instance; where a service instance represents a device that can provide service capabilities. The prediction module is used to generate predicted response times for each service instance based on resource status information and a pre-trained quality analysis model. The calculation module is used to calculate the quality score of each service instance based on the predicted response time. The routing optimization module is used to generate an optimal service instance routing table based on the k service instances with the highest quality scores, where k ≥ 1.

[0018] According to another aspect of this disclosure, a computer device is provided, including a memory, a processor, and a computer program stored in the memory, the processor executing the computer program to implement the method of one aspect above.

[0019] According to another aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the method of one aspect above.

[0020] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method of the above-described aspect.

[0021] It should be understood that both the foregoing general description and the following detailed description are exemplary and intended to provide further illustration of the claimed technology. Attached Figure Description

[0022] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.

[0023] Figure 1This is a system architecture diagram illustrating a service routing optimization method according to an embodiment of this disclosure.

[0024] Figure 2 This is a flowchart illustrating node grouping according to an embodiment of the present disclosure.

[0025] Figure 3 This is an illustrated association map based on an embodiment of the present disclosure.

[0026] Figure 4 This is a flowchart illustrating a service routing optimization method according to an embodiment of this disclosure.

[0027] Figure 5 This is a flowchart illustrating yet another service routing optimization method according to an embodiment of the present disclosure.

[0028] Figure 6 This is a schematic diagram of the structure of a service routing optimization apparatus according to an embodiment of the present disclosure.

[0029] Figure 7 This is a schematic diagram illustrating the structure of a computer device according to an embodiment of the present disclosure.

[0030] Figure 8 This is a schematic diagram illustrating a computer program product according to an embodiment of the present disclosure. Detailed Implementation

[0031] To make the objectives, technical solutions, and advantages of this disclosure more apparent, exemplary embodiments according to this disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this disclosure, and not all embodiments of this disclosure. It should be understood that this disclosure is not limited to the exemplary embodiments described herein.

[0032] Service routing optimization refers to the selection and adjustment of data transmission paths in computer networks or communication systems through algorithms and strategies to improve network performance, reduce bandwidth consumption, increase transmission efficiency, and enhance network stability and reliability. Its core objective is to achieve optimal data transmission path planning and resource allocation in complex and ever-changing network environments.

[0033] However, the commonly used service routing optimization techniques still have the following problems: (1) Relying on a simple polling mechanism and static service availability detection technology to select the appropriate service instance (e.g., server) at the moment results in low service response efficiency.

[0034] (2) In terms of service routing information storage, relational or non-relational databases are usually used for centralized storage, which has the problems of data being easily tampered with and poor security.

[0035] (3) Blockchain technology has low consensus efficiency, making it difficult to meet the demand for efficient on-chaining and querying of service routing information.

[0036] The above description, with reference to the accompanying drawings, illustrates a service routing optimization method, apparatus, device, medium, and product according to embodiments of this disclosure. Through four core steps—resource status information collection, model quality analysis, routing table generation, and blockchain storage—the service routing process achieves intelligence and decentralization, effectively addressing the issues of low response efficiency and poor data security in existing service routing mechanisms. The deep integration of artificial intelligence and blockchain technology enables intelligent decision-making and decentralized storage in the service routing process, significantly improving service discovery efficiency and data security.

[0037] To facilitate understanding of this embodiment, a service routing optimization method disclosed in this disclosure will first be described in detail. The execution subject of the service routing optimization method provided in this disclosure is generally a computer device with certain computing capabilities. This computer device may include, for example, a terminal device, a server, or other processing devices. The terminal device may be a user equipment (UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, in-vehicle device, wearable device, etc. In some possible implementations, this service routing optimization method can be implemented by a processor calling computer-readable instructions stored in memory.

[0038] like Figure 1 The diagram shown is a system architecture diagram of the service routing optimization method provided in this embodiment of the disclosure, including a service registration layer 1, an AI analysis layer 2, and a blockchain storage layer 3. The following is a detailed description of the architecture of each layer: Service Registration Layer 1: Responsible for collecting and uploading resource status information to the AI ​​analysis layer.

[0039] The service registration layer includes service registration nodes deployed in the distributed system. These nodes are software agent devices deployed on each service instance, responsible for collecting and reporting the real-time operational status data of that service instance. The service registration nodes collect real-time resource status information from each service instance (e.g., servers), including but not limited to key status indicators such as CPU utilization, memory usage, network bandwidth utilization, and disk I / O throughput. This resource status information is transmitted via lightweight communication protocols (such as gRPC or MQTT) to ensure real-time data collection and low latency. During data upload, message queue protocols such as MQTT or Kafka can be used to improve the reliability and throughput of data transmission.

[0040] Specifically, the collected raw data is in structured JSON format, containing fields such as timestamp, service instance ID, resource type, and numerical value. For example, the JSON format of the CPU utilization field is as follows: json { "timestamp": "2024-04-05T10:00:00Z", "service_id": "S12345", "resource_type": "CPU", "value": 0.75 } AI Analysis Layer 2: Responsible for performing model training and model analysis.

[0041] Specifically, the AI ​​analytics layer includes AI service analytics nodes. These nodes preprocess resource status information to obtain resource status vectors. Using the resource status vectors of service instances as independent variables and response time as the dependent variable, the AI ​​service analytics nodes construct a quality analysis model for the service instances. This quality analysis model is trained on historical data using machine learning algorithms to dynamically evaluate the quality of service instances, thereby generating an optimal service instance routing table. The AI ​​service analytics nodes can be deployed on edge computing nodes or cloud servers, with deployment strategies flexibly adjusted according to actual needs.

[0042] In the data preprocessing stage, data cleaning is performed first to remove outliers and missing values. A Z-score-based anomaly detection method is used to remove data points exceeding the mean ± 3σ range. Subsequently, data from different dimensions is normalized to eliminate the impact of differences in units. Taking CPU utilization as an example, the normalization formula is as follows:

[0043] in, This represents the normalized CPU utilization rate. This is the raw data value of CPU utilization. and These are the minimum and maximum values ​​of the data in this dimension, respectively.

[0044] The quality analysis model is based on an artificial intelligence model, aiming to achieve dynamic evaluation of service instance quality. Specific AI models can include deep learning networks, random forests, and XGBoost. The model's input layer receives preprocessed resource status information of the service instances, and the output layer provides predicted response times. The intermediate layers employ a fully connected structure, with 64, 32, and 16 nodes per layer, respectively. The ReLU activation function is used to enhance the model's non-linear expressive power.

[0045] During model training, this embodiment employs a gradient descent optimization algorithm (such as Adam) and chooses mean squared error (MSE) as the loss function to measure the deviation between the predicted and actual response times. The training dataset consists of historical operation logs of service instances, covering resource status and response time records of multiple service instances under different load conditions. To further improve model training efficiency, this embodiment uses principal component analysis (PCA) to reduce the dimensionality of the multidimensional historical operation logs, retaining principal components with a variance contribution rate exceeding 95%. This step effectively reduces the dimensionality of the feature space while preserving the main trends in data variation, providing more efficient input features for model training.

[0046] The following is the training algorithm for the quality analysis model: The model training process employs supervised learning, with the input being the historical runtime logs of the service instances, specifically the resource state vector X = [ , ,..., ],in, This represents the status of CPU, memory, etc.; the output is the predicted response time; the training objective is to minimize the loss function L, which is defined as follows:

[0047] Where m is the sample size. This is the predicted response time of the model for the i-th sample.

[0048] During training, batch gradient descent is used to update the model parameters, and the iterative formula is as follows:

[0049] in, For learning rate, This represents the gradient of the loss function with respect to the parameters.

[0050] After model training is complete, the AI ​​service analysis node converts the latest uploaded resource status information from the service registration layer into a resource status vector. The quality analysis model infers the predicted response time value of the service instance based on the current resource status vector, and generates a quality score for the service instance by combining service quality assessment indicators (such as resource utilization, network latency, etc.). The quality score formula is as follows:

[0051] in, This represents the quality score, and T represents the predicted response time. This represents the average resource utilization rate (such as the utilization rate of indicators like CPU, memory, and network). This represents the maximum resource utilization rate. This represents the average network latency. This indicates the maximum network latency. , , These are weighting coefficients, which can be 0.4, 0.3, and 0.3 respectively.

[0052] Finally, based on the quality score results, the top k (k≥1) service instances are selected as candidate routing nodes and sorted from low to high to generate the optimal service instance routing table.

[0053] This embodiment introduces an artificial intelligence model to collect and analyze the resource status of service instances (such as CPU, memory, network, disk, etc.) in real time, constructs a quality analysis model, dynamically evaluates the quality of service instances, and generates an optimal service instance routing table. Compared with traditional polling or static selection methods, it can select high-quality service instances based on real-time status, significantly improving the response efficiency and service quality of service routing.

[0054] Blockchain Storage Layer 3: After the optimal service instance routing table is generated, it is encapsulated as a data sample and submitted to the blockchain network via a smart contract. The optimal service instance routing table is stored in a high-efficiency consensus blockchain system to improve the security and query efficiency of routing data during service routing.

[0055] Compared to traditional relational or non-relational databases, blockchain possesses characteristics such as immutability and distributed storage, effectively ensuring the integrity and reliability of service routing information. By storing the optimal service instance routing table in a high-efficiency consensus blockchain system, and leveraging the immutability and distributed storage characteristics of blockchain, the integrity and reliability of service routing data are effectively guaranteed, thus enhancing the overall system security.

[0056] To address the issue of insufficient consensus efficiency in traditional blockchains, this embodiment proposes an efficient decentralized storage method. Nodes are grouped, and an improved consensus mechanism is adopted. Nodes reach consensus through decentralization, ensuring data consistency and security, and improving on-chain efficiency.

[0057] Specifically, such as Figure 2 As shown, the node grouping process includes: S201: Calculate the correlation strength between any two nodes based on the historical consensus records of all nodes in the blockchain system.

[0058] During historical consensus, a consensus between two nodes is recorded as 1, otherwise as 0. This type of data is typically stored in a structured format in a distributed ledger, such as JSON or binary format.

[0059] To construct the association graph, the original transaction data first needs to be cleaned and normalized. The cleaning process includes removing invalid and abnormal records. Historical consensus samples over a specific period are then compiled. The association strength between nodes can be calculated using the following formula:

[0060] in, This represents the association strength between node i and node j. This represents the total number of verifications between node i and node j. and These represent the total number of verifications for nodes i and j, respectively. This formula effectively measures the security between two nodes, thus providing a basis for subsequent construction of the association graph.

[0061] S202: Construct an association graph by connecting two nodes with an edge whose association strength is greater than a preset threshold.

[0062] Based on the association strength between any two nodes calculated above, an undirected association graph G=(V, E) is constructed, where V represents the set of nodes, E represents the edge between nodes, and the edge weight is the association strength calculated above. Set a preset threshold for association strength. When the correlation strength is greater than At that time, edges are established in the associated graph, where, The initial value can be the average correlation strength between all nodes.

[0063] like Figure 3 As shown, any two points in the correlation graph are connected, and the numbers between the nodes represent the correlation strength between the two nodes.

[0064] S203: Calculate the total association strength of each node in the association graph.

[0065] The total association strength of each node is calculated as the sum of the association strengths of that node and all other nodes. Taking node i as an example, the formula is:

[0066] in, This represents the total association strength of node i, and m is the total number of nodes.

[0067] S204: Select the N nodes with the highest total association strength as the initial nodes and group the nodes.

[0068] N is determined based on the total number of nodes. For example, if there are 100 nodes, N equals 10, which means the 100 nodes are divided into 10 groups. Based on the calculated total association strength, the 10 nodes with the highest total association strength are selected as the initial nodes for each node group. Since the initial nodes have high association strength, it indicates that the nodes participate in consensus and the consensus credibility is relatively high, so they are used as the starting point for each node group.

[0069] This embodiment employs breadth-first search (BFS) and depth-first search (DFS) algorithms to group nodes in the entire association graph based on the strength of the associations between them. To better illustrate this scheme, [the following is used as an example]. Figure 3 For example, assuming node B is the starting point of node group b, node C is the starting point of node group c, and node D is the starting point of node group d, the specific grouping steps are as follows: S41: Starting from point B, use the BFS algorithm to search the correlation graph ( Figure 3 Search within B to find the node with the strongest association that is directly connected to the starting point B, and assign that node to node group b.

[0070] S42: Using the BFS algorithm, iterate through the starting point C and starting point D in turn to find the node with the strongest association with them, and assign the node to the corresponding node group (a node that has been assigned to a group cannot be assigned to another group), until all nodes on the graph that are directly related to the starting point B, starting point C, and starting point D are assigned to the corresponding groups.

[0071] S43: Taking the starting point D as an example, randomly select a node directly connected to the starting point D (e.g., node F). Use the DFS algorithm to search for the node with the strongest association with node F that has not been grouped. Suppose that node H is found, add node H to node group d. Through this traversal method, all nodes in the blockchain are divided into their corresponding node groups.

[0072] After node grouping is completed, when a new optimal service instance routing table needs to be stored in the blockchain, the on-chain process includes: First, all nodes compete for the right to record transactions according to a preset algorithm.

[0073] For example, in the Proof-of-Work (PoW) consensus algorithm, all nodes need to simultaneously calculate the hash value, and the node that generates the calculation result fastest obtains the consensus and initiates the accounting.

[0074] Next, confirm the number of target nodes that have been granted accounting permissions. Depending on the number, there are two possible scenarios: Scenario 1: Only one node solves the hash value mathematical problem first. This node gains the right to record the transaction. The nodes to which this target node belongs then form a group to conduct blockchain consensus. After consensus is reached, the optimal service instance routing table is stored in the blockchain. Because the consensus process is completed only within the group, the number of nodes participating in the consensus is reduced, thus improving consensus efficiency.

[0075] Scenario 2: A math problem where two or more nodes simultaneously calculate the hash value. Assume that in node group 1, the first node to calculate the hash solution is... In node group 2, the node that first calculates the hash solution is Then, cross-validation is performed between the two groups, with all nodes in node group 2 being validated. The calculation results are verified to be correct, and all nodes in node group 1 are also checked. To determine the correctness of the calculation results, the node that passes cross-validation first is designated as the final node. Assume the final node is... The blockchain consensus is reached by all nodes in node group 1. Once the consensus is reached, the optimal service instance routing table is stored in the blockchain.

[0076] This embodiment integrates artificial intelligence and blockchain technology to construct a complete closed-loop process from state acquisition, quality analysis, route generation to secure storage. It realizes intelligent decision-making and decentralized storage in the service routing process, providing an efficient, secure, and scalable service discovery solution for large-scale distributed systems.

[0077] Based on the above embodiments, this embodiment also provides a service routing optimization method, such as... Figure 4 As shown, it includes: S401: Deploy service registration node.

[0078] In a distributed system, multiple service registration nodes are deployed. Each service registration node is responsible for monitoring and collecting resource status information of the service instances it manages, including metrics such as CPU, memory, network, and disk. The collection frequency is set to once per second to ensure data real-time performance.

[0079] S402: Data upload and preprocessing.

[0080] The service registration node uploads the collected resource status information to the AI ​​service analysis node via the gRPC protocol. The AI ​​service analysis node cleans, normalizes, and reduces the dimensionality of the data to generate a standardized resource status vector.

[0081] S403: Model Reasoning and Scoring.

[0082] The AI ​​service analysis node loads a pre-trained quality analysis model. The model infers based on the current resource status vector of the service instance, predicts its response time, and generates a quality score.

[0083] S404: Generate the optimal service instance routing table.

[0084] Based on the quality score, the AI ​​service analysis node generates an optimal service instance routing table, which includes information such as service instance ID, score, and response time.

[0085] S405: Blockchain Storage and Consensus.

[0086] The optimal service instance routing table is encapsulated as a blockchain transaction and submitted to the blockchain network. During consensus on-chain processing, cross-validation within and between node groups quickly determines the node's accounting authority, improving consensus efficiency and the speed of service routing table on-chain processing and querying.

[0087] S406: Service route lookup.

[0088] When a user initiates a service request, the system queries the optimal service instance routing table from the blockchain and selects a service instance with a high rating for invocation, thus achieving efficient and secure service discovery.

[0089] Based on the above embodiments, this embodiment also provides a service routing optimization method, such as... Figure 5 The diagram shown is another flowchart for service routing optimization methods, including S501-S504: S501: Based on the service registration nodes deployed on each service instance, collect resource status information of each service instance; Among them, service instances represent devices that can provide service capabilities, and resource status information is used to characterize resource usage.

[0090] S502: Based on resource status information and a pre-trained quality analysis model, generate predicted response times for each service instance.

[0091] S503: Calculate the quality score for each service instance based on the predicted response time.

[0092] S504: Generate an optimal service instance routing table based on the k service instances with the highest quality scores; Where k≥1.

[0093] In one or more embodiments, the process of building and training the quality analysis model includes: An artificial intelligence model is constructed, which includes an input layer, an intermediate layer, and an output layer. The intermediate layer adopts a fully connected structure. Based on the historical operation logs of each service instance, the gradient descent algorithm is used to train the artificial intelligence model until the model converges, thus obtaining a quality analysis model.

[0094] In one or more embodiments, a quality score for each service instance is calculated based on the predicted response time, including: Obtain the average and maximum resource utilization of each service instance, as well as the average and maximum network latency of each service instance; The first evaluation metric is obtained by taking the reciprocal of the predicted response time; the second evaluation metric is obtained by calculating the ratio of the average resource utilization rate to the maximum resource utilization rate; the third evaluation metric is obtained by calculating the ratio of the average network latency to the maximum network latency; and the quality score of each service instance is obtained by weighted summing of the first, second, and third evaluation metrics.

[0095] The quality scoring formula is as follows:

[0096] in, This represents the quality score, and T represents the predicted response time. This represents the average resource utilization rate (such as the utilization rate of indicators like CPU, memory, and network). This represents the maximum resource utilization rate. This represents the average network latency. This indicates the maximum network latency. , , These are weighting coefficients, which can be 0.4, 0.3, and 0.3 respectively.

[0097] In one or more embodiments, it further includes: Calculate the correlation strength between any two nodes based on the historical consensus records of each node in the blockchain. By connecting two nodes with an edge whose association strength is greater than a preset threshold, an association graph can be obtained; Calculate the total association strength of each node in the association graph, and select the N nodes with the highest total association strength as the initial nodes; where N is determined based on the number of node groups. Each initial node is used as the starting point for each node group. Based on the correlation strength between each node and each starting point, each node is assigned to a node group. Each node exists in only one node group. When the optimal service instance routing table request is stored in the blockchain, blockchain consensus is performed based on node grouping. After consensus is passed, the optimal service instance routing table is stored in the blockchain.

[0098] In one or more embodiments, nodes are grouped into node groups based on the association strength between each node and each starting point, including: The breadth-first search algorithm is used to traverse the strongly related nodes of each starting point in turn. The strongly related nodes include the nodes that are directly connected to the starting point and have the strongest association. Strongly related nodes are assigned to the node group corresponding to the starting point, until all nodes directly connected to the starting point have been grouped. Using a depth-first search algorithm, ungrouped nodes are assigned to corresponding node groups based on their association strength.

[0099] In one or more embodiments, blockchain consensus is achieved based on node grouping. After consensus is reached, the optimal service instance routing table is stored in the blockchain, including: Each node performs calculations according to a preset algorithm, and the target node that generates the calculation results the fastest is obtained. The target node then obtains the accounting authority for the routing table of the optimal service instance. If the number of target nodes is equal to 1, the nodes where the target node is located will form a blockchain consensus group. After the consensus is passed, the optimal service instance routing table will be stored in the blockchain. If the number of target nodes is greater than 1, the target node group to which each target node belongs is confirmed. The calculation results of each target node are cross-validated through each node in each target node group. The target node that passes the cross-validation first is taken as the final node. The node group to which the final node belongs conducts blockchain consensus. After the consensus is passed, the optimal service instance routing table is stored in the blockchain.

[0100] For example: Scenario 1: Only one node solves the hash value mathematical problem first. This node gains the right to record the transaction. The nodes to which this target node belongs then form a group to conduct blockchain consensus. After consensus is reached, the optimal service instance routing table is stored in the blockchain. Because the consensus process is completed only within the group, the number of nodes participating in the consensus is reduced, thus improving consensus efficiency.

[0101] Scenario 2: A math problem where two or more nodes simultaneously calculate the hash value. Assume that in node group 1, the first node to calculate the hash solution is... In node group 2, the node that first calculates the hash solution is Then, cross-validation is performed between the two groups, with all nodes in node group 2 being validated. The calculation results are verified to be correct, and all nodes in node group 1 are also checked. To determine the correctness of the calculation results, the node that passes cross-validation first is designated as the final node. Assume the final node is... The blockchain consensus is reached by all nodes in node group 1. Once the consensus is reached, the optimal service instance routing table is stored in the blockchain.

[0102] According to another aspect of the embodiments of this disclosure, a service routing optimization apparatus is provided, such as... Figure 6 As shown, the device includes: The data collection module 601 is used to collect resource status information of each service instance based on the service registration nodes deployed on each service instance; where a service instance represents a device that can provide service capabilities. The prediction module 602 is used to generate predicted response times for each service instance based on resource status information and a pre-trained quality analysis model. The calculation module 603 is used to calculate the quality score of each service instance based on the predicted response time value; The routing optimization module 604 is used to generate an optimal service instance routing table based on the k service instances with the highest quality scores, where k ≥ 1.

[0103] The service routing optimization apparatus and the service routing optimization method provided in this disclosure are based on the same inventive concept and have the same beneficial effects as the methods they adopt, operate or implement.

[0104] This disclosure also provides a computer device for performing the above-described service routing optimization method. Please refer to... Figure 7 It illustrates a schematic diagram of a computer device provided by some embodiments of this disclosure. For example... Figure 7 As shown, the computer device 7 includes: a processor 700, a memory 701, a bus 702, and a communication interface 703. The processor 700, the communication interface 703, and the memory 701 are connected via the bus 702. The memory 701 stores a computer program that can run on the processor 700. When the processor 700 runs the computer program, it executes the service routing optimization method provided in any of the foregoing embodiments of this disclosure.

[0105] The memory 701 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between the device network element and at least one other network element is achieved through at least one communication interface 703 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.

[0106] Bus 702 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory 701 is used to store programs. After receiving an execution instruction, the processor 700 executes the program. The service routing optimization method disclosed in any of the foregoing embodiments of this disclosure can be applied to the processor 700, or implemented by the processor 700.

[0107] The processor 700 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 700 or by software instructions. The processor 700 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPTA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 701. Processor 700 reads the information in memory 701 and, in conjunction with its hardware, completes the steps of the above method.

[0108] The computer device provided in this disclosure and the service routing optimization method provided in this disclosure are based on the same inventive concept and have the same beneficial effects as the methods they adopt, operate or implement.

[0109] This disclosure also provides a computer-readable storage medium corresponding to the service routing optimization method provided in the foregoing embodiments. The computer-readable storage medium is an optical disc, on which a computer program (i.e., a computer program product) is stored. When the computer program is run by a processor, it executes the service routing optimization method provided in any of the foregoing embodiments.

[0110] It should be noted that examples of the computer-readable storage medium may also include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other optical and magnetic storage media, which will not be elaborated here.

[0111] The computer-readable storage medium provided in the above embodiments of this disclosure and the service routing optimization method provided in the embodiments of this disclosure are based on the same inventive concept and have the same beneficial effects as the methods adopted, run or implemented by the applications stored therein.

[0112] This disclosure also provides a computer program product; please refer to [reference needed]. Figure 8 The computer program product 800 carries program code, namely computer program 801. The instructions included in the computer program 801 can be used to execute the steps of the service routing optimization method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.

[0113] The aforementioned computer program product can be implemented through hardware, software, or a combination thereof. In one optional embodiment, the computer program product is specifically embodied in a computer storage medium; in another optional embodiment, the computer program product is specifically embodied in a software product, such as a software development kit (SDK), etc.

[0114] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0115] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0116] Additionally, as used herein, the "or" used in a list of items beginning with "at least one" indicates a separate list, such that a list of, for example, "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not imply that the described example is preferred or better than other examples.

[0117] It should also be noted that in the systems and methods of this disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions to this disclosure.

[0118] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.

[0119] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.

[0120] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A service routing optimization method, characterized in that, include: Based on the service registration nodes deployed on each service instance, resource status information of each service instance is collected; wherein, the service instance represents a device that can provide service capabilities, and the resource status information is used to characterize resource usage. Based on the resource status information and the pre-trained quality analysis model, the predicted response time values ​​for each of the service instances are generated. Based on the predicted response time, a quality score is calculated for each of the service instances; An optimal service instance routing table is generated based on the k service instances with the highest quality scores, where k ≥ 1.

2. The service routing optimization method as described in claim 1, characterized in that, The construction and training process of the quality analysis model includes: Construct an artificial intelligence model, which includes an input layer, an intermediate layer, and an output layer, wherein the intermediate layer adopts a fully connected structure; Based on the historical operation logs of each service instance, the gradient descent algorithm is used to train the artificial intelligence model until the artificial intelligence model converges, thereby obtaining the quality analysis model.

3. The service routing optimization method as described in claim 1, characterized in that, Based on the predicted response time, a quality score is calculated for each service instance, including: Obtain the average and maximum resource utilization of each service instance, and obtain the average and maximum network latency of each service instance; The first evaluation index is obtained by taking the reciprocal of the predicted response time value; the second evaluation index is obtained by calculating the ratio of the average resource utilization rate to the maximum resource utilization rate; and the third evaluation index is obtained by calculating the ratio of the average network latency to the maximum network latency. The quality score of each service instance is obtained by weighted summation of the first evaluation index, the second evaluation index, and the third evaluation index.

4. The service routing optimization method as described in claim 1, characterized in that, Also includes: Calculate the correlation strength between any two nodes based on the historical consensus records of each node in the blockchain. By connecting two nodes whose association strength is greater than a preset threshold with an edge, an association graph is obtained; Calculate the total association strength of each node in the association graph, and select the N nodes with the highest total association strength as initial nodes; wherein, N is determined based on the number of node groups; Each initial node is used as the starting point for each node group. Based on the correlation strength between each node and each starting point, each node is assigned to a node group. Each node exists in only one node group. When the optimal service instance routing table is requested to be stored in the blockchain, blockchain consensus is performed based on the node group. After the consensus is passed, the optimal service instance routing table is stored in the blockchain.

5. The service routing optimization method as described in claim 4, characterized in that, Based on the correlation strength between each node and each starting point, each node is divided into its respective node group, including: The strong-related nodes of each starting point are traversed sequentially using a breadth-first search algorithm. The strong-related nodes include the nodes that are directly connected to the starting point and have the strongest association. The strongly associated nodes are assigned to the node group corresponding to the starting point, until all nodes directly connected to the starting point have been grouped. Using a depth-first search algorithm, ungrouped nodes are assigned to corresponding node groups based on their association strength.

6. The service routing optimization method as described in claim 4, characterized in that, Based on the node grouping, a blockchain consensus is reached. After the consensus is passed, the optimal service instance routing table is stored in the blockchain, including: Each node performs calculations according to a preset algorithm to obtain the target node that generates the calculation results the fastest, and the target node obtains the accounting permission for the optimal service instance routing table. If the number of target nodes is equal to 1, the nodes where the target node is located are grouped to conduct blockchain consensus. After the consensus is passed, the optimal service instance routing table is stored in the blockchain. If the number of target nodes is greater than 1, the target node group to which each target node belongs is identified. The calculation results of each target node are cross-validated by each node in each target node group. The target node that passes the cross-validation first is taken as the final node. Blockchain consensus is achieved by the node group to which the final node belongs. After consensus is achieved, the optimal service instance routing table is stored in the blockchain.

7. A service routing optimization device, characterized in that, include: The data collection module is used to collect resource status information of each service instance based on the service registration nodes deployed on each service instance; wherein, the service instance represents a device that can provide service capabilities; The prediction module is used to generate predicted response times for each of the service instances based on the resource status information and a pre-trained quality analysis model. The calculation module is used to calculate the quality score of each service instance based on the predicted response time value; The routing optimization module is used to generate an optimal service instance routing table based on the k service instances with the highest quality scores, wherein k ≥ 1.

8. A computer embedded device, comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 6.