Method, apparatus, device, and storage medium for cross-platform call service

By using service configuration files and integrated processing to generate address addresses, cross-platform calling services are implemented, which solves the problems of insufficient resources and extended addressing time caused by cross-platform calling, and improves the efficiency of service calling.

CN115955462BActive Publication Date: 2025-06-27CHINA CONSTRUCTION BANK +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211620627.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-15
Publication Date
2025-06-27
Estimated Expiration
2042-12-15

AI Technical Summary

Technical Problem

During the process of localization of information and innovation, cross-platform and cross-environment service calls have problems such as insufficient resources and extended addressing time, especially when synchronizing data between multiple platforms, resulting in resource expansion and performance degradation.

Method used

By determining the service information of the target service to be called, and based on the preset service configuration file, the first domain name address of the second platform related to the service information is determined, and the integration process is performed to generate an address address, and then accessing the second platform to obtain the IP address of the service providing node, and calling the service providing node's services based on the IP address.

Benefits of technology

This solution implements cross-platform calls through configuration files, avoiding resource expansion, improving addressing speed, and improving the effectiveness of service calls.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115955462B_ABST
    Figure CN115955462B_ABST
Patent Text Reader

Abstract

The present application provides a method, device, equipment and storage medium for cross-platform service invocation. It relates to the technical field of big data processing. The method includes: determining the service information of the target service to be invoked, determining the first domain name address of the second platform related to the service information based on a preset service configuration file, integrating and processing the first domain name address and the service information to generate an addressing address, accessing the second platform based on the addressing address, obtaining the IP address of the service providing node that provides the target service from the second platform, and invoking the service of the service providing node based on the IP address. It can achieve the purpose of cross-platform service invocation by integrating the service configuration file and the address. Compared with the existing method of data synchronization between platforms, this solution only needs to maintain the configuration file, thereby avoiding resource expansion, and the addressing speed can also be improved through the configuration file, thus enhancing the service invocation effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of big data processing, and in particular, to a method, device, equipment and storage medium for cross-platform service invocation. Background Art

[0002] In the process of domestic substitution in the field of information technology, some services or platforms may be adapted to the domestic environment first, and cross-platform and cross-environment service invocation problems may occur when these services are invoked with the original services. For example, for a platform built based on a Nacos cluster, the services in each platform can only invoke the services registered in that platform, and cross-platform service invocation technology is required to invoke the services of other platforms. When related technologies solve the cross-platform service invocation of the Nacos cluster, the Nacos synchronization method is adopted. The data of the two Nacos clusters are synchronized through NacosSync, so that both sides have full data. However, if the number of platforms is very large, synchronizing data between platforms will cause insufficient resources in the original platform, thus requiring expansion, resulting in a doubling of resource requirements and an extension of the addressing time. Therefore, it affects the effect of cross-platform service invocation. Summary of the Invention

[0003] This application provides a method, device, equipment and storage medium for cross-platform service invocation, aiming to solve at least one of the technical problems in the related technologies to a certain extent.

[0004] In a first aspect, this application provides a method for cross-platform service invocation, which is applied to a service consumer node registered on a first platform. The method includes: determining the service information of a target service to be invoked; determining a first domain name address of a second platform related to the service information based on a preset service configuration file; integrating and processing the first domain name address and the service information to generate an addressing address; accessing the second platform based on the addressing address, and obtaining the IP address of a service provider node that provides the target service from the second platform; and invoking the service of the service provider node based on the IP address.

[0005] In a second aspect, this application provides a device for cross-platform service invocation, including: a first determination module, configured to determine the service information of a target service to be invoked; a second determination module, configured to determine a first domain name address of a second platform related to the service information based on a preset service configuration file; an integration module, configured to integrate and process the first domain name address and the service information to generate an addressing address; an addressing module, configured to access the second platform based on the addressing address, and obtain the IP address of a service provider node that provides the target service from the second platform; and an invocation module, configured to invoke the service of the service provider node based on the IP address.

[0006] In a third aspect, the present application provides an electronic device, including: a processor; and a memory for storing instructions executable by the processor; wherein, the processor is configured to execute the instructions to implement a method for cross-platform calling of services.

[0007] In a fourth aspect, the present application provides a computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enabling the electronic device to execute a method for cross-platform calling of services.

[0008] In a fifth aspect, the present application provides a computer program product, including a computer program, and the computer program is executed by a processor to implement a method for cross-platform calling of services.

[0009] The method, device, equipment and storage medium for cross-platform calling of services provided by the present application determine the service information of the target service to be called, and based on a preset service configuration file, determine the first domain name address of the second platform related to the service information, and perform an integration process on the first domain name address and the service information to generate an addressing address, and access the second platform based on the addressing address, and obtain the IP address of the service providing node that provides the target service from the second platform, and call the service of the service providing node based on the IP address. It can achieve the purpose of cross-platform calling of services by integrating the service configuration file and the address. Compared with the existing method of data synchronization between platforms, this solution only needs to maintain the configuration file, thereby avoiding resource expansion, and the addressing speed can also be improved through the configuration file, and then the service call effect can be enhanced. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0011] Figure 1 is a schematic flowchart of a method for cross-platform calling of services shown in the first embodiment of the present application;

[0012] Figure 2 is a schematic flowchart of the process of calling services between platforms shown in an embodiment of the present application;

[0013] Figure 3 is a schematic flowchart of a method for cross-platform calling of services shown in the second embodiment of the present application;

[0014] Figure 4 is a block diagram of a device for cross-platform calling of services shown in the present application;

[0015] Figure 5 shows a block diagram of an exemplary electronic device suitable for implementing the embodiments of the present application.

[0016] Through the above-mentioned drawings, specific embodiments of the present application have been shown, and will be described in more detail hereinafter. These drawings and the written description are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by reference to specific embodiments. Detailed Embodiments

[0017] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the drawings are exemplary only for explaining the present application and should not be construed as limiting the present application. On the contrary, the embodiments of the present application include all variations, modifications, and equivalents falling within the spirit and scope of the appended claims.

[0018] It should be noted that the execution subject of the method for cross-platform call service in this embodiment may be a device for cross-platform call service, which may be implemented in software and / or hardware, and the device may be configured in an electronic device, which may include but is not limited to a terminal, a server, etc.

[0019] Figure 1 is a flowchart of the method for cross-platform call service according to the first embodiment of the present application. As Figure 1 shown, the method is applied to a service consumption node registered on the first platform, and the method includes:

[0020] S101: Determine the service information of the target service to be called.

[0021] In the embodiments of the present disclosure, in the case of needing to call a service, the service consumption node (which may also be referred to as a service consumer Service) first determines the service information of the target service to be called.

[0022] Among them, the service that the service consumption node currently needs to call may be referred to as the target service. The target service may be, for example, querying a bill, modifying an order, adding a member, and any other possible services, which are not limited herein. And, the target service is provided by a service providing node (which may also be referred to as a service provider Service), that is: the service providing node provides services such as bill information management, order information management, member information management, etc., and different service providing nodes may provide different services.

[0023] The information related to the target service may be referred to as service information. In some embodiments, the service information may be the name of the target service, such as "order", "bill", "member information", etc.; or the service information may also be the service number of the target service, which is not limited herein.

[0024] Among them, the service consumption node is registered on the first platform, and the service provider node is registered on the second platform. The first platform and the second platform can be built based on any technology. For example, they can be built based on the Nacos cluster, and there is no restriction on this.

[0025] In a specific example, Figure 2 is a schematic diagram of the process of calling services between platforms shown in the embodiments of the present application. As Figure 2 shown, platform A can be used as the first platform, and platform B can be used as the second platform. Platform A and platform B can be built based on the Nacos cluster, that is: platform A is built by Nacos cluster A, and platform A is built by Nacos cluster B. Among them, the first platform (Nacos cluster A) can register multiple services, including ServiceA1, ServiceA2, ServiceA3, etc. That is to say, each node in the cluster can be used as a service node. Among them, each service node can be, for example, a service provider node (service consumer) or a service consumption node (service consumer), and there is no restriction on this; similarly, the second platform (Nacos cluster B) can also register multiple services, including: ServiceB1, ServiceB2, ServiceB3, etc. That is: each node in cluster B can be used as a service node, and each service node can be, for example, a service provider node (service consumer) or a service consumption node (service consumer). It should be noted that the first platform and the second platform are configured with a domain name resolution service.

[0026] In the embodiments of the present disclosure, the service provider node can be any node in the first platform (Nacos cluster A) that needs to call a service. For example, ServiceA1. That is to say, ServiceA1 first determines the service information of the target service to be called.

[0027] S102: Based on a preset service configuration file, determine the first domain name address of the second platform related to the service information.

[0028] In the embodiments of the present disclosure, each platform (for example, platform A and platform B) can pre-configure a service configuration file, which is used to record the domain name address of the platform (Nacos cluster) providing the service and the service information of the platform.

[0029] In some embodiments, multiple platforms can maintain a unified service configuration file. That is to say, the service configuration file records the domain name addresses of all platforms and the service information provided by each platform; or, each platform can maintain a service configuration file separately, and this service configuration file records the service information of the services that each service consumption node on the platform needs to call and the domain name address of the platform where the service is located.

[0030] For example, the service configuration file of the first platform (Platform A) records the domain names of multiple other platforms (including Platform B) and the service information provided by the platforms. In some embodiments, the service configuration file may be in the form of a table, as shown in Table 1 below:

[0031] Table 1

[0032] Platform Name Domain Name Address Service Information Platform B www.... Billing Service Platform C www.... Membership Service ... ... ...

[0033] As shown in Table 1, the service configuration file can record the service data of multiple platforms. Each service data includes, for example, the platform name, the platform domain name, and the service information of one or more services provided by the platform (e.g., service name, service number, etc.).

[0034] In practical applications, as Figure 2 shown, the service configuration file can be configured in the service configuration module of the platform. After the service consumption node determines the service information of the target service, it can read the service configuration file in the service configuration module ( Figure 2 step 1 in it) to determine the domain name of the second platform related to the service information, and this domain name can be referred to as the first domain name.

[0035] For example, if the target service to be invoked by the service consumption node ServiceA1 is to query the bill, the service consumption node ServiceA1 first determines the corresponding service information. The service information may include, for example, the service name ("bill"), the service number, etc., and there is no limitation on this; further, the service consumption node ServiceA1 reads the service configuration file in the service configuration module of the first platform and queries the platform related to the service information as the second platform. That is to say, if the service information provided by Platform B includes "bill service", then this second platform is used as the second platform, and correspondingly, the domain name of Platform B is used as the first domain name.

[0036] In some embodiments, service provider nodes are also registered on the first platform. Therefore, after the service consumption node determines the service information, it first determines whether the service provider node providing the target service is registered on the first platform. That is to say, it determines whether the service provider node registered on this platform can be called to provide the target service.

[0037] Further, in the case where the service provider node providing the target service is registered on the first platform, the service provider node can be directly called, thus avoiding cross-platform service calls; while in the case where it is determined that the service provider node is not registered on the first platform, the service consumption node ServiceA1 determines the first domain name of the second platform based on the service configuration file.

[0038] S103: Integrate and process the first domain name and the service information to generate an addressing address.

[0039] Specifically, as Figure 2 shown, each platform of this embodiment may also be configured with an address reorganization module. After determining the first domain name address and service information, the service consumption node ServiceA1 may call this address reorganization module to integrate and process the first domain name address and service information to generate an addressing address. That is to say, the addressing address carries the first domain name address of the second platform and the service information of the target service. (Corresponding to Figure 2 Step 2)

[0040] S104: Access the second platform based on the addressing address, and obtain the IP address of the service providing node that provides the target service from the second platform.

[0041] Further, the service consumption node ServiceA1 accesses the second platform based on the addressing address ( Figure 2 Step 3). The second platform may determine the IP address of the service providing node (service consumer) that provides the target service according to the service information carried in the addressing address. For example, if the service providing node that provides the target service is ServiceB1, then determine the IP address of the service providing node ServiceB1, and return the IP address of the service providing node ServiceB1 to the service consumption node ServiceA1 ( Figure 2 Step 4). In this case, the service consumption node ServiceA1 obtains the IP address of the service providing node ServiceB1 that provides the target service from the second platform.

[0042] In some embodiments, there may be multiple service providing nodes that provide the target service. For example, ServiceB1, ServiceB2, and ServiceB3 can all provide the target service. In this case, the second platform may select the IP address of any one service providing node and return it to the service consumption node ServiceA1 to avoid the problem of service unavailability in case of a single node failure.

[0043] S105: Invoke the service of the service providing node based on the IP address.

[0044] Further, the service consumption node ServiceA1 may invoke the service of the service providing node ServiceB1 based on this IP address, so as to achieve the purpose of cross-platform service invocation. ( Figure 2 Step 5)

[0045] It should be noted that in the technical solution of this application, the acquisition, storage, application, etc. of the data involved all comply with the provisions of relevant laws and regulations and do not violate public order and good customs.

[0046] In the embodiments of the present disclosure, by determining the service information of the target service to be invoked, and based on a preset service configuration file, determining the first domain name address of the second platform related to the service information, and integrating and processing the first domain name address and the service information to generate an addressing address, and accessing the second platform based on the addressing address, and obtaining the IP address of the service providing node that provides the target service from the second platform, and invoking the service of the service providing node based on the IP address, it is possible to achieve the purpose of cross-platform service invocation by means of integrating the service configuration file and the address. Compared with the existing method of data synchronization between platforms, this solution only needs to maintain the configuration file, thereby avoiding resource expansion, and the addressing speed can also be increased through the configuration file, thereby improving the effect of service invocation.

[0047] Figure 3 It is a schematic flowchart of a method for cross-platform service invocation shown in the second embodiment of the present application, as Figure 3 shown, the method includes:

[0048] S301: Determine the service information of the target service to be invoked.

[0049] For the specific description of S301, please refer to the above embodiments, and details are not described herein again.

[0050] S302: Based on the service configuration file, determine the candidate domain name addresses of multiple candidate platforms related to the service information.

[0051] As described in the background art, during the process of domestic substitution in the field of information technology, some platforms will be deployed in the domestic substitution environment. In this case, there will be a problem that platforms in the domestic substitution environment and non-domestic substitution environment coexist. That is to say, for a target service, there may be multiple platforms that provide the target service, which may lead to data conflicts.

[0052] In this case, the service consumer node ServiceA1 in this embodiment determines the candidate domain name addresses of multiple candidate platforms related to the service information based on the service configuration file.

[0053] Among them, platforms related to the service information can all be called candidate platforms. For example, the candidate platforms include platform B (domestic substitution environment) and platform C (non-domestic substitution environment). Correspondingly, the domain name addresses of the candidate platforms can be called candidate domain name addresses.

[0054] S303: Determine the second platform from multiple candidate platforms, and use the candidate domain name address of the second platform as the first domain name address.

[0055] Furthermore, in this embodiment, the second platform can be determined from the candidate platforms, and the candidate domain name address of the second platform is used as the first domain name address.

[0056] In some embodiments, the user can perform a selection operation on the candidate platforms, that is, select the second platform from multiple candidate platforms. In this case, the service consumption node ServiceA1 determines the second platform in response to the selection operation on the multiple candidate platforms.

[0057] In other embodiments, for example, the platform identifier (domestic environment identifier or non-domestic environment identifier) of each platform can be recorded in the service profile. In this case, the service consumption node ServiceA1 can determine the second platform according to the platform identifiers of the multiple candidate platforms. For example, it determines the candidate platform with the platform identifier of the domestic environment as the target platform. Thus, this embodiment can accurately perform addressing and avoid the problem of data conflicts among multiple platforms.

[0058] S304: Integrate and process the first domain name address and service information to generate an addressing address.

[0059] S305: Access the second platform based on the addressing address and obtain the IP address of the service providing node that provides the target service from the second platform.

[0060] S306: Invoke the service of the service providing node based on the IP address.

[0061] For the specific description of S304 - S306, refer to the above embodiments and will not be elaborated here.

[0062] In the embodiments of the present disclosure, by determining the service information of the target service to be invoked, and based on a preset service profile, determining the first domain name address of the second platform related to the service information, integrating and processing the first domain name address and service information to generate an addressing address, accessing the second platform based on the addressing address, obtaining the IP address of the service providing node that provides the target service from the second platform, and invoking the service of the service providing node based on the IP address, it can achieve the purpose of cross-platform service invocation by using the method of integrating the service profile and the address. Compared with the existing method of data synchronization between platforms, this solution only needs to maintain the configuration file, thus avoiding resource expansion, and the addressing speed can be improved through the configuration file, thereby enhancing the service invocation effect. In addition, this embodiment can accurately perform addressing and avoid the problem of data conflicts among multiple platforms.

[0063] Figure 4 is a block diagram of a device for cross-platform service invocation shown according to the present application, as Figure 4 shown, the device 40 for cross-platform service invocation includes:

[0064] A first determination module 401, configured to determine the service information of the target service to be invoked;

[0065] The second determination module 402 is configured to determine a first domain name address of a second platform related to service information based on a preset service configuration file;

[0066] The integration module 403 is configured to perform an integration process on the first domain name address and the service information to generate an addressing address;

[0067] The addressing module 404 is configured to access the second platform based on the addressing address and obtain an IP address of a service providing node that provides a target service from the second platform; and

[0068] The invocation module 405 is configured to invoke the service of the service providing node based on the IP address.

[0069] In some embodiments, the second determination module 402 is specifically configured to: determine candidate domain name addresses of multiple candidate platforms related to the service information based on the service configuration file; and determine the second platform from the multiple candidate platforms, and use the candidate domain name address of the second platform as the first domain name address.

[0070] In some embodiments, the second determination module 402 is specifically configured to: determine the second platform in response to a selection operation on multiple candidate platforms; or determine the second platform according to the platform identifiers of the multiple candidate platforms.

[0071] In some embodiments, the first platform and the second platform are built based on a Nacos cluster.

[0072] In some embodiments, the second determination module 402 is specifically configured to: determine whether a service providing node that provides the target service is registered on the first platform; and in the case where it is determined that the service providing node is not registered on the first platform, determine the first domain name address of the second platform based on the service configuration file.

[0073] In this embodiment, by determining the service information of the target service to be invoked, and based on a preset service configuration file, determining the first domain name address of the second platform related to the service information, and performing an integration process on the first domain name address and the service information to generate an addressing address, and accessing the second platform based on the addressing address, and obtaining the IP address of the service providing node that provides the target service from the second platform, and invoking the service of the service providing node based on the IP address, it is possible to achieve the purpose of cross-platform service invocation by using the method of integrating the service configuration file and the address. Compared with the existing method of data synchronization between platforms, this solution only needs to maintain the configuration file, thereby avoiding resource expansion, and the addressing speed can also be improved through the configuration file, thereby enhancing the service invocation effect.

[0074] According to an embodiment of the present application, the present application further provides an electronic device, a readable storage medium, and a computer program product.

[0075] Figure 5 FIG. Figure 5 is a block diagram of an electronic device according to the present application. For example, the electronic device 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0076] Referring to Figure 5 FIG. Figure 5 , the electronic device 500 may include one or more of the following components: a processing component 502, a memory 504, a power component 506, a multimedia component 508, an audio component 510, an input / output (I / O) interface 512, a sensor component 514, and a communication component 516.

[0077] The processing component 502 generally controls the overall operation of the electronic device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-described methods. In addition, the processing component 502 may include one or more modules to facilitate the interaction between the processing component 502 and other components. For example, the processing component 502 may include a multimedia module to facilitate the interaction between the multimedia component 508 and the processing component 502.

[0078] The memory 504 is configured to store various types of data to support the operation of the electronic device 500. Examples of such data include instructions for any application or method operating on the electronic device 500, contact data, phone book data, messages, pictures, videos, etc. The memory 504 may be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, a disk, or an optical disc.

[0079] The power component 506 provides power to the various components of the electronic device 500. The power component 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 500.

[0080] The multimedia component 508 includes a touch display screen that provides an output interface between the electronic device 500 and the user. In some embodiments, the touch display screen may include a liquid crystal display (LCD) and a touch panel (TP). The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of touch or swipe actions but also detect the duration and pressure associated with the touch or swipe operation. In some embodiments, the multimedia component 508 includes a front camera and / or a rear camera. When the electronic device 500 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera can receive external multimedia data. Each of the front camera and the rear camera can be a fixed optical lens system or have a focal length and optical zoom capabilities.

[0081] The audio component 510 is configured to output and / or input audio signals. For example, the audio component 510 includes a microphone (MIC) that is configured to receive external audio signals when the electronic device 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals can be further stored in the memory 504 or transmitted via the communication component 516.

[0082] In some embodiments, the audio component 510 further includes a speaker for outputting audio signals.

[0083] The I / O interface 512 provides an interface between the processing component 502 and a peripheral interface module, which can be a keyboard, a click wheel, buttons, etc. These buttons can include but are not limited to: a home button, a volume button, a power button, and a lock button.

[0084] The sensor component 514 includes one or more sensors for providing status assessments of various aspects of the electronic device 500. For example, the sensor component 514 can detect the on / off state of the electronic device 500, the relative positioning of components, such as the display and the keypad of the electronic device 500. The sensor component 514 can also detect a change in the position of the electronic device 500 or a component of the electronic device 500, the presence or absence of user contact with the electronic device 500, the orientation or acceleration / deceleration of the electronic device 500, and the temperature change of the electronic device 500. The sensor component 514 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor component 514 can also include a light sensor, such as a CMOS or a CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 514 can further include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0085] The communication component 516 is configured to facilitate communication between the electronic device 500 and other devices in a wired or wireless manner. The electronic device 500 can access a communication standard-based wireless network, such as WiFi, 2G, or 3G, or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 516 further includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on Radio Frequency Identification (RFID) technology, Infrared Data Association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

[0086] In an exemplary embodiment, the electronic device 500 can be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the method of the above cross-platform call service.

[0087] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 504 including instructions, and the above instructions can be executed by a processor 920 of the electronic device 500 to complete the above method. Optionally, the computer-readable storage medium can be a ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.

[0088] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application, which follow the general principles of the present application and include known common knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.

[0089] It should be understood that the present application is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.

Claims

1. A method for cross-platform calling services, characterized in that, Applied to service consumption nodes registered on the first platform, the method includes: Determine the service information of the target service to be invoked; Based on a preset service configuration file, determine the first domain name address of the second platform related to the service information; wherein, the service configuration file is used to record the domain name address of the second platform and the service information of the second platform; Integrate the first domain name address and the service information to generate an addressing address; Access the second platform based on the addressing address, and obtain the IP address of the service provider node providing the target service from the second platform; and Invoke the service of the service provider node based on the IP address; The determining the first domain name address of the second platform related to the service information based on a preset service configuration file includes: Based on the service configuration file, determine the candidate domain name addresses of multiple candidate platforms related to the service information; and Determine the second platform from the multiple candidate platforms, and use the candidate domain name address of the second platform as the first domain name address.

2. The method according to claim 1, wherein The determining the second platform from the multiple candidate platforms includes: In response to a selection operation on the multiple candidate platforms, determine the second platform; or Determine the second platform according to the platform identifiers of the multiple candidate platforms.

3. The method according to claim 1, characterized in that, The determining the first domain name address of the second platform related to the service information based on a preset service configuration file includes: Judge whether the service provider node providing the target service is registered on the first platform; In the case where it is determined that the service provider node is not registered on the first platform, determine the first domain name address of the second platform based on the service configuration file.

4. The method according to claim 1, wherein Wherein, The first platform and the second platform are built based on the Nacos cluster.

5. A device for cross-platform calling of services, which is applied to a service consumption node registered on a first platform, and is characterized in that Includes: The first determination module is used to determine the service information of the target service to be invoked; The second determination module is used to determine the first domain name address of the second platform related to the service information based on a preset service configuration file; wherein, the service configuration file is used to record the domain name address of the second platform and the service information of the second platform; The integration module is used to integrate the first domain name address and the service information to generate an addressing address; The addressing module is used to access the second platform based on the addressing address, and obtain the IP address of the service provider node providing the target service from the second platform; and The invocation module is used to invoke the service of the service provider node based on the IP address; The second determination module is specifically used to determine the candidate domain name addresses of multiple candidate platforms related to the service information based on the service configuration file; and Determine the second platform from the multiple candidate platforms, and use the candidate domain name address of the second platform as the first domain name address.

6. The device according to claim 5, characterized in that, The second determination module is specifically used for: In response to a selection operation on the multiple candidate platforms, determine the second platform; or Determine the second platform according to the platform identifiers of the multiple candidate platforms.

7. The device according to claim 5, characterized in that The second determination module is specifically used for: Determine whether the service provider node providing the target service is registered on the first platform; In the case where it is determined that the service provider node is not registered on the first platform, determine the first domain name address of the second platform based on the service configuration file.

8. The device according to claim 5, characterized in that, Wherein, The first platform and the second platform are built based on the Nacos cluster.

9. An electronic device, characterized in that, It includes: A processor and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1-4.

10. A computer-readable storage medium, characterized in that, Computer-executable instructions are stored in the computer-readable storage medium, and when the computer-executable instructions are executed by a processor, they are used to implement the method according to any one of claims 1-4.

11. A computer program product, characterized in that, It includes a computer program, and when the computer program is executed by a processor, it implements the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Service discovery and service registration method and device based on gateway

    CN114697231A