Service calling method and device, equipment and medium

By converting application-level service registration information into interface-level call information on the service calling platform, the problem of interface-level service discovery that application-level registration services cannot be called is solved, and the utilization rate of service resources is improved.

CN119621369APending Publication Date: 2025-03-14BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411662609.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

On the service calling platform discovered by interface level service, target services registered at the application level cannot be discovered, resulting in waste of service resources.

Method used

By sending the calling service information to the service registration center, the application-level service registration information is obtained and converted into interface-level call information to realize interface-level calls to services registered at the application-level.

Benefits of technology

It realizes calling services registered at application level on the platform of interface-level service discovery, which improves the utilization rate of existing service resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621369A_ABST
    Figure CN119621369A_ABST
Patent Text Reader

Abstract

The embodiment of the invention relates to a service calling method and device, equipment and a medium, and the method is applied to a service calling platform for interface-level service discovery, and comprises the steps that calling service information is sent to a service registration center, the calling service information represents an application-level target service registered in the service registration center, and the target service is called by the application-level target service; development languages of the target service and the service calling platform are different; obtaining service registration information of an application level corresponding to the calling service information returned by the service registration center; performing interface-level information recombination on the service registration information to obtain interface-level calling information; and in response to a calling request for the target service, calling the target service based on the calling information. Therefore, the information registered by the application-level granularity is converted into the information of the interface-level granularity, and the service is called according to the information of the interface-level granularity, so that the calling of the service registered by the application-level granularity is realized on a platform for service discovery by the interface-level granularity, and the utilization rate of service resources is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a service invoking method, device, equipment and medium. Background Art

[0002] With the development of computer technology, calls between services are becoming more and more frequent. The call can be implemented through a call platform built based on Remote Procedure Call Protocol (RPC). However, since the service provider is registered at the application level and the service caller is discovered at the interface level, the interface-level caller on the call platform cannot discover the service provided by the application-level provider, wasting existing service resources. Summary of the invention

[0003] In order to solve the above technical problems, the present disclosure provides a service calling method, apparatus, device and medium.

[0004] The present disclosure provides a service invocation method, which is applied to a service invocation platform for interface-level service discovery. The method includes:

[0005] Sending the calling service information to the service registration center, wherein the calling service information indicates the application-level target service registered in the service registration center, and the development language of the target service and the service calling platform are different;

[0006] Obtaining application-level service registration information corresponding to the calling service information returned by the service registration center;

[0007] Reorganize the service registration information into interface-level information to obtain interface-level call information;

[0008] In response to the call request for the target service, the target service is called based on the call information.

[0009] The embodiment of the present disclosure also provides a service calling device, which is arranged on a service calling platform for interface-level service discovery, and the device includes:

[0010] A sending module, used to send the calling service information to the service registration center, wherein the calling service information represents the application-level target service registered in the service registration center, and the development language of the target service and the service calling platform are different;

[0011] An acquisition module, used to acquire application-level service registration information corresponding to the calling service information returned by the service registration center;

[0012] A conversion module, used for reorganizing the service registration information into interface-level information to obtain interface-level call information;

[0013] The calling module is used to call the target service based on the calling information in response to the calling request for the target service.

[0014] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the service calling method provided by the embodiment of the present disclosure.

[0015] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the service calling method provided by the embodiment of the present disclosure.

[0016] Compared with the prior art, the technical solution provided by the embodiment of the present disclosure has the following advantages: the service calling method provided by the embodiment of the present disclosure is applied to the service calling platform of interface-level granularity service discovery, including: sending calling service information to the service registration center, wherein the calling service information represents the target service at the application level registered in the service registration center, and the development language of the target service and the service calling platform are different; obtaining the application-level service registration information corresponding to the calling service information returned by the service registration center; reorganizing the service registration information into interface-level information to obtain interface-level calling information; responding to the calling request for the target service, calling the target service based on the calling information. With the above technical solution, the service registration center returns the service registration information at the application-level granularity according to the calling service information sent by the service calling platform, and the service calling platform converts the service registration information into the calling information at the interface-level granularity, and calls the target service according to the calling information, realizing the conversion of the information registered at the application-level granularity into the information at the interface-level granularity and calling the corresponding service according to the information at the interface-level granularity, realizing the calling of the service registered at the application-level granularity on the platform for service discovery at the interface-level granularity, and improving the utilization rate of the existing service resources. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0018] Figure 1 A flowchart of a service calling method provided in an embodiment of the present disclosure;

[0019] Figure 2A flowchart of another service calling method provided by an embodiment of the present disclosure;

[0020] Figure 3 A schematic diagram of a framework of a service calling method provided in an embodiment of the present disclosure;

[0021] Figure 4 A schematic diagram of another service calling method provided by an embodiment of the present disclosure;

[0022] Figure 5 A schematic diagram of the structure of a service calling device provided in an embodiment of the present disclosure;

[0023] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0024] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0025] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0026] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0027] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0028] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0029] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0030] With the development of computer technology, calls between services are becoming more and more frequent. This call can be implemented through a call platform (for example, Dubbo) built based on Remote Procedure Call Protocol (RPC). Java services such as Dubbo 2.x perform service discovery at the interface level, but C++ services register services at the application level, so Dubbo 2.x does not support cross-language service calls. Dubbo 3.x can perform service discovery at the application level, and cross-language service calls can be implemented through Dubbo 3.x, but Dubbo 3.x only supports Nacos, Zookeeper and other registration centers, and Dubbo 3.x does not support Consul registration center for application-level granularity discovery. However, a large number of C++ services are registered with the Consul registration center, and there are a large number of Java services that need to call these C++ services. The Java service as the caller cannot discover the C++ service as the provider.

[0031] In the related art, it is necessary to migrate the provider's C++ service from registering with the Consul registry to registering with the Nacos registry, and upgrade Dubbo to version 3.x to implement cross-language calls. However, the above method is a huge cost for the service provider, and all services need to be migrated to the Nacos registry. The number of migrated services is too large, the transformation cost is huge, and it may cause service instability and lead to online failures. Therefore, there is an urgent need for a method that can discover services registered at the application level granularity through the interface level granularity.

[0032] In order to solve the above technical problems, the embodiments of the present disclosure provide a service calling method, which is introduced below in conjunction with specific embodiments.

[0033] Figure 1 A flow chart of a service calling method provided in an embodiment of the present disclosure is provided. The method can be executed by a service calling device or a service calling platform for interface-level service discovery, wherein the device can be implemented using software and / or hardware and can generally be integrated in an electronic device.

[0034] like Figure 1 As shown, the method includes:

[0035] Step 101: Send the calling service information to the service registration center, wherein the calling service information indicates the application-level target service registered in the service registration center, and the development language of the target service and the service calling platform are different.

[0036] Among them, the service call platform can be a software platform for implementing remote procedure calls (RPC) between services. The service call platform can be a software platform for service discovery at the interface level granularity. The present embodiment does not limit the development language of the service call platform. For example, the development language of the service call platform can include Java language or Python language, etc. The present embodiment does not limit the type of the service call platform. For example, the service call platform can be a software platform obtained by extending and developing the original call platform based on the extension point development (Service Provider Interface, SPI) mechanism. The original call platform can be a software platform with a call function between Java services. The present embodiment does not limit the original call platform. For example, the original call platform can be Dubbo version 2.x or Dubbo version 3.x. If the original platform is Dubbo version 3.x, the service call platform is obtained by extending and developing the interface-level granularity service discovery function part based on Dubbo version 3.x. The interface level can be the smallest granularity with the functional interface, that is, the functional interface as the basic unit.

[0037] The calling service information may be information for identifying the target service, and the calling service information may include the name or identifier of the target service, etc. The service registration center may be a software center for registering and discovering services. In the service registration center, the target service may be the provider of the service, and the service calling platform may be the caller of the service. The provider registers itself in the service registration center, and the caller discovers the corresponding service provider based on the service registration center and makes a call. This embodiment does not limit the type of the service registration center. For example, the service registration center may be a Consul registration center. The disclosed embodiment does not limit the correspondence between the service registration center and the service calling platform. For example, the service registration center and the service calling platform may correspond one to one.

