Supplementation method and device for micro-service core link service list

By calculating the overlap between the target link and the core link in the microservice system, the core link service list is automatically updated, which solves the problem of inefficient updates in the existing technology, and achieves more efficient and complete core link data updates.

CN119806856APending Publication Date: 2025-04-11MICRO INSURANCE AGENCY LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411693140.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In microservice governance, the update efficiency of core link service list is inefficient, mainly due to the need to sort out the upstream and downstream information between services, which takes a long time.

Method used

By obtaining the target link and the preset core link set in the microservice system, calculate the overlap between the target link and the core link, select the core link with the overlap of greater than the set threshold, and include it in the core link service list.

Benefits of technology

It improves the efficiency of updating the core link service list, avoids omissions when manually sorting out the list, and ensures the integrity of the microservice system dynamically updates the core link data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806856A_ABST
    Figure CN119806856A_ABST
Patent Text Reader

Abstract

The invention relates to a microservice core link service list supplement method and device, and the method comprises the steps: obtaining a target link in a microservice system and a preset core link set, and enabling each link in the target link and the core link set to comprise a plurality of service interfaces; under the condition that the target link is detected to meet a preset triggering condition, calculating the overlap ratio of the target link and each core link in the core link set according to the number of service interfaces in the links and the length of a link sequence; selecting a core link of which the overlap ratio is greater than a set overlap ratio threshold as a matched core link; and the service interfaces which exist in the target link and do not exist in the matched core link are included in a core link service list. According to the invention, the updating efficiency of the core link service list is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of microservice systems, and in particular to a method and device for supplementing a microservice core link service list. Background Art

[0002] In microservice governance, a large number of services are deployed in the system in a scattered manner. New services are constantly generated and old services disappear. Therefore, the list of core link services needs to be updated in real time. The existing technology uses manual confirmation of all services, but the microservice system is very complex. The services in the link have a calling sequence and hierarchical relationship. Manual confirmation requires sorting out the upstream and downstream information between services and then confirming them. Comprehensive confirmation takes a long time, resulting in low efficiency in updating the list of core link services. Summary of the invention

[0003] The present application provides a method and device for supplementing a microservice core link service list to solve the problem of low updating efficiency of the core link service list.

[0004] In a first aspect, the present application provides a method for supplementing a microservice core link service list, the method comprising:

[0005] Acquire a target link and a preset core link set in the microservice system, wherein each link in the target link and the core link set includes multiple service interfaces;

[0006] When it is detected that the target link meets a preset trigger condition, the overlap between the target link and each core link in the core link set is calculated according to the number of service interfaces in the link and the link sequence length;

[0007] Select the core link whose overlap degree is greater than the set overlap degree threshold as the matching core link;

[0008] The service interfaces that exist in the target link but do not exist in the matching core link are included in the core link service list.

[0009] Optionally, calculating the overlap between the target link and each core link in the core link set according to the number of service interfaces in the link and the link sequence length includes:

[0010] Determine the position and interface type of the service interface in the target link, and the position and interface type of the core link service interface in the core link set, wherein the position is used to indicate the calling order and hierarchical relationship between services;

[0011] Determine the intersection sequence length and union sequence length between the target link and the core link according to the location and interface type of the service interface;

[0012] Determine the number of intersection service interfaces and the number of union service interfaces between the target link and the core link according to the location and interface type of the service interface;

[0013] The overlap degree between the target link and the core link is determined according to the intersection sequence length, the union sequence length, the number of the intersection service interfaces, and the number of the union service interfaces.

[0014] Optionally, determining the intersection sequence length and the union sequence length between the target link and the core link according to the position and the interface type of the service interface includes:

[0015] Find the number of service interfaces whose positions and interface types match in the target link and the core link, and use the number of service interfaces as the intersection sequence length;

[0016] All service interfaces in the target link and the core link are extracted, and repeated counts of service interfaces with the same position and interface type are removed, and the number of remaining service interfaces is used as the length of the union sequence.

