CN110597572B - Service call relation analysis method and computer system - Google Patents

Service call relation analysis method and computer system Download PDF

Info

Publication number
CN110597572B
CN110597572B CN201810607670.8A CN201810607670A CN110597572B CN 110597572 B CN110597572 B CN 110597572B CN 201810607670 A CN201810607670 A CN 201810607670A CN 110597572 B CN110597572 B CN 110597572B
Authority
CN
China
Prior art keywords
service
services
name
calling
computer system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810607670.8A
Other languages
Chinese (zh)
Other versions
CN110597572A (en
Inventor
叶玉婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201810607670.8A priority Critical patent/CN110597572B/en
Publication of CN110597572A publication Critical patent/CN110597572A/en
Application granted granted Critical
Publication of CN110597572B publication Critical patent/CN110597572B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention provides a service call relation analysis method and a computer system, which are used for solving the technical problems that a large amount of system resources are consumed for determining the service call condition in the computer system and the analysis speed is slow in the prior art. The method comprises the following steps: updating the name of each service according to the mutual calling process of a plurality of services when the computer system runs, wherein the name of each service represents the calling relation between the service and other services; and analyzing the calling relation among the services according to the updated names of the services so as to determine the service use condition in the computer system.

Description

Service calling relation analysis method and computer system
Technical Field
The invention relates to the technical field of computers, in particular to a service calling relation analysis method and a computer system.
Background
In a computer system, various business functions are realized by executing services, and one business function usually needs a plurality of services to be mutually called to complete. With the complexity of business functions, the calling among the services becomes more common, and the reusability of the services is fully embodied. But in turn, service invocation conditions in computer systems are becoming more difficult to determine accurately.
In the prior art, service calling situations in a computer system are determined by analyzing monitoring logs in the computer system. However, the data volume of the monitoring log in the computer system is very large, the process of extracting the call information from the large monitoring log consumes a large amount of system resources, and the analysis speed is slow.
Disclosure of Invention
The embodiment of the invention provides a service calling relation analysis method and a computer system, which are used for solving the technical problems that a large amount of system resources are required to be consumed and the analysis speed is slow when the service calling condition in the computer system is determined in the prior art.
In a first aspect, a service invocation relation analysis method is provided, which is applied to a computer system including multiple services, and includes:
updating the name of each service according to the calling process among the services when the computer system runs, wherein the name of each service represents the calling relationship between the service and other services;
and analyzing the calling relation among the services according to the updated names of the services so as to determine the service use condition in the computer system.
In a possible implementation manner, each of the plurality of services includes a preset original name, and updating the name of each service according to a mutual calling process of the plurality of services when the computer system runs includes:
aiming at any service in the plurality of services, combining an original name of the service and an original name of a service called by the service into a new name by a preset naming rule, wherein the preset naming rule comprises an arrangement rule and a separation rule among the original names;
and updating the name of any service to be the new name.
In a possible implementation manner, updating the name of each service according to a mutual calling process of the plurality of services when the computer system runs includes:
at least one message transmitted among the plurality of services carries calling chain information, and each service adds the original name of the service to the calling chain information according to the preset naming rule when being called;
generating a calling tree according to at least one piece of calling chain information carried in the at least one message after the plurality of services are called, wherein the calling tree represents a calling relation among the plurality of services;
and combining the original name of any service and the original name of the service called by any service into the new name according to the calling tree.
In a possible implementation manner, before the updating the name of any service to be the new name, the method further includes:
determining whether the number of times of combining the new name in the computer system reaches a preset number of times;
if yes, updating the name of any service to be the new name;
otherwise, ending the current updating of the name of any service.
In a possible implementation manner, according to the updated names of the services, analyzing the calling relationship among the services to determine the service usage in the computer system, including one or more of the following:
determining a service directly called and a service indirectly called by a first service in the plurality of services according to the updated names of the plurality of services, and determining a call chain of the first service according to the service directly called and the service indirectly called by the first service;
determining a service for directly calling the first service and a service for indirectly calling the first service in the plurality of services according to the updated names of the plurality of services, and determining a called chain of the first service according to the service for directly calling the first service and the service for indirectly calling the first service;
determining a total number of services associated with a first service in the plurality of services according to the updated names of the plurality of services, and determining a ratio of the total number to the number of the plurality of services as the dependency of the computer system on the first service, wherein the services associated with the first service comprise a service directly calling the first service, a service indirectly calling the first service, a service directly called by the first service and a service indirectly called by the first service;
and determining the calling relationship among the services according to the updated names of the services, and generating a panoramic view of service calling in the computer system according to the calling relationship.
In a possible implementation manner, the computer system includes a plurality of service centers, wherein each service center includes a preset service center name, each service center includes one or more services in the plurality of services, and an original name of each of the plurality of services is composed of a service center name of a service center to which each service belongs and an identifier preset for each service.
In a possible implementation manner, according to the updated names of the services, analyzing the calling relationship among the services to determine the service usage in the computer system, including one or more of the following:
determining the number of services which are called by a second service center in the services which belong to a first service center according to the updated names of the services, wherein the first service center and the second service center are any two service centers in the service centers;
and determining the number of calling services belonging to a second service center in the services belonging to a first service center according to the updated names of the services, and determining that the ratio of the number to the total number of the services belonging to the first service center is the dependency of the first service center on the second service center, wherein the first service center and the second service center are any two service centers in the service centers.
In a second aspect, there is provided a computer system, the computer system comprising a plurality of services, the computer system further comprising:
the naming module is used for updating the name of each service according to the calling process among the services when the computer system runs, wherein the name of each service represents the calling relation between the service and other services;
and the analysis module is used for analyzing the calling relation among the services according to the updated names of the services so as to determine the service use condition in the computer system.
In one possible implementation manner, each of the plurality of services includes a preset original name, and the naming module is configured to:
aiming at any service in the plurality of services, combining an original name of the service and an original name of a service called by the service into a new name by a preset naming rule, wherein the preset naming rule comprises an arrangement rule and a separation rule among the original names;
and updating the name of any service to be the new name.
In one possible implementation, the naming module is configured to:
at least one message transmitted among the plurality of services carries calling chain information, and each service adds the original name of the service to the calling chain information according to the preset naming rule when being called;
generating a calling tree according to at least one piece of calling chain information carried in the at least one message after the plurality of services are called, wherein the calling tree represents a calling relation among the plurality of services;
and combining the original name of any service and the original name of the service called by any service into the new name according to the calling tree.
In one possible implementation, the naming module is further configured to:
before updating the name of any service to be the new name, determining whether the number of times of combining the new name in the computer system reaches a preset number of times;
if yes, updating the name of any service to be the new name;
otherwise, ending the current updating of the name of any service.
In one possible implementation, the analysis module is configured to perform one or more of the following:
determining a service directly called by a first service and a service indirectly called by the first service in the plurality of services according to the updated names of the plurality of services, and determining a call chain of the first service according to the service directly called by the first service and the service indirectly called by the first service;
determining a service for directly calling the first service and a service for indirectly calling the first service in the plurality of services according to the updated names of the plurality of services, and determining a called chain of the first service according to the service for directly calling the first service and the service for indirectly calling the first service;
determining a total number of services associated with a first service in the plurality of services according to the updated names of the plurality of services, and determining a ratio of the total number to the number of the plurality of services as the dependency of the computer system on the first service, wherein the services associated with the first service comprise a service directly calling the first service, a service indirectly calling the first service, a service directly called by the first service and a service indirectly called by the first service;
and determining the calling relationship among the services according to the updated names of the services, and generating a panoramic view of service calling in the computer system according to the calling relationship.
In a possible implementation manner, the computer system includes a plurality of service centers, where each service center includes a preset service center name, each service center includes one or more services in the plurality of services, and an original name of each of the plurality of services is composed of a service center name of a service center to which each service belongs and an identifier preset for each service.
In one possible implementation, the analysis module is configured to perform one or more of the following:
determining the number of services which are called by a second service center in the services which belong to a first service center according to the updated names of the services, wherein the first service center and the second service center are any two service centers in the service centers;
and determining the number of the services which are called by the second service center in the services belonging to the first service center according to the updated names of the services, and determining the ratio of the number to the total number of the services belonging to the first service center as the dependency of the first service center on the second service center, wherein the first service center and the second service center are any two service centers in the service centers.
In a third aspect, a computer device is provided, the computer device comprising:
at least one processor, and
a memory coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, and the at least one processor performs the method of the first aspect or any implementation manner of the first aspect by executing the instructions stored by the memory.
In a fourth aspect, a computer-readable storage medium is provided, comprising:
the computer readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method of the first aspect or any implementation manner of the first aspect.
In the embodiment of the invention, the name of each service is updated according to the mutual calling process of a plurality of services when the computer system runs, and the calling relation among the services is analyzed according to the updated names of the services to determine the service use condition in the computer system, wherein the name of each service represents the calling relation between the service and other services. The name of the service is used for representing the calling relationship between the service and other services, so that the calling relationship of each service in the computer system can be known by analyzing the name of each service in the computer system, and the service use condition in the computer system is determined.
Moreover, the names of the services are easy to obtain and the data volume is small, so that the calculation complexity is low when the calling relation between the services is analyzed according to the service names, the efficiency is high, the occupied system resources are small, and the response speed of a computer system is not influenced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flow chart of a service invocation relationship analysis method in an embodiment of the present invention;
FIG. 2 is a diagram illustrating a call relationship between services according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating a relationship between a service center and a service according to an embodiment of the present invention;
FIG. 4 is a panoramic view of a call chain in a computer system according to an embodiment of the present invention;
fig. 5 is a block diagram of a computer system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in this document generally indicates that the preceding and following related objects are in an "or" relationship unless otherwise specified. It is to be understood that the terms first, second, etc. used in the description of the embodiments of the invention are used for distinguishing between similar elements and not necessarily for describing a sequential or chronological order.
Example one
The embodiment of the invention provides a service calling relation analysis method which can be applied to a computer system comprising a plurality of services. For example, the computer system may be a data center, a distributed system, a cluster, a physical server, a cloud server, a computer, a cell phone, a wearable device, and the like.
For a better understanding of the method in the embodiments of the present invention, the following detailed description will be made with reference to the drawings and specific embodiments.
Referring to fig. 1, a flow of the service invocation relationship analysis method in the embodiment of the present invention is described as follows:
step 101: and updating the name of each service according to the mutual calling process of a plurality of services when the computer system runs, wherein the name of each service represents the calling relation between the service and other services.
Step 102: and analyzing the calling relationship among the services according to the updated names of the services to determine the service use condition in the computer system.
In the embodiment of the invention, the name of each service in the computer system consists of an original name of the service and a service calling relationship. The original name of the service can play a role in identifying the service and can also be used for representing the basic attribute of the service; and a service invocation relationship may represent the invocation relationship of the service with other services.
In one possible embodiment, the original name of the service may include an identifier preset by the service, for example, the identifier may be a number, such as a combination of arabic numbers and/or letters, or a character string, such as a character representing an operation mode, an operation entity, a service scope, or a service granularity of the service, and the like.
Specifically, for example, the identifier preset by the service may be named by using a hump naming method of verb + noun, wherein the verb is all lower case, and the noun initial is upper case. For example, it may be determined that the preset identifier of the service that creates the customer information is createccustomer.
In another possible embodiment, the original name of the service may include, in addition to the identifier of the service preset, a service center name of a service center to which the service belongs, that is, the original name of the service may be composed of the service center name of the service center to which the service belongs and the identifier of the service preset. In particular, the computer system may include a plurality of business centers, each with a pre-set business center name, each including one or more services in the computer system.
The name of the service center may be a number, such as a combination of an arabic numeral and/or an alphabet, or a character string with a specific meaning. For example, the initial capital of the english name of the service center may be used as the name of the service center, and table 1 shows some possible examples of the name of the service center:
TABLE 1
Service center Name of service center Paraphrasing
Center of merchandize PGC Product Good Center
Customer center CC Customer Center
Order centre OC Order Center
Billing and accounting center FAC Fee Account Center
Real-time marketing center RMC Realtime Marketing Center
Retail inventory center RIC Retail Inventory Center
Customer interaction center CIC Customer Interaction Center
In the embodiment of the present invention, the original name of the service is composed of a service center name and a service preset identifier, and the service center name and the service preset identifier may be combined in a preset combination manner to be the original name of the service. For example, the service center name and the identifier may be combined into an original name of the service by using a combination of direct connections, for example, an original name of a Customer Center (CC) to which a customer information service (createCustomer) is directly connected is called CCcreateCustomer. Thus, the service center of the service can be determined by the original name of the service.
In the implementation of the present invention, the "call procedure between multiple services when the computer system runs" described in step 101 may be a call procedure that is expected to occur when the computer system runs, or may be a call procedure that occurs when the computer system actually runs. That is, the step of updating the name of each service in step 101 may be naming each service before the computer system is operated, or naming each service according to the actual operation condition of the computer system when the computer system is operated.
In a possible implementation manner, updating the name of each service according to the mutual calling process of a plurality of services when the computer system runs may be: aiming at any service in a plurality of services, combining the original name of the service and the original name of the service called by the service into a new name by a preset naming rule, and then updating the name of the service into the new name. The preset naming rules comprise arrangement rules and separation rules among the original names, the arrangement rules are used for defining how to determine the sequence of each original name in the combined name when a plurality of original names are combined, and the separation rules are used for defining how to distinguish two adjacent original names in the combined name.
In a specific implementation process, by adjusting a preset naming rule, the name of a service can be presented in one of three situations as follows:
in the first case, the name of a service only reflects which services the service calls, i.e. the name of a service only includes the original name of the service and the original name of the service called by the service;
in the second case, the name of the service only reflects which services the service is called by, i.e. the name of the service only includes the original name of the service and the original name of the service calling the service;
in a third case, the name of a service represents both which services the service has invoked and which services the service has invoked, i.e. the name of a service comprises both the original name of the service and the original name of the service that the service has invoked, and the original name of the service that the service has invoked.
It should be noted that inter-service calls include both direct and indirect calls. For example, if service a calls service B and service B calls service C, service a calls service B and service B calls service C as direct calls, and service a calls service C as indirect calls. The call in the foregoing three cases may be a call mode including only direct call, or may be a call mode including both direct call and indirect call. When the calling mode comprises a direct calling mode and an indirect calling mode, the preset naming rule is more complex.
For ease of understanding, in the following description, the foregoing first case is used, and the call referred to in the first case is described as including only a direct call.
In one possible implementation, the original name of the service performing the call may be defined in the preset naming convention to precede the original service name of the called service, and a hyphen (i.e., "_") separation between the two original names may be defined. For example, if the creating user alert service (cccreateuusertips) of the client center calls the querying user do not disturb rule service (cicquerynodrrentrule) of the client interaction center, the name of the creating user alert service may be updated to be the new name cccreateuusertips _ cicquerynodrrentrule in the first case.
Further, in a possible implementation manner, the preset naming rule may further define: if a service directly calls two or more services, a "$" connection is used between the parallel services. For example, the query retail inventory order item service (OCqueryRetailInventyOrderItem) of the order center invokes the query business order service (RICqueryBusinessOrder) and the query distribution order service (RICqueryDispatching) of the retail inventory center, in the first case, the name of the query retail inventory order item service of the order center may be updated to be the new name OCqueryRetailInventyOrderitem _ RICqueryBusinessOrder RICqueryDispatching.
In a specific implementation process, due to the business complexity of the centralized service, one service may have multiple calling scenarios at the same time, and in different calling scenarios, the service may select different services to call according to different conditions, so that one service may have multiple names at the same time, where each name corresponds to one calling scenario.
Furthermore, the dependency relationship between services may change, for example, a new call relationship is added or changed, so that the name of the service may be supplemented and improved according to the call process occurring during the actual operation of the computer system, that is, the name of the service may be updated.
In a possible embodiment, the process of updating the service name may be that at least one message transmitted among the plurality of services carries call chain information, each service adds its original name to the call chain information according to the preset naming rule when being called, further, a call tree is generated according to at least one call chain information carried in at least one message after the plurality of services are called, and according to the call tree, the original name of any service in the computer system and the original name of the service called by the any service are combined into a new name according to the preset naming rule, where the call tree may represent a call relationship among the plurality of services in the computer system, and the call chain information may be carried in a message body, for example.
In a specific implementation process, a call chain tracking switch may be set in the computer system, and when the call chain tracking switch is turned off, the name of the service is not updated, specifically, the call chain information is not carried in a message transmitted among multiple services; when the calling chain tracking switch is turned on, the original name of the service for the calling entrance is used as calling chain information, the original name of the called service is gradually added into calling chain information in the calling process, recursive recording is carried out until no subordinate service exists, finally, a calling tree is output at a calling exit, and further, the name of the service is perfected and updated according to the calling tree.
The following describes an example of a service name update procedure in the embodiment of the present invention with reference to the call relationship shown in fig. 2. In fig. 2, C1, C2, and C3 are 3 service centers, where C1 includes service S1, C2 includes service S2, and C3 includes service S3 and S4; C1S1, C2S2, C3S3 and C3S4 are original names of S1, S2, S3 and S4 respectively; C1S1 calls C3S4 and C2S2, respectively, C2S2 calls C3S3, and C1S1 has no upper level service, C3S3 and C3S4 have no lower level service, then C1S1 is a call entry, and C3S3 and C3S4 are call exits.
Referring to fig. 2, at the call entry, the original name of C1S1 itself is used as call chain information (in this case, C1S 1), and in a call chain, after C3S4 is called by C1S1, the original name of C3S4 itself is added to the call chain information (in this case, C1S1_ C3S 4); in the other call chain, after the C2S2 is called by the C1S1, the original name of the C2S2 itself is added to the call chain information (in this case, C1S1_ C2S 2), and after the C3S3 is called by the C2S2, the original name of the C3S3 itself is added to the call chain information (in this case, C1S1_ C2S2_ C3S 3). Since C3S3 and C3S4 have no lower level service, two pieces of call chain information, C1S1_ C3S4 and C1S1_ C2S2_ C3S3, are output at the call exit. The computer system can generate a call tree representing the call relationship between C1S1, C2S2, C3S3, and C3S4 according to the two pieces of call chain information, and update the names of C1S1, C2S2, C3S3, and C3S4 according to the call tree.
In a possible implementation process, before updating the name of any service, it may be further determined whether the number of times the new name is combined in the computer system reaches a preset number of times, if so, the name of any service is updated to be the new name, otherwise, the current update of the name of any service is ended. And determining whether the number of times of combining the new name in the computer system reaches a preset number, namely representing whether the number of times of determining the occurrence of the calling relationship reaches the preset number.
Specifically, the call relation between services in a computer system is generally stable, however, sometimes the call relation of an individual service changes due to some accidental factors during the operation of the computer system, but these changes are only temporary, the call relation may be restored to the previous call relation during the next operation, and if the service name is updated as long as the change of the call relation is detected, the service name in the system changes frequently due to the accidental factors, which is not favorable for determining the service usage in the system.
Referring to fig. 1, in step 102, the calling relationship among the services is analyzed according to the updated names of the services, so that the number of services that the service center directly calls other service centers, the number of services that the service center is called by other service centers, and the dependency between the service centers can be determined, the calling relationship and the called relationship of a certain service can also be determined, the dependency of the system on a certain service (that is, the influence on the system when the service changes) and the depth of service calling can also be evaluated, and a panoramic view of a system calling chain can be generated to visualize the calling relationship among the services.
Specifically, analyzing the calling relationship among the plurality of services according to the updated names of the plurality of services to determine the service usage in the computer system may include one or more of the following:
(1) Determining a service directly called by a first service and a service indirectly called by the first service in the plurality of services according to the updated names of the plurality of services, and determining a calling chain of the first service according to the service directly called by the first service and the service indirectly called by the first service;
(2) Determining a service for directly calling the first service and a service for indirectly calling the first service in the plurality of services according to the updated names of the plurality of services, and determining a called chain of the first service according to the service for directly calling the first service and the service for indirectly calling the first service;
(3) Determining the total number of services related to a first service in the plurality of services according to the updated names of the plurality of services, and determining the ratio of the total number to the number of the plurality of services as the dependency degree of the computer system on the first service, wherein the services related to the first service comprise a service directly calling the first service, a service indirectly calling the first service, a service directly called by the first service and a service indirectly called by the first service;
(4) Determining the calling relationship among the services according to the updated names of the services, and generating a panoramic view of service calling in the computer system according to the calling relationship;
(5) Determining the number of services which are called by a second service center in the services which belong to the first service center according to the updated names of the services, wherein the first service center and the second service center are any two service centers in the service centers;
(6) And determining the number of the services which are called from the services belonging to the first service center and belong to the second service center according to the updated names of the services, and determining that the ratio of the number to the total number of the services belonging to the first service center is the dependency of the first service center on the second service center, wherein the first service center and the second service center are any two service centers in the plurality of service centers.
When the above-mentioned content (5) and content (6) are implemented in step 102, the original name of the service required includes the name of the service center.
The following is an example of a specific process for analyzing call relations among a plurality of services to determine service usage in a computer system, with three service centers and nine services as shown in fig. 3:
referring to fig. 3, the service center C1 includes services S1, S2, and S3, the service center C2 includes services S4, S5, and S6, and the service center C3 includes services S7, S8, and S9.
Assume that the updated names of the services obtained based on step 101 are as follows:
service S1: C1S1_ C2S4$ C3S9;
service S2: C1S2_ C1S1$ C3S7;
service S3: C1S3_ C2S4$ C2S5;
service S4: C2S4;
service S5: C2S5;
service S6: C2S6_ C3S7$ C3S8;
service S7: C3S7_ C1S1;
service S8: C3S8;
service S9: C3S9_ C3S8.
Then it can be determined from the updated name:
1. the service number of other service centers directly called by the service center is as follows:
the number of the service invoking service of the service center C2 in the service of the service center C1: 2
(a specific determination may be to retrieve the number of names that conform to the search formula C1XX _ C2XX/C1XX _ XXXX $ C2XX/C1XX _ C2XX $ XXXX in the updated names of the services S1-S9);
the number of the service center C3 called in the service of the service center C1: 2
(a specific determination may be to retrieve the number of names that conform to the search formula C1XX _ C3XX/C1XX _ XXXX $ C3XX/C1XX _ C3XX $ XXXX in the updated names of the services S1-S9);
the number of the service center C1 called in the service of the service center C2: 0
(a specific determination may be to retrieve the number of names that conform to the search formula C2XX _ C1XX/C2XX _ XXXX $ C1XX/C2XX _ C1XX $ XXXX in the updated names of the services S1-S9);
the number of the service center C3 called in the service of the service center C2: 2
(a specific determination may be to retrieve the number of names that conform to the search formula C2XX _ C3XX/C2XX _ XXXX $ C3XX/C2XX _ C3XX $ XXXX in the updated names of services S1-S9);
the number of the service invoking service of the service center C1 in the service of the service center C3: 1
(a specific determination may be to search for a name number that matches the search formula C3XX _ C1XX/C3XX _ XXXXXX $ C1XX/C3XX _ C1XX $ XXXXX in the updated names of the services S1-S9);
the number of the service center C2 called in the service of the service center C3: 0
(A specific determination may be to retrieve the number of names that meet the search formula C3XX _ C2XX/C3XX _ XXXXXX $ C2XX/C3XX _ C2XX $ XXXXX in the updated names of the services S1-S9).
2. The dependency situation between the service centers is:
dependence of the service center C1 on the service center C2: 66.67 percent
(the specific determination method may be to divide the number of the services of the service center C1, which invoke the service of the service center C2, by the total number of the services of the service center C1);
the service center C1 has a dependency on the service center C3: 66.67 percent;
the service center C2 has a dependency on the service center C1: 0%;
dependence of the service center C2 on the service center C3: 66.67 percent;
dependency of the service center C3 on the service center C1: 33.33 percent;
dependence of the service center C3 on the service center C2: 0 percent.
3. The call chain (including direct call and indirect call) cases of a certain service are:
other services invoked by service S1: C1S1_ C2S4; C1S1_ C3S9_ C3S8;
(the specific determination method may be to search for the calling service after C1S1_ XXXX $ XXXX, and then recursively search for other services called by the calling service until there is no next service call);
other services invoked by service S2: C1S2_ C1S1_ C2S4; C1S2_ C1S1_ C3S9_ C3S8; C1S2_ C3S7_ C1S1_ C2S4; C1S2_ C3S7_ C1S1_ C3S9_ C3S8;
other services invoked by service S3: C1S3_ C2S4; C1S3_ C2S5;
other services invoked by service S4: none;
other services invoked by service S5: none;
other services invoked by service S6: C2S6_ C3S7_ C1S1_ C2S4; C2S6_ C3S7_ C1S1_ C3S9_ C3S8; C2S6_ C3S8;
other services invoked by service S7: C3S7_ C1S1_ C2S4; C3S7_ C1S1_ C3S9_ C3S8;
other services invoked by service S8: none;
other services invoked by service S9: C3S9_ C3S8.
4. The called chain (including directly called and indirectly called) cases of a certain service are:
invoked relationship of service S1: C1S2_ C1S1; C2S6_ C3S7_ C1S1; C1S2_ C3S7_ C1S1;
(specific determination can be to search for service meeting the search formula XXXX _ C1S1/XXXX _ C1S1$ XXXX/XXXX _ XXXX $ C1S1, and then search its parent call service upwards recursively until there is no parent call service);
called relationship of service S2: none;
invoked relationship of service S3: none;
invoked relationship of service S4: C1S2_ C1S1_ C2S4; C2S6_ C3S7_ C1S1_ C2S4; C1S2_ C3S7_ C1S1_ C2S4;
invoked relationship of service S5: C1S3_ C2S5;
invoked relationship of service S6: none;
invoked relationship of service S7: C2S6_ C3S7; C1S2_ C3S7;
invoked relationship of service S8: C2S6_ C3S8; C2S6_ C3S7_ C1S1_ C3S9_ C3S8; C1S2_ C3S7_ C1S1_ C3S9_ C3S8; C1S2_ C1S1_ C3S9_ C3S8;
invoked relationship of service S9: C2S6_ C3S7_ C1S1_ C3S9; C1S2_ C3S7_ C1S1_ C3S9; C1S2_ C1S1_ C3S9.
5. The dependency situation of a computer system on a certain service is:
dependency of the computer system on the service S1: 6/9=66.67%; the dependency is used for measuring the influence degree on the computer system when the service S1 is changed such as newly adding, modifying, deleting and the like;
( The specific determination method may be: the number of services associated with service S1 is divided by the total number of services in the computer system. The services related to the service S1 include a service for directly calling S1, a service for indirectly calling S1, a service for directly calling S1, and a service for indirectly calling S1, and the original names of the services related to the service S1 in the nine services shown in fig. 3 are C2S4, C3S9, C3S8, C1S2, C2S6, and C3S7 )
Dependency of the computer system on service S2: 5/9=55.56%;
dependency of the computer system on service S3: 2/9=22.22%;
dependency of the computer system on service S4: 4/9=44.44%;
dependency of the computer system on service S5: 1/9=11.11%;
dependency of the computer system on service S6: 5/9=55.56%;
dependency of the computer system on service S7: 6/9=66.67%;
dependency of the computer system on service S8: 5/9=55.56%;
dependency of the computer system on service S9: 5/9=55.56%.
6. A system call chain panorama generated from the updated names may be as shown in fig. 4. The service pointed by the arrow is the called service, for example, the reference S2 points to S1 in fig. 4 indicates that the service S2 calls the service S1.
Example two
Based on the same inventive concept, the embodiment of the present invention provides a computer system, which includes a plurality of services, for example, the computer system described in the first embodiment. In addition, since the first embodiment and the second embodiment are based on the same inventive concept, the first embodiment and the second embodiment can be referred to and cited in understanding and explaining the first embodiment and the second embodiment.
Referring to fig. 5, the computer system in the embodiment of the present invention includes a naming module 501 and an analyzing module 502, where:
a naming module 501, configured to update names of the services according to a calling process among the services when the computer system is running, where the name of each service represents a calling relationship between the service and another service;
the analysis module 502 is configured to analyze a call relationship between the services according to the updated names of the services to determine a service usage in the computer system.
In a possible implementation, each service in the plurality of services includes a preset original name, and the naming module 501 is configured to:
aiming at any service in the plurality of services, combining the original name of the service and the original name of the service called by the service into a new name by a preset naming rule, wherein the preset naming rule comprises an arrangement rule and a separation rule among the original names;
and updating the name of any service to be the new name.
In one possible implementation, the naming module 501 is configured to:
at least one message transmitted among the plurality of services carries calling chain information, and each service adds the original name of the service to the calling chain information according to the preset naming rule when being called;
generating a calling tree according to at least one piece of calling chain information carried in the at least one message after the plurality of services are called, wherein the calling tree represents the calling relation among the plurality of services;
and combining the original name of any service and the original name of the service called by any service into the new name according to the calling tree.
In one possible implementation, the naming module 501 is further configured to:
before the name of any service is updated to be the new name, determining whether the number of times of combining the new name in the computer system reaches a preset number of times;
if yes, updating the name of any service to be the new name;
otherwise, ending the current updating of the name of any service.
In one possible implementation, the analysis module 502 is configured to perform one or more of the following:
determining a service directly called by a first service and a service indirectly called by the first service in the plurality of services according to the updated names of the plurality of services, and determining a call chain of the first service according to the service directly called by the first service and the service indirectly called by the first service;
determining a service for directly calling the first service and a service for indirectly calling the first service in the plurality of services according to the updated names of the plurality of services, and determining a called chain of the first service according to the service for directly calling the first service and the service for indirectly calling the first service;
determining the total number of services related to a first service in the plurality of services according to the updated names of the plurality of services, and determining the ratio of the total number to the number of the plurality of services as the dependency of the computer system on the first service, wherein the services related to the first service comprise a service directly calling the first service, a service indirectly calling the first service, a service directly called by the first service and a service indirectly called by the first service;
and determining the calling relationship among the services according to the updated names of the services, and generating a panoramic view of service calling in the computer system according to the calling relationship.
In a possible implementation, the computer system includes a plurality of service centers, wherein each service center includes a preset service center name, each service center includes one or more services of the plurality of services, and the original name of each of the plurality of services is composed of the service center name of the service center to which the service belongs and a preset identifier of the service.
In one possible implementation, the analysis module 502 is configured to perform one or more of the following:
determining the number of services which are called by a second service center in the services which belong to a first service center according to the updated names of the services, wherein the first service center and the second service center are any two service centers in the services;
and determining the number of calling services belonging to a second service center from the services belonging to the first service center according to the updated names of the services, and determining the ratio of the number to the total number of the services belonging to the first service center as the dependency of the first service center on the second service center, wherein the first service center and the second service center are any two service centers in the plurality of service centers.
EXAMPLE III
Based on the same inventive concept, an embodiment of the present invention provides a computer device, including:
at least one processor, and
a memory coupled to the at least one processor;
the memory stores instructions executable by the at least one processor, and the at least one processor executes the instructions stored in the memory to perform the method according to the first embodiment.
Example four
Based on the same inventive concept, the embodiment of the present invention provides a computer-readable storage medium, which stores computer instructions that, when executed on a computer, cause the computer to perform the method of the first embodiment.
In particular implementations, the computer-readable storage medium includes: various storage media capable of storing program codes, such as a Universal Serial Bus flash drive (USB), a portable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above-described embodiments of the apparatus are merely illustrative, wherein units/modules illustrated as separate components may or may not be physically separate, and components shown as units/modules may or may not be physical units/modules, may be located in one place, or may be distributed over a plurality of network units/modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
One or more of the above technical solutions have at least the following beneficial effects:
in the embodiment of the invention, the name of each service is updated according to the mutual calling process of a plurality of services when the computer system runs, and the calling relation among the services is analyzed according to the updated names of the services to determine the service use condition in the computer system, wherein the name of each service represents the calling relation between the service and other services. The name of the service is used for representing the calling relationship between the service and other services, so that the calling relationship of each service in the computer system can be known by analyzing the name of each service in the computer system, and the service use condition in the computer system is determined.
Moreover, the names of the services are easy to obtain and the data volume is small, so that the calculation complexity is low when the calling relation among the services is analyzed according to the service names, the efficiency is high, the occupied system resources are small, and the response speed of a computer system is not influenced.
Furthermore, at least one message transmitted among the plurality of services carries calling chain information, and a new name of each service is determined according to a calling tree generated based on the calling chain information, so that the service name in the computer system can be updated and perfected, and the method is suitable for the change of the calling relationship in the computer system.
Further, before the name of any service is updated to be a new name, whether the number of times the new name is combined in the computer system reaches a preset number is determined, so that the condition that the name of the service in the system is frequently changed due to accidental factors can be avoided, and the service using condition in the system can be more accurately determined.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. Based on the understanding, the above technical solutions substantially or otherwise contributing to the prior art may be embodied in the form of a software product, which may be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the various embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A service invocation relationship analysis method applied to a computer system comprising a plurality of services, the method is characterized by comprising the following steps:
updating the name of each service according to the mutual calling process of the services when the computer system runs, wherein the name of each service represents the calling relation between the service and other services; each of the plurality of services comprises a preset original name;
updating the name of each service according to the mutual calling process of the services when the computer system runs, wherein the updating comprises the following steps: aiming at any service in the plurality of services, combining an original name of the service and an original name of a service called by the service into a new name by a preset naming rule, wherein the preset naming rule comprises an arrangement rule and a separation rule among the original names; updating the name of any service to be the new name;
aiming at any service in the plurality of services, combining the original name of the service and the original name of the service called by the service into a new name by a preset naming rule, wherein the method comprises the following steps: at least one message transmitted among the plurality of services carries calling chain information, and each service adds the original name of the service to the calling chain information according to the preset naming rule when being called; generating a calling tree according to at least one piece of calling chain information carried in the at least one message after the plurality of services are called, wherein the calling tree represents the calling relationship among the plurality of services; combining the original name of any service and the original name of the service called by any service into the new name according to the calling tree;
and analyzing the calling relationship among the services according to the updated names of the services so as to determine the service use condition in the computer system.
2. The method of claim 1, prior to updating the name of any of the services to the new name, further comprising:
determining whether the number of times of combining the new name in the computer system reaches a preset number of times;
if yes, updating the name of any service to be the new name;
otherwise, ending the current updating of the name of any service.
3. The method of claim 1 or 2, wherein analyzing the call relationships among the plurality of services to determine service usage in the computer system based on the updated names of the plurality of services comprises one or more of:
determining a service directly called by a first service and a service indirectly called by the first service in the plurality of services according to the updated names of the plurality of services, and determining a call chain of the first service according to the service directly called by the first service and the service indirectly called by the first service;
determining a service for directly calling the first service and a service for indirectly calling the first service in the plurality of services according to the updated names of the plurality of services, and determining a called chain of the first service according to the service for directly calling the first service and the service for indirectly calling the first service;
determining a total number of services associated with a first service in the plurality of services according to the updated names of the plurality of services, and determining a ratio of the total number to the number of the plurality of services as the dependency of the computer system on the first service, wherein the services associated with the first service comprise a service directly calling the first service, a service indirectly calling the first service, a service directly called by the first service and a service indirectly called by the first service;
and determining the calling relationship among the services according to the updated names of the services, and generating a panoramic view of service calling in the computer system according to the calling relationship.
4. The method of claim 1, wherein the computer system comprises a plurality of service centers, wherein each service center comprises a preset service center name, each service center comprises one or more services of the plurality of services, and each original name of each of the plurality of services is composed of the service center name of the service center to which the service belongs and a preset identifier of the service.
5. The method of claim 4, wherein analyzing the call relationships among the plurality of services to determine service usage in the computer system based on the updated names of the plurality of services comprises one or more of:
determining the number of services which are called by a second service center in the services which belong to a first service center according to the updated names of the services, wherein the first service center and the second service center are any two service centers in the services;
and determining the number of calling services belonging to a second service center in the services belonging to a first service center according to the updated names of the services, and determining that the ratio of the number to the total number of the services belonging to the first service center is the dependency of the first service center on the second service center, wherein the first service center and the second service center are any two service centers in the service centers.
6. A computer system, wherein the computer system includes a plurality of services, the computer system further comprising:
the naming module is used for updating the name of each service according to the calling process among the services when the computer system runs, wherein the name of each service represents the calling relationship between the service and other services; each of the plurality of services comprises a preset original name;
the naming module is configured to: aiming at any service in the plurality of services, combining an original name of the service and an original name of a service called by the service into a new name by a preset naming rule, wherein the preset naming rule comprises an arrangement rule and a separation rule among the original names; updating the name of any service to be the new name;
the naming module is used for: at least one message transmitted among the plurality of services carries calling chain information, and each service adds the original name of the service to the calling chain information according to the preset naming rule when being called; generating a calling tree according to at least one piece of calling chain information carried in the at least one message after the plurality of services are called, wherein the calling tree represents the calling relationship among the plurality of services; combining the original name of any service and the original name of the service called by any service into the new name according to the calling tree;
and the analysis module is used for analyzing the calling relation among the services according to the updated names of the services so as to determine the service use condition in the computer system.
7. The system of claim 6, wherein the naming module is further to:
before updating the name of any service to be the new name, determining whether the number of times of combining the new name in the computer system reaches a preset number of times;
if yes, updating the name of any service to be the new name;
otherwise, ending the current updating of the name of any service.
8. The system of claim 6 or 7, wherein the computer system comprises a plurality of service centers, wherein each service center comprises a preset service center name, each service center comprises one or more services of the plurality of services, and the original names of the services are composed of the service center name of the service center to which the service belongs and the preset identifier of the service.
9. A computer device, characterized in that the computer device comprises:
at least one processor, and
a memory coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor, the at least one processor performing the method of any one of claims 1-5 by executing the instructions stored by the memory.
10. A computer-readable storage medium characterized by:
the computer readable storage medium stores computer instructions that, when executed on a computer, cause the computer to perform the method of any of claims 1-5.
CN201810607670.8A 2018-06-13 2018-06-13 Service call relation analysis method and computer system Active CN110597572B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810607670.8A CN110597572B (en) 2018-06-13 2018-06-13 Service call relation analysis method and computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810607670.8A CN110597572B (en) 2018-06-13 2018-06-13 Service call relation analysis method and computer system

Publications (2)

Publication Number Publication Date
CN110597572A CN110597572A (en) 2019-12-20
CN110597572B true CN110597572B (en) 2022-12-13

Family

ID=68849525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810607670.8A Active CN110597572B (en) 2018-06-13 2018-06-13 Service call relation analysis method and computer system

Country Status (1)

Country Link
CN (1) CN110597572B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116755804B (en) * 2023-07-03 2024-04-26 红有软件股份有限公司 Assembled integrated big data processing method and system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790718A (en) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 Service call link analysis method and system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106790718A (en) * 2017-03-16 2017-05-31 北京搜狐新媒体信息技术有限公司 Service call link analysis method and system

Also Published As

Publication number Publication date
CN110597572A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
EP3418910A1 (en) Big data-based method and device for calculating relationship between development objects
CN108304522A (en) Comparison method, device and the terminal device of difference between a kind of database
CN112749056A (en) Application service index monitoring method and device, computer equipment and storage medium
CN114282011B (en) Knowledge graph construction method and device, and graph calculation method and device
CN110597572B (en) Service call relation analysis method and computer system
CN110782169A (en) Method and device for updating business process
CN112732242A (en) Wide table processing script generation method and device
CN111124883B (en) Test case library introduction method, system and equipment based on tree form
CN117055851A (en) Software architecture recovery method and device, electronic equipment and storage medium
CN114510408A (en) Information feedback method, device, system, equipment and storage medium
CN110765100B (en) Label generation method and device, computer readable storage medium and server
CN111352824B (en) Test method and device and computer equipment
CN109840213B (en) Test data creating method, device, terminal and storage medium for GUI test
CN113656046A (en) Application deployment method and device
CN113448985A (en) API (application program interface) interface generation method, calling method and device and electronic equipment
CN106469086B (en) Event processing method and device
CN111127077A (en) Recommendation method and device based on stream computing
CN115048284B (en) Method, computing device and storage medium for testing applications of a system
CN110765127B (en) Method, device, equipment and storage medium for scoring fact data
CN110096504B (en) Streaming event feature matching method and device
CN112988842B (en) Method and device for associating user ID
CN113568656A (en) Configuration data processing method and device, storage medium and equipment
CN112486556B (en) Method, system, terminal and storage medium for server to be compatible with BMC
CN112988661B (en) Balance table updating method and related equipment thereof
CN112418740A (en) Application software content management method, system, terminal and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant