Service calling method and device, electronic equipment and storage medium

By introducing service proxy components into the microservice architecture, duplicate calls in the service call link are determined and eliminated, the problem of repeated calls in the basic service being called repeatedly is solved, and system efficiency and user experience are improved.

CN119988063APending Publication Date: 2025-05-13BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510108623.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-23
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

In the microservice architecture, complex call links lead to a significant increase in the number of repeated calls of the basic service, resulting in wasting system resources and reduced operational efficiency.

Method used

Provide a service call method, which receives a service call request through the service proxy component, determines whether the repeated call elimination conditions are met, obtains the repeated call situation of the second service in the service dependency link, and obtains the execution result according to the situation, avoiding repeated calls.

Benefits of technology

Effectively eliminate duplicate calls to basic services, reduce machine deployment, reduce resource usage, improve system operation efficiency, and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988063A_ABST
    Figure CN119988063A_ABST
Patent Text Reader

Abstract

The invention relates to a service calling method and device, electronic equipment and a storage medium, the service calling method is applied to a service agent component, and comprises the following steps: receiving a service calling request from a first service, the service calling request being used for requesting to call a second service; determining whether the service call request satisfies a repeated call elimination condition based on the second service; if the service calling request meets a repeated calling elimination condition, acquiring a repeated calling condition of the second service in a service dependency link to which the second service belongs; and obtaining an execution result corresponding to the service calling request according to an obtaining mode corresponding to the repeated calling condition, and returning the execution result to the first service. The embodiment of the invention can avoid repeatedly calling the second service, avoid waste of system resources and improve the system operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a service calling method, device, electronic device and storage medium. Background Art

[0002] Microservices Architecture is a software architecture style that splits a large monolithic application into multiple small and independent services, each of which can be independently developed, deployed and expanded. Each microservice usually focuses on a specific business function or field and can interact with other microservices through lightweight communication protocols (such as HTTP / REST, message queues, etc.). This architecture enhances the flexibility, scalability and maintainability of the application, and can better cope with complex and changing business scenarios.

[0003] At present, the internal call links of enterprises are complex. A user request from the client often involves multiple services within the company, and these multiple internal services may rely on the same internal basic services at the same time. For example: Figure 1 As shown in the figure, in one user request, three requests are made to the basic service X. The complex call link relationship will lead to a significant increase in the number of repeated calls to the basic service, a serious waste of system resources, and reduced system operation efficiency. Summary of the invention

[0004] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a service calling method, device, electronic device and storage medium.

[0005] In a first aspect, the present application provides a service calling method, which is applied to a service proxy component, comprising:

[0006] Receiving a service invocation request from a first service, wherein the service invocation request is used to request invocation of a second service;

[0007] Determining whether the service call request satisfies a duplicate call elimination condition based on the second service;

[0008] If the service call request satisfies a repeated call elimination condition, obtaining repeated call status of the second service in the service dependency link to which it belongs;

[0009] The execution result corresponding to the service call request is obtained according to the acquisition method corresponding to the repeated call situation, and returned to the first service.

[0010] Optionally, determining whether the service call request satisfies a repeated call elimination condition based on the second service includes:

[0011] Obtaining service identification information of the second service;

[0012] Determine whether the service identification information is in the service information set and whether the state corresponding to the service identification information is a preset state;

[0013] If the service identification information is in the service information set and the state corresponding to the service identification information is a preset state, it is determined that the second service meets the repeated call elimination condition.

[0014] Optionally, obtaining a repeated call status of the second service in the service dependency link to which the second service belongs includes:

[0015] Acquire link information corresponding to the service dependency link;

[0016] The number of repeated calls corresponding to the second service is obtained in the link information as the repeated call situation.

[0017] Optionally, acquiring the execution result corresponding to the service call request according to the acquisition method corresponding to the repeated call situation includes:

[0018] Determine the number of repeated calls according to the repeated call situation, and determine whether the number of repeated calls is within a preset range;

[0019] If the number of repeated calls is within a preset range, calling the second service to obtain an execution result;

[0020] Obtain the execution result of the second service.

[0021] Optionally, the method further comprises:

[0022] When a bypass transmission triggering condition is met, determining a downstream service located downstream of the first service in the service dependency link;

[0023] The execution result is sent to the downstream service.

[0024] Optionally, acquiring the execution result corresponding to the service call request according to the acquisition method corresponding to the repeated call situation includes:

[0025] Determine the number of repeated calls according to the repeated call situation, and determine whether the number of repeated calls is within a preset range;

[0026] If the number of repeated calls is not within a preset range, an execution result corresponding to the second service is obtained.

[0027] Optionally, obtaining an execution result corresponding to the second service includes:

[0028] Determining an upstream service located upstream of the first service in the service dependency link;

[0029] Obtain an execution result sent by any of the upstream services as the execution result corresponding to the second service.

[0030] In a second aspect, the present application provides a service calling device, which is applied to a service proxy component, including:

[0031] A first determining module, configured to receive a service invocation request from a first service, wherein the service invocation request is used to request invocation of a second service;

[0032] A second determination module, configured to determine whether the service call request satisfies a duplicate call elimination condition based on the second service;

[0033] A first acquisition module is used to obtain the repeated calling status of the second service in the service dependency link to which it belongs if the service calling request meets the repeated calling elimination condition;

[0034] The second acquisition module is used to acquire the execution result corresponding to the service call request according to the acquisition method corresponding to the repeated call situation, and return it to the first service.

[0035] Optionally, the second determining module includes:

[0036] A first acquisition unit, configured to acquire service identification information of the second service;

[0037] A first determining unit, configured to determine whether the service identification information is in the service information set and whether a state corresponding to the service identification information is a preset state;

[0038] The second determining unit is configured to determine that the second service satisfies a repeated call elimination condition if the service identification information is in the service information set and the state corresponding to the service identification information is a preset state.

[0039] Optionally, the first acquisition module includes:

[0040] A second acquisition unit, configured to acquire link information corresponding to the service dependency link;

[0041] The third acquisition unit is used to acquire the number of repeated calls corresponding to the second service in the link information as the repeated call situation.

[0042] Optionally, the second acquisition module includes:

[0043] A third determining unit, configured to determine the number of repeated calls according to the repeated call situation, and determine whether the number of repeated calls is within a preset range;

[0044] A calling unit, configured to call the second service to obtain an execution result if the number of repeated calls is within a preset range;

[0045] The fourth acquisition unit is used to acquire the execution result of the second service.

[0046] Optionally, the device further comprises:

[0047] A third determination module, configured to determine a downstream service located downstream of the first service in the service dependency link when a bypass transmission triggering condition is met;

[0048] A sending module is used to send the execution result to the downstream service.

[0049] Optionally, the second acquisition module includes:

[0050] A fourth determining unit, configured to determine the number of repeated calls according to the repeated call situation, and determine whether the number of repeated calls is within a preset range;

[0051] The fifth acquisition unit is used to acquire the execution result corresponding to the second service if the number of repeated calls is not within a preset range.

[0052] Optionally, the fifth acquiring unit includes:

[0053] a determination subunit, configured to determine an upstream service located upstream of the first service in the service dependency link;

[0054] The acquisition subunit is used to obtain the execution result sent by any of the upstream services as the execution result corresponding to the second service.

[0055] In a third aspect, the present application provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus;

[0056] Memory, used to store computer programs;

[0057] The processor is used to implement any service calling method described in the first aspect when executing the program stored in the memory.

[0058] In a fourth aspect, the present application provides a computer-readable storage medium, on which a service calling method program is stored. When the service calling method program is executed by a processor, the steps of the service calling method described in any one of the first aspects are implemented.

[0059] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:

[0060] In the embodiment of the present application, when the service call request satisfies the repeated call elimination condition, the repeated call situation of the second service in the service dependency link to which it belongs is obtained, and the execution result corresponding to the service call request is obtained according to the acquisition method corresponding to the repeated call situation, and returned to the first service. In the embodiment of the present application, by obtaining the execution result according to the acquisition method corresponding to the repeated call situation, the execution result can be obtained by using the corresponding acquisition method when there is no repeated call or repeated call of the second service, and the method of obtaining the execution result when repeated call occurs and when no repeated call occurs is distinguished, so as to avoid repeated calling of the second service, avoid waste of system resources, and improve system operation efficiency. A large number of repeated calls to basic services are eliminated, so that basic services can reduce machine deployment, reduce resource usage, and save costs for enterprises; in a user's request link, several repeated network requests are eliminated. The delay of the entire request link can be improved, so that the user's request can be responded to more quickly, and the user experience is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] 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.

[0062] 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.

[0063] Figure 1 It is a schematic diagram of a microservice architecture in the prior art;

[0064] Figure 2 A schematic diagram of a microservice architecture provided for an embodiment of the present application;

[0065] Figure 3 A flowchart of a service calling method provided in an embodiment of the present application;

[0066] Figure 4 A structural diagram of a service calling device provided in an embodiment of the present application;

[0067] Figure 5 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] 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.

[0069] The complex call link relationship between services will lead to a significant increase in the number of repeated calls of basic services, serious waste of system resources, and reduced system operation efficiency. To this end, the embodiments of the present application provide a service calling method, device, electronic device and storage medium.

[0070] The embodiment of the present application provides a service calling method applicable to a microservice architecture, in which services in the microservice architecture are all written in Java language, calls between services are all made using the http protocol, and apache httpclient components are all used when services initiate http calls. The service calling method can be applied to a service proxy component, which can refer to a Java Agent. The service proxy component utilizes the dynamic bytecode technology of the Java Agent to enhance the call request code of each service in the service dependency link to the basic service, and combines the bypass information transmission to achieve the goal of not needing to modify the business code, nor the original transmission protocol between services, and efficiently eliminating repeated calls to the basic service.

[0071] like Figure 2 As shown, the service proxy component of the present application (such as Figure 2 The Agent in the service dependency link can communicate with each first service in the service dependency link (such as Figure 2 In the service A, service B and service C) association setting, each first service depends on the second service (such as Figure 2 The basic service X in the application), each service proxy component can be configured with the configuration center component (such as Figure 2 Because not all http calls of the first service have the problem of duplicate calls to the second service, the configuration center component needs to be used to store the duplicate call elimination conditions. The duplicate call elimination conditions can be used to filter which http calls need to be eliminated. The configuration format of the configuration center component is a map structure. The key is a string type that stores the URL address of the http call, and the value is a boolean type that stores whether duplicate call elimination is enabled.

[0072] Here are some examples: [

[0074] {

[0075] "key":"http: / / api.xxx.com / apis / xxx",

[0076] "value":true

[0077] },

[0078] {

[0079] "key":"http: / / api.xxx.com / apis / yyy",

[0080] "value":true

[0081] },

[0082] {

[0083] "key":"http: / / api.xxx.com / apis / zzz",

[0084] "value":false

[0085] }

[0086] ], where "key" is the URL address of http: / / api.xxx.com / apis / xxx. Since the configuration center stores the URL address and its corresponding "value" status is "true", the http call with the URL http: / / api.xxx.com / apis / xxx is a repeated call request for the URL address and needs to be eliminated. Similarly, the http call with the URL address http: / / api.xxx.com / apis / yyy is a repeated call request and also needs to be eliminated. Where "key" is the URL address of http: / / api.xxx.com / apis / zzz, although the configuration center stores the URL address, its corresponding "value" status is "false", so the http call with the URL http: / / api.xxx.com / apis / zzz is not a repeated call request and does not need to be eliminated.

[0087] In addition, the data storage and distribution of the configuration center components are not the focus of this application. The existing configuration center solutions in the enterprise can be reused, such as Nacos, Zookeeper, etc.

[0088] like Figure 3 As shown, the service calling method may include the following steps:

[0089] Step S101, receiving a service call request from a first service, wherein the service call request is used to request to call a second service;

[0090] In an embodiment of the present application, a service call request is sent when a first service initiates an http call. The first service is any service in the microservice architecture. The service call request is used to call any second service in the microservice architecture. The second service can be a basic service or a non-basic service.

[0091] The service call request may carry service identification information of the called second service, such as URL address information and the like.

[0092] In this step, the service identification information of the second service that the first service needs to call can be extracted from the service call request, and the second service to be called is determined according to the service identification information of the second service.

[0093] Step S102, determining whether the service call request satisfies a duplicate call elimination condition based on the second service;

[0094] In order to solve the problem caused by repeated calling of http calls, it can be determined whether the service calling request meets the repeated calling elimination condition.

[0095] In an embodiment of the present application, the repeated call elimination condition can be obtained from the configuration center component, and the repeated call elimination condition includes: whether the service identification information of the second service is located in the service information set and whether the status of the second service enables repeated call elimination.

[0096] In one embodiment of the present application, determining whether the service call request satisfies a repeated call elimination condition based on the second service includes: obtaining service identification information of the second service; determining whether the service identification information is located in the service information set and whether the state corresponding to the service identification information is a preset state; if the service identification information is located in the service information set and the state corresponding to the service identification information is a preset state, determining that the second service satisfies the repeated call elimination condition.

[0097] In this embodiment, the service identification information of the second service includes URL address information, the state corresponding to the service information is repeated call on / off, the service information set includes the URL that needs to eliminate repeated calls, and the preset state refers to the on state.

[0098] If the service identification information of the second service to be called by the service call request is located in the service information set, it indicates that the first service is located in the service dependency link that depends on the second service, and the second service is a basic service. If the status of the second service is to enable duplicate call elimination, it indicates that duplicate call elimination is enabled for the second service.

[0099] like Figure 2 As shown, the service dependency link includes multiple first services that depend on second services, and the services that any first service depends on include the second service and / or other first services.

[0100] Exemplarily, if the URL information of the second service is http: / / api.xxx.com / apis / xxx and the state corresponding to the service identification information of the second service is "true", it can be determined that the service identification information of the second service is located in the service information set and the state corresponding to the service identification information is a preset state, and it is determined that the second service meets the repeated call elimination condition;

[0101] Exemplarily, if the URL information of the second service is http: / / api.xxx.com / apis / xxx and the status corresponding to the service identification information of the second service is "true", it can be determined that the service identification information of the second service is located in the service information set and the status corresponding to the service identification information is the preset status, and it is determined that the second service meets the repeated call elimination condition.

[0102] Step S103: if the service call request satisfies the repeated call elimination condition, obtaining the repeated call status of the second service in the service dependency link to which it belongs;

[0103] In the embodiment of the present application, the repeated call situation refers to whether the second service is repeatedly called for the first time by the first service in the service dependency link to which it belongs. Whether it is repeatedly called for the first time can be recorded for the basic service in each service dependency link.

[0104] In one embodiment of the present application, obtaining the repeated calling status of the second service in the service dependency link to which it belongs includes: obtaining link information corresponding to the service dependency link; obtaining the number of repeated calling times corresponding to the second service in the link information as the repeated calling status.

[0105] In this implementation, it can be determined whether the second service is currently being called for the first time based on the number of repeated calls.

[0106] If the second service does not meet the duplicate call elimination conditions, the service call request can be considered as an http call that does not require duplicate call elimination (that is, the service identification information of the second service is not located in the service information set or the status of the second service is to close duplicate call elimination). For this service call request, the aspect logic can be directly terminated; the business code continues to process normally.

[0107] Step S104: acquiring the execution result corresponding to the service calling request according to the acquisition method corresponding to the repeated calling situation, and returning it to the first service.

[0108] In an embodiment of the present application, corresponding execution result acquisition strategies can be set in advance for repeated calling situations of different basic services. Furthermore, when it is determined that the basic service is called for the first time based on the repeated calling situation, the basic service can be called normally to obtain the execution result after the basic service is called and cached. When the transmission of the execution result is triggered, the execution result is passed to the downstream service through a bypass. When it is determined that the basic service is not called for the first time based on the repeated calling situation, the execution result cached when the basic service is called normally for the first time can be obtained through a bypass.

[0109] For example, Figure 2 As shown in the figure, when service A in a request link requests basic service X for the first time, the Agent caches the request result and passes it in the link (passed through the http header, the business is not aware of it, and it does not affect normal business requests). When service B and service C request basic service X, the Agent can find the corresponding cached result data in the link data and directly return the result to the service. Low cost (avoiding calls) and high efficiency (reducing network requests)

[0110] In this step, the numerical range corresponding to the repeated call situation may be determined first, and then the execution result may be acquired using an acquisition method corresponding to the corresponding numerical range, and the execution result may be returned to the first service.

[0111] In the embodiment of the present application, when the service call request satisfies the repeated call elimination condition, the repeated call situation of the second service in the service dependency link to which it belongs is obtained, and the execution result corresponding to the service call request is obtained according to the acquisition method corresponding to the repeated call situation, and returned to the first service. In the embodiment of the present application, by obtaining the execution result according to the acquisition method corresponding to the repeated call situation, the execution result can be obtained by using the corresponding acquisition method when there is no repeated call or repeated call of the second service, and the method of obtaining the execution result when repeated call occurs and when no repeated call occurs is distinguished, so as to avoid repeated calling of the second service, avoid waste of system resources, and improve system operation efficiency. A large number of repeated calls to basic services are eliminated, so that basic services can reduce machine deployment, reduce resource usage, and save costs for enterprises; in a user's request link, several repeated network requests are eliminated. The delay of the entire request link can be improved, so that the user's request can be responded to more quickly, and the user experience is improved.

[0112] In one embodiment of the present application, step S104 obtains the execution result corresponding to the service call request according to the acquisition method corresponding to the repeated call situation, including:

[0113] Step S201, determining the number of repeated calls according to the repeated call situation, and determining whether the number of repeated calls is within a preset range;

[0114] In the embodiment of the present application, the preset range is that the number of repeated calls is less than 2. When the current service call request is the first call to the second service, the number of repeated calls is within the preset range.

[0115] Step S202, if the number of repeated calls is within a preset range, calling the second service to obtain an execution result;

[0116] Step S203: Obtain the execution result of the second service.

[0117] The embodiment of the present application can normally call the basic service, that is, the second service, when the current service call request is the first call to the basic service in the service dependency link, obtain the execution result of the second service, cache the execution result, so as to return the execution result to the first service normally, and prepare for returning the same execution result when the second service is repeatedly called subsequently by caching the execution result.

[0118] In one embodiment of the present application, the method further includes:

[0119] Step S301, when a bypass transmission triggering condition is met, determining a downstream service located downstream of the first service in the service dependency link;

[0120] In the embodiment of the present application, the bypass transmission triggering condition can be set according to actual needs, for example: the current time reaches the synchronization time, the execution result is obtained, or the acquisition request of the downstream service is received. The downstream service refers to the service that calls the first service in the service dependency link.

[0121] Step S302: Send the execution result to the downstream service.

[0122] In an embodiment of the present application, when the bypass transmission trigger condition is met, the execution result can be bypassed to the downstream service to avoid the downstream service from repeatedly calling the second service, avoid wasting system resources, and improve system operation efficiency.

[0123] In one embodiment of the present application, step S104 obtains the execution result corresponding to the service call request according to the acquisition method corresponding to the repeated call situation, including:

[0124] Step S401, determining the number of repeated calls according to the repeated call situation, and determining whether the number of repeated calls is within a preset range;

[0125] In the embodiment of the present application, the preset range is that the number of repeated calls is less than 2. When the current service call request is not the first call to the second service, the number of repeated calls is not within the preset range.

[0126] Step S402: if the number of repeated calls is not within a preset range, obtaining an execution result corresponding to the second service.

[0127] In one embodiment of the present application, step S302 obtains the execution result corresponding to the second service, including: determining the upstream service located upstream of the first service in the service dependency link; obtaining the execution result sent by any of the upstream services as the execution result corresponding to the second service.

[0128] The embodiment of the present application can directly obtain the execution result of the upstream service when the current service call request is not the first call to the basic service in the service dependency link, without repeatedly calling the second service, thereby avoiding waste of system resources and improving system operation efficiency.

[0129] In another embodiment of the present application, a service calling device is also provided, which is applied to a service proxy component, such as Figure 4 As shown, including:

[0130] A first determining module 11 is used to receive a service calling request from a first service, wherein the service calling request is used to request to call a second service;

[0131] A second determination module 12, configured to determine whether the service call request satisfies a duplicate call elimination condition based on the second service;

[0132] A first acquisition module 13 is used to obtain the repeated calling status of the second service in the service dependency link to which it belongs if the service calling request meets the repeated calling elimination condition;

[0133] The second acquisition module 14 is used to acquire the execution result corresponding to the service call request according to the acquisition method corresponding to the repeated call situation, and return it to the first service.

[0134] Optionally, the second determining module includes:

[0135] A first acquisition unit, configured to acquire service identification information of the second service;

[0136] A first determining unit, configured to determine whether the service identification information is in the service information set and whether a state corresponding to the service identification information is a preset state;

[0137] The second determining unit is configured to determine that the second service satisfies a repeated call elimination condition if the service identification information is in the service information set and the state corresponding to the service identification information is a preset state.

[0138] Optionally, the first acquisition module includes:

[0139] A second acquisition unit, configured to acquire link information corresponding to the service dependency link;

[0140] The third acquisition unit is used to acquire the number of repeated calls corresponding to the second service in the link information as the repeated call situation.

[0141] Optionally, the second acquisition module includes:

[0142] A third determining unit, configured to determine the number of repeated calls according to the repeated call situation, and determine whether the number of repeated calls is within a preset range;

[0143] A calling unit, configured to call the second service to obtain an execution result if the number of repeated calls is within a preset range;

[0144] The fourth acquisition unit is used to acquire the execution result of the second service.

[0145] Optionally, the device further comprises:

[0146] A third determination module, configured to determine a downstream service located downstream of the first service in the service dependency link when a bypass transmission triggering condition is met;

[0147] A sending module is used to send the execution result to the downstream service.

[0148] Optionally, the second acquisition module includes:

[0149] A fourth determining unit, configured to determine the number of repeated calls according to the repeated call situation, and determine whether the number of repeated calls is within a preset range;

[0150] The fifth acquisition unit is used to acquire the execution result corresponding to the second service if the number of repeated calls is not within a preset range.

[0151] Optionally, the fifth acquiring unit includes:

[0152] a determination subunit, configured to determine an upstream service located upstream of the first service in the service dependency link;

[0153] The acquisition subunit is used to obtain the execution result sent by any of the upstream services as the execution result corresponding to the second service.

[0154] In another embodiment of the present application, an electronic device is provided, including 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;

[0155] Memory, used to store computer programs;

[0156] The processor is used to implement any service calling method described in the first aspect when executing the program stored in the memory.

[0157] The electronic device provided by the embodiment of the present invention, the processor executes the program stored in the memory, and when the service call request meets the repeated call elimination condition, obtains the repeated call situation of the second service in the service dependency link to which it belongs, obtains the execution result corresponding to the service call request according to the acquisition method corresponding to the repeated call situation, and returns it to the first service. The embodiment of the present application obtains the execution result according to the acquisition method corresponding to the repeated call situation, and can use the corresponding acquisition method to obtain the execution result when there is no repeated call or repeated call of the second service, distinguish the method of obtaining the execution result when repeated call occurs and when no repeated call occurs, avoid repeated call of the second service, avoid waste of system resources, and improve system operation efficiency. A large number of repeated calls to basic services are eliminated, so that basic services can reduce machine deployment, reduce resource usage, and save costs for enterprises; in a user's request link, several repeated network requests are eliminated. The delay of the entire request link can be improved, so that the user's request can be responded to more quickly, and the user experience is improved.

[0158] The communication bus 1140 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0159] The communication interface 1120 is used for communication between the above electronic device and other devices.

[0160] The memory 1130 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0161] The above-mentioned processor 1110 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0162] In another embodiment of the present application, a computer-readable storage medium is provided, on which a service calling method program is stored. When the service calling method program is executed by a processor, the steps of the service calling method described in any one of the first aspects are implemented.