[0038] The target service may be a service that needs to be discovered by the service call platform. The target service may have multiple functional interfaces. The functional interfaces may correspond to the functions implemented by the target service. The function interfaces may be used to call the corresponding functions of the target service. The target service may be a service that the service call platform itself needs to call, or the target service may be a service that the access service of the access service call platform needs to call. The access service may be a service developed in Java. The number of the target services may be one or more. The target service may be a service registered at the application level granularity. This embodiment does not limit the development language of the target service. For example, the development language of the target service may include C++ or Python. The different development languages ​​of the target service and the service call platform may be understood as different program language environments of the target service and the service call platform. In an optional implementation, the development language of the target service is C++ and the development language of the service call platform is Java. The application level may be based on the application as the smallest granularity, that is, the application as a whole is the basic unit.

[0039] In the embodiment of the present disclosure, when the service calling device is started, the service calling device can transmit the calling service information pre-configured for itself to the service registration center through the HyperText Transfer Protocol (HTTP) interface of the service registration center. Alternatively, the service calling device can access one or more access services that need to call the target service, and the corresponding calling service information is pre-set for the access service. When the access service is started, the service calling device can determine the calling service information of the access service and send the calling service information to the service registration center.

[0040] Step 102: Obtain application-level service registration information corresponding to the calling service information returned by the service registration center.

[0041] Among them, the service registration information may be information that the target service has registered in advance in the service registration center, and the service registration information may be used to call the target service. In some embodiments of the present disclosure, the service registration information includes a calling service address, a calling service end, and registration interface information corresponding to the target service, and the registration interface information includes multiple registration interface names registered at the application level by the target service. The calling service address may be the Internet Protocol (IP) address of the target device where the called target service is located. The calling service end may be the port number of the target service called in the target device. The registration interface information may be information about the functional interface provided by the target service for other services, and the registration interface information may be the overall information of the application corresponding to the target service. A registration interface name may be the name of a functional interface provided by the target service to an external service. Optionally, the service registration information may also include: one or more of computer room information, regional information, and interface call parameter information.

[0042] In the disclosed embodiment, the target service pre-registers the service registration information of the application-level granularity to the service registration center through the remote procedure call protocol. The present embodiment does not limit the remote procedure call protocol. For example, the remote procedure call protocol can be a high-performance remote procedure call (gRPC) protocol. In the service registration center, the target service name and its corresponding service registration center are recorded. After receiving the calling service information, the service registration center returns the service registration information corresponding to the target service name consistent with the calling service information to the service calling device, and the service calling device receives the service registration information.

[0043] Step 103: reorganize the service registration information into interface-level information to obtain interface-level calling information.

[0044] Among them, the call information can be used to make an interface-level call to the corresponding function of the target service through the functional interface. The call information can be information corresponding to the functional interface in the format of an invoking object (Invoker). The call information can be an interface-level instance of the target service for calling. The call information can be a Java object that is directly called.

[0045] In the embodiment of the present disclosure, after obtaining the service registration information of application-level granularity returned by the hypertext transfer protocol interface of the service registration center, the service calling device splits and reorganizes the service registration information at the interface-level granularity to obtain the calling information at the interface level, and caches the calling information for subsequent target service calls.

[0046] Figure 2 A flow chart of another service calling method provided by an embodiment of the present disclosure, such as Figure 2As shown, in some embodiments of the present disclosure, the service registration information is reorganized into interface-level information to obtain interface-level call information, including:

[0047] Step 201: Arrange and concatenate each registration interface name in the service registration information with the calling service address and calling service port in the service registration information in a preset information sequence to obtain a plurality of intermediate information; wherein the intermediate information corresponds to the registration interface name.

[0048] The preset information sequence may be a pre-set registration interface name, a calling service address, and an information arrangement sequence between the calling service port, and this embodiment does not limit the preset information sequence. The intermediate information may be information determined in the process of converting the application-level service registration information into the interface-level calling information, and the intermediate information may be information in a uniform resource locator (URL) format, and the intermediate information may be information based on which the service calling platform performs interface-level service discovery.

[0049] In this embodiment, the service calling device can obtain each registered interface name in the service registration information, and arrange and splice each registered interface name with the calling service address and calling service port in the service registration information in a preset information order to obtain intermediate information corresponding to the registered interface name. For example, if the service registration information includes 10 registered interface names, 10 intermediate information are obtained.

[0050] Step 202: convert the formats of the multiple intermediate information to obtain multiple call information.

[0051] In this embodiment, the service calling device can convert the data format of each intermediate information respectively to obtain calling information corresponding to the intermediate information one by one.

[0052] In some embodiments of the present disclosure, multiple intermediate information are format-converted to obtain multiple call information, including: converting the multiple intermediate information from a uniform resource locator format to a call object format to obtain multiple call information.

[0053] The uniform resource locator format may be a data format that meets the requirements of the data structure corresponding to the uniform resource locator, and the uniform resource locator format may be a flat and long data structure. The call object format may be a format that meets the requirements of the data structure corresponding to the call object, and the call object format may be a three-dimensional data structure.

[0054] In this embodiment, for the intermediate information in the uniform resource locator format, the service calling device can extract data from the intermediate information and construct the calling information in the calling object format according to the extracted data. Thus, the conversion of information from the uniform resource locator format to the calling object format is realized, and after the service calling device discovers the service at the interface level granularity, a foundation is created for performing service calling at the interface level granularity.

[0055] In the above scheme, the application-level service registration information is converted into the interface-level calling information, which creates a foundation for implementing the interface-level service calling on the basis of the service registration at the application level.

[0056] Optionally, before arranging and splicing each registered interface name in the service registration information with the calling service address and calling service port in the service registration information in a preset information order to obtain multiple intermediate information, the service calling device can also delete the registered interface names that do not belong to the preset interface names. The preset interface name can be a preset interface name that needs to be retained. This achieves the interface-level preliminary screening of the registered interface names, generates the calling information corresponding to the functional interface required by the service calling device, avoids the generation of redundant calling information, and saves cache space and data processing resources.

[0057] Step 104: In response to the call request for the target service, the target service is called based on the call information.

[0058] The call request may be used to make an interface-level call to a specific function of a target service.

[0059] In this embodiment, the service calling device can generate a call request according to its own call demand for the target service, and call the target service at the interface level according to the call request. Alternatively, the service calling device is connected to multiple access services, and the access service generates a call request according to its own call demand for the target service and sends the call request to the service calling device, and the service calling device receives the call request and calls the target service at the interface level according to the call request.

[0060] In some embodiments of the present disclosure, calling a target service based on calling information includes: extracting the target interface name in the calling request, determining the calling information whose corresponding registered interface name is consistent with the target interface name as the target calling information; and calling the target service through the interface corresponding to the target calling information.

[0061] The target interface name may be the name of the functional interface to be called, and the target call information may be the information based on which the target service call is specifically made.

[0062] In this embodiment, after determining the call request, the service call device parses the call request and extracts the target interface name in the call request. Further, the target interface name is compared with the registered interface name in the call information, the call information in which the registered interface name is consistent with the target interface name is determined, and the call information is determined as the target table information. The functional interface of the target service is determined according to the target call information, and the corresponding function of the target service is called through the functional interface.

[0063] In the above scheme, the calling information is screened by the interface name, and the service calling device for service discovery at the interface level calls the target service registered at the application level.

[0064] Figure 3 A schematic diagram of a service calling method provided by an embodiment of the present disclosure is shown in FIG. Figure 3 As shown, the target service can be a service developed in C++, the service registration center can be the Consul registration center, and the service call platform can be a software platform developed in Java. As the service provider, the target service is registered to the service registration center at the application level granularity, and the service call platform, as the service caller, performs service subscription discovery at the interface level granularity through the corresponding toolkit (Software Development Kit, SDK), thereby realizing the discovery of the target service at the application level granularity registered on the service registration center at the interface level granularity.

[0065] The service calling scheme provided by the embodiment of the present disclosure is applied to the service calling platform of interface-level granularity service discovery, including: sending calling service information to the service registration center, wherein the calling service information represents the target service at the application level registered in the service registration center, and the development language of the target service and the service calling platform are different; obtaining the application-level service registration information corresponding to the calling service information returned by the service registration center; reorganizing the service registration information into interface-level information to obtain interface-level calling information; and responding to the calling request for the target service, calling the target service based on the calling information. With the above technical scheme, the service registration center returns the service registration information at the application-level granularity according to the calling service information sent by the service calling platform, and the service calling platform converts the service registration information into calling information at the interface-level granularity, and calls the target service according to the calling information, realizing the conversion of the information registered at the application-level granularity into the information at the interface-level granularity and calling the corresponding service according to the information at the interface-level granularity, realizing the calling of the service registered at the application-level granularity on the platform for service discovery at the interface-level granularity, and improving the utilization rate of existing service resources.

[0066] In some embodiments of the present disclosure, before performing format conversion on multiple intermediate information to obtain multiple call information, the service call method further includes: combining multiple intermediate information with the same registration interface name into an intermediate information group. Accordingly, performing format conversion on multiple intermediate information to obtain multiple call information includes: performing format conversion on multiple intermediate information in units of intermediate information groups to obtain a call information group including multiple call information.

[0067] The intermediate information group may be a collection of intermediate information, which may correspond to the registered interface name one by one, and the intermediate information group may be understood as a list of intermediate information. The call information group may be a collection of call information, which may correspond to the registered interface name one by one, and the call information group may be understood as a list of call information.

[0068] In this embodiment, the number of target services can be multiple, that is, the same target service can be deployed on multiple target devices. One target service can correspond to multiple registered interface names, that is, one target service can provide multiple functional interfaces.

[0069] Since the call service addresses and other information of multiple target devices providing the same target service are different, for the same target service, multiple target devices providing the target service correspond to multiple call service information, and the target service on the specified target device can be called through the call service information. The target device registers the corresponding call service information to the service registration center. The service call device sends the call service information to the service registration center, and the service registration center determines the multiple service registration information corresponding to the call service information, and returns the multiple service registration information to the service call device, and the multiple service registration information corresponds to the same target service. The service call device extracts and sorts the data for each service registration information to obtain the intermediate information corresponding to each service registration information. Furthermore, the service call device divides the multiple intermediate information with the same registration interface name into the same intermediate information group. An intermediate information group corresponding one to one to the registration interface name is obtained.

[0070] Furthermore, the service calling device converts the intermediate information in the intermediate information group from the uniform resource locator format to the calling object format to obtain a calling information group containing multiple calling information. For example, if there are interface A and interface B, interface A corresponds to one intermediate information group and one calling information group, and interface B corresponds to one intermediate information group and one calling information group.

[0071] In the above scheme, the call information corresponding to the same registered interface name is divided into the same call information group, which creates a basis for subsequent load-balanced service calls based on the call information group.

[0072] In some embodiments of the present disclosure, calling a target service based on call information includes: determining a call information group where the call information is located, determining target call information in the call information group according to a preset load balancing algorithm, and calling the target service through an interface corresponding to the target call information. The load balancing algorithm may be a pre-set algorithm for evenly distributing workloads between target devices that provide the target service, and this embodiment does not limit the load balancing algorithm.

[0073] In this embodiment, after determining the call information, the service call device can extract the target interface name in the call request and determine the call information group where the call information whose corresponding registered interface name is consistent with the target interface name is located. Further, the target call information is determined from the multiple call information in the call information group according to a preset load balancing algorithm, and the target service on the corresponding target device is called through the interface corresponding to the target call information.

[0074] In the above scheme, the target calling information in the calling information group is determined by the load balancing algorithm, so that the target device providing the target service is called in a balanced manner, thereby balancing the load of the target device.

[0075] In some embodiments of the present disclosure, the interface call platform includes a first inheritance class and a second inheritance class, the service call method is implemented by the first rewriting method of the first inheritance class, and the second rewriting method of the second inheritance class calls the first rewriting method. Among them, the first inheritance class is the inheritance class of the registration discovery (ConsulRegistry) class in the original call platform, the first rewriting method is the rewriting method of the getHealthServices method in the registration discovery class, the second inheritance class is the inheritance class of the registration discovery factory (AbstractRegistryFactory) class in the original call platform, and the second rewriting method is the rewriting method of the create registration (createRegistry) method in the registration discovery factory class. Among them, the original call platform can be the original 2.x version of Dubbo.

[0076] The first rewriting method implements the service calling method provided by any of the above embodiments. Specifically, the first rewriting method can call the hypertext transfer protocol interface of the service registration center to obtain the service registration information of the target service registered at the application level granularity on the service registration center. Then, the service registration information is parsed, and the intermediate information required for the service calling device to perform service discovery at the interface level granularity is constructed.