[0017] Optionally, determining the number of intersection service interfaces and the number of union service interfaces between the target link and the core link according to the location and interface type of the service interface includes:

[0018] Traversing the service interfaces in the target link and the core link, if the interface types of the service interfaces at the same position are the same, recording the service interfaces to obtain the number of intersection service interfaces;

[0019] The service interfaces in the target link and the core link are merged into a set, and the repeated counts of the service interfaces with the same interface type are removed from the set, and the remaining number of service interfaces is used as the number of service interfaces in the union set.

[0020] Optionally, the calculation formula of the overlap degree is:

[0021] Among them, F is the overlap degree, and A1 and A2 are constants.

[0022] Optionally, detecting that the target link meets a preset trigger condition includes:

[0023] Obtaining the calling frequency of the target link and the number of service categories in the target link;

[0024] If the calling frequency is greater than a set frequency threshold, and the number of service categories is greater than a set number threshold, it is determined that the target link meets the preset trigger condition.

[0025] Optionally, after calculating the overlap between the target link and each core link in the core link set according to the number of service interfaces in the link and the link sequence length, the method further includes:

[0026] If the overlap between the target link and any core link is greater than the set overlap threshold, the target link is included in the core link set.

[0027] In a second aspect, the present application provides a device for supplementing a microservice core link service list, the device comprising:

[0028] An acquisition module, used to acquire a target link and a preset core link set in a microservice system, wherein each link in the target link and the core link set includes multiple service interfaces;

[0029] A calculation module, configured to calculate the overlap between the target link and each core link in the core link set according to the number of service interfaces in the link and the length of the link sequence when it is detected that the target link meets a preset trigger condition;

[0030] A selection module, used to select a core link whose overlap is greater than a set overlap threshold as a matching core link;

[0031] The inclusion module is used to include the service interface that exists in the target link but does not exist in the matching core link into the core link service list.

[0032] In a third aspect, the present application provides an electronic device comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus.

[0033] In a fourth aspect, the present application also provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the method for supplementing the microservice core link service list described in any one of the above items of the present application.

[0034] In a fifth aspect, the present application also provides a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the supplementary aspects of the microservice core link service list or the supplementary aspects of the microservice core link service list.

[0035] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art: in the present application, by analyzing the number of service interfaces in the link and the link sequence length, it is identified that the target link matches the core link, and it is considered that the target link also belongs to the core link. Then, the unique service interface in the target link can be included in the core link service list. Compared with manually updating the list, the present application improves the updating efficiency of the core link service list. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0038] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0039] Figure 1 A flow chart of a method for supplementing a microservice core link service list provided in an embodiment of the present application;

[0040] Figure 2 A schematic diagram of the structure of the core link Tc1 provided in an embodiment of the present application;

[0041] Figure 3 A schematic diagram of the structure of the core link Tc2 provided in an embodiment of the present application;

[0042] Figure 4 A schematic diagram of the structure of the core link Tc3 provided in an embodiment of the present application;

[0043] Figure 5 A schematic diagram of the structure of the target link Tm provided in an embodiment of the present application;

[0044] Figure 6 A schematic diagram of the intersection structure of Tm and Tc1 provided in the embodiments of the present application;

[0045] Figure 7 A schematic diagram of the union structure of Tm and Tc1 provided in the embodiments of the present application;

[0046] Figure 8A schematic diagram of the intersection structure of Tm and Tc3 provided in the embodiments of the present application;

[0047] Fig. 9 A schematic diagram of the union structure of Tm and Tc3 provided in the embodiments of the present application;

[0048] Fig.10 A schematic diagram of the structure of a device for supplementing a microservice core link service list provided in an embodiment of the present application;

[0049] Fig.11 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0051] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0052] The present application provides a method for supplementing a microservice core link service list, which is applied to a server to improve the efficiency of updating the core link service list, such as Figure 1 As shown, the method includes:

[0053] Step 101: Obtain a target link and a preset core link set in a microservice system, wherein each link in the target link and the core link set includes multiple service interfaces;

[0054] Step 102: When it is detected that the target link meets the preset trigger condition, the overlap between the target link and each core link in the core link set is calculated according to the number of service interfaces in the link and the link sequence length;

[0055] Step 103: Select a core link whose overlap degree is greater than a set overlap degree threshold as a matching core link;

[0056] Step 104: Add the service interfaces that exist in the target link but do not exist in the matching core link to the core link service list.

[0057] This application provides a batch of core links in advance. After the system detects that the target link meets the trigger conditions, it detects whether it belongs to the core link. The detection method is to match the link according to the sequence length of the link and the number of service interfaces in the link. If the target link belongs to the core link, then the unique service interface in the target link is marked and the service interface is included in the core link service list.

[0058] This application is applicable to microservice scenarios. The microservice architecture is to solve the coupling problem in complex systems by splitting different functional modules into independent microservices to achieve high cohesion and low coupling of services. In this way, when a microservice needs to be modified or expanded, only the service needs to be operated without affecting other services. Therefore, the core link is usually implemented using a microservice architecture.

[0059] This application is applicable to various business processes in microservice scenarios, such as the online insurance purchase process, the links of which include multiple service interfaces such as user authentication, product display, order processing, payment processing, policy generation, risk assessment, policy management, and customer service. The core links include key service interfaces such as order processing, payment processing, and policy generation. These service interfaces are called in a specific order and hierarchy to ensure that users can successfully complete the insurance purchase process. For another example, in the online insurance claims process, the links include multiple service interfaces such as claim application, document upload, claim review, compensation calculation, payment processing, and compensation notification. The core links are claim review and compensation calculation, which are responsible for key steps such as claim review and compensation calculation. These service interfaces are called in a specific order and hierarchy to ensure the smooth progress of the claims process and the accurate calculation of compensation.

[0060] The present application utilizes the call chain information in the full-link tracking system to identify whether new service nodes are added to the core call chain, thereby updating the core link service list, specifically including the following contents: initially setting a set of core links Tc=Tc1~Tcn and target links Tm. According to the characteristics of the full-link call chain, each link corresponds to multiple services with a call order and a hierarchical relationship. The present application pre-sets a set of trigger conditions. The system detects that the target link meets the trigger condition, and compares the target link Tm with each core link in Tc1~Tcn. Specifically, the overlap is calculated based on the link sequence length and the number of service interfaces of the target link and the link sequence length and the number of service interfaces of the core link. When the overlap is greater than the set overlap threshold C, the target link is marked as M and the matching core link Tci is determined. The link marked with M belongs to the core link. The target link is added to the core link Tc, and then the service interface types in the target link Tm and the core link Tci are compared to select the service interface that exists in the target link Tm but not in the core link Tci, and include the service interface in the core link service list.

[0061] The following is an example to explain the service interface of the link. Figure 2 The schematic diagram of the structure of the core link Tc1 includes multiple service interfaces (Method A, Method B, Method C, Method D, Method E, Method F) and the calling relationships between them. First, it can be seen from the figure that Method A is the starting point of the whole process.

[0062] The following describes in detail the calling order and hierarchical relationship of each service:

[0063] Method A: As the starting point, it triggers two sub-service interfaces at the same time, namely Method B and Method C.

[0064] Method B: After being called by Method A, it further calls Method D. This shows that Method B is a middle-layer service. After completing its own task, it still needs to rely on Method D to complete subsequent processing.

[0065] Method C: Similarly, Method C is also called by Method A. After being called by Method A, it further calls MethodE and MethodF.

[0066] Method D: As a subservice of Method B, it is at a lower level in the entire process. The execution of Method D depends on the call of Method B, and it does not call other services.

[0067] Method E: As a subservice of Method C, it is at a lower level in the entire process. The execution of Method E depends on the call of Method C, and it does not call other services.