[0163] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0164] 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 service calling method, characterized in that: Applied in service proxy components, including: Receiving a service invocation request from a first service, wherein the service invocation request is used to request invocation of a second service; Determining whether the service call request satisfies a duplicate call elimination condition based on the second service; If the service call request satisfies a repeated call elimination condition, obtaining repeated call status of the second service in the service dependency link to which it belongs; The execution result corresponding to the service call request is obtained according to the acquisition method corresponding to the repeated call situation, and returned to the first service.

2. The service calling method according to claim 1, characterized in that: Determining whether the service call request satisfies a repeated call elimination condition based on the second service includes: Obtaining service identification information of the second service; Determine whether the service identification information is in the service information set and whether the state corresponding to the service identification information is a preset state; If the service identification information is in the service information set and the state corresponding to the service identification information is a preset state, it is determined that the second service meets the repeated call elimination condition.

3. The service calling method according to claim 1, characterized in that: Obtaining repeated calling status of the second service in the service dependency link to which it belongs, including: Acquire link information corresponding to the service dependency link; The number of repeated calls corresponding to the second service is obtained in the link information as the repeated call situation.

4. The service calling method according to claim 1, characterized in that: Acquiring an execution result corresponding to the service call request according to an acquisition method corresponding to the repeated call situation, including: Determine the number of repeated calls according to the repeated call situation, and determine whether the number of repeated calls is within a preset range; If the number of repeated calls is within a preset range, calling the second service to obtain an execution result; Obtain the execution result of the second service.

