Business capability calling method and device, computer device and storage medium
By selecting target service capabilities with high idle rates in a distributed service capability network, the problems of resource waste and service interruption are solved, achieving efficient resource utilization and service stability.
Patent Information
- Application Number
- CN202411996097.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2044-12-31
AI Technical Summary
In a distributed service capability network, traditional service capability selection methods lead to resource waste and service interruption risks, and fail to effectively utilize idle resources.
The business management server responds to business capability call requests, obtains target sniffing nodes and initiates business capability query requests, selects target business capabilities with idle rates greater than or equal to preset idle rates, and calls them using the target business capability address information.
It improves the overall utilization of resources in the distributed service capability network, reduces the probability of idleness and the risk of service interruption, and ensures the continuity and reliability of services.
Smart Images

Figure CN119697264B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of wireless communication and terminal, and particularly relates to a service capability calling method and device, computer equipment and storage medium. BACKGROUND
[0002] With the development of distributed service capability technology, the demand for calling various types of service capabilities of new applications under the distributed service capability network gradually increases. However, when selecting service capabilities in the distributed service capability network, the traditional scheme is to select the service capability with the strongest capability to ensure the rapid implementation of the application. However, the way of selecting the service capability in this way will cause the waste of resources of other service capabilities. SUMMARY
[0003] Therefore, it is necessary to provide a service capability calling method and device, computer equipment and storage medium capable of improving resource utilization.
[0004] In a first aspect, the present application provides a service capability calling method applied to a service management server for managing a distributed service capability network, comprising:
[0005] In response to a service capability calling request, obtaining a service capability type of a service capability to be called from the service capability calling request;
[0006] According to the service capability type, obtaining a target sniffing node, and initiating a service capability query request to the target sniffing node; the service capability query request is used to request the target sniffing node to obtain service capability address information of a target service capability, the target service capability belongs to service capabilities within a sniffing range of the target sniffing node, and an idle rate of the target service capability is greater than or equal to a preset idle rate;
[0007] According to the service capability address information, initiating calling to the target service capability.
[0008] In one of the embodiments, a plurality of sniffing nodes are arranged in the distributed service capability network; and the obtaining of the target sniffing node according to the service capability type comprises:
[0009] Obtaining a sniffing node address list matched with the service capability type from a pre-stored sniffing node management information table; the sniffing node management information table is used to store an association relationship between sniffing node address information and service capability types;
[0010] According to the sniffing node address list, obtaining the target sniffing node.
[0011] In one of the embodiments, the obtaining of the target sniffing node according to the sniffing node address information comprises:
[0012] obtaining a routing distance between each address information of the sniffing node address list and the address information corresponding to the service capability invocation request;
[0013] taking the sniffing node corresponding to the address information of the sniffing node address list with the minimum routing distance as the target sniffing node.
[0014] In one of the embodiments, after the step of initiating the service capability query request to the target sniffing node, the method further comprises:
[0015] obtaining the service capability query result returned by the target sniffing node, and removing the address information of the sniffing node corresponding to the target sniffing node from the sniffing node address list in the case that the service capability query result indicates that no address information of the target service capability is found within the sniffing range of the target sniffing node.
[0016] returning to the step of obtaining the target sniffing node according to the sniffing node address list until the service capability query result indicates that the address information of the target service capability is found within the sniffing range of the target sniffing node.
[0017] In a second aspect, the application further provides a service capability invocation method applied to a sniffing node in a distributed service capability network, comprising:
[0018] In one of the embodiments, in response to a service capability query request initiated by a service management server, obtaining an idle rate of service capability within a sniffing range; the service capability query request is generated by the service management server in response to a target sniffing node obtained according to a service capability type of a service capability to be invoked in a service capability invocation request;
[0019] obtaining a service capability address set with an idle rate greater than or equal to a preset idle rate, and obtaining address information of a target service capability according to the service capability address set;
[0020] returning the address information of the target service capability to the service management server.
[0021] In one of the embodiments, the service capability query request contains address information corresponding to the service capability invocation request.
[0022] The step of obtaining the address information of the target service capability according to the service capability address set comprises:
[0023] obtaining a routing distance between each address information of the service capability address set and the address information corresponding to the service capability invocation request;
[0024] obtaining the service capability address information corresponding to the minimum routing distance, and obtaining the service capability address information of the target service capability according to the service capability address information corresponding to the minimum routing distance.
[0025] In one of the embodiments, the obtaining of the service capability address information of the target service capability according to the service capability address information corresponding to the minimum routing distance comprises:
[0026] determining the service capability to be checked according to the service capability address information corresponding to the minimum routing distance, and obtaining the availability query result of the service capability to be checked;
[0027] in a case where the availability query result represents that the service capability to be checked is available, determining the service capability address information corresponding to the minimum routing distance as the service capability address information of the target service capability;
[0028] in a case where the availability query result represents that the service capability to be checked is unavailable, removing the service capability address information corresponding to the minimum routing distance from the service capability address set, and returning to execute the step of obtaining the service capability address information corresponding to the minimum routing distance until the availability query result represents that the service capability to be checked is available, or there is no service capability address information in the service capability address set.
[0029] In one of the embodiments, after the returning to execute the step of obtaining the service capability address information corresponding to the minimum routing distance, the method further comprises:
[0030] in a case where there is no service capability address information in the service capability address set, returning a service capability query result to the service management server, the service capability query result being used to represent that no service capability address information of the target service capability is queried within the sniffing range.
[0031] In a third aspect, the application further provides a service capability calling device applied to a service management server for managing a distributed service capability network, the device comprising:
[0032] a type obtaining module, configured to obtain a service capability type of a service capability to be called from a service capability calling request in response to the service capability calling request;
[0033] a request sending module, configured to obtain a target sniffing node according to the service capability type, and initiate a service capability query request to the target sniffing node, the service capability query request being used to request the target sniffing node to obtain service capability address information of a target service capability, the target service capability belonging to service capabilities within a sniffing range of the target sniffing node, and an idle rate of the target service capability being greater than or equal to a preset idle rate.
[0034] The capability invoking module is configured to initiate a call to the target service capability according to the service capability address information.
[0035] In a fourth aspect, the present application provides a service capability invoking device applied to a sniffing node in a distributed service capability network, and the device comprises:
[0036] The idle rate obtaining module is configured to obtain an idle rate of the service capability within the sniffing range in response to a service capability query request initiated by the service management server, wherein the service capability query request is generated by the target sniffing node according to a service capability type of the service capability to be invoked in the service capability invoking request after the service management server responds to the service capability invoking request.
[0037] The address obtaining module is configured to obtain a service capability address set of the service capability with an idle rate greater than or equal to a preset idle rate, and obtain the service capability address information of the target service capability according to the service capability address set.
[0038] The address returning module is configured to return the service capability address information of the target service capability to the service management server.
[0039] In a fifth aspect, the present application provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in the first aspect or the second aspect when executing the computer program.
[0040] In a sixth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program implements the steps of the method in the first aspect or the second aspect when executed by a processor.
[0041] The business capability calling method, device, computer device and storage medium, the business management server obtains a business capability type of a to-be-called business capability from the business capability calling request in response to the business capability calling request; the business management server obtains a target sniffing node according to the business capability type, and initiates a business capability query request to the target sniffing node; the business capability query request is used to request the target sniffing node to obtain business capability address information of a target business capability, the target business capability belongs to a business capability in a sniffing range of the target sniffing node, and an idle rate of the target business capability is greater than or equal to a preset idle rate; and the business management server initiates calling to the target business capability according to the business capability address information. After responding to the business capability calling request, the application initiates the business capability query request to the target sniffing node matched with the business capability type, to request the target sniffing node to obtain the business capability address information of the target business capability with the idle rate greater than or equal to the preset idle rate in the sniffing range, so that the business management server can call the business capability with the high idle rate through the business capability address information of the target business capability, effectively balance the calling frequency of each capability in the distributed business capability network, improve the overall utilization rate of the business capability resources in the distributed business capability network, and reduce the idle probability of the business capability resources in the distributed business capability network. In addition, the service interruption risk caused by frequent calling of the same high-load business capability can be reduced, and the continuity and reliability of the service are ensured. BRIEF DESCRIPTION OF DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application or the related art. Obviously, the drawings in the following description only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0043] Figure 1 An application environment diagram of the business capability calling method in an embodiment;
[0044] Figure 2 A flowchart of the business capability calling method in an embodiment;
[0045] Figure 3 A flowchart of the step of obtaining the target sniffing node according to the business capability type in an embodiment;
[0046] Figure 4 A flowchart of the step of obtaining the target sniffing node according to the sniffing node address list in an embodiment;
[0047] Figure 5 A flowchart of the business capability calling method in another embodiment;
[0048] Figure 6 A flowchart of a step of obtaining service capability address information of a target service capability according to the above service capability address set in an embodiment;
[0049] Figure 7 An application environment diagram of a service capability calling method in another embodiment;
[0050] Figure 8 A flowchart of a service capability calling method in yet another embodiment;
[0051] Figure 9 A flowchart of a step of sniffing a type of service capability corresponding to a node area according to a query request message in an embodiment;
[0052] Figure 10 A structural block diagram of a service capability calling device in an embodiment;
[0053] Figure 11 A structural block diagram of a service capability calling device in another embodiment;
[0054] Figure 12 An internal structure diagram of a computer device in an embodiment. DETAILED DESCRIPTION
[0055] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0056] The service capability calling method provided by the embodiments of the present application can be applied in an application environment as shown in Figure 1 The service management server 102 communicates with the sniffing nodes 104 through a network, the service management server 102 is used to manage a distributed service capability network, and a plurality of sniffing nodes 104 are located in the distributed service capability network, each sniffing node 104 has a respective sniffing range, as shown in Figure 1As shown in FIG. 1, the sniffing node 104 is connected with adjacent service capabilities and can sniff the service capabilities within its sniffing range; the distributed service capability network can be a system composed of multiple service capability instances distributed in different locations of the network, which can provide various types of service functions. The service management server 102 obtains the service capability type of the service capability to be invoked from the service capability invocation request in response to the service capability invocation request; the service management server 102 obtains the target sniffing node (one of the sniffing nodes 104) according to the service capability type and initiates a service capability query request to the target sniffing node; the service capability query request is used to request the target sniffing node to obtain the service capability address information of the target service capability, the target service capability belongs to the service capabilities within the sniffing range of the target sniffing node, and the idle rate of the target service capability is greater than or equal to the preset idle rate; the service management server 102 initiates invocation to the target service capability according to the service capability address information. The service management server 102 can be a physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0057] In an exemplary embodiment, as shown in FIG. 1, a service capability invocation method is provided, which is applied to the service management server 102 in FIG. 1 for example, and includes the following steps S202 to S206. Figure 2 Figure 1 As shown in FIG. 1, a service capability invocation method is provided, which is applied to the service management server 102 in FIG. 1 for example, and includes the following steps S202 to S206.
[0058] Step S202, in response to a service capability invocation request, obtaining the service capability type of the service capability to be invoked from the service capability invocation request.
[0059] The service capability invocation request can be a request of an application program or other system to access a specific service function in the distributed service capability network, and the request can contain the service capability type of the service capability to be invoked, wherein the application program can be a third-party application program. The service capability type can be the category of different types of service capabilities, which corresponds to the specific service function of the service capability.
[0060] For example, the service management server receives a service capability invocation request initiated by a third-party application or other system, and then parses the service capability invocation request to extract the service capability type of the service capability to be invoked.
[0061] Step S204, obtaining a target sniffing node according to the service capability type, and initiating a service capability query request to the target sniffing node; wherein the service capability query request is used to request the target sniffing node to obtain service capability address information of a target service capability, the target service capability belongs to service capabilities within a sniffing range of the target sniffing node, and an idle rate of the target service capability is greater than or equal to a preset idle rate.
[0062] The sniffing node can be a monitoring node distributed in the distributed service capability network; the target sniffing node can be a sniffing node matching the service capability type, for example, there is a service capability matching the service capability type in service capabilities within a sniffing range of the sniffing node A, that is, the sniffing node A can be considered as a target sniffing node. The service capability query request is a request sent by the service management server to the target sniffing node, which is used to request the target sniffing node to find and return service capability address information of a target service capability meeting the condition. The service capability address information can be location information containing a specific service capability instance or path information of an access path, based on which the service management server can accurately locate and call the target service capability. The sniffing range can be a distribution range of service capabilities that can be monitored or detected by the sniffing node. The idle rate can be a probability that the service capability is not called within a set time period, and can also be a proportional relationship between a time when the service capability is not used and the set time period. The preset idle rate can be a standard value set in advance, which is used by the user to measure whether the service capability has reached the idle condition set in advance, and the service capability needs to be called in time so that the resource can be applied to improve the resource utilization.
[0063] Exemplarily, the service management server determines a plurality of sniffing nodes matching the service capability type according to the service capability type, can determine a target sniffing node from the plurality of sniffing nodes, and then sends a service capability query request to the target sniffing node to request the target sniffing node to return service capability address information of a target service capability meeting the condition; after the target sniffing node receives the service capability query request, finds a service capability with an idle rate greater than or equal to a preset idle rate in service capabilities corresponding to the service capability type within the sniffing range, takes the service capability as the target service capability, and returns the service capability address information of the target service capability to the service management server initiating the request.
[0064] Step S206, initiating a call to the target service capability according to the service capability address information.
[0065] Exemplarily, after the service management server receives the service capability address information of the target service capability returned by the target sniffing node, sends a call instruction to the target service capability according to the service capability address information, and executes the call to the target service capability.
[0066] In the above service capability calling method, after responding to the service capability calling request, the service capability query request is initiated to the target sniffing node matched with the service capability type, so that the target sniffing node obtains the service capability address information of the target service capability with the idle rate greater than or equal to the preset idle rate within the sniffing range, thereby the service management server can call the service capability with high idle rate through the service capability address information of the target service capability, effectively balance the calling frequency of each capability in the distributed service capability network, improve the overall utilization rate of the service capability resources in the distributed service capability network, and reduce the idle probability of the service capability resources in the distributed service capability network. In addition, the service interruption risk caused by frequent calling of the same high-load service capability can be reduced, and the continuity and reliability of the service can be ensured.
[0067] In an exemplary embodiment, a plurality of sniffing nodes are arranged in the above distributed service capability network; as shown in the figure, Figure 3 As shown, the target sniffing node obtained according to the service capability type in step S204 can specifically include steps S302 to S304. Wherein:
[0068] Step S302, obtaining the sniffing node address list matched with the service capability type from the pre-stored sniffing node management information table; wherein the sniffing node management information table is used to store the association relationship between the sniffing node address information and the service capability type.
[0069] Wherein, the pre-stored sniffing node management information table can refer to the association relationship between the address information of the sniffing node and the service capability type monitored by each sniffing node, for example, the address information of the sniffing node A is associated with the service capability type a, the service capability type c and the service capability type e, the address information of the sniffing node B is associated with the service capability type b, the service capability type d and the service capability type e, here only for example, without actual limitation, in actual application, the association can be made according to the actual situation. The pre-stored sniffing node management information table can be stored in the service management server, and the service management can be called and looked up quickly.
[0070] Wherein, the sniffing node address list can refer to the list containing a plurality of sniffing node address information obtained from the sniffing node management information table, and the sniffing node address information in the list is matched with the service capability type. The sniffing node address information can point to the position of the sniffing node in the distributed service capability network, and the communication with the sniffing node can be established through the sniffing node address information.
[0071] Exemplarily, the service management server calls a pre-stored sniffing node management information table, queries the association relationship in the sniffing node management information table through the service capability type, acquires the sniffing node address information matched with the service capability type and forms a list.
[0072] In step S304, the target sniffing node is acquired according to the above-mentioned sniffing node address list.
[0073] Exemplarily, the sniffing node address list contains sniffing node address information A, sniffing node address information B and sniffing node address information C, the service management server selects the appropriate sniffing node address information from the acquired sniffing node address list, for example, the geographic distance, load and the like can be considered to select, if the sniffing node address information B is taken as the sniffing node address information of the target sniffing node, the target sniffing node is acquired through the sniffing node address information B.
[0074] In the embodiment, through the correspondence between the sniffing node address information and the service capability type in the sniffing node management information table, the service management server can quickly locate the sniffing node responsible for the specific service capability type, improve the resource locating efficiency, and further provide the basis for improving the resource calling efficiency.
[0075] In one exemplary embodiment, as shown in Figure 4 The above-mentioned step S304 can specifically include the following steps:
[0076] In step S402, the routing distance between each sniffing node address information in the above-mentioned sniffing node address list and the address information corresponding to the above-mentioned service capability calling request is acquired.
[0077] In step S404, the sniffing node corresponding to the sniffing node address information with the minimum routing distance is taken as the above-mentioned target sniffing node.
[0078] The routing distance can refer to the network distance of two network nodes in a computer network, the smaller the routing distance, the lower the network delay from the request initiation place to the target sniffing node; in the embodiment, the routing distance can refer to the network distance between the sniffing node corresponding to the sniffing node address information and the network node corresponding to the service capability calling request initiation place.
[0079] Exemplarily, the service management server acquires address information corresponding to the service capability invocation request, and determines a network node corresponding to a source of the service capability invocation request according to the address information; the service management server acquires address information of each sniffing node in the sniffing node address list, and then calculates a routing distance between a sniffing node corresponding to the address information of the sniffing node and the network node corresponding to the source of the service capability invocation request according to the address information of each sniffing node; the sniffing node with the minimum routing distance is taken as a target sniffing node, and then the service management server can establish a communication connection with the target sniffing node according to the address information of the sniffing node of the target sniffing node, so as to prepare to send a service capability query request to the target sniffing node through the communication connection.
[0080] In the embodiment, the sniffing node with the minimum routing distance to the user who initiates the service capability invocation request is selected, the target service capability determined through the sniffing node also has a smaller routing distance to the user due to the sniffing range of the sniffing node, so that data transmission delay in a possible subsequent service capability use process is reduced, and the response speed and service quality of the service management server are improved.
[0081] In an exemplary embodiment, after the step of initiating the service capability query request to the target sniffing node in step S204, the method can further include the following steps:
[0082] In step S51, the service capability query result returned by the target sniffing node is acquired, and in the case that the service capability query result represents that no service capability address information of the target service capability is queried in the sniffing range of the target sniffing node, the address information of the sniffing node corresponding to the target sniffing node is removed from the sniffing node address list.
[0083] In step S52, the step of acquiring the target sniffing node according to the sniffing node address list is returned to be executed until the service capability query result represents that the service capability address information of the target service capability is queried in the sniffing range of the target sniffing node.
[0084] The service capability query result can be a query result obtained after the target sniffing node receives the service capability query request and performs corresponding sniffing operation on the service capability in the sniffing range. The service capability query result representing that no service capability address information of the target service capability is queried in the sniffing range of the target sniffing node can mean that the sniffing node performs query in the sniffing range, but no target service capability meeting the condition is queried.
[0085] In the above embodiment, the service management server removes the address information of the target sniffing node from the list of sniffing node addresses, which means that when the target sniffing node fails to find a service capability that meets the condition within its sniffing range, the service management server removes the address information of the current target sniffing node from the list of sniffing node addresses, so as to narrow the search range when a new target sniffing node is confirmed.
[0086] In an exemplary embodiment, after the service management server initiates a service capability query request to the target sniffing node, the target sniffing node returns a service capability query result to the service management server. In the case that the service capability query result indicates that the target sniffing node fails to find the target service capability within its sniffing range, the service management server removes the address information of the target sniffing node that fails to find the target service capability from the list of sniffing node addresses. Then the service management server returns to the previous step and continues to perform the step of obtaining the target sniffing node according to the list of sniffing node addresses, i.e., the step S304. The above steps are repeated until the service capability query result indicates that the target sniffing node finds the target service capability within its sniffing range, that is, until there is a target sniffing node that returns valid address information of the target service capability.
[0087] In the above embodiment, by dynamically adjusting the selection of the sniffing node, even if a certain sniffing node fails to provide the service required by the service capability query request, the service management server can still find other sniffing nodes to meet the service capability query request. By removing the address information of the sniffing node that fails to provide valid service capability, the speed of finding the target service capability is accelerated.
[0088] In an exemplary embodiment, as shown in Figure 5 , a service capability calling method is also provided. The method is applied to the sniffing node 104 in Figure 1 , and includes the following steps S502 to S506. In the method:
[0089] In step S502, the idle rate of the service capability within the sniffing range is obtained in response to a service capability query request initiated by the service management server. The service capability query request is generated by the service management server in response to a service capability calling request, and is based on the type of the service capability to be called in the service capability calling request.
[0090] In the above embodiment, the service management server removes the address information of the target sniffing node from the list of sniffing node addresses, which means that when the target sniffing node fails to find a service capability that meets the condition within its sniffing range, the service management server removes the address information of the current target sniffing node from the list of sniffing node addresses, so as to narrow the search range when a new target sniffing node is confirmed.
[0091] The service capability invocation request can be a request of an application program or other system to access a specific service function in the distributed service capability network, and the request can include a service capability type of the service capability to be invoked. The application program can be a third-party application program. The service capability type can be a category of different kinds of service capabilities, and corresponds to a specific service function of the service capability. The target sniffing node can be a sniffing node that matches the service capability type. For example, if there is a service capability in the sniffing range of the sniffing node A that matches the service capability type, the sniffing node A can be considered as the target sniffing node. The service capability query request is a request sent by the service management server to the target sniffing node, and is used to require the target sniffing node to find and return the service capability address information of the target service capability that meets the condition. The sniffing range can be a distribution range of service capabilities that can be monitored or detected by the sniffing node. The idle rate can be a probability that the service capability is not invoked within a set time period, and can also be a proportional relationship between the time that the service capability is not used and the set time period.
[0092] Exemplarily, when the service management server initiates the service capability query request, the corresponding sniffing node receives the request, that is, the target sniffing node receives the request. The target sniffing node initiates sniffing on the service capabilities in the sniffing range thereof, and collects the idle rates of all the service capabilities in the sniffing range.
[0093] In step S504, a service capability address set with an idle rate greater than or equal to a preset idle rate is obtained, and service capability address information of the target service capability is obtained according to the service capability address set.
[0094] The preset idle rate can be a standard value preset in advance, and is used to measure whether the service capability has reached a preset idle condition, and needs to be invoked in time to make the resource be applied, so as to improve the resource utilization rate.
[0095] The service capability address set can be a list of service capability addresses that meet the following condition after being screened, and the condition can be that the idle rates of the service capabilities corresponding to the service capability address information are greater than or equal to the preset idle rate.
[0096] The service capability address information can include location information of a specific service capability instance or path information of an access path thereof, and the service management server can accurately locate and invoke the target service capability based on the service capability address information of the target service capability.
[0097] Exemplarily, the sniffing node screens according to the idle rates of all service capabilities in the sniffed range, determines service capabilities with idle rates greater than or equal to a preset idle rate, and then forms service capability address information of the service capabilities into a service capability address set. Then, the sniffing node determines one service capability address information in the service capability address set as service capability address information of the target service capability.
[0098] In step S506, the service capability address information of the target service capability is returned to the service management server.
[0099] Exemplarily, the sniffing node returns the service capability address information of the target service capability to the service management server, and the service management server can invoke the target service capability according to the service capability address information of the target service capability.
[0100] In this embodiment, the sniffing node uses the preset idle rate as a screening condition, ensures that only when the idle rate of a service capability is greater than or equal to the preset idle rate, the service capability has a chance to be invoked, and can fully utilize resources with high idle rates, thereby improving the effective utilization rate of overall resources.
[0101] In one exemplary embodiment, the service capability query request contains address information corresponding to the service capability invocation request. Figure 6 As shown in the figure, the step S504 of obtaining the service capability address information of the target service capability according to the service capability address set can include the following steps.
[0102] In step S602, the route distance between each service capability address information in the service capability address set and the address information corresponding to the service capability invocation request is obtained.
[0103] The route distance in this embodiment can refer to the network distance between two network nodes in a computer network. The smaller the route distance is, the lower the network delay from the request initiation location to the network node corresponding to the service capability. In this embodiment, the route distance can refer to the network distance between the network node corresponding to the service capability address information and the network node corresponding to the service capability invocation request initiation location.
[0104] Exemplarily, the sniffing node obtains each service capability address information from the service capability address set. For each service capability address information, the network distance between the network node corresponding to the service capability address information and the network node corresponding to the service capability invocation request initiation location is calculated as the route distance.
[0105] In step S604, the service capability address information corresponding to the minimum route distance is obtained, and the service capability address information of the target service capability is obtained according to the service capability address information corresponding to the minimum route distance.
[0106] Exemplarily, the sniffing node compares all the obtained routing distances, finds the minimum routing distance, and obtains the service capability address information corresponding to the minimum routing distance, and takes the service capability address information corresponding to the minimum routing distance as the service capability address information of the target service capability.
[0107] In this embodiment, by calculating the routing distance and selecting the minimum value, the network delay between the requester of the subsequent service capability invocation request and the target service capability to be invoked is reduced, and the response rate of the service capability invocation is improved.
[0108] In an exemplary embodiment, the step S604 of obtaining the service capability address information of the target service capability according to the service capability address information corresponding to the minimum routing distance can specifically include the following steps:
[0109] Step S71, determining the service capability to be verified according to the service capability address information corresponding to the minimum routing distance, and obtaining the availability query result of the service capability to be verified.
[0110] The service capability to be verified can be a specific service capability determined by the service capability address information corresponding to the minimum routing distance, but needs to be verified for availability to ensure that the service capability is available. The availability query result can be a feedback on the availability state of the service capability to be verified.
[0111] Exemplarily, the sniffing node determines the specific service capability identified by the service capability address information corresponding to the minimum routing distance as the service capability to be verified, and then initiates an availability query to the service capability to be verified, requests it to return the current availability state, that is, obtains the availability query result of the service capability to be verified.
[0112] Step S72, in the case that the availability query result represents that the service capability to be verified is available, determining the service capability address information corresponding to the minimum routing distance as the service capability address information of the target service capability.
[0113] Exemplarily, the sniffing node receives the availability query result and judges, in the case that the availability query result represents that the service capability to be verified is available, determines the service capability address information corresponding to the minimum routing distance as the address of the target service capability, that is, in the case that the service capability to be verified is normally available, takes it as the target service capability.
[0114] Step S73, in the case that the availability query result represents that the to-be-checked service capability is unavailable, removing the service capability address information corresponding to the minimum routing distance from the service capability address set, and returning to execute the step of acquiring the service capability address information corresponding to the minimum routing distance until the availability query result represents that the to-be-checked service capability is available, or there is no service capability address information in the service capability address set.
[0115] Exemplarily, the sniffing node receives the availability query result and judges, in the case that the availability query result represents that the to-be-checked service capability is unavailable, removes the service capability address information corresponding to the minimum routing distance from the service capability address set, after which the sniffing node re-executes the step of acquiring the service capability address information corresponding to the minimum routing distance, that is, needs to determine the service capability address information corresponding to the minimum routing distance in the service capability address set after removal, and then performs the corresponding availability query again, until the availability query result represents that the to-be-checked service capability is available, or there is no available service capability address information in the service capability address set, that is, stops the above-mentioned loop process when a to-be-checked service capability is found to be available, or stops the above-mentioned loop process when no to-be-checked service capability is found to be available and because the unavailable service capability address information is removed, there is no service capability address information in the service capability address set.
[0116] In this embodiment, through the availability checking mechanism, it is ensured that only the truly available service capability is selected as the target service capability, avoiding the risk of service interruption caused by selecting a faulty or overloaded service instance, and improving the reliability of service capability invocation service.
[0117] In an exemplary embodiment, after the step of returning to execute the step of acquiring the service capability address information corresponding to the minimum routing distance performed in the above-mentioned step S73, there can further be included a step of: in the case that there is no service capability address information in the service capability address set, returning a service capability query result to the service management server, the service capability query result being used to represent that no service capability address information of the target service capability is queried within the sniffing range.
[0118] Exemplarily, in the case that the sniffing node determines that there is no service capability address information in the service capability address set, the sniffing node can return a service capability query result to the service management server, which can be used to represent that the current sniffing node has not queried the service capability address information of the target service capability within the sniffing range.
[0119] In the embodiment, when the sniffing node cannot find the service capability meeting the condition, the sniffing node feeds back the condition to the service management server in time, avoids unnecessary waiting time, and improves the response speed and service efficiency of the service management server.
[0120] In an exemplary embodiment, the application further provides a service capability calling system, which comprises a service capability management platform (i.e., a service management server) and a sniffing node. The service capability calling system can be applied to an application environment as shown in Figure 7 The service capability management platform can comprise a service capability calling module and a service capability management module. The sniffing node and various service capabilities are located in a service capability development environment (i.e., a distributed service capability network). As shown in the figure, the service capabilities within the sniffing range of the sniffing node S1 can comprise service capability E1, service capability E2, and service capability E3. The service capabilities within the sniffing range of the sniffing node S2 can comprise service capability E4 and service capability E5. The service capabilities within the sniffing range of the sniffing node Sx can comprise service capability Ey. In the service capability development environment, a sniffing node is added. The address information of the service capability meeting the calling type and the preset idle rate requirement is obtained through the nearest route query. In the service management platform, a service capability management module is added. The service capability information from the service development environment is received, stored, and updated. The address list of the sniffing node where the service capability meeting the calling request is located is fed back to the service capability calling module. In the service management platform, a service capability calling module is added. Based on the service capability type required by the third-party application, the service capability meeting the idle rate requirement is selected and called. The capability calling frequency in the open service system can be effectively balanced, and the resource utilization rate can be improved.
[0121] Specifically, based on the above service capability calling system, the service capability selection process is described in combination with the processes shown in Figure 7 and Figure 8 The service capability selection process can comprise the following steps.
[0122] In step S71, a service capability calling request is sent. The third-party application sends a service capability calling request to the service capability calling module. The request message carries the service capability type required for calling.
[0123] In step S72, a service capability calling request is sent. The service capability calling module sends a service capability calling request to the service capability management module. The request message carries the service capability type required for calling.
[0124] In step S73, a calling response message is returned. The service capability management module returns a calling response message to the service capability calling module. The response message carries the sniffing node address list to which the service capability required for calling belongs.
[0125] Step S74, initiate service capability query request. The service capability calling module initiates a service capability query request to the sniffing node closest to the routing address of the address list, and the request message carries the type of service capability to be called.
[0126] Step S75, sniffing. The sniffing node initiates sniffing on the service capability in the region, and queries the idle rate of the service capability meeting the calling type.
[0127] Step S76, return query response message. The sniffing node returns a query response message to the service capability calling module, and the response message carries the service capability address information (service capability address information of the target service capability) meeting the preset idle rate and closest to the routing.
[0128] Step S77, initiate calling. The service capability calling module initiates calling to the service capability corresponding to the service capability address information.
[0129] Step S78, return calling response message. The service capability calling module returns a calling response message to the third-party application.
[0130] In the above service capability calling method and system:
[0131] 1. Add a service capability calling module and a service capability management module in the service capability management platform, and add a sniffing node in the service capability development environment.
[0132] 2. The third-party application initiates a service capability calling request to the service capability management module through the service capability calling module.
[0133] 3. The service capability management module is responsible for receiving, storing and updating service capability information from the service development environment, and supports feeding back the address list of the sniffing node where the service capability meeting the calling request is located to the service capability calling module.
[0134] 4. The service capability calling module initiates a service capability query request to the sniffing node closest to the routing address according to the address list returned by the service capability management module, and the request message carries the type of service capability to be called.
[0135] 5. The sniffing node sniffs the service capability of the corresponding type in the node region according to the query request message, and feeds back the service capability address information meeting the preset idle rate requirement and closest to the routing to the service capability calling module.
[0136] Wherein, the implementation process is specifically as follows Figure 9The service management server initiates a service capability query request to the sniffing node Sx closest to the address in the address list (sniffing node address list), the sniffing node initiates a broadcast to the service capability set E1 in the area (sniffing range) where the sniffing node is located, if there is a subset E2 in the service capability set E1 that meets the preset idle rate requirement, the service capability closest to the subset E2 is queried for availability, if the service capability Ey is available, the address information of the service capability Ey is returned; if there is no subset E2 in the service capability set E1 that meets the preset idle rate requirement, the sniffing node S1 is deleted from the address list, if the address list is empty, the process is ended, if the address list is not empty, the step of initiating a service capability query request to the sniffing node Sx closest to the address in the address list (sniffing node address list) is returned; after the service capability closest to the subset E2 is queried for availability, if the service capability Ey is not available, the Ey is deleted from the subset E2, if the subset E2 is not an empty set at this time, the step of querying the availability of the service capability closest to the subset E2 is returned, if the subset E2 is an empty set at this time, the step of deleting the sniffing node S1 from the address list is executed until the process is ended.
[0137] 6. The service capability calling module initiates a call to the service capability where the address is located.
[0138] 7. If the sniffing node closest to the route does not have a service capability that meets the preset idle rate requirement, the service capability calling module continues to repeat the above steps 4-6 in the next sniffing node closest to the route in the address list.
[0139] New applications under the future network will need to call various types of service capabilities to achieve, under the open service system, the calling mode and efficiency of distributed service capabilities are directly related to the rapid generation of applications, and the same type of service capability can be provided by several different capability developers, there are differences in processing capabilities between service capabilities, how to select the optimal service capability is one of the problems to be solved. In the selection of service capabilities, the traditional method is to select the service capability with the strongest processing capability to ensure the rapid implementation of the application, but this will cause the service capability with strong processing capability to be frequently called, especially for applications that need to continuously call to establish a connection, which will cause congestion to the server where the service capability is located, affecting the processing efficiency; while for other service capability servers of the same type, the idle rate is too high, causing resource waste. Moreover, centralized calling of the service capabilities of several leading developers is not conducive to the balanced development of the open service system. Therefore, the present application proposes a service capability calling method and system, which can call the service capability that meets the preset idle rate requirement from the area where the distributed node closest to the route is located according to the application demand, solving the problem of idle distributed service capability resources under the open service system.
[0140] It should be understood that although the steps in the flowcharts involved in the embodiments described above are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other orders. Moreover, at least some of the steps in the flowcharts involved in the embodiments described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of the steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or steps or stages in other steps.
[0141] Based on the same inventive concept, the embodiments of the present application also provide a service capability calling device for implementing the service capability calling method described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more service capability calling device embodiments provided below can refer to the limitations of the service capability calling method described above, and will not be repeated here.
[0142] In an exemplary embodiment, as shown in Figure 10 A service capability calling device 800 is provided, applied to a service management server for managing a distributed service capability network, and includes a type acquisition module 801, a request sending module 802, and a capability calling module 803, wherein:
[0143] The type acquisition module 801 is configured to acquire a service capability type of a service capability to be called from a service capability calling request in response to the service capability calling request.
[0144] The request sending module 802 is configured to acquire a target sniffing node according to the service capability type, and initiate a service capability query request to the target sniffing node; the service capability query request is used to request the target sniffing node to acquire service capability address information of a target service capability, the target service capability belongs to service capabilities within a sniffing range of the target sniffing node, and an idle rate of the target service capability is greater than or equal to a preset idle rate.
[0145] The capability calling module 803 is configured to initiate calling to a target service capability according to the service capability address information.
[0146] In an example embodiment, the distributed service capability network is provided with a plurality of sniffing nodes; the request sending module 802 is further configured to acquire a list of sniffing node addresses matching the service capability type from a pre-stored sniffing node management information table; the sniffing node management information table is configured to store an association between sniffing node address information and service capability type; and the target sniffing node is acquired according to the list of sniffing node addresses.
[0147] In an example embodiment, the request sending module 802 is further configured to acquire a routing distance between each sniffing node address information in the list of sniffing node addresses and address information corresponding to the service capability invocation request; and the sniffing node corresponding to the sniffing node address information with the minimum routing distance is taken as the target sniffing node.
[0148] In an example embodiment, the service capability invocation apparatus further includes a loop acquisition module configured to acquire a service capability query result returned by the target sniffing node, remove, in a case where the service capability query result indicates that no target service capability address information is queried within the sniffing range of the target sniffing node, the sniffing node address information corresponding to the target sniffing node from the list of sniffing node addresses, and return to execute the step of acquiring the target sniffing node according to the list of sniffing node addresses until the service capability query result indicates that target service capability address information is queried within the sniffing range of the target sniffing node.
[0149] In an example embodiment, as shown in Figure 11 A service capability invocation apparatus 900 is provided, which is applied to a sniffing node in a distributed service capability network and includes an idle rate acquisition module 901, an address acquisition module 902, and an address return module 903, wherein:
[0150] The idle rate acquisition module 901 is configured to acquire an idle rate of service capability within a sniffing range in response to a service capability query request initiated by a service management server; the service capability query request is generated by the service management server according to a target sniffing node acquired in response to a service capability invocation request and based on a service capability type of a service capability to be invoked in the service capability invocation request;
[0151] The address acquisition module 902 is configured to acquire a service capability address set with an idle rate greater than or equal to a preset idle rate, and acquire service capability address information of a target service capability according to the service capability address set;
[0152] The address return module 903 is configured to return the service capability address information of the target service capability to the service management server.
[0153] In an example embodiment, the address information corresponding to the service capability invocation request is included in the service capability query request; the address obtaining module 902 is further configured to obtain a routing distance between each service capability address information in the service capability address set and the address information corresponding to the service capability invocation request; obtain the service capability address information corresponding to the minimum routing distance; and obtain the service capability address information of the target service capability according to the service capability address information corresponding to the minimum routing distance.
[0154] In an example embodiment, the address obtaining module 902 is further configured to determine a service capability to be verified according to the service capability address information corresponding to the minimum routing distance, and obtain an availability query result of the service capability to be verified; in a case where the availability query result indicates that the service capability to be verified is available, determine the service capability address information corresponding to the minimum routing distance as the service capability address information of the target service capability; in a case where the availability query result indicates that the service capability to be verified is unavailable, remove the service capability address information corresponding to the minimum routing distance from the service capability address set, and return to the step of obtaining the service capability address information corresponding to the minimum routing distance until the availability query result indicates that the service capability to be verified is available, or there is no service capability address information in the service capability address set.
[0155] In an example embodiment, the service capability invocation apparatus further includes a query result feedback module configured to, in a case where there is no service capability address information in the service capability address set, return a service capability query result to the service management server, the service capability query result being used to indicate that no service capability address information of the target service capability is found within the sniffing range.
[0156] Each of the modules in the service capability invocation apparatus can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the modules can be embedded in or independent of a processor in the computer device in hardware form, or stored in a memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each of the modules.
[0157] In an example embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in FIG. 8. Figure 12As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with the terminal outside through the network connection. The computer program is executed by the processor to implement a service capability invocation method.
[0158] Those skilled in the art can understand that, Figure 12 The skilled in the art can understand that,
[0159] In one embodiment, a computer device is also provided, including a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0160] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by the processor to implement the steps in the above method embodiments.
[0161] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by the processor to implement the steps in the above method embodiments.
[0162] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0163] The technical features of the above embodiments can be combined in any manner. To make the description concise, all possible combinations of the technical features in the above embodiments are not described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.
[0164] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.
Claims
1. A service capability invocation method, characterized by, A method applied to a service management server for managing a distributed service capability network, the method comprising: in response to a service capability invocation request, obtaining a service capability type of a service capability to be invoked from the service capability invocation request; obtaining a sniffer node address list matched with the service capability type from a pre-stored sniffer node management information table, the sniffer node management information table being used to store an association relationship between sniffer node address information and a service capability type, a plurality of sniffer nodes being provided in the distributed service capability network, a routing distance between each sniffer node address information in the sniffer node address list and address information corresponding to the service capability invocation request being obtained, a sniffer node corresponding to sniffer node address information of a minimum routing distance being taken as a target sniffer node, and a service capability query request being initiated to the target sniffer node, the service capability query request being used to request the target sniffer node to obtain service capability address information of a target service capability, the target service capability belonging to service capabilities within a sniffing range of the target sniffer node, and an idle rate of the target service capability being greater than or equal to a preset idle rate; initiating invocation to the target service capability according to the service capability address information.
2. The method of claim 1, wherein, after the service capability query request is initiated to the target sniffer node, the method further comprises: obtaining a service capability query result returned by the target sniffer node, and in a case where the service capability query result indicates that no service capability address information of the target service capability is queried within the sniffing range of the target sniffer node, removing sniffer node address information corresponding to the target sniffer node from the sniffer node address list; returning to the step of obtaining the target sniffer node according to the sniffer node address list until the service capability query result indicates that service capability address information of the target service capability is queried within the sniffing range of the target sniffer node.
3. A service capability invocation method, characterized by, A method applied to a sniffer node in a distributed service capability network, the method comprising: in response to a service capability query request initiated by a service management server, obtaining an idle rate of a service capability within a sniffing range, the service capability query request being generated according to a target sniffer node obtained by the service management server in response to a service capability invocation request, the service capability query request containing address information corresponding to the service capability invocation request; obtain a service capability address set with an idle rate greater than or equal to a preset idle rate, obtain a routing distance between each service capability address information in the service capability address set and address information corresponding to the service capability invocation request, obtain service capability address information corresponding to a minimum routing distance, determine a service capability to be verified according to the service capability address information corresponding to the minimum routing distance, and obtain an availability query result of the service capability to be verified; in a case where the availability query result represents that the service capability to be verified is available, determine the service capability address information corresponding to the minimum routing distance as service capability address information of a target service capability; in a case where the availability query result represents that the service capability to be verified is unavailable, remove the service capability address information corresponding to the minimum routing distance from the service capability address set, and return to performing the step of obtaining service capability address information corresponding to a minimum routing distance until the availability query result represents that the service capability to be verified is available, or there is no service capability address information in the service capability address set; return the service capability address information of the target service capability to the service management server.
4. The method of claim 3, wherein, After the step of returning to performing the step of obtaining service capability address information corresponding to a minimum routing distance, the method further includes: in a case where there is no service capability address information in the service capability address set, return a service capability query result to the service management server, the service capability query result being used to represent that no service capability address information of a target service capability is queried within a sniffing range.
5. A service capability invocation apparatus, characterized by, A service management server applied to manage a distributed service capability network, the device includes: a type obtaining module configured to obtain a service capability type of a service capability to be invoked from a service capability invocation request in response to the service capability invocation request; a request sending module configured to obtain a sniffing node address list matched with the service capability type from a pre-stored sniffing node management information table, the sniffing node management information table being used to store an association relationship between sniffing node address information and a service capability type, a plurality of sniffing nodes being arranged in the distributed service capability network, obtain a routing distance between each sniffing node address information in the sniffing node address list and address information corresponding to the service capability invocation request, and take a sniffing node corresponding to sniffing node address information with a minimum routing distance as a target sniffing node, and initiate a service capability query request to the target sniffing node, the service capability query request being used to request the target sniffing node to obtain service capability address information of a target service capability, the target service capability belonging to a service capability within a sniffing range of the target sniffing node, and an idle rate of the target service capability being greater than or equal to a preset idle rate; a capability invocation module configured to initiate invocation to a target service capability according to the service capability address information.
6. A service capability invocation apparatus, characterized by, A sniffing node applied to a distributed service capability network, the device includes: The idle rate obtaining module is configured to obtain an idle rate of the service capability within the sniffing range in response to a service capability query request initiated by the service management server; the service capability query request is generated by the service management server in response to a service capability invocation request, according to a target sniffing node obtained from a service capability type of the service capability to be invoked in the service capability invocation request; the service capability query request contains address information corresponding to the service capability invocation request; The address obtaining module is configured to obtain a service capability address set with an idle rate greater than or equal to a preset idle rate, obtain a routing distance between each service capability address information in the service capability address set and the address information corresponding to the service capability invocation request, obtain service capability address information corresponding to a minimum routing distance, determine a service capability to be checked according to the service capability address information corresponding to the minimum routing distance, and obtain an availability query result of the service capability to be checked; in a case where the availability query result represents that the service capability to be checked is available, the service capability address information corresponding to the minimum routing distance is determined as service capability address information of a target service capability; in a case where the availability query result represents that the service capability to be checked is unavailable, the service capability address information corresponding to the minimum routing distance is removed from the service capability address set, and the step of obtaining service capability address information corresponding to a minimum routing distance is returned to be executed until the availability query result represents that the service capability to be checked is available, or there is no service capability address information in the service capability address set; The address returning module is configured to return the service capability address information of the target service capability to the service management server. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6 when the computer program is executed by the processor. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 4.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 4.
9. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 4.
Citation Information
Patent Citations
Business processing method and device and storage medium
CN116016221A
Service processing method and device, network equipment and storage medium
CN116112572A