[0068] Method F: As a sub-service of Method C, it is at a lower level in the entire process. The execution of Method E depends on the call of Method C, and it does not call other services.

[0069] Optionally, the link in this application refers to a series of processing stages formed by multiple services calling each other in a distributed system. Each processing stage contains a start time, an end time, and context information. The call chain can show the calling order and hierarchical relationship between services. The core link involves a collection of necessary services. The lack of any of these services will result in impaired functionality.

[0070] Optionally, the core link set in this application can be manually set or automatically generated by the system. If it is manually set, a batch of core links are manually selected and then included in a set; if it is automatically generated, a matching rule can be pre-set, and when the parameters in the link meet the matching rule, the link is automatically marked, determined to be a core link, and included in the core link set.

[0071] Optionally, the link sequence length in this application refers to the number of all service interfaces included in the link sequence, and can also be regarded as the length of the service interface sequence, for example Figure 2 If there are 6 service interfaces, the link sequence length is 6.

[0072] Optionally, the number of service interfaces in the present application is the number of service interfaces with non-repeated interface types in the link sequence. For example, if there are two service interfaces MethodR with the same interface type but different positions in the link, the number of MethodR is recorded as 1.

[0073] In this application, by analyzing the number of service interfaces in the link and the length of the link sequence, it is identified that the target link matches the core link, and the target link is considered to be a core link. Then the unique service interface in the target link can be included in the core link service list. Compared with the manual update list, this application improves the update efficiency of the core link service list. In addition, this application can also avoid missing core services when manually sorting the list, and ensure the integrity of the core link data dynamically updated by the microservice system.

[0074] As an optional implementation, in step 102, calculating the overlap between the target link and each core link in the core link set according to the number of service interfaces in the link and the link sequence length includes:

[0075] Step S201: Determine the position and interface type of the service interface in the target link, and the position and interface type of the core link service interface in the core link set, wherein the position is used to indicate the calling order and hierarchical relationship between services;

[0076] Step S202: determining the intersection sequence length and union sequence length between the target link and the core link according to the location and interface type of the service interface;

[0077] Step S203: Determine the number of intersection service interfaces and the number of union service interfaces between the target link and the core link according to the location and interface type of the service interface;

[0078] Step S204: Determine the overlap between the target link and the core link according to the intersection sequence length, the union sequence length, the intersection service interface quantity and the union service interface quantity.

[0079] The system parses each service interface in the link and records the location and interface type (e.g., the name or identifier of the service) of each service interface. The location is used to indicate the calling order and hierarchical relationship between services, e.g. Figure 2 In the example, MethodB's position can be described as: it is called by MethodA and also calls MethodD. The interface type is used to distinguish services, such as MethodA, MethodB, and MethodC.

[0080] The system compares the service interfaces in the target link Tm and the core link Tc one by one from beginning to end. If the service interfaces in the same position of the two links are the same, the service interface is recorded. The number of service interfaces with matching positions and the same service interfaces is counted and recorded as the intersection sequence length. The intersection sequence length reflects the number of service interfaces with matching positions and the same type in the two links, indicating the similarity of the two links in terms of order and hierarchy.

[0081] The length of the union sequence reflects the length of the minimum sequence covering all service interfaces in the two links, indicating the comprehensive length of the two links. The system merges all service interfaces in the target link Tm and the core link Tc into a set, removes duplicate service interfaces, and counts the number of union service interfaces. The number of union service interfaces reflects the number of all different service interfaces in the two links, indicating the comprehensive diversity of the two links at the service interface level.

[0082] The formula for calculating the overlap is as follows:

[0083] Among them, F is the overlap degree, and A1 and A2 are constants.

[0084] The higher the overlap value, the higher the similarity between the target link Tm and the core link Tc. The overlap value can be used to determine whether the target link is part of the core link, thereby deciding whether to add it to the core link set.

[0085] Through these steps and calculations, the core link service list can be effectively identified and updated, ensuring the dynamic update of the system and the integrity of the core link data.