5. The service calling method according to claim 1, characterized in that: The method further comprises: When a bypass transmission triggering condition is met, determining a downstream service located downstream of the first service in the service dependency link; The execution result is sent to the downstream service.

6. The service calling method according to claim 1, characterized in that: Acquiring an execution result corresponding to the service call request according to an acquisition method corresponding to the repeated call situation, including: Determine the number of repeated calls according to the repeated call situation, and determine whether the number of repeated calls is within a preset range; If the number of repeated calls is not within a preset range, an execution result corresponding to the second service is obtained.

7. The service calling method according to claim 6, characterized in that: Obtaining an execution result corresponding to the second service, including: Determining an upstream service located upstream of the first service in the service dependency link; Obtain an execution result sent by any of the upstream services as the execution result corresponding to the second service.

8. A service calling device, characterized in that: Applied in service proxy components, including: A first determining module, configured to receive a service invocation request from a first service, wherein the service invocation request is used to request invocation of a second service; A second determination module, configured to determine whether the service call request satisfies a duplicate call elimination condition based on the second service; A first acquisition module is used to obtain the repeated calling status of the second service in the service dependency link to which it belongs if the service calling request meets the repeated calling elimination condition; The second acquisition module is used to acquire the execution result corresponding to the service call request according to the acquisition method corresponding to the repeated call situation, and return it to the first service.

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; The processor is used to implement the service calling method described in any one of claims 1 to 7 when executing the program stored in the memory.

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