[0077] And add a configuration file directory under the corresponding resource directory in the code project, and add a configuration file of the second inheritance class to the configuration file directory. The configuration file is used to configure the second inheritance class. The configuration file includes a prefix part and a suffix part. The prefix part can be an identifier that represents the second inheritance class, and the suffix part can be the specific name of the second inheritance class. Further, the adjusted code is packaged and provided to the caller of the service for use. When the caller of the service uses the adjusted code, it configures the above prefix part in the configuration information of the service registration center, thereby realizing the subsequent operation of the adjusted code.

[0078] Figure 4 A schematic diagram of another service calling method provided by the embodiment of the present disclosure is shown in FIG. Figure 4 As shown, the target service is pre-registered with the service registration center. When the service call platform is started, it constructs a corresponding request according to the pre-configured call service information and the hypertext transfer protocol interface of the service registration center, and obtains the service registration information of the target service on the service registration center through the request. Further, after obtaining the service registration information, the call service address, call service end, registration interface information, etc. in the service registration information are extracted, and the call service address, call service end, and registration interface information are encapsulated and combined to construct the intermediate information required for the service call platform to perform interface-level service discovery, and the intermediate information is divided into intermediate information groups according to the registration interface information. Further, the intermediate information is extracted and format converted, and encapsulated into call information that can be directly called. The call information is grouped in the call information group, and each call information represents an instance of a target service that can be called. Further, the service call platform caches the call information group, and each time a call is required, a target call information is selected from the call information group according to the load balancing algorithm for calling.

[0079] The service calling method provided by the embodiment of the present disclosure solves the cross-language calling problem between Java services that perform service discovery at the interface level and C++ services that perform service registration at the application level, avoiding the huge cost and instability consumed by the migration and transformation of a large number of services. It creates a foundation for unified management of services and traffic scheduling, improves the efficiency of cross-language service calling, reduces the instability of services caused by migration, and reduces the probability of online failures.

[0080] Specifically, an intermediate adaptation layer is added, and corresponding code logic is added to the service call platform toolkit (Dubbo SDK) used by the Java service as the caller. This enables the discovery of service registration information registered by the service provider (for example, C++ service) from the service registration center at the application-level granularity by calling the service information during service discovery. After obtaining the service registration information, corresponding screening, reorganization, encapsulation and other processing are performed, and then the information is converted into the call information required for the caller (for example, Java service) to perform interface-level granularity service discovery. In this way, the caller can discover the information of the provider service and use load balancing algorithms, local routing and other functions to perform remote procedure calls.

[0081] This method realizes the mixed use of application-level granularity and interface-level granularity. The service provider uses application-level granularity for registration, and the service caller uses interface-level granularity for service discovery. Therefore, services with different registration granularities can be included in a unified service call platform for discovery, eliminating the barriers between services of different granularities, so that services can be placed in a unified call pool for other services to call.

[0082] Figure 5 This is a schematic diagram of the structure of a service invocation device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated into an electronic device or a service invocation platform for interface-level service discovery. Figure 5 As shown, the device comprises:

[0083] The sending module 501 is used to send the calling service information to the service registration center, wherein the calling service information represents the application-level target service registered in the service registration center, and the development language of the target service and the service calling platform are different;

[0084] The acquisition module 502 is used to acquire the application-level service registration information corresponding to the calling service information returned by the service registration center;

[0085] The conversion module 503 is used to reorganize the service registration information into interface-level information to obtain interface-level call information;

[0086] The calling module 504 is configured to call the target service based on the calling information in response to the calling request for the target service.

[0087] Optionally, the service registration information includes a calling service address, a calling server, and registration interface information corresponding to the target service, and the registration interface information includes a plurality of registration interface names registered at the application level for the target service.

[0088] Optionally, the conversion module 503 includes:

[0089] An arrangement submodule, used to arrange and splice each of the registration interface names in the service registration information with the calling service address and the calling service port in the service registration information in a preset information order to obtain a plurality of intermediate information; wherein the intermediate information corresponds to the registration interface name;

[0090] The conversion submodule is used to convert the formats of the multiple intermediate information to obtain multiple call information.

[0091] Optionally, the conversion submodule is used to:

[0092] The plurality of intermediate information are converted from a uniform resource locator format into a call object format to obtain the plurality of call information.

[0093] Optionally, calling the target service based on the calling information includes:

[0094] Extracting the target interface name in the call request, and determining the call information whose corresponding registered interface name is consistent with the target interface name as the target call information;

[0095] The target service is called through the interface corresponding to the target calling information.