[0086] In step S202, the specific process of determining the intersection sequence length and union sequence length between the target link and the core link based on the position and interface type of the service interface includes: finding the number of service interfaces whose positions and interface types match in the target link and the core link, and taking the number of service interfaces as the intersection sequence length; extracting all service interfaces in the target link and the core link, and removing the repeated counts of service interfaces with the same position and interface type, and taking the remaining number of service interfaces as the union sequence length.

[0087] First, we need to find the number of service interfaces whose positions and interface types match in the target link and the core link. This means that we need to find those service interfaces that exist in both links and have the same position and interface type. The number of these matching service interfaces will be used as the intersection sequence length, which represents the length of the common service interface part between the target link and the core link, reflecting the common points in structure and function between the two links. In order to calculate the intersection sequence length, we can traverse each service interface in the target link and the core link and compare their positions and interface types. If the positions and interface types of the two service interfaces are the same, then they can be considered to be matched, and this matching service interface is counted in the intersection sequence length. Finally, the number of all matching service interfaces is added up to get the intersection sequence length.

[0088] Next, it is necessary to extract all service interfaces in the target link and the core link, and remove service interfaces with repeated positions and interface types. The purpose of the union sequence length is to show the total number of unique service interfaces after the two links are merged, which reflects the comprehensive diversity of the two links in terms of service interfaces. This indicator helps to understand the functional differences and complementarities of the two links. In order to calculate the union sequence length, all service interfaces in the target link and the core link can be extracted to form a set containing all service interfaces. Then, each service interface in this set can be traversed and checked whether it also exists in the other link and has the same position and interface type. If a service interface exists in both links and has the same position and interface type, it is counted only once. Finally, the number of remaining service interfaces is added to obtain the union sequence length.

[0089] The intersection sequence length and the union sequence length are important indicators for measuring the relationship between the target link and the core link. The intersection sequence length focuses on the common points of the two links, while the union sequence length focuses on the diversity of the two links. Through these two indicators, we can more comprehensively understand and analyze the relationship between the target link and the core link. Through the above steps, the intersection sequence length and the union sequence length can be accurately calculated, thereby providing basic data for the subsequent overlap calculation. These data can help determine whether the target link is part of the core link, so as to update the core link service list.

[0090] In step S203, the number of intersection service interfaces and the number of union service interfaces between the target link and the core link are determined based on the location and interface type of the service interface, including: traversing the service interfaces in the target link and the core link, and if the interface types of the service interfaces at the same location are the same, recording the service interfaces to obtain the number of intersection service interfaces; merging the service interfaces in the target link and the core link into a set, and removing the repeated counts of service interfaces with the same interface type from the set, and taking the remaining number of service interfaces as the number of union service interfaces.

[0091] First, the specific location and interface type of the service interface in each link need to be clarified. Next, the service interfaces in the target link Tm and the core link Tc1 are traversed. During the traversal process, if the service interfaces at the same location are found to have the same interface type, the service interface is recorded. In this way, the number of intersection service interfaces of the two links can be calculated. In order to calculate the number of union service interfaces, the service interfaces in the target link Tm and the core link Tc1 need to be merged into a set, and then the counts of repeated interface types are removed from this set. The remaining number of service interfaces is the number of union service interfaces.

[0092] For example, Figure 2is a schematic diagram of the structure of the core link Tc1. Figure 3 is a schematic diagram of the structure of the core link Tc2, Figure 4 is a schematic diagram of the structure of the core link Tc3, Figure 5 The structure diagram of the target link Tm is shown in Figure 1. By calculating the intersection and union of Tm with Tc1, Tc2 and Tc3 respectively, the intersection sequence length, union sequence length, intersection service interface number and union service interface number can be calculated.

[0093] The service interface sequence of the core link Tc1 and the target link Tm is described below. Figure 2 and Figure 5 It can be converted into the following service interface sequence.

[0094] Core link Tc1:

[0095] Target link Tm:

[0096] It can be seen that the positions of service interfaces A, B, C, D, and E are all the same, so the intersection service interface sequence of Tc1 and Tm can be calculated based on the multiple service interfaces, and the intersection service interface sequence can be converted into Figure 6 The intersection structure diagram of Tm and Tc1 in FIG. 1 can also be used to calculate the union service interface sequence of Tc1 and Tm through multiple service interfaces. The intersection service interface sequence can be converted into Figure 7 Schematic diagram of the union structure of Tm and Tc1.

[0097] Intersection service interface sequence of Tc1 and Tm:

[0098] The union service interface sequence of Tc1 and Tm:

[0099] exist Figure 6 In the example, the length of the intersection sequence of Tm and Tc1 is the number of repeated service interfaces, that is, the length of the intersection sequence is 5, and the number of intersection service interfaces is also 5.

[0100] Figure 7 In the example, the length of the union sequence is the number of all service interfaces, that is, the length of the union sequence is 7, and the number of union service interfaces is also 7.

[0101] Therefore, the overlap between Tm and Tc1 is:

[0102] Similarly, the intersection service interface sequence of Tc2 and Tm can also be calculated. Tc2 and Tm have no intersection; and the union service interface sequence of Tc2 and Tm can be calculated. The length of the union sequence and the number of union service interfaces are both 12.

[0103] Therefore, the overlap between Tm and Tc2 is:

[0104] Similarly, the intersection service interface sequence of Tc3 and Tm can also be calculated, such as Figure 8 As shown, the intersection sequence length and the number of intersection service interfaces are both 3; and the union service interface sequence of Tc3 and Tm is calculated, as Fig. 9 As shown, the length of the union sequence is 9, but there are two MethodDs in the union service interface. The interface types of these two MethodDs are repeated and need to be counted as one. Therefore, the number of union service interfaces is 8.

[0105] Therefore, the overlap between Tm and Tc3 is:

[0106] Assume A1 = 0.6, A2 = 0.4, then F M1 =0.714, F M2 =0, F M3 =0.35.

[0107] A1 and A2 are set in order to calculate the overlap degree F. The specific values ​​of A1 and A2 are set by technicians based on experience.

[0108] Assuming that the overlap threshold C is set to 0.67, then only F M1 is greater than C, therefore, the overlap between Tc1 and Tm is greater than the set overlap threshold C, Tm is a core link, and the additional interface type of Tm compared to Tc1 is the service interface MethodG, so MethodG is included in the core link set.

[0109] As an optional implementation, detecting that the target link meets the preset trigger condition includes: obtaining the calling frequency of the target link and the number of service categories in the target link; if the calling frequency is greater than the set frequency threshold and the number of service categories is greater than the set number threshold, it is determined that the target link meets the preset trigger condition.

[0110] In this application, call frequency refers to the number of times the target link is called within a certain time range. For example, if it is observed that the Tm link has been called 1000 times in the past month, then this is the call frequency. The time range of the call frequency includes but is not limited to: seconds, minutes, hours, days, weeks, etc.

[0111] The number of service categories refers to the number of different service categories involved in the target link. For example, a Tm link may involve multiple service categories such as user authentication, payment processing, and data storage.

[0112] If the call frequency is greater than the set frequency threshold, and the number of service categories is greater than the set number threshold, it can be determined that the target link meets the preset trigger condition. For example, the set frequency threshold is 500 times, the number threshold is 3 service categories, and since the call frequency of the Tm link is 1000 times and the number of service categories is 4, it meets the preset trigger condition.

[0113] Based on the same technical concept, the present application provides a method for supplementing a microservice core link service list, comprising the following steps.

[0114] Step 1: Obtain the target link Tm and the preset core link set Tc.

[0115] Step 2: Detect that the calling frequency of the target link is greater than the set frequency threshold and the number of service categories is greater than the set number threshold, confirming that the preset trigger condition is met.

[0116] Step 3: Determine the intersection sequence length and union sequence length between the target link and the core link according to the location and interface type of the service interface.

[0117] Step 4: Determine the number of intersection service interfaces and the number of union service interfaces between the target link and the core link according to the location and interface type of the service interface.

[0118] Step 5: Calculate the overlap:

[0119]

[0120] Step 6: If the overlap degree F is greater than the set overlap degree threshold C, the target link Tm is included in the core link set Tc.

[0121] Step 7: Add the service interfaces that exist in the target link but not in the matching core link to the core link service list.

[0122] In the related art, it is necessary to fully confirm all services under the name, even if the call chain of the service itself has not changed, confirmation is required. This application omits this step and improves computing efficiency.

[0123] Correspondingly, the present application also provides a method for deleting a core link service list. The core link set Tc is dynamically updated. If a core link Tn is removed from the set Tc, it is necessary to determine the service interface that only exists in the link Tn but not in other core links in the set Tc, and then delete the service interface from the core link service list.

[0124] Based on the same technical concept, the present application provides a device for supplementing a microservice core link service list. Fig.10 As shown, the device comprises:

[0125] The acquisition module 1001 is used to acquire a target link and a preset core link set in the microservice system, wherein each link in the target link and the core link set includes multiple service interfaces;

[0126] The calculation module 1002 is used to calculate the overlap between the target link and each core link in the core link set according to the number of service interfaces in the link and the length of the link sequence when it is detected that the target link meets the preset trigger condition;

[0127] A selection module 1003 is used to select a core link whose overlap is greater than a set overlap threshold as a matching core link;

[0128] The inclusion module 1004 is used to include the service interface that exists in the target link but does not exist in the matching core link into the core link service list.

[0129] Optionally, the calculation module 1002 is used to:

[0130] Determine the location and interface type of the service interface in the target link, and the location and interface type of the core link service interface in the core link set, wherein the location is used to indicate the calling order and hierarchical relationship between services;

[0131] Determine the intersection sequence length and union sequence length between the target link and the core link according to the location and interface type of the service interface;

[0132] Determine the number of intersection service interfaces and the number of union service interfaces between the target link and the core link according to the location and interface type of the service interface;

[0133] The overlap between the target link and the core link is determined according to the intersection sequence length, the union sequence length, the number of intersection service interfaces, and the number of union service interfaces.

[0134] Optionally, the calculation module 1002 is specifically configured to:

[0135] Find the number of service interfaces whose positions and interface types match in the target link and the core link, and use the number of service interfaces as the intersection sequence length;

[0136] Extract all service interfaces in the target link and the core link, remove duplicate counts of service interfaces with the same position and interface type, and use the number of remaining service interfaces as the length of the union sequence.

[0137] Optionally, the calculation module 1002 is specifically configured to:

[0138] Traverse the service interfaces in the target link and the core link. If the interface types of the service interfaces at the same position are the same, record the service interfaces and obtain the number of intersection service interfaces.

[0139] The service interfaces in the target link and the core link are merged into a set, and the repeated counts of the service interfaces with the same interface type are removed from the set, and the remaining number of service interfaces is used as the number of service interfaces in the union set.

[0140] Optionally, the calculation formula of the overlap degree is:

[0141] Among them, F is the overlap degree, and A1 and A2 are constants.

[0142] Optionally, the calculation module 1002 is used to:

[0143] Obtain the call frequency of the target link and the number of service categories in the target link;

[0144] If the calling frequency is greater than the set frequency threshold and the number of service categories is greater than the set number threshold, it is determined that the target link meets the preset trigger condition.

[0145] Optionally, the device is also used for:

[0146] If the overlap between the target link and any core link is greater than the set overlap threshold, the target link is included in the core link set.

[0147] like Fig.11 As shown, an embodiment of the present application provides an electronic device, including a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, wherein the processor 1101, the communication interface 1102, and the memory 1103 communicate with each other through the communication bus 1104.

[0148] The memory 1103 is used to store computer programs.

[0149] In one embodiment of the present application, the processor 1101 is used to implement the method for supplementing the microservice core link service list provided by any one of the aforementioned method embodiments when executing the program stored in the memory 1103.

[0150] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the method for supplementing the microservice core link service list provided in any of the aforementioned method embodiments are implemented.

[0151] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the method provided in various optional implementations of the supplementary aspects of the microservice core link service list or the supplementary aspects of the microservice core link service list.

[0152] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0154] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0155] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for supplementing a microservice core link service list, characterized in that: The method comprises: Acquire a target link and a preset core link set in the microservice system, wherein each link in the target link and the core link set includes multiple service interfaces; When it is detected that the target link meets a preset trigger condition, the overlap between the target link and each core link in the core link set is calculated according to the number of service interfaces in the link and the link sequence length; Select the core link whose overlap degree is greater than the set overlap degree threshold as the matching core link; The service interfaces that exist in the target link but do not exist in the matching core link are included in the core link service list.

2. The method according to claim 1, characterized in that: Calculating the overlap between the target link and each core link in the core link set according to the number of service interfaces in the link and the link sequence length includes: Determine the position and interface type of the service interface in the target link, and the position and interface type of the core link service interface in the core link set, wherein the position is used to indicate the calling order and hierarchical relationship between services; Determine the intersection sequence length and union sequence length between the target link and the core link according to the location and interface type of the service interface; Determine the number of intersection service interfaces and the number of union service interfaces between the target link and the core link according to the location and interface type of the service interface; The overlap degree between the target link and the core link is determined according to the intersection sequence length, the union sequence length, the number of the intersection service interfaces, and the number of the union service interfaces.

3. The method according to claim 2, characterized in that Determining the intersection sequence length and the union sequence length between the target link and the core link according to the position and the interface type of the service interface includes: Find the number of service interfaces whose positions and interface types match in the target link and the core link, and use the number of service interfaces as the intersection sequence length; All service interfaces in the target link and the core link are extracted, and repeated counts of service interfaces with the same position and interface type are removed, and the number of remaining service interfaces is used as the length of the union sequence.

4. The method according to claim 2, characterized in that: Determining the number of intersection service interfaces and the number of union service interfaces between the target link and the core link according to the location and interface type of the service interface includes: Traversing the service interfaces in the target link and the core link, if the interface types of the service interfaces at the same position are the same, recording the service interfaces to obtain the number of intersection service interfaces; The service interfaces in the target link and the core link are merged into a set, and the repeated counts of the service interfaces with the same interface type are removed from the set, and the remaining number of service interfaces is used as the number of service interfaces in the union set.

5. The method according to claim 2, characterized in that: The calculation formula of the overlap degree is: Among them, F is the overlap degree, and A1 and A2 are constants.

6. The method according to claim 1, characterized in that Detecting that the target link meets a preset trigger condition includes: Obtaining the calling frequency of the target link and the number of service categories in the target link; If the calling frequency is greater than a set frequency threshold, and the number of service categories is greater than a set number threshold, it is determined that the target link meets the preset trigger condition.

7. The method according to claim 1, characterized in that After calculating the overlap between the target link and each core link in the core link set according to the number of service interfaces in the link and the link sequence length, the method further includes: If the overlap between the target link and any core link is greater than the set overlap threshold, the target link is included in the core link set.

8. A device for supplementing a microservice core link service list, characterized in that: The device comprises: An acquisition module, used to acquire a target link and a preset core link set in a microservice system, wherein each link in the target link and the core link set includes multiple service interfaces; A calculation module, configured to calculate the overlap between the target link and each core link in the core link set according to the number of service interfaces in the link and the length of the link sequence when it is detected that the target link meets a preset trigger condition; A selection module, used to select a core link whose overlap is greater than a set overlap threshold as a matching core link; The inclusion module is used to include the service interface that exists in the target link but does not exist in the matching core link into the core link service list.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-7 when executing a program stored in a memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.