[0096] Optionally, the service calling device further comprises a combining module, which is used to combine multiple intermediate information with the same registration interface name into one intermediate information group before converting the format of the multiple intermediate information to obtain multiple calling information;

[0097] Accordingly, the conversion submodule is used to:

[0098] The intermediate information groups are used as units to perform format conversion on the plurality of intermediate information to obtain a calling information group including a plurality of calling information.

[0099] Optionally, calling the target service based on the calling information includes:

[0100] Determine the call information group to which the call information belongs, determine the target call information in the call information group according to a preset load balancing algorithm, and call the target service through the interface corresponding to the target call information.

[0101] The service calling device provided in the embodiments of the present disclosure can execute the service calling method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.

[0102] The embodiments of the present disclosure also provide a computer program product, including a computer program / instruction, which implements the service calling method provided by any embodiment of the present disclosure when executed by a processor.

[0103] Figure 6 This is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. Figure 6 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure. The electronic device 600 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0104] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0105] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0106] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the service call method of the embodiment of the present disclosure are executed.

[0107] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0108] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0109] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0110] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the electronic device, the electronic device: obtains a first image and a first video and a second video corresponding to the first image, wherein the resolution of the second video is greater than that of the first video; determines a first target time point of the first image in the first video; extracts a second image in the second video based on the first target time point, and determines a target image based on the second image; and determines the target image as a base map for generating a preset image for the first video and / or the second video.

[0111] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0112] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0113] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, constitute a limitation on the unit itself.

[0114] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0115] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0116] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0117] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0118] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0119] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.

Claims

1. A service calling method, characterized in that: A service invocation platform applied to interface-level service discovery, the method comprising: Sending the calling service information to the service registration center, wherein the calling service information indicates the application-level target service registered in the service registration center, and the development language of the target service and the service calling platform are different; Obtaining application-level service registration information corresponding to the calling service information returned by the service registration center; Reorganize the service registration information into interface-level information to obtain interface-level call information; In response to the call request for the target service, the target service is called based on the call information.

2. The method according to claim 1, characterized in that The service registration information includes a calling service address, a calling server, and registration interface information corresponding to the target service. The registration interface information includes a plurality of registration interface names registered at the application level by the target service.

3. The method according to claim 2, characterized in that The service registration information is reorganized into interface-level information to obtain interface-level call information, including: Arrange and splice each of the registration interface names in the service registration information with the calling service address and the calling service port in the service registration information in a preset information order to obtain a plurality of intermediate information; wherein the intermediate information corresponds to the registration interface name; The multiple intermediate information are formatted to obtain multiple call information.

4. The method according to claim 3, characterized in that The multiple intermediate information are formatted to obtain multiple call information, including: The plurality of intermediate information are converted from a uniform resource locator format into a call object format to obtain the plurality of call information.

5. The method according to claim 1, characterized in that: Calling the target service based on the calling information includes: Extracting the target interface name in the call request, and determining the call information whose corresponding registered interface name is consistent with the target interface name as the target call information; The target service is called through the interface corresponding to the target calling information.

6. The method according to claim 3, characterized in that Before converting the format of the plurality of intermediate information to obtain the plurality of call information, the method further includes: Combine multiple intermediate information with the same registration interface name into one intermediate information group; Accordingly, the multiple intermediate information are formatted and multiple call information are obtained, including: The intermediate information groups are used as units to perform format conversion on the plurality of intermediate information to obtain a calling information group including a plurality of calling information.

7. The method according to claim 6, characterized in that Calling the target service based on the calling information includes: Determine the call information group to which the call information belongs, determine the target call information in the call information group according to a preset load balancing algorithm, and call the target service through the interface corresponding to the target call information.

8. A service calling device, characterized in that: A service calling platform is provided for interface-level service discovery, and the device comprises: A sending module, used to send the calling service information to the service registration center, wherein the calling service information represents the application-level target service registered in the service registration center, and the development language of the target service and the service calling platform are different; An acquisition module, used to acquire application-level service registration information corresponding to the calling service information returned by the service registration center; A conversion module, used for reorganizing the service registration information into interface-level information to obtain interface-level call information; The calling module is used to call the target service based on the calling information in response to the calling request for the target service.

9. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the service calling method described in any one of claims 1-7 above.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the service calling method described in any one of claims 1 to 7.