WO2017185961A1 - Method and apparatus for processing service discovery - Google Patents

Method and apparatus for processing service discovery Download PDF

Info

Publication number
WO2017185961A1
WO2017185961A1 PCT/CN2017/079623 CN2017079623W WO2017185961A1 WO 2017185961 A1 WO2017185961 A1 WO 2017185961A1 CN 2017079623 W CN2017079623 W CN 2017079623W WO 2017185961 A1 WO2017185961 A1 WO 2017185961A1
Authority
WO
WIPO (PCT)
Prior art keywords
service
provider information
service provider
name information
returned
Prior art date
Application number
PCT/CN2017/079623
Other languages
French (fr)
Chinese (zh)
Inventor
洪志维
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017185961A1 publication Critical patent/WO2017185961A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers

Definitions

  • This document relates to, but is not limited to, the field of communications, and in particular, to a method and apparatus for processing service discovery.
  • the distributed service system splits the functions of the service system and puts the functions on several independent computers. Through the cooperation between these computers, the functions of the whole system are completed.
  • the split function module usually refers to the service.
  • the biggest advantage of using a distributed system is the processing speed of the system.
  • An additional advantage of the distributed service system is that the functional modules are separate and easy to manage, maintain, and update.
  • the volume of business and types of services become increasingly complex, and services of the same business type may be provided by multiple service providers.
  • the search for services between services finds that calls are becoming more frequent, and providing an efficient and stable service discovery mechanism is also very important in large service systems.
  • the service discovery mechanism in the related art includes the following parts:
  • Service Registration Center Mainly responsible for the management of services and the status of monitoring services.
  • Service provider Mainly responsible for registering services and publishing services to the service registry through the server agent module.
  • Service Consumer It is mainly responsible for finding the required service through the consumer agent module to the service registry.
  • the service provider registers its own service information with the service registry, and then the service consumer queries the service registry for the service information list, and then the service registry returns the service provider address list to the service consumer, and finally the service consumer returns.
  • the service provider address list select one of the service providers and establish a link with them for service calls.
  • the following problems may exist in some application scenarios: after the service consumer acquires the service, if the service is in the service registration center, the service information and status There is an update, only the service can be obtained again, the service consumer can get the latest service provider information list, otherwise the service provider address list will be updated in a timely manner. For example, the status of a service in the service registry is no longer available. If the service consumer does not update the service provider address list in the local cache, the call may still be the original service, and the service call will fail.
  • the embodiment of the invention provides a processing method and device for service discovery, which can timely update the service provider address list.
  • An embodiment of the present invention provides a method for processing service discovery, including:
  • the locally stored service provider information corresponding to the first service name information includes: service provider information corresponding to the first service name information pre-stored in a local cache;
  • the processing method further includes: backing up service provider information corresponding to the first service name information stored in the local cache to a local memory file.
  • the updating, according to the service provider information returned by the service registration center, the locally stored service provider information corresponding to the first service name information includes:
  • processing method further includes:
  • the service provider information corresponding to the second service name information is locally queried, the service provider information corresponding to the second service name information is locally obtained;
  • the service provider information corresponding to the second service name information returned from the local or the service registration center is returned to the user.
  • the processing method further includes:
  • the service registration center is caused to acquire the first service query request according to the second service query request and the preset load balancing policy. a service provider information corresponding to the service name information and returned;
  • the service registration center is caused to acquire, according to the second service query request, a message corresponding to the second service name information.
  • the service provider information list is returned and includes two or more service provider information.
  • the service provider information corresponding to the second service name information returned from the local or the service registration center includes: a service provider information corresponding to the second service name information Or a service provider information list corresponding to the second service name information; wherein the service provider information list includes two or more service provider information;
  • the service provider information corresponding to the second service name information that is to be returned from the local or returned by the service registration center includes:
  • the service link type invoked by the service call request is a long link
  • the provider information is returned to the user
  • the second determination result is that the service link type invoked by the service call request is not a long link, according to a preset load balancing policy, returned from the local or the service registry, and the second A service provider information is obtained from the service provider information list corresponding to the service name information and returned to the user.
  • an embodiment of the present invention further provides a computer storage medium.
  • the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the service discovery method.
  • An embodiment of the present invention further provides a processing device for service discovery, including:
  • the first obtaining module is configured to periodically acquire the first service name information that has been queried according to the preset time interval;
  • the first receiving module is configured to send a first service query request to the service registration center according to the first service name information, and receive the first service that is returned by the service registration center according to the first service query request.
  • Service provider information corresponding to the name information
  • the update module is configured to update the locally stored service provider information corresponding to the first service name information according to the service provider information returned by the service registration center.
  • the locally stored service provider information corresponding to the first service name information includes: service provider information corresponding to the first service name information pre-stored in a local cache;
  • the processing device further includes:
  • a backup module configured to back up service provider information corresponding to the first service name information stored in the local cache to a local memory file
  • the update module includes:
  • An update unit configured to be based on service provider information returned by the service registry
  • the local cache and the service provider information corresponding to the first service name information stored in the local memory file are updated.
  • the processing device further includes:
  • the query module is configured to: after receiving the service call request, query the service provider information corresponding to the second service name information locally according to the second service name information included in the service call request;
  • a second obtaining module configured to: if the service provider information corresponding to the second service name information is locally queried, obtain the service provider information corresponding to the second service name information locally;
  • a second receiving module configured to send a second service query to the service registration center according to the second service name information if the service provider information corresponding to the second service name information is not queried locally And requesting, by the service registration center, the service provider information corresponding to the second service name information returned according to the second service query request;
  • the service provider information corresponding to the second service name information returned from the local or returned by the service registration center is returned to the user.
  • the processing device further includes:
  • the first judging module is configured to determine whether the service link type invoked by the service invocation request is a long link, and obtain a first judgment result;
  • a first execution module configured to: if the first determination result is that the service link type invoked by the service call request is a long link, causing the service registration center to perform a second service query request and a preset load balancing a policy, acquiring a service provider information corresponding to the second service name information, and returning;
  • a second execution module configured to: if the first determination result is that the service link type invoked by the service call request is not a long link, causing the service registration center to acquire and refer to the second service query request according to the second service query request.
  • the service provider information list corresponding to the second service name information includes two or more service provider information.
  • the service provider information corresponding to the second service name information that is obtained locally or returned by the service registration center includes: one corresponding to the second service name information a service provider information or a service provider information list corresponding to the second service name information, wherein the service provider information list includes two or more service provider information;
  • the return module includes:
  • a second determining unit configured to determine whether the service link type invoked by the service call request is a long link, and obtain a second determination result
  • a first returning unit configured to: if the second determination result is that the service link type invoked by the service call request is a long link, the device that is obtained locally or returned by the service registry, and the second A service provider information corresponding to the service name information is returned to the user;
  • a second returning unit configured to: if the second determination result is that the service link type invoked by the service call request is not a long link, returning from the local or the service registry according to a preset load balancing policy And obtaining a service provider information in the service provider information list corresponding to the second service name information and returning to the user.
  • the technical solution provided by the embodiment of the present invention includes: periodically acquiring the first service name information that has been queried according to a preset time interval; and then sending the first service query to the service registration center according to the first service name information. Requesting, and receiving service provider information corresponding to the first service name information returned by the service registration center according to the first service query request; and finally storing the first service name according to the service provider information returned by the service registration center The service provider information corresponding to the information is updated.
  • the updated service provider information can be synchronized to the locality in time, thereby avoiding the service call failure caused by the update failure, and enhancing the effective service discovery. Sex.
  • FIG. 1 is a flowchart of a processing method for service discovery according to the present invention
  • FIG. 2 is a flowchart of an implementation method of a service discovery method according to the present invention.
  • FIG. 3 is a flowchart of another implementation of a method for processing service discovery according to the present invention.
  • FIG. 4 is a schematic structural diagram of a processing device for service discovery according to the present invention.
  • a method for processing service discovery includes:
  • Step 101 Obtain the first service name information that has been queried periodically according to a preset time interval.
  • Step 102 Send a first service query request to the service registration center according to the first service name information, and receive service provider information corresponding to the first service name information returned by the service registration center according to the first service query request;
  • Step 103 Update the locally stored service provider information corresponding to the first service name information according to the service provider information returned by the service registration center.
  • the service discovery processing method of the embodiment of the present invention is applied to the service consumer end, and when the service provider information of the service registration center is updated, the updated service provider information can be synchronized to the service consumer end in time, and the relevant solution is solved.
  • the service provider discovery list has a problem that the service provider address list is not updated in time, and the service call failure caused by the update is not timely, thereby enhancing the effectiveness of the service discovery.
  • the service name information that has been queried includes: service name information stored locally after querying the service registration center.
  • the queried service provider information is generally only stored in the local cache, and the service provider information may include a service name describing the service function, a service provider's IP address, a port, a service path, an attribute, and the like.
  • the locally stored service provider information corresponding to the first service name information includes: service provider information corresponding to the first service name information pre-stored in the local cache;
  • Step 104 Back up the service provider information corresponding to the first service name information stored in the local cache to the local memory file.
  • the service provider information can be obtained from the local memory file according to the service name and loaded into the local cache, ensuring smooth service call.
  • the foregoing step 103 may include:
  • Step 1031 Update the service provider information corresponding to the first service name information stored in the local cache and the local memory file according to the service provider information returned by the service registration center.
  • a method for processing service discovery includes:
  • step 201 a timing update task is started.
  • Step 202 Timely acquire the first service name information that has been queried according to a preset time interval.
  • Step 203 Send a first service query request to the service registration center according to the first service name information.
  • Step 204 Receive service provider information corresponding to the first service name information returned by the service registration center according to the first service query request.
  • Step 205 the service provider information returned by the service registry is compared with the service provider information stored in the local cache, to determine whether the service provider information is updated, if the service provider information is updated, then go to step 206; If the service provider information is not updated, go to step 207.
  • Step 206 Update the local cache and the service provider information in the local memory file.
  • step 207 it is determined whether the scheduled update task process is finished. If the scheduled update task process ends, the process goes to step 208. If the scheduled update task process is not completed, the process goes to step 202.
  • Step 208 ending.
  • the service discovery processing method in the embodiment of the present invention can timely update the updated service provider information to the service consumer end when the service provider information of the service registration center is updated, thereby avoiding The effectiveness of service discovery is enhanced by the failure of service calls due to untimely updates.
  • the problem that the service registry abnormality causes the service to be called again is solved, and the stability of the service discovery is increased.
  • processing method of the embodiment of the present invention may further include:
  • Step 105 After receiving the service invocation request, query the service provider information corresponding to the second service name information locally according to the second service name information included in the service call request.
  • the service provider information corresponding to the second service name information may be queried in the local memory file.
  • the corresponding service name information is generally not queried in the local memory file.
  • the corresponding service name information can be queried in the local memory file.
  • Step 106 If the service provider information corresponding to the second service name information is locally queried, the service provider information corresponding to the second service name information is locally obtained.
  • the service provider information in the local memory file may be loaded into the local cache, and then directly taken out from the local cache and passed through The steps are returned to the user.
  • the service provider information stored in the local memory file is the information updated by the above steps 101-103.
  • Step 107 If the service provider information corresponding to the second service name information is not found in the local, send a second service query request to the service registration center according to the second service name information, and receive the service registration center according to the second service.
  • the service registration center needs to be queried for acquisition.
  • the service After receiving the service provider information returned by the service registry, the service can be received.
  • the provider information is saved to the local cache and backed up in the local memory file for later use.
  • Step 108 The service provider information corresponding to the second service name information returned from the local or service registration center is returned to the user.
  • the user's call to the service is facilitated by returning the obtained service provider information corresponding to the second service name information to the user.
  • the service of the same service type may be provided by multiple service providers, therefore, the service consumer may query multiple service provider information by calling the service once.
  • the general service consumer can select a service provider based on the load balancing principle.
  • the processing method of the embodiment of the present invention may further include:
  • Step 109 Determine whether the service link type invoked by the service call request is a long link, and obtain a first judgment result.
  • Step 1010 If the first judgment result is that the service link type invoked by the service call request is a long link, the service registration center obtains one corresponding to the second service name information according to the second service query request and the preset load balancing policy. Service provider information and return.
  • the load balancing of the service can be performed by the service registry, so that the service registry selects a suitable service provider among the multiple service providers and returns to the service consumer, thereby reducing the service registry. Transmit load and improve the efficiency of service call execution.
  • Step 1011 If the first judgment result is that the service link type invoked by the service call request is not a long link, the service registration center obtains the second service name letter according to the second service query request.
  • the service provider information list corresponding to the information is returned, wherein the service provider information list includes a plurality of (two or more) service provider information.
  • the load balancing of the service may be performed through the service consumer, so that the service registry returns the plurality of service provider information that is queried to the service consumer, and the service consumer is in the plurality of service providers. Choose a service provider with the right load.
  • the service provider information corresponding to the second service name information that is obtained locally or returned by the service registration center includes: one service provider information corresponding to the second service name information or the second service name A list of service provider information corresponding to the information, wherein the service provider information list includes two or more service provider information.
  • the service may be made for the long link service through the above steps 109-1011 when the service is first called.
  • the registry is load balanced to return a properly loaded service provider information; for short link services, the service registry returns a list of service provider information including two or more service provider information.
  • the above step 108 may include:
  • Step 1081 Determine whether the service link type invoked by the service call request is a long link, and obtain a second determination result.
  • Step 1082 If the second determination result is that the service link type invoked by the service call request is a long link, a service provider information corresponding to the second service name information returned from the local or service registration center is returned to the service provider information. user.
  • Step 1083 If the second judgment result is that the service link type invoked by the service call request is not a long link, according to the preset load balancing policy, the locally obtained or service registration center returns Returning, a service provider information is obtained from the service provider information list corresponding to the second service name information and returned to the user.
  • a method for processing service discovery includes:
  • Step 301 Start a service query task according to the service call request.
  • Step 302 Determine whether the service provider information corresponding to the second service name information exists in the local memory file. If the service provider information corresponding to the second service name information exists in the local memory file, go to step 303. If the service provider information corresponding to the second service name information does not exist in the local memory file, the process proceeds to step 304.
  • the updated service provider information is stored in the local memory file.
  • Step 303 Obtain the service provider information corresponding to the second service name information from the local memory file and put it into the cache, and then jump to step 309.
  • Step 304 Send a second service query request to the service registration center according to the second service name information.
  • Step 305 determining whether the service link type invoked by the service call request is a long link, if the service link type invoked by the service call request is a long link, then jumping to step 306, if the service link type invoked by the service call request is not Long link, go to step 307.
  • Step 306 The service registration center obtains a service provider information corresponding to the second service name information according to the second service query request and the preset load balancing policy, and returns, and then proceeds to step 308.
  • Step 307 The service registration center obtains a service provider information list corresponding to the second service name information according to the second service query request, and returns.
  • the service provider information list includes two or more service provider information.
  • Step 308 Receive a service provider information or a service provider information list returned by the service registration center, save the received information to a local cache, and perform backup in the local memory file.
  • Step 309 it is determined whether the service link type invoked by the service call request is a long link. If the service link type invoked by the service call request is a long link, the process jumps to step 3010, if the service link type invoked by the service call request is not Long link, go to step 3011.
  • Step 3010 Return a service provider information corresponding to the second service name information returned from the local or service registration center to the user.
  • Step 3011 Obtain a service provider information in the service provider information list corresponding to the second service name information returned from the local or service registration center according to the preset load balancing policy, and return the information to the user.
  • the processing method of the service discovery determines whether the load balancing of the service is performed by the service registration center side according to whether the service belongs to the long link service, and solves the problem that the calling service is based on the long link service.
  • the application service registry has a problem of excessive transmission overhead and inefficient service calls, which increases the flexibility and effectiveness of service discovery processing.
  • the method for processing service discovery in the embodiment of the present invention is applied to a distributed system including a service provider, a service registry, and a service consumer, and is specifically applied to a service consumer.
  • the service provider registers the service to be published to the service registration center, and the service registration center is used to receive the service request from the service consumer.
  • the latest service provider information is returned to the service consumer in real time, and the service consumption is
  • the terminal is configured to send a query service request to the service registration center, receive the service returned from the service registration center, automatically establish a link with the service provider, and invoke the corresponding service.
  • the updated service provider information can be synchronized to the service consumer end in time, thereby avoiding the service caused by the update failure.
  • the problem that the service registry abnormality causes the service to be called again is solved, and the stability of the service discovery is increased.
  • the load balancing of the service is performed by the service registration center side according to whether the service belongs to the long link service, and the application service registration center transmission load overhead is solved when the calling service is based on the long link service.
  • the inefficiency of Yamato service calls increases the flexibility and effectiveness of service discovery processing.
  • the embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the service discovery method.
  • the embodiment of the invention further provides a processing device for service discovery, comprising: a memory and a processor; wherein
  • the processor is configured to execute program instructions in the memory
  • the locally stored service provider information corresponding to the first service name information is updated according to the service provider information returned by the service registration center.
  • an embodiment of the present invention further provides a service discovery processing apparatus, including:
  • the first obtaining module is configured to periodically acquire the first service name information that has been queried according to the preset time interval;
  • the first receiving module is configured to send a first service query request to the service registration center according to the first service name information, and receive service provider information corresponding to the first service name information returned by the service registration center according to the first service query request. ;
  • the update module is configured to update the locally stored service provider information corresponding to the first service name information according to the service provider information returned by the service registry.
  • the processing device for service discovery is applied to the service consumer end, and when the service provider information of the service registration center is updated, the updated service provider information can be synchronized to the service consumer end in time, and the current solution is solved.
  • Service provider address list update with service discovery mechanism The problem of not being timely, avoiding service call failures caused by unsynchronized updates, and enhancing the effectiveness of service discovery.
  • the locally stored service provider information corresponding to the first service name information includes: service provider information corresponding to the first service name information pre-stored in the local cache;
  • a backup module configured to back up the service provider information corresponding to the first service name information stored in the local cache to the local memory file;
  • the update module can include:
  • the update unit is configured to update the service provider information corresponding to the first service name information stored in the local cache and the local memory file according to the service provider information returned by the service registry.
  • processing apparatus of the embodiment of the present invention may further include:
  • the query module is configured to: after receiving the service call request, query the service provider information corresponding to the second service name information locally according to the second service name information included in the service call request;
  • the second obtaining module is configured to: if the service provider information corresponding to the second service name information is locally queried, obtain the service provider information corresponding to the second service name information locally;
  • the second receiving module is configured to: if the service provider information corresponding to the second service name information is not found in the local area, send a second service query request to the service registration center according to the second service name information, and receive the service registration center. Service provider information corresponding to the second service name information returned according to the second service query request;
  • the return module is set to return the service provider information corresponding to the second service name information, which is to be retrieved from the local or the service registration center, to the user.
  • processing apparatus of the embodiment of the present invention may further include:
  • the first judging module is configured to determine whether the service link type invoked by the service invocation request is a long link, and obtain a first judgment result;
  • a first execution module configured to: if the first determination result is a service link type called a long link, the service registration center is configured according to the second service query request and the preset load Balance the policy, obtain a service provider information corresponding to the second service name information, and return;
  • a second execution module configured to: if the first determination result is that the service link type invoked by the service call request is not a long link, cause the service registration center to acquire the service provider corresponding to the second service name information according to the second service query request The list of information is returned and wherein the list of service provider information includes two or more service provider information.
  • the service provider information corresponding to the second service name information that is obtained locally or returned by the service registration center includes: one service provider information corresponding to the second service name information or the second a service provider information list corresponding to the service name information, wherein the service provider information list includes two or more service provider information;
  • the return module can include:
  • a second determining unit configured to determine whether the service link type invoked by the service call request is a long link, and obtain a second determination result
  • a first returning unit configured to: if the second determination result is that the service link type invoked by the service call request is a long link, a service provided corresponding to the second service name information returned from the local or service registration center Information is returned to the user;
  • a second returning unit configured to: if the second determination result is that the service link type invoked by the service call request is not a long link, according to the preset load balancing policy, returning from the local or service registry, and the second service A service provider information is obtained from the service provider information list corresponding to the name information and returned to the user.
  • the updated service provider information can be synchronized to the service consumer end in time, thereby avoiding the service caused by the update failure.
  • the problem that the service registry abnormality causes the service to be called again is solved, and the stability of the service discovery is increased.
  • determining whether the load balancing of the service is performed by the service registration center side according to whether the service belongs to the long link service, and solving the problem that the application service registration center has excessive transmission load overhead and low service call efficiency when the calling service is based on the long link service. Increased flexibility and effectiveness of service discovery processing.
  • processing device of the service discovery is related to the processing method of the service discovery described above.
  • Corresponding devices, in which all the implementations in the above method embodiments are applicable to the embodiment of the device, can also achieve the same technical effect.
  • the size of the sequence number of the above process does not mean the order of execution order, and the order of execution should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. .
  • each module/unit in the foregoing embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, being executed by a processor and stored in a memory. Programs/instructions to implement their respective functions.
  • the invention is not limited to any specific form of combination of hardware and software.
  • the above technical solution improves the efficiency of synchronizing updated service provider information to the local, and enhances the effectiveness of service discovery.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Computer And Data Communications (AREA)

Abstract

A method and apparatus for processing service discovery. The method comprises: acquiring first service name information that has been queried regularly according to a pre-set time interval; sending a first service query request to a service registration centre according to the first service name information, and receiving service provider information, returned by the service registration centre according to the first service query request, corresponding to the first service name information; and updating, according to the service provider information returned by the service registration centre, the service provider information corresponding to the first service name information locally stored. The embodiments of the present invention improve the efficiency of synchronizing the updated service provider information to the locality, and enhance the validity of service discovery.

Description

一种服务发现的处理方法及装置Method and device for processing service discovery 技术领域Technical field
本文涉及但不限于通信领域,尤其涉及一种服务发现的处理方法及装置。This document relates to, but is not limited to, the field of communications, and in particular, to a method and apparatus for processing service discovery.
背景技术Background technique
分布式服务***就是将服务***的功能拆分,将功能放在几***立的计算机上,通过这几台计算机之间的相互协作,来完成整个***的功能。在这里,拆分的功能模块通常指的就是服务。The distributed service system splits the functions of the service system and puts the functions on several independent computers. Through the cooperation between these computers, the functions of the whole system are completed. Here, the split function module usually refers to the service.
采用分布式***最大的优点表现在***的处理速度上。分布式服务***另外的优点还在于功能模块分开,便于管理、维护和更新。然而,随着移动互联网的发展,网站应用规模的不断扩大,业务量和业务类型日趋复杂多样,同一个业务类型的服务可能由多个服务提供端提供。同时,业务之间服务的查找发现调用也日趋频繁,提供一种高效稳定的服务发现机制在大型的服务***中也就显得相当重要了。The biggest advantage of using a distributed system is the processing speed of the system. An additional advantage of the distributed service system is that the functional modules are separate and easy to manage, maintain, and update. However, with the development of the mobile Internet, the scale of website applications continues to expand, the volume of business and types of services become increasingly complex, and services of the same business type may be provided by multiple service providers. At the same time, the search for services between services finds that calls are becoming more frequent, and providing an efficient and stable service discovery mechanism is also very important in large service systems.
为了能找到满足用户需求的服务,相关技术中的服务发现机制包括以下几个部分:In order to find a service that meets the needs of users, the service discovery mechanism in the related art includes the following parts:
服务注册中心:主要负责服务的管理和监控服务的状态。Service Registration Center: Mainly responsible for the management of services and the status of monitoring services.
服务提供端:主要负责通过服务端代理模块向服务注册中心注册服务和发布服务。Service provider: Mainly responsible for registering services and publishing services to the service registry through the server agent module.
服务消费端:主要负责通过消费端代理模块向服务注册中心查找所需要的服务。Service Consumer: It is mainly responsible for finding the required service through the consumer agent module to the service registry.
首先服务提供端向服务注册中心注册自己提供的服务信息,然后服务消费端向服务注册中心查询服务的信息列表,接着服务注册中心返回服务提供者地址列表给服务消费端,最后服务消费端从返回的服务提供端地址列表中,选择其中一台服务提供端,并与其建立链接进行服务调用。First, the service provider registers its own service information with the service registry, and then the service consumer queries the service registry for the service information list, and then the service registry returns the service provider address list to the service consumer, and finally the service consumer returns. In the service provider address list, select one of the service providers and establish a link with them for service calls.
上述服务发现实现方案中,在一些应用场景下可能存在以下问题:服务消费端获取服务发生调用后,如果该服务在服务注册中心的服务信息及状态 有更新,只有再次获取服务,服务消费端才能得到最新的服务提供者信息列表,否则服务提供者地址列表会存在更新不及时的情况。比如,某个服务在服务注册中心的状态已不可用,如果服务消费端没有更新本地缓存中的服务提供者地址列表,调用的仍可能是原来的服务,这时就会造成服务调用失败。In the above service discovery implementation solution, the following problems may exist in some application scenarios: after the service consumer acquires the service, if the service is in the service registration center, the service information and status There is an update, only the service can be obtained again, the service consumer can get the latest service provider information list, otherwise the service provider address list will be updated in a timely manner. For example, the status of a service in the service registry is no longer available. If the service consumer does not update the service provider address list in the local cache, the call may still be the original service, and the service call will fail.
发明概述Summary of invention
以下是对本文详细描述的主题的概述。本概述并非是为了限制权利要求的保护范围。The following is an overview of the topics detailed in this document. This Summary is not intended to limit the scope of the claims.
本发明实施例提供一种服务发现的处理方法及装置,能够及时的实现服务提供者地址列表的更新。The embodiment of the invention provides a processing method and device for service discovery, which can timely update the service provider address list.
本发明实施例提供一种服务发现的处理方法,包括:An embodiment of the present invention provides a method for processing service discovery, including:
按照预设时间间隔,定时获取已查询的第一服务名信息;Obtaining the first service name information that has been queried periodically according to a preset time interval;
根据所述第一服务名信息向服务注册中心发送第一服务查询请求,并接收所述服务注册中心根据所述第一服务查询请求返回的,与所述第一服务名信息对应的服务提供者信息;Sending a first service query request to the service registration center according to the first service name information, and receiving a service provider corresponding to the first service name information returned by the service registration center according to the first service query request information;
根据所述服务注册中心返回的服务提供者信息,对本地存储的与所述第一服务名信息对应的服务提供者信息进行更新。Updating the locally stored service provider information corresponding to the first service name information according to the service provider information returned by the service registration center.
可选的,所述本地存储的与所述第一服务名信息对应的服务提供者信息包括:预先存储在本地缓存中的与所述第一服务名信息对应的服务提供者信息;Optionally, the locally stored service provider information corresponding to the first service name information includes: service provider information corresponding to the first service name information pre-stored in a local cache;
所述处理方法还包括:将所述本地缓存中存储的与所述第一服务名信息对应的服务提供者信息备份到本地内存文件中。The processing method further includes: backing up service provider information corresponding to the first service name information stored in the local cache to a local memory file.
可选的,所述根据所述服务注册中心返回的服务提供者信息,对本地存储的与所述第一服务名信息对应的服务提供者信息进行更新包括:Optionally, the updating, according to the service provider information returned by the service registration center, the locally stored service provider information corresponding to the first service name information includes:
根据所述服务注册中心返回的服务提供者信息,对所述本地缓存以及所述本地内存文件中存储的与所述第一服务名信息对应的服务提供者信息进行更新。And updating, according to the service provider information returned by the service registration center, the local cache and the service provider information corresponding to the first service name information stored in the local memory file.
可选的,所述处理方法还包括: Optionally, the processing method further includes:
接收服务调用请求后,根据所述服务调用请求包含的第二服务名信息,在本地查询与所述第二服务名信息对应的服务提供者信息;After receiving the service invocation request, querying the service provider information corresponding to the second service name information locally according to the second service name information included in the service invocation request;
若在本地查询到与所述第二服务名信息对应的服务提供者信息,则从本地获取与所述第二服务名信息对应的服务提供者信息;If the service provider information corresponding to the second service name information is locally queried, the service provider information corresponding to the second service name information is locally obtained;
若在本地中没有查询到与所述第二服务名信息对应的服务提供者信息,则根据所述第二服务名信息,向所述服务注册中心发送第二服务查询请求,接收所述服务注册中心根据所述第二服务查询请求返回的,与所述第二服务名信息对应的服务提供者信息;If the service provider information corresponding to the second service name information is not found in the local area, sending a second service query request to the service registration center according to the second service name information, and receiving the service registration The service provider information corresponding to the second service name information returned by the center according to the second service query request;
将从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息返回给用户。The service provider information corresponding to the second service name information returned from the local or the service registration center is returned to the user.
可选的,所述若在本地中没有查询到与所述第二服务名信息对应的服务提供者信息,则根据所述第二服务名信息,向所述服务注册中心发送第二服务查询请求之后,所述处理方法还包括:Optionally, if the service provider information corresponding to the second service name information is not found in the local, the second service query request is sent to the service registration center according to the second service name information. Afterwards, the processing method further includes:
判断所述服务调用请求所调用的服务链接类型是否为长链接,得到第一判断结果;Determining whether the service link type invoked by the service call request is a long link, and obtaining a first judgment result;
若所述第一判断结果为所述服务调用请求所调用的服务链接类型为长链接,则使所述服务注册中心根据所述第二服务查询请求以及预设负载均衡策略,获取与所述第二服务名信息对应的一个服务提供者信息并返回;If the first judgment result is that the service link type invoked by the service call request is a long link, the service registration center is caused to acquire the first service query request according to the second service query request and the preset load balancing policy. a service provider information corresponding to the service name information and returned;
若所述第一判断结果为所述服务调用请求所调用的服务链接类型不是长链接,则使所述服务注册中心根据所述第二服务查询请求,获取与所述第二服务名信息对应的服务提供者信息列表并返回,其中所述服务提供者信息列表包括两个或两个以上服务提供者信息。If the first judgment result is that the service link type invoked by the service call request is not a long link, the service registration center is caused to acquire, according to the second service query request, a message corresponding to the second service name information. The service provider information list is returned and includes two or more service provider information.
可选的,所述从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息包括:与所述第二服务名信息对应的一个服务提供者信息或者与所述第二服务名信息对应的服务提供者信息列表;其中,所述服务提供者信息列表包括两个或两个以上服务提供者信息;Optionally, the service provider information corresponding to the second service name information returned from the local or the service registration center includes: a service provider information corresponding to the second service name information Or a service provider information list corresponding to the second service name information; wherein the service provider information list includes two or more service provider information;
所述将从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息返回给用户包括: Returning, to the user, the service provider information corresponding to the second service name information that is to be returned from the local or returned by the service registration center includes:
判断所述服务调用请求所调用的服务链接类型是否为长链接,得到第二判断结果;Determining whether the service link type invoked by the service call request is a long link, and obtaining a second determination result;
若所述第二判断结果为所述服务调用请求所调用的服务链接类型为长链接,则将从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的一个服务提供者信息返回给用户;If the second determination result is that the service link type invoked by the service call request is a long link, a service corresponding to the second service name information that is to be returned locally or returned by the service registration center The provider information is returned to the user;
若所述第二判断结果为所述服务调用请求所调用的服务链接类型不是长链接,则根据预设负载均衡策略,在从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息列表中获取一个服务提供者信息并返回给用户。If the second determination result is that the service link type invoked by the service call request is not a long link, according to a preset load balancing policy, returned from the local or the service registry, and the second A service provider information is obtained from the service provider information list corresponding to the service name information and returned to the user.
再一方面,本发明实施例还提供一种计算机存储介质,计算机存储介质中存储有计算机可执行指令,计算机可执行指令用于执行上述服务发现的处理方法。In still another aspect, an embodiment of the present invention further provides a computer storage medium. The computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the service discovery method.
本发明的实施例还提供一种服务发现的处理装置,包括:An embodiment of the present invention further provides a processing device for service discovery, including:
第一获取模块,设置为按照预设时间间隔,定时获取已查询的第一服务名信息;The first obtaining module is configured to periodically acquire the first service name information that has been queried according to the preset time interval;
第一接收模块,设置为根据所述第一服务名信息向服务注册中心发送第一服务查询请求,并接收所述服务注册中心根据所述第一服务查询请求返回的,与所述第一服务名信息对应的服务提供者信息;The first receiving module is configured to send a first service query request to the service registration center according to the first service name information, and receive the first service that is returned by the service registration center according to the first service query request. Service provider information corresponding to the name information;
更新模块,设置为根据所述服务注册中心返回的服务提供者信息,对本地存储的与所述第一服务名信息对应的服务提供者信息进行更新。The update module is configured to update the locally stored service provider information corresponding to the first service name information according to the service provider information returned by the service registration center.
可选的,所述本地存储的与所述第一服务名信息对应的服务提供者信息包括:预先存储在本地缓存中的与所述第一服务名信息对应的服务提供者信息;Optionally, the locally stored service provider information corresponding to the first service name information includes: service provider information corresponding to the first service name information pre-stored in a local cache;
所述处理装置还包括:The processing device further includes:
备份模块,设置为将所述本地缓存中存储的与所述第一服务名信息对应的服务提供者信息备份到本地内存文件中;a backup module, configured to back up service provider information corresponding to the first service name information stored in the local cache to a local memory file;
可选的,所述更新模块包括:Optionally, the update module includes:
更新单元,设置为根据所述服务注册中心返回的服务提供者信息,对所 述本地缓存以及所述本地内存文件中存储的与所述第一服务名信息对应的服务提供者信息进行更新。An update unit configured to be based on service provider information returned by the service registry The local cache and the service provider information corresponding to the first service name information stored in the local memory file are updated.
可选的,所述处理装置还包括:Optionally, the processing device further includes:
查询模块,设置为接收服务调用请求后,根据所述服务调用请求包含的第二服务名信息,在本地查询与所述第二服务名信息对应的服务提供者信息;The query module is configured to: after receiving the service call request, query the service provider information corresponding to the second service name information locally according to the second service name information included in the service call request;
第二获取模块,设置为若在本地查询到与所述第二服务名信息对应的服务提供者信息,则从本地获取与所述第二服务名信息对应的服务提供者信息;a second obtaining module, configured to: if the service provider information corresponding to the second service name information is locally queried, obtain the service provider information corresponding to the second service name information locally;
第二接收模块,设置为若在本地中没有查询到与所述第二服务名信息对应的服务提供者信息,则根据所述第二服务名信息,向所述服务注册中心发送第二服务查询请求,接收所述服务注册中心根据所述第二服务查询请求返回的,与所述第二服务名信息对应的服务提供者信息;a second receiving module, configured to send a second service query to the service registration center according to the second service name information if the service provider information corresponding to the second service name information is not queried locally And requesting, by the service registration center, the service provider information corresponding to the second service name information returned according to the second service query request;
返回模块,设置为将从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息返回给用户。And returning to the module, the service provider information corresponding to the second service name information returned from the local or returned by the service registration center is returned to the user.
可选的,所述处理装置还包括:Optionally, the processing device further includes:
第一判断模块,设置为判断所述服务调用请求所调用的服务链接类型是否为长链接,得到第一判断结果;The first judging module is configured to determine whether the service link type invoked by the service invocation request is a long link, and obtain a first judgment result;
第一执行模块,设置为若所述第一判断结果为所述服务调用请求所调用的服务链接类型为长链接,则使所述服务注册中心根据所述第二服务查询请求以及预设负载均衡策略,获取与所述第二服务名信息对应的一个服务提供者信息并返回;a first execution module, configured to: if the first determination result is that the service link type invoked by the service call request is a long link, causing the service registration center to perform a second service query request and a preset load balancing a policy, acquiring a service provider information corresponding to the second service name information, and returning;
第二执行模块,设置为若所述第一判断结果为所述服务调用请求所调用的服务链接类型不是长链接,则使所述服务注册中心根据所述第二服务查询请求,获取与所述第二服务名信息对应的服务提供者信息列表并返回,其中,所述服务提供者信息列表包括两个或两个以上服务提供者信息。a second execution module, configured to: if the first determination result is that the service link type invoked by the service call request is not a long link, causing the service registration center to acquire and refer to the second service query request according to the second service query request The service provider information list corresponding to the second service name information includes two or more service provider information.
可选的,所述从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息包括:与所述第二服务名信息对应的一个 服务提供者信息或者与所述第二服务名信息对应的服务提供者信息列表,其中所述服务提供者信息列表包括两个或两个以上服务提供者信息;Optionally, the service provider information corresponding to the second service name information that is obtained locally or returned by the service registration center includes: one corresponding to the second service name information a service provider information or a service provider information list corresponding to the second service name information, wherein the service provider information list includes two or more service provider information;
所述返回模块包括:The return module includes:
第二判断单元,设置为判断所述服务调用请求所调用的服务链接类型是否为长链接,得到第二判断结果;a second determining unit, configured to determine whether the service link type invoked by the service call request is a long link, and obtain a second determination result;
第一返回单元,设置为若所述第二判断结果为所述服务调用请求所调用的服务链接类型为长链接,则将从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的一个服务提供者信息返回给用户;a first returning unit, configured to: if the second determination result is that the service link type invoked by the service call request is a long link, the device that is obtained locally or returned by the service registry, and the second A service provider information corresponding to the service name information is returned to the user;
第二返回单元,设置为若所述第二判断结果为所述服务调用请求所调用的服务链接类型不是长链接,则根据预设负载均衡策略,在从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息列表中获取一个服务提供者信息并返回给用户。a second returning unit, configured to: if the second determination result is that the service link type invoked by the service call request is not a long link, returning from the local or the service registry according to a preset load balancing policy And obtaining a service provider information in the service provider information list corresponding to the second service name information and returning to the user.
与相关技术相比,本发明实施例提供的技术方案,包括:按照预设时间间隔,定时获取已查询的第一服务名信息;然后根据第一服务名信息向服务注册中心发送第一服务查询请求,并接收服务注册中心根据第一服务查询请求返回的,与第一服务名信息对应的服务提供者信息;最后根据服务注册中心返回的服务提供者信息,对本地存储的与第一服务名信息对应的服务提供者信息进行更新。本发明实施例,当服务注册中心的服务提供者信息有更新时,能及时将更新后的服务提供者信息同步到本地,避免了由于更新不及时造成的服务调用失败,增强了服务发现的有效性。Compared with the related art, the technical solution provided by the embodiment of the present invention includes: periodically acquiring the first service name information that has been queried according to a preset time interval; and then sending the first service query to the service registration center according to the first service name information. Requesting, and receiving service provider information corresponding to the first service name information returned by the service registration center according to the first service query request; and finally storing the first service name according to the service provider information returned by the service registration center The service provider information corresponding to the information is updated. In the embodiment of the present invention, when the service provider information of the service registration center is updated, the updated service provider information can be synchronized to the locality in time, thereby avoiding the service call failure caused by the update failure, and enhancing the effective service discovery. Sex.
在阅读并理解了附图和详细描述后,可以明白其他方面。Other aspects will be apparent upon reading and understanding the drawings and detailed description.
附图概述BRIEF abstract
图1为本发明服务发现的处理方法流程图;1 is a flowchart of a processing method for service discovery according to the present invention;
图2为本发明服务发现的处理方法一实现流程图;2 is a flowchart of an implementation method of a service discovery method according to the present invention;
图3为本发明服务发现的处理方法另一实现流程图;3 is a flowchart of another implementation of a method for processing service discovery according to the present invention;
图4为本发明服务发现的处理装置的结构示意图。FIG. 4 is a schematic structural diagram of a processing device for service discovery according to the present invention.
详述 Detailed
下文中将结合附图对本申请的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
如图1所示,本发明实施例的服务发现的处理方法,包括:As shown in FIG. 1 , a method for processing service discovery according to an embodiment of the present invention includes:
步骤101,按照预设时间间隔,定时获取已查询的第一服务名信息;Step 101: Obtain the first service name information that has been queried periodically according to a preset time interval.
步骤102,根据第一服务名信息向服务注册中心发送第一服务查询请求,并接收服务注册中心根据第一服务查询请求返回的,与第一服务名信息对应的服务提供者信息;Step 102: Send a first service query request to the service registration center according to the first service name information, and receive service provider information corresponding to the first service name information returned by the service registration center according to the first service query request;
步骤103,根据服务注册中心返回的服务提供者信息,对本地存储的与第一服务名信息对应的服务提供者信息进行更新。Step 103: Update the locally stored service provider information corresponding to the first service name information according to the service provider information returned by the service registration center.
本发明实施例的服务发现的处理方法,应用于服务消费端,在服务注册中心的服务提供者信息有更新时,能及时将更新后的服务提供者信息同步到服务消费端本地,解决了相关技术中服务发现机制存在的服务提供者地址列表更新不及时的问题,避免了由于更新不及时造成的服务调用失败,增强了服务发现的有效性。The service discovery processing method of the embodiment of the present invention is applied to the service consumer end, and when the service provider information of the service registration center is updated, the updated service provider information can be synchronized to the service consumer end in time, and the relevant solution is solved. In the technology, the service provider discovery list has a problem that the service provider address list is not updated in time, and the service call failure caused by the update is not timely, thereby enhancing the effectiveness of the service discovery.
其中,已查询的服务名信息包括:向服务注册中心查询服务后保存在本地的服务名信息。The service name information that has been queried includes: service name information stored locally after querying the service registration center.
其中,查询过的服务提供者信息一般仅存储在本地缓存中,服务提供者信息可包括描述服务功能的服务名、服务提供者的IP地址、端口、服务路径、属性等。The queried service provider information is generally only stored in the local cache, and the service provider information may include a service name describing the service function, a service provider's IP address, a port, a service path, an attribute, and the like.
由于服务提供者信息仅存储在本地缓存中,因此服务消费端重启后再次查询服务并调用服务时,如果服务注册中心已发生异常或者不可用,比如宕机,则服务消费端将查询不到服务,从而导致服务调用不成功。为避免这种问题,可选的,本地存储的与第一服务名信息对应的服务提供者信息包括:预先存储在本地缓存中的与第一服务名信息对应的服务提供者信息;Since the service provider information is only stored in the local cache, when the service consumer restarts and queries the service again and invokes the service, if the service registry has an exception or is unavailable, such as downtime, the service consumer will not query the service. , causing the service call to be unsuccessful. To avoid such a problem, optionally, the locally stored service provider information corresponding to the first service name information includes: service provider information corresponding to the first service name information pre-stored in the local cache;
本发明实施例处理方法还可以包括:The processing method of the embodiment of the present invention may further include:
步骤104,将本地缓存中存储的与第一服务名信息对应的服务提供者信息备份到本地内存文件中。Step 104: Back up the service provider information corresponding to the first service name information stored in the local cache to the local memory file.
这里,当服务注册中心发生异常或者不可用时,服务消费端重启后再次 调用服务时,可以根据服务名从本地内存文件中获取服务提供者信息并加载到本地缓存,保证了服务调用的顺利进行。Here, when the service registry is abnormal or unavailable, the service consumer restarts again. When the service is invoked, the service provider information can be obtained from the local memory file according to the service name and loaded into the local cache, ensuring smooth service call.
此时,通过将查询到的服务提供者信息备份到本地内存文件中,解决了服务注册中心异常导致服务再次调用失败的问题,增加了服务发现的稳定性。At this time, by backing up the queried service provider information to the local memory file, the problem that the service registry abnormality causes the service to be called again is solved, and the stability of the service discovery is increased.
可选的,上述步骤103可以包括:Optionally, the foregoing step 103 may include:
步骤1031,根据服务注册中心返回的服务提供者信息,对本地缓存以及本地内存文件中存储的与第一服务名信息对应的服务提供者信息进行更新。Step 1031: Update the service provider information corresponding to the first service name information stored in the local cache and the local memory file according to the service provider information returned by the service registration center.
此时,通过对本地缓存以及本地内存文件中的服务提供者信息及时进行更新,避免了由于更新不及时造成的服务调用失败,增强了服务发现的有效性。At this time, by timely updating the local cache and the service provider information in the local memory file, the service call failure caused by the update is not timely, and the effectiveness of the service discovery is enhanced.
基于上述内容,对本发明实施例的一实现流程进行示例:Based on the above content, an implementation process of an embodiment of the present invention is performed:
如图2所示,本发明实施例的服务发现的处理方法,包括:As shown in FIG. 2, a method for processing service discovery according to an embodiment of the present invention includes:
步骤201,启动定时更新任务。In step 201, a timing update task is started.
步骤202,按照预设时间间隔,定时获取已查询的第一服务名信息。Step 202: Timely acquire the first service name information that has been queried according to a preset time interval.
步骤203,根据第一服务名信息向服务注册中心发送第一服务查询请求。Step 203: Send a first service query request to the service registration center according to the first service name information.
步骤204,接收服务注册中心根据第一服务查询请求返回的,与第一服务名信息对应的服务提供者信息。Step 204: Receive service provider information corresponding to the first service name information returned by the service registration center according to the first service query request.
步骤205,将服务注册中心返回的服务提供者信息与本地缓存中存储的服务提供者信息进行对比,判断服务提供者信息是否有更新,如果服务提供者信息有更新,则跳转至步骤206;如果服务提供者信息没有更新,跳转至步骤207。 Step 205, the service provider information returned by the service registry is compared with the service provider information stored in the local cache, to determine whether the service provider information is updated, if the service provider information is updated, then go to step 206; If the service provider information is not updated, go to step 207.
步骤206,对本地缓存以及本地内存文件中的服务提供者信息进行更新。Step 206: Update the local cache and the service provider information in the local memory file.
步骤207,判断定时更新任务进程是否结束,如果定时更新任务进程结束,则跳转至步骤208,如果定时更新任务进程未结束,跳转至步骤202。In step 207, it is determined whether the scheduled update task process is finished. If the scheduled update task process ends, the process goes to step 208. If the scheduled update task process is not completed, the process goes to step 202.
步骤208,结束。 Step 208, ending.
通过上述流程可以看出,本发明实施例的服务发现的处理方法,在服务注册中心的服务提供者信息有更新时,能及时将更新后的服务提供者信息同步到服务消费端本地,避免了由于更新不及时造成的服务调用失败,增强了服务发现的有效性。且通过将查询到的服务提供者信息备份到本地内存文件中,解决了服务注册中心异常导致服务再次调用失败的问题,增加了服务发现的稳定性。Through the foregoing process, it can be seen that the service discovery processing method in the embodiment of the present invention can timely update the updated service provider information to the service consumer end when the service provider information of the service registration center is updated, thereby avoiding The effectiveness of service discovery is enhanced by the failure of service calls due to untimely updates. By backing up the queried service provider information to the local memory file, the problem that the service registry abnormality causes the service to be called again is solved, and the stability of the service discovery is increased.
可选的,本发明实施例处理方法还可以包括:Optionally, the processing method of the embodiment of the present invention may further include:
步骤105,接收服务调用请求后,根据服务调用请求包含的第二服务名信息,在本地查询与第二服务名信息对应的服务提供者信息。Step 105: After receiving the service invocation request, query the service provider information corresponding to the second service name information locally according to the second service name information included in the service call request.
这里,可在本地内存文件中查询与第二服务名信息对应的服务提供者信息。Here, the service provider information corresponding to the second service name information may be queried in the local memory file.
其中,对于首次调用的服务,一般不会在本地内存文件中查询到对应的服务名信息。而对于再次调用的服务,由于之前已经保存并备份,一般可以在本地内存文件中查询到对应的服务名信息。Among them, for the service that is called for the first time, the corresponding service name information is generally not queried in the local memory file. For the service that is called again, since the data has been saved and backed up before, the corresponding service name information can be queried in the local memory file.
步骤106,若在本地查询到与第二服务名信息对应的服务提供者信息,则从本地获取与第二服务名信息对应的服务提供者信息。Step 106: If the service provider information corresponding to the second service name information is locally queried, the service provider information corresponding to the second service name information is locally obtained.
这里,若本地内存文件中查询到与第二服务名信息对应的服务提供者信息,则可将本地内存文件中的服务提供者信息加载到本地缓存中,然后直接从本地缓存中取出并通过后续步骤返回给用户。Here, if the service provider information corresponding to the second service name information is queried in the local memory file, the service provider information in the local memory file may be loaded into the local cache, and then directly taken out from the local cache and passed through The steps are returned to the user.
其中,本地内存文件中存储的服务提供者信息为经上述步骤101-103更新后的信息。The service provider information stored in the local memory file is the information updated by the above steps 101-103.
步骤107,若在本地中没有查询到与第二服务名信息对应的服务提供者信息,则根据第二服务名信息,向服务注册中心发送第二服务查询请求,接收服务注册中心根据第二服务查询请求返回的,与第二服务名信息对应的服务提供者信息。Step 107: If the service provider information corresponding to the second service name information is not found in the local, send a second service query request to the service registration center according to the second service name information, and receive the service registration center according to the second service. The service provider information corresponding to the second service name information returned by the query request.
这里,若在本地内存文件没有查询到与第二服务名信息对应的服务提供者信息,则需要向服务注册中心查询获取。Here, if the service provider information corresponding to the second service name information is not queried in the local memory file, the service registration center needs to be queried for acquisition.
其中,接收到服务注册中心返回的服务提供者信息之后,可将接收的服 务提供者信息保存到本地缓存中,并在本地内存文件中进行备份,以供后续使用。After receiving the service provider information returned by the service registry, the service can be received. The provider information is saved to the local cache and backed up in the local memory file for later use.
步骤108,将从本地获取的或者服务注册中心返回的,与第二服务名信息对应的服务提供者信息返回给用户。Step 108: The service provider information corresponding to the second service name information returned from the local or service registration center is returned to the user.
这里,通过将获取到的与第二服务名信息对应的服务提供者信息返回给用户,方便了用户对服务的调用。Here, the user's call to the service is facilitated by returning the obtained service provider information corresponding to the second service name information to the user.
此时,通过在本地以及服务注册中心两侧查询,增强了服务调用的有效性。At this point, the effectiveness of the service call is enhanced by querying both locally and the service registry.
其中,同一个业务类型的服务可能由多个服务提供者提供,因此,服务消费端调用一次服务可能查询到多个服务提供者信息。为了保证服务提供者之间的平衡,一般服务消费端可基于负载均衡原理选择一个服务提供者。Among them, the service of the same service type may be provided by multiple service providers, therefore, the service consumer may query multiple service provider information by calling the service once. In order to ensure a balance between service providers, the general service consumer can select a service provider based on the load balancing principle.
但若服务调用的是基于长链接的服务应用场景,且此时服务的负载均衡由服务消费端侧来执行,这种情况一方面增加了服务注册中心的传输负载,另一方面会大大降低服务调用的执行效率。However, if the service invokes a service application scenario based on a long link, and the load balancing of the service is performed by the service consumer side, this situation increases the transmission load of the service registry on the one hand, and greatly reduces the service on the other hand. The execution efficiency of the call.
为避免上述问题,可选的,上述步骤107中,若在本地中没有查询到与第二服务名信息对应的服务提供者信息,则根据第二服务名信息,向服务注册中心发送第二服务查询请求之后,本发明实施例处理方法还可以包括:In order to avoid the above problem, optionally, in the foregoing step 107, if the service provider information corresponding to the second service name information is not found in the local, the second service is sent to the service registration center according to the second service name information. After the query request, the processing method of the embodiment of the present invention may further include:
步骤109,判断服务调用请求所调用的服务链接类型是否为长链接,得到第一判断结果。Step 109: Determine whether the service link type invoked by the service call request is a long link, and obtain a first judgment result.
步骤1010,若第一判断结果为服务调用请求所调用的服务链接类型为长链接,则使服务注册中心根据第二服务查询请求以及预设负载均衡策略,获取与第二服务名信息对应的一个服务提供者信息并返回。Step 1010: If the first judgment result is that the service link type invoked by the service call request is a long link, the service registration center obtains one corresponding to the second service name information according to the second service query request and the preset load balancing policy. Service provider information and return.
这里,对于长链接服务,可通过服务注册中心执行服务的负载均衡,使服务注册中心在多个服务提供者中选择一个负载合适的服务提供者并返回给服务消费端,减少了服务注册中心的传输负载,并提高了服务调用的执行效率。Here, for the long link service, the load balancing of the service can be performed by the service registry, so that the service registry selects a suitable service provider among the multiple service providers and returns to the service consumer, thereby reducing the service registry. Transmit load and improve the efficiency of service call execution.
步骤1011,若第一判断结果为服务调用请求所调用的服务链接类型不是长链接,则使服务注册中心根据第二服务查询请求,获取与第二服务名信 息对应的服务提供者信息列表并返回,其中服务提供者信息列表包括多个(两个或两个以上)服务提供者信息。Step 1011: If the first judgment result is that the service link type invoked by the service call request is not a long link, the service registration center obtains the second service name letter according to the second service query request. The service provider information list corresponding to the information is returned, wherein the service provider information list includes a plurality of (two or more) service provider information.
这里,对于短链接服务,可继续通过服务消费端执行服务的负载均衡,使服务注册中心将查询到的多个服务提供者信息返回给服务消费端,并通过服务消费端在多个服务提供者中选择一个负载合适的服务提供者。Here, for the short link service, the load balancing of the service may be performed through the service consumer, so that the service registry returns the plurality of service provider information that is queried to the service consumer, and the service consumer is in the plurality of service providers. Choose a service provider with the right load.
此时,根据服务是否属于长链接服务来决定服务的负载均衡是否由服务注册中心侧来执行,解决了调用服务是基于长链接的服务时应用服务注册中心传输负载开销过大和服务调用效率低下的问题,增加了服务发现处理的灵活性和有效性。At this time, according to whether the service belongs to the long link service to determine whether the load balancing of the service is performed by the service registration center side, and the application service registration center is overloaded and the service call is inefficient when the calling service is based on the long link service. The problem increases the flexibility and effectiveness of service discovery processing.
可选的,从本地获取的或者所述服务注册中心返回的,与第二服务名信息对应的服务提供者信息包括:与第二服务名信息对应的一个服务提供者信息或者与第二服务名信息对应的服务提供者信息列表,其中,服务提供者信息列表包括两个或两个以上服务提供者信息。Optionally, the service provider information corresponding to the second service name information that is obtained locally or returned by the service registration center includes: one service provider information corresponding to the second service name information or the second service name A list of service provider information corresponding to the information, wherein the service provider information list includes two or more service provider information.
这里,对于再次调用的服务,即从本地获取到与第二服务名信息对应的服务提供者信息的情况,可在首次调用该服务时,通过上述步骤109-1011,对于长链接服务,使服务注册中心经过负载均衡返回一个负载合适的服务提供者信息;对于短链接服务,使服务注册中心返回包括两个或两个以上服务提供者信息的服务提供者信息列表。Here, for the service that is called again, that is, the service provider information corresponding to the second service name information is locally acquired, the service may be made for the long link service through the above steps 109-1011 when the service is first called. The registry is load balanced to return a properly loaded service provider information; for short link services, the service registry returns a list of service provider information including two or more service provider information.
上述步骤108可以包括:The above step 108 may include:
步骤1081,判断服务调用请求所调用的服务链接类型是否为长链接,得到第二判断结果。Step 1081: Determine whether the service link type invoked by the service call request is a long link, and obtain a second determination result.
步骤1082,若第二判断结果为服务调用请求所调用的服务链接类型为长链接,则将从本地获取的或者服务注册中心返回的,与第二服务名信息对应的一个服务提供者信息返回给用户。Step 1082: If the second determination result is that the service link type invoked by the service call request is a long link, a service provider information corresponding to the second service name information returned from the local or service registration center is returned to the service provider information. user.
这里,对于长链接服务,由于已经在服务注册中心进行了负载均衡,因此直接将与第二服务名信息对应的一个服务提供者信息返回给用户即可。Here, for the long link service, since the load balancing has been performed in the service registration center, one service provider information corresponding to the second service name information is directly returned to the user.
步骤1083,若第二判断结果为服务调用请求所调用的服务链接类型不是长链接,则根据预设负载均衡策略,在从本地获取的或者服务注册中心返 回的,与第二服务名信息对应的服务提供者信息列表中获取一个服务提供者信息并返回给用户。Step 1083: If the second judgment result is that the service link type invoked by the service call request is not a long link, according to the preset load balancing policy, the locally obtained or service registration center returns Returning, a service provider information is obtained from the service provider information list corresponding to the second service name information and returned to the user.
这里,对于短链接服务,需要在服务消费端进行负载均衡后选择一个负载合适的服务提供者返回给用户。Here, for the short link service, it is necessary to select a suitable service provider to return to the user after load balancing on the service consumer.
此时,通过将长链接服务的负载均衡放在服务注册中心侧执行,减少了服务注册中心的传输负载,并提高了服务调用的执行效率。At this time, by performing load balancing of the long link service on the service registration center side, the transmission load of the service registry is reduced, and the execution efficiency of the service call is improved.
基于上述内容,下面对本发明实施例的另一实现流程如下:Based on the above, another implementation process of the embodiment of the present invention is as follows:
如图3所示,本发明实施例的服务发现的处理方法,包括:As shown in FIG. 3, a method for processing service discovery according to an embodiment of the present invention includes:
步骤301,根据服务调用请求,启动服务查询任务。Step 301: Start a service query task according to the service call request.
步骤302,判断与第二服务名信息对应的服务提供者信息在本地内存文件中是否存在,如果与第二服务名信息对应的服务提供者信息在本地内存文件中存在,则跳转至步骤303,如果与第二服务名信息对应的服务提供者信息在本地内存文件中不存在,跳转至步骤304。Step 302: Determine whether the service provider information corresponding to the second service name information exists in the local memory file. If the service provider information corresponding to the second service name information exists in the local memory file, go to step 303. If the service provider information corresponding to the second service name information does not exist in the local memory file, the process proceeds to step 304.
这里,对于再次调用的服务,本地内存文件中存储有经过更新的服务提供者信息。Here, for the service that is called again, the updated service provider information is stored in the local memory file.
步骤303,从本地内存文件获取与第二服务名信息对应的服务提供者信息并放到缓存,之后跳转至步骤309。Step 303: Obtain the service provider information corresponding to the second service name information from the local memory file and put it into the cache, and then jump to step 309.
步骤304,根据第二服务名信息,向服务注册中心发送第二服务查询请求。Step 304: Send a second service query request to the service registration center according to the second service name information.
步骤305,判断服务调用请求所调用的服务链接类型是否为长链接,如果服务调用请求所调用的服务链接类型为长链接,则跳转至步骤306,如果服务调用请求所调用的服务链接类型不是长链接,跳转至步骤307。 Step 305, determining whether the service link type invoked by the service call request is a long link, if the service link type invoked by the service call request is a long link, then jumping to step 306, if the service link type invoked by the service call request is not Long link, go to step 307.
步骤306,使服务注册中心根据第二服务查询请求以及预设负载均衡策略,获取与第二服务名信息对应的一个服务提供者信息并返回,之后跳转至步骤308。Step 306: The service registration center obtains a service provider information corresponding to the second service name information according to the second service query request and the preset load balancing policy, and returns, and then proceeds to step 308.
步骤307,使服务注册中心根据第二服务查询请求,获取与第二服务名信息对应的服务提供者信息列表并返回。其中,服务提供者信息列表包括两个或两个以上服务提供者信息。 Step 307: The service registration center obtains a service provider information list corresponding to the second service name information according to the second service query request, and returns. The service provider information list includes two or more service provider information.
步骤308,接收服务注册中心返回的一个服务提供者信息或者服务提供者信息列表,将接收到的信息保存到本地缓存,并在本地内存文件中进行备份。Step 308: Receive a service provider information or a service provider information list returned by the service registration center, save the received information to a local cache, and perform backup in the local memory file.
步骤309,判断服务调用请求所调用的服务链接类型是否为长链接,如果服务调用请求所调用的服务链接类型为长链接,则跳转至步骤3010,如果服务调用请求所调用的服务链接类型不是长链接,跳转至步骤3011。 Step 309, it is determined whether the service link type invoked by the service call request is a long link. If the service link type invoked by the service call request is a long link, the process jumps to step 3010, if the service link type invoked by the service call request is not Long link, go to step 3011.
步骤3010,将从本地获取的或者服务注册中心返回的,与第二服务名信息对应的一个服务提供者信息返回给用户。Step 3010: Return a service provider information corresponding to the second service name information returned from the local or service registration center to the user.
步骤3011,根据预设负载均衡策略,在从本地获取的或者服务注册中心返回的,与第二服务名信息对应的服务提供者信息列表中获取一个服务提供者信息并返回给用户。Step 3011: Obtain a service provider information in the service provider information list corresponding to the second service name information returned from the local or service registration center according to the preset load balancing policy, and return the information to the user.
通过上述流程可以看出,本发明实施例的服务发现的处理方法,根据服务是否属于长链接服务来决定服务的负载均衡是否由服务注册中心侧来执行,解决了调用服务是基于长链接的服务时应用服务注册中心传输负载开销过大和服务调用效率低下的问题,增加了服务发现处理的灵活性和有效性。It can be seen that the processing method of the service discovery according to the embodiment of the present invention determines whether the load balancing of the service is performed by the service registration center side according to whether the service belongs to the long link service, and solves the problem that the calling service is based on the long link service. The application service registry has a problem of excessive transmission overhead and inefficient service calls, which increases the flexibility and effectiveness of service discovery processing.
本发明实施例的服务发现的处理方法,应用于包括服务提供端、服务注册中心和服务消费端的分布式***,具体应用于服务消费端。其中,服务提供端将要发布的服务注册到服务注册中心,服务注册中心用于接受服务消费端的查找服务请求,当发现存在相应服务时,实时返回最新的服务提供者信息给服务消费端,服务消费端用于向服务注册中心发送查询服务请求,接收从服务注册中心返回的服务,自动与服务提供端建立链接,并调用相应的服务。The method for processing service discovery in the embodiment of the present invention is applied to a distributed system including a service provider, a service registry, and a service consumer, and is specifically applied to a service consumer. The service provider registers the service to be published to the service registration center, and the service registration center is used to receive the service request from the service consumer. When the corresponding service is found, the latest service provider information is returned to the service consumer in real time, and the service consumption is The terminal is configured to send a query service request to the service registration center, receive the service returned from the service registration center, automatically establish a link with the service provider, and invoke the corresponding service.
本发明实施例的服务发现的处理方法,在服务注册中心的服务提供者信息有更新时,能及时将更新后的服务提供者信息同步到服务消费端本地,避免了由于更新不及时造成的服务调用失败,增强了服务发现的有效性。且通过将查询到的服务提供者信息备份到本地内存文件中,解决了服务注册中心异常导致服务再次调用失败的问题,增加了服务发现的稳定性。且根据服务是否属于长链接服务来决定服务的负载均衡是否由服务注册中心侧来执行,解决了调用服务是基于长链接的服务时应用服务注册中心传输负载开销过 大和服务调用效率低下的问题,增加了服务发现处理的灵活性和有效性。When the service provider information of the service registration center is updated, the updated service provider information can be synchronized to the service consumer end in time, thereby avoiding the service caused by the update failure. The call failed, enhancing the effectiveness of service discovery. By backing up the queried service provider information to the local memory file, the problem that the service registry abnormality causes the service to be called again is solved, and the stability of the service discovery is increased. And whether the load balancing of the service is performed by the service registration center side according to whether the service belongs to the long link service, and the application service registration center transmission load overhead is solved when the calling service is based on the long link service. The inefficiency of Yamato service calls increases the flexibility and effectiveness of service discovery processing.
本发明实施例还提供一种计算机存储介质,计算机存储介质中存储有计算机可执行指令,计算机可执行指令用于执行上述服务发现的处理方法。The embodiment of the invention further provides a computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the service discovery method.
本发明实施例还提供一种服务发现的处理装置,包括:存储器和处理器;其中,The embodiment of the invention further provides a processing device for service discovery, comprising: a memory and a processor; wherein
处理器被配置为执行存储器中的程序指令;The processor is configured to execute program instructions in the memory;
程序指令在处理器读取执行以下操作:Program instructions perform the following operations on the processor read:
按照预设时间间隔,定时获取已查询的第一服务名信息;Obtaining the first service name information that has been queried periodically according to a preset time interval;
根据第一服务名信息向服务注册中心发送第一服务查询请求,并接收服务注册中心根据第一服务查询请求返回的,与第一服务名信息对应的服务提供者信息;Sending a first service query request to the service registration center according to the first service name information, and receiving service provider information corresponding to the first service name information returned by the service registration center according to the first service query request;
根据服务注册中心返回的服务提供者信息,对本地存储的与第一服务名信息对应的服务提供者信息进行更新。The locally stored service provider information corresponding to the first service name information is updated according to the service provider information returned by the service registration center.
如图4所示,本发明的实施例还提供一种服务发现的处理装置,包括:As shown in FIG. 4, an embodiment of the present invention further provides a service discovery processing apparatus, including:
第一获取模块,设置为按照预设时间间隔,定时获取已查询的第一服务名信息;The first obtaining module is configured to periodically acquire the first service name information that has been queried according to the preset time interval;
第一接收模块,设置为根据第一服务名信息向服务注册中心发送第一服务查询请求,并接收服务注册中心根据第一服务查询请求返回的,与第一服务名信息对应的服务提供者信息;The first receiving module is configured to send a first service query request to the service registration center according to the first service name information, and receive service provider information corresponding to the first service name information returned by the service registration center according to the first service query request. ;
更新模块,设置为根据服务注册中心返回的服务提供者信息,对本地存储的与第一服务名信息对应的服务提供者信息进行更新。The update module is configured to update the locally stored service provider information corresponding to the first service name information according to the service provider information returned by the service registry.
本发明实施例的服务发现的处理装置,应用于服务消费端,在服务注册中心的服务提供者信息有更新时,能及时将更新后的服务提供者信息同步到服务消费端本地,解决了现有服务发现机制存在的服务提供者地址列表更新 不及时的问题,避免了由于更新不及时造成的服务调用失败,增强了服务发现的有效性。The processing device for service discovery according to the embodiment of the present invention is applied to the service consumer end, and when the service provider information of the service registration center is updated, the updated service provider information can be synchronized to the service consumer end in time, and the current solution is solved. Service provider address list update with service discovery mechanism The problem of not being timely, avoiding service call failures caused by unsynchronized updates, and enhancing the effectiveness of service discovery.
可选的,本地存储的与第一服务名信息对应的服务提供者信息包括:预先存储在本地缓存中的与第一服务名信息对应的服务提供者信息;Optionally, the locally stored service provider information corresponding to the first service name information includes: service provider information corresponding to the first service name information pre-stored in the local cache;
本发明实施例处理装置还可以包括:The processing device of the embodiment of the present invention may further include:
备份模块,设置为将本地缓存中存储的与第一服务名信息对应的服务提供者信息备份到本地内存文件中;a backup module, configured to back up the service provider information corresponding to the first service name information stored in the local cache to the local memory file;
可选的,更新模块可以包括:Optionally, the update module can include:
更新单元,设置为根据服务注册中心返回的服务提供者信息,对本地缓存以及本地内存文件中存储的与第一服务名信息对应的服务提供者信息进行更新。The update unit is configured to update the service provider information corresponding to the first service name information stored in the local cache and the local memory file according to the service provider information returned by the service registry.
可选的,本发明实施例处理装置还可以包括:Optionally, the processing apparatus of the embodiment of the present invention may further include:
查询模块,设置为接收服务调用请求后,根据服务调用请求包含的第二服务名信息,在本地查询与第二服务名信息对应的服务提供者信息;The query module is configured to: after receiving the service call request, query the service provider information corresponding to the second service name information locally according to the second service name information included in the service call request;
第二获取模块,设置为若在本地查询到与第二服务名信息对应的服务提供者信息,则从本地获取与第二服务名信息对应的服务提供者信息;The second obtaining module is configured to: if the service provider information corresponding to the second service name information is locally queried, obtain the service provider information corresponding to the second service name information locally;
第二接收模块,设置为若在本地中没有查询到与第二服务名信息对应的服务提供者信息,则根据第二服务名信息,向服务注册中心发送第二服务查询请求,接收服务注册中心根据第二服务查询请求返回的,与第二服务名信息对应的服务提供者信息;The second receiving module is configured to: if the service provider information corresponding to the second service name information is not found in the local area, send a second service query request to the service registration center according to the second service name information, and receive the service registration center. Service provider information corresponding to the second service name information returned according to the second service query request;
返回模块,设置为将从本地获取的或者服务注册中心返回的,与第二服务名信息对应的服务提供者信息返回给用户。The return module is set to return the service provider information corresponding to the second service name information, which is to be retrieved from the local or the service registration center, to the user.
可选的,本发明实施例处理装置还可以包括:Optionally, the processing apparatus of the embodiment of the present invention may further include:
第一判断模块,设置为判断服务调用请求所调用的服务链接类型是否为长链接,得到第一判断结果;The first judging module is configured to determine whether the service link type invoked by the service invocation request is a long link, and obtain a first judgment result;
第一执行模块,设置为若第一判断结果为服务调用请求所调用的服务链接类型为长链接,则使服务注册中心根据第二服务查询请求以及预设负载均 衡策略,获取与第二服务名信息对应的一个服务提供者信息并返回;a first execution module, configured to: if the first determination result is a service link type called a long link, the service registration center is configured according to the second service query request and the preset load Balance the policy, obtain a service provider information corresponding to the second service name information, and return;
第二执行模块,设置为若第一判断结果为服务调用请求所调用的服务链接类型不是长链接,则使服务注册中心根据第二服务查询请求,获取与第二服务名信息对应的服务提供者信息列表并返回,其中,服务提供者信息列表包括两个或两个以上服务提供者信息。a second execution module, configured to: if the first determination result is that the service link type invoked by the service call request is not a long link, cause the service registration center to acquire the service provider corresponding to the second service name information according to the second service query request The list of information is returned and wherein the list of service provider information includes two or more service provider information.
可选的,从本地获取的或者所述服务注册中心返回的,与第二服务名信息对应的服务提供者信息包括:与第二服务名信息对应的一个服务提供者信息或者与所述第二服务名信息对应的服务提供者信息列表,其中,服务提供者信息列表包括两个或两个以上服务提供者信息;Optionally, the service provider information corresponding to the second service name information that is obtained locally or returned by the service registration center includes: one service provider information corresponding to the second service name information or the second a service provider information list corresponding to the service name information, wherein the service provider information list includes two or more service provider information;
返回模块可以包括:The return module can include:
第二判断单元,设置为判断服务调用请求所调用的服务链接类型是否为长链接,得到第二判断结果;a second determining unit, configured to determine whether the service link type invoked by the service call request is a long link, and obtain a second determination result;
第一返回单元,设置为若第二判断结果为服务调用请求所调用的服务链接类型为长链接,则将从本地获取的或者服务注册中心返回的,与第二服务名信息对应的一个服务提供者信息返回给用户;a first returning unit, configured to: if the second determination result is that the service link type invoked by the service call request is a long link, a service provided corresponding to the second service name information returned from the local or service registration center Information is returned to the user;
第二返回单元,设置为若第二判断结果为服务调用请求所调用的服务链接类型不是长链接,则根据预设负载均衡策略,在从本地获取的或者服务注册中心返回的,与第二服务名信息对应的服务提供者信息列表中获取一个服务提供者信息并返回给用户。a second returning unit, configured to: if the second determination result is that the service link type invoked by the service call request is not a long link, according to the preset load balancing policy, returning from the local or service registry, and the second service A service provider information is obtained from the service provider information list corresponding to the name information and returned to the user.
本发明实施例的服务发现的处理方法,在服务注册中心的服务提供者信息有更新时,能及时将更新后的服务提供者信息同步到服务消费端本地,避免了由于更新不及时造成的服务调用失败,增强了服务发现的有效性。且通过将查询到的服务提供者信息备份到本地内存文件中,解决了服务注册中心异常导致服务再次调用失败的问题,增加了服务发现的稳定性。且根据服务是否属于长链接服务来决定服务的负载均衡是否由服务注册中心侧来执行,解决了调用服务是基于长链接的服务时应用服务注册中心传输负载开销过大和服务调用效率低下的问题,增加了服务发现处理的灵活性和有效性。When the service provider information of the service registration center is updated, the updated service provider information can be synchronized to the service consumer end in time, thereby avoiding the service caused by the update failure. The call failed, enhancing the effectiveness of service discovery. By backing up the queried service provider information to the local memory file, the problem that the service registry abnormality causes the service to be called again is solved, and the stability of the service discovery is increased. And determining whether the load balancing of the service is performed by the service registration center side according to whether the service belongs to the long link service, and solving the problem that the application service registration center has excessive transmission load overhead and low service call efficiency when the calling service is based on the long link service. Increased flexibility and effectiveness of service discovery processing.
需要说明的是,该服务发现的处理装置是与上述服务发现的处理方法相 对应的装置,其中上述方法实施例中所有实现方式均适用于该装置的实施例中,也能达到同样的技术效果。It should be noted that the processing device of the service discovery is related to the processing method of the service discovery described above. Corresponding devices, in which all the implementations in the above method embodiments are applicable to the embodiment of the device, can also achieve the same technical effect.
在本发明的实施例中,应理解,上述过程的序号的大小并不意味着执行顺序的先后,执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。In the embodiment of the present invention, it should be understood that the size of the sequence number of the above process does not mean the order of execution order, and the order of execution should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention. .
以上所述是本发明的可选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。The above is an alternative embodiment of the present invention, and it should be noted that those skilled in the art can make several improvements and retouchings without departing from the principles of the present invention. It should also be considered as the scope of protection of the present invention.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件(例如处理器)完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现。相应地,上述实施例中的每个模块/单元可以采用硬件的形式实现,例如通过集成电路来实现其相应功能,也可以采用软件功能模块的形式实现,例如通过处理器执行存储于存储器中的程序/指令来实现其相应功能。本发明不限制于任何特定形式的硬件和软件的结合。One of ordinary skill in the art will appreciate that all or a portion of the above steps may be performed by a program to instruct related hardware, such as a processor, which may be stored in a computer readable storage medium, such as a read only memory, disk or optical disk. Wait. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the foregoing embodiment may be implemented in the form of hardware, for example, by implementing an integrated circuit to implement its corresponding function, or may be implemented in the form of a software function module, for example, being executed by a processor and stored in a memory. Programs/instructions to implement their respective functions. The invention is not limited to any specific form of combination of hardware and software.
虽然本申请所揭露的实施方式如上,但所述的内容仅为便于理解本申请而采用的实施方式,并非用以限定本申请,如本发明实施方式中的具体的实现方法。任何本申请所属领域内的技术人员,在不脱离本申请所揭露的精神和范围的前提下,可以在实施的形式及细节上进行任何的修改与变化,但本申请的专利保护范围,仍须以所附的权利要求书所界定的范围为准。The embodiments disclosed in the present application are as described above, but the descriptions are only for the purpose of understanding the present application, and are not intended to limit the present application, such as the specific implementation method in the embodiments of the present invention. Any modifications and changes in the form and details of the embodiments may be made by those skilled in the art without departing from the spirit and scope of the disclosure. The scope defined by the appended claims shall prevail.
工业实用性Industrial applicability
上述技术方案提升了将更新后的服务提供者信息同步到本地的效率,增强了服务发现的有效性。 The above technical solution improves the efficiency of synchronizing updated service provider information to the local, and enhances the effectiveness of service discovery.

Claims (13)

  1. 一种服务发现的处理方法,包括:A method of processing service discovery, including:
    按照预设时间间隔,定时获取已查询的第一服务名信息;Obtaining the first service name information that has been queried periodically according to a preset time interval;
    根据所述第一服务名信息向服务注册中心发送第一服务查询请求,并接收所述服务注册中心根据所述第一服务查询请求返回的,与所述第一服务名信息对应的服务提供者信息;Sending a first service query request to the service registration center according to the first service name information, and receiving a service provider corresponding to the first service name information returned by the service registration center according to the first service query request information;
    根据所述服务注册中心返回的服务提供者信息,对本地存储的与所述第一服务名信息对应的服务提供者信息进行更新。Updating the locally stored service provider information corresponding to the first service name information according to the service provider information returned by the service registration center.
  2. 根据权利要求1所述的处理方法,其中,所述本地存储的与所述第一服务名信息对应的服务提供者信息包括:预先存储在本地缓存中的与所述第一服务名信息对应的服务提供者信息;The processing method according to claim 1, wherein the locally stored service provider information corresponding to the first service name information comprises: pre-stored in the local cache corresponding to the first service name information Service provider information;
    所述处理方法还包括:将所述本地缓存中存储的与所述第一服务名信息对应的服务提供者信息备份到本地内存文件中。The processing method further includes: backing up service provider information corresponding to the first service name information stored in the local cache to a local memory file.
  3. 根据权利要求2所述的处理方法,其中,所述根据所述服务注册中心返回的服务提供者信息,对本地存储的与所述第一服务名信息对应的服务提供者信息进行更新包括:The processing method according to claim 2, wherein the updating the locally stored service provider information corresponding to the first service name information according to the service provider information returned by the service registration center comprises:
    根据所述服务注册中心返回的服务提供者信息,对所述本地缓存以及所述本地内存文件中存储的与所述第一服务名信息对应的服务提供者信息进行更新。And updating, according to the service provider information returned by the service registration center, the local cache and the service provider information corresponding to the first service name information stored in the local memory file.
  4. 根据权利要求1所述的处理方法,所述处理方法还包括:The processing method according to claim 1, further comprising:
    接收服务调用请求后,根据所述服务调用请求包含的第二服务名信息,在本地查询与所述第二服务名信息对应的服务提供者信息;After receiving the service invocation request, querying the service provider information corresponding to the second service name information locally according to the second service name information included in the service invocation request;
    若在本地查询到与所述第二服务名信息对应的服务提供者信息,则从本地获取与所述第二服务名信息对应的服务提供者信息;If the service provider information corresponding to the second service name information is locally queried, the service provider information corresponding to the second service name information is locally obtained;
    若在本地中没有查询到与所述第二服务名信息对应的服务提供者信息,则根据所述第二服务名信息,向所述服务注册中心发送第二服务查询请求,接收所述服务注册中心根据所述第二服务查询请求返回的,与所述第二服务 名信息对应的服务提供者信息;If the service provider information corresponding to the second service name information is not found in the local area, sending a second service query request to the service registration center according to the second service name information, and receiving the service registration The center returns according to the second service query request, and the second service Service provider information corresponding to the name information;
    将从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息返回给用户。The service provider information corresponding to the second service name information returned from the local or the service registration center is returned to the user.
  5. 根据权利要求4所述的处理方法,所述若在本地中没有查询到与所述第二服务名信息对应的服务提供者信息,则根据所述第二服务名信息,向所述服务注册中心发送第二服务查询请求之后,所述处理方法还包括:The processing method according to claim 4, if the service provider information corresponding to the second service name information is not queried locally, the service registration center is used according to the second service name information. After the second service query request is sent, the processing method further includes:
    判断所述服务调用请求所调用的服务链接类型是否为长链接,得到第一判断结果;Determining whether the service link type invoked by the service call request is a long link, and obtaining a first judgment result;
    若所述第一判断结果为所述服务调用请求所调用的服务链接类型为长链接,则使所述服务注册中心根据所述第二服务查询请求以及预设负载均衡策略,获取与所述第二服务名信息对应的一个服务提供者信息并返回;If the first judgment result is that the service link type invoked by the service call request is a long link, the service registration center is caused to acquire the first service query request according to the second service query request and the preset load balancing policy. a service provider information corresponding to the service name information and returned;
    若所述第一判断结果为所述服务调用请求所调用的服务链接类型不是长链接,则使所述服务注册中心根据所述第二服务查询请求,获取与所述第二服务名信息对应的服务提供者信息列表并返回,其中所述服务提供者信息列表包括两个或两个以上服务提供者信息。If the first judgment result is that the service link type invoked by the service call request is not a long link, the service registration center is caused to acquire, according to the second service query request, a message corresponding to the second service name information. The service provider information list is returned and includes two or more service provider information.
  6. 根据权利要求4所述的处理方法,其特征在于,所述从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息包括:与所述第二服务名信息对应的一个服务提供者信息或者与所述第二服务名信息对应的服务提供者信息列表;其中,所述服务提供者信息列表包括两个或两个以上服务提供者信息;The processing method according to claim 4, wherein the service provider information corresponding to the second service name information returned from the local or the service registration center includes: a service provider information corresponding to the service name information or a service provider information list corresponding to the second service name information; wherein the service provider information list includes two or more service provider information;
    所述将从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息返回给用户包括:Returning, to the user, the service provider information corresponding to the second service name information that is to be returned from the local or returned by the service registration center includes:
    判断所述服务调用请求所调用的服务链接类型是否为长链接,得到第二判断结果;Determining whether the service link type invoked by the service call request is a long link, and obtaining a second determination result;
    若所述第二判断结果为所述服务调用请求所调用的服务链接类型为长链接,则将从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的一个服务提供者信息返回给用户;If the second determination result is that the service link type invoked by the service call request is a long link, a service corresponding to the second service name information that is to be returned locally or returned by the service registration center The provider information is returned to the user;
    若所述第二判断结果为所述服务调用请求所调用的服务链接类型不是 长链接,则根据预设负载均衡策略,在从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息列表中获取一个服务提供者信息并返回给用户。If the second determination result is that the service link type invoked by the service call request is not Long link, according to the preset load balancing policy, obtaining a service provider information in the service provider information list corresponding to the second service name information returned from the local or the service registration center, and returning to the service provider information user.
  7. 一种服务发现的处理装置,包括:A processing device for service discovery, comprising:
    第一获取模块,设置为按照预设时间间隔,定时获取已查询的第一服务名信息;The first obtaining module is configured to periodically acquire the first service name information that has been queried according to the preset time interval;
    第一接收模块,设置为根据所述第一服务名信息向服务注册中心发送第一服务查询请求,并接收所述服务注册中心根据所述第一服务查询请求返回的,与所述第一服务名信息对应的服务提供者信息;The first receiving module is configured to send a first service query request to the service registration center according to the first service name information, and receive the first service that is returned by the service registration center according to the first service query request. Service provider information corresponding to the name information;
    更新模块,设置为根据所述服务注册中心返回的服务提供者信息,对本地存储的与所述第一服务名信息对应的服务提供者信息进行更新。The update module is configured to update the locally stored service provider information corresponding to the first service name information according to the service provider information returned by the service registration center.
  8. 根据权利要求7所述的处理装置,其中,所述本地存储的与所述第一服务名信息对应的服务提供者信息包括:预先存储在本地缓存中的与所述第一服务名信息对应的服务提供者信息;The processing device according to claim 7, wherein the locally stored service provider information corresponding to the first service name information comprises: pre-stored in the local cache corresponding to the first service name information Service provider information;
    所述处理装置还包括:The processing device further includes:
    备份模块,设置为将所述本地缓存中存储的与所述第一服务名信息对应的服务提供者信息备份到本地内存文件中。The backup module is configured to back up the service provider information corresponding to the first service name information stored in the local cache to a local memory file.
  9. 根据权利要求8所述的处理装置,其中,所述更新模块包括:The processing device of claim 8, wherein the update module comprises:
    更新单元,设置为根据所述服务注册中心返回的服务提供者信息,对所述本地缓存以及所述本地内存文件中存储的与所述第一服务名信息对应的服务提供者信息进行更新。And an update unit configured to update the local cache and the service provider information corresponding to the first service name information stored in the local memory file according to the service provider information returned by the service registry.
  10. 根据权利要求7所述的处理装置,所述处理装置还包括:The processing device of claim 7, further comprising:
    查询模块,设置为接收服务调用请求后,根据所述服务调用请求包含的第二服务名信息,在本地查询与所述第二服务名信息对应的服务提供者信息;The query module is configured to: after receiving the service call request, query the service provider information corresponding to the second service name information locally according to the second service name information included in the service call request;
    第二获取模块,设置为若在本地查询到与所述第二服务名信息对应的服务提供者信息,则从本地获取与所述第二服务名信息对应的服务提供者信息; a second obtaining module, configured to: if the service provider information corresponding to the second service name information is locally queried, obtain the service provider information corresponding to the second service name information locally;
    第二接收模块,设置为若在本地中没有查询到与所述第二服务名信息对应的服务提供者信息,则根据所述第二服务名信息,向所述服务注册中心发送第二服务查询请求,接收所述服务注册中心根据所述第二服务查询请求返回的,与所述第二服务名信息对应的服务提供者信息;a second receiving module, configured to send a second service query to the service registration center according to the second service name information if the service provider information corresponding to the second service name information is not queried locally And requesting, by the service registration center, the service provider information corresponding to the second service name information returned according to the second service query request;
    返回模块,设置为将从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息返回给用户。And returning to the module, the service provider information corresponding to the second service name information returned from the local or returned by the service registration center is returned to the user.
  11. 根据权利要求10所述的处理装置,所述处理装置还包括:The processing device of claim 10, further comprising:
    第一判断模块,设置为判断所述服务调用请求所调用的服务链接类型是否为长链接,得到第一判断结果;The first judging module is configured to determine whether the service link type invoked by the service invocation request is a long link, and obtain a first judgment result;
    第一执行模块,设置为若所述第一判断结果为所述服务调用请求所调用的服务链接类型为长链接,则使所述服务注册中心根据所述第二服务查询请求以及预设负载均衡策略,获取与所述第二服务名信息对应的一个服务提供者信息并返回;a first execution module, configured to: if the first determination result is that the service link type invoked by the service call request is a long link, causing the service registration center to perform a second service query request and a preset load balancing a policy, acquiring a service provider information corresponding to the second service name information, and returning;
    第二执行模块,设置为若所述第一判断结果为所述服务调用请求所调用的服务链接类型不是长链接,则使所述服务注册中心根据所述第二服务查询请求,获取与所述第二服务名信息对应的服务提供者信息列表并返回,其中所述服务提供者信息列表包括两个或两个以上服务提供者信息。a second execution module, configured to: if the first determination result is that the service link type invoked by the service call request is not a long link, causing the service registration center to acquire and refer to the second service query request according to the second service query request The service provider information list corresponding to the second service name information includes two or more service provider information.
  12. 根据权利要求10所述的处理装置,其中,所述从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息包括:与所述第二服务名信息对应的一个服务提供者信息或者与所述第二服务名信息对应的服务提供者信息列表,其中,所述服务提供者信息列表包括两个或两个以上服务提供者信息;The processing device according to claim 10, wherein the service provider information corresponding to the second service name information returned from the local or the service registration center comprises: the second service name a service provider information corresponding to the information or a service provider information list corresponding to the second service name information, wherein the service provider information list includes two or more service provider information;
    所述返回模块包括:The return module includes:
    第二判断单元,设置为判断所述服务调用请求所调用的服务链接类型是否为长链接,得到第二判断结果;a second determining unit, configured to determine whether the service link type invoked by the service call request is a long link, and obtain a second determination result;
    第一返回单元,设置为若所述第二判断结果为所述服务调用请求所调用的服务链接类型为长链接,则将从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的一个服务提供者信息返回给用户; a first returning unit, configured to: if the second determination result is that the service link type invoked by the service call request is a long link, the device that is obtained locally or returned by the service registry, and the second A service provider information corresponding to the service name information is returned to the user;
    第二返回单元,设置为若所述第二判断结果为所述服务调用请求所调用的服务链接类型不是长链接,则根据预设负载均衡策略,在从本地获取的或者所述服务注册中心返回的,与所述第二服务名信息对应的服务提供者信息列表中获取一个服务提供者信息并返回给用户。a second returning unit, configured to: if the second determination result is that the service link type invoked by the service call request is not a long link, returning from the local or the service registry according to a preset load balancing policy And obtaining a service provider information in the service provider information list corresponding to the second service name information and returning to the user.
  13. 一种计算机存储介质,其特征在于,所述计算机存储介质中存储有计算机可执行指令,计算机可执行指令用于执行如权利要求1~6任一项服务发现的处理方法。 A computer storage medium, characterized in that the computer storage medium stores computer executable instructions for performing a service discovery method according to any one of claims 1 to 6.
PCT/CN2017/079623 2016-04-26 2017-04-06 Method and apparatus for processing service discovery WO2017185961A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610266262.1 2016-04-26
CN201610266262.1A CN107317830B (en) 2016-04-26 2016-04-26 Service discovery processing method and device

Publications (1)

Publication Number Publication Date
WO2017185961A1 true WO2017185961A1 (en) 2017-11-02

Family

ID=60160726

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/079623 WO2017185961A1 (en) 2016-04-26 2017-04-06 Method and apparatus for processing service discovery

Country Status (2)

Country Link
CN (1) CN107317830B (en)
WO (1) WO2017185961A1 (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710424A (en) * 2018-12-18 2019-05-03 成都淞幸科技有限责任公司 A kind of implementation method of distributed application services
CN110190997A (en) * 2019-05-31 2019-08-30 深圳前海微众银行股份有限公司 Configuration information obtaining method, device, equipment and computer readable storage medium
CN110730197A (en) * 2018-07-17 2020-01-24 北京京东尚科信息技术有限公司 Service discovery method and system
CN110955460A (en) * 2019-11-15 2020-04-03 北京金山云网络技术有限公司 Service process starting method and device, electronic equipment and storage medium
CN112202605A (en) * 2020-09-27 2021-01-08 中国建设银行股份有限公司 Service configuration method, device, equipment and storage medium
CN112887149A (en) * 2021-01-29 2021-06-01 中汽创智科技有限公司 Service visual management system and management method thereof
CN113364706A (en) * 2021-06-03 2021-09-07 上海中通吉网络技术有限公司 Method for centralizing service flow
CN113742100A (en) * 2021-08-27 2021-12-03 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN113783826A (en) * 2020-09-22 2021-12-10 北京沃东天骏信息技术有限公司 Micro-service exception handling method and device
CN114697231A (en) * 2020-12-31 2022-07-01 电科云(北京)科技有限公司 Gateway-based service discovery and service registration method and device
CN115037785A (en) * 2022-08-12 2022-09-09 深圳市星卡软件技术开发有限公司 Instant communication system and method
CN115103008A (en) * 2022-06-13 2022-09-23 北京奇艺世纪科技有限公司 Service request forwarding system

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110740046B (en) * 2018-07-18 2023-08-08 北京京东尚科信息技术有限公司 Method and device for analyzing service contract
CN109189856B (en) * 2018-08-15 2021-09-28 中国联合网络通信集团有限公司 Distributed database service management method, device, server and storage medium
CN110377431B (en) * 2019-07-29 2022-02-01 中国工商银行股份有限公司 Service calling method and device under multi-registry scene
CN112579319B (en) * 2020-12-07 2023-09-08 中国民航信息网络股份有限公司 Service calling method and device based on LRU Cache optimization

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110040569A1 (en) * 2007-10-02 2011-02-17 American Well Corporation, a Delaware corporation Tracking the Availability of Service Providers Across Multiple Platforms
CN103516746A (en) * 2012-06-26 2014-01-15 中兴通讯股份有限公司 Method for pushing service change information, device and system thereof
CN104468838A (en) * 2014-12-30 2015-03-25 桂林电子科技大学 P2P network and Web service selection method in publish-subscribe pattern
CN105450757A (en) * 2015-12-02 2016-03-30 联动优势电子商务有限公司 Service management method and system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5694547A (en) * 1992-10-13 1997-12-02 Bay Networks, Inc. System for registration of clients in an ATM network providing for communication of client registration messages to a central manager
CN100370770C (en) * 2004-03-03 2008-02-20 华为技术有限公司 Method for implementing long connection changeover of network
CN100337200C (en) * 2005-04-22 2007-09-12 珠海金山软件股份有限公司 Software upgrading method for use in computer systems
CN105376225B (en) * 2015-11-02 2019-07-26 亚信科技(南京)有限公司 A kind of method and device of software service

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110040569A1 (en) * 2007-10-02 2011-02-17 American Well Corporation, a Delaware corporation Tracking the Availability of Service Providers Across Multiple Platforms
CN103516746A (en) * 2012-06-26 2014-01-15 中兴通讯股份有限公司 Method for pushing service change information, device and system thereof
CN104468838A (en) * 2014-12-30 2015-03-25 桂林电子科技大学 P2P network and Web service selection method in publish-subscribe pattern
CN105450757A (en) * 2015-12-02 2016-03-30 联动优势电子商务有限公司 Service management method and system

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110730197A (en) * 2018-07-17 2020-01-24 北京京东尚科信息技术有限公司 Service discovery method and system
CN110730197B (en) * 2018-07-17 2023-08-08 北京京东尚科信息技术有限公司 Service discovery method and system
CN109710424A (en) * 2018-12-18 2019-05-03 成都淞幸科技有限责任公司 A kind of implementation method of distributed application services
CN110190997A (en) * 2019-05-31 2019-08-30 深圳前海微众银行股份有限公司 Configuration information obtaining method, device, equipment and computer readable storage medium
CN110955460A (en) * 2019-11-15 2020-04-03 北京金山云网络技术有限公司 Service process starting method and device, electronic equipment and storage medium
CN110955460B (en) * 2019-11-15 2023-10-03 北京金山云网络技术有限公司 Service process starting method and device, electronic equipment and storage medium
CN113783826A (en) * 2020-09-22 2021-12-10 北京沃东天骏信息技术有限公司 Micro-service exception handling method and device
CN113783826B (en) * 2020-09-22 2023-08-04 北京沃东天骏信息技术有限公司 Micro-service exception handling method and device
CN112202605A (en) * 2020-09-27 2021-01-08 中国建设银行股份有限公司 Service configuration method, device, equipment and storage medium
CN114697231B (en) * 2020-12-31 2023-08-01 电科云(北京)科技有限公司 Gateway-based service discovery and service registration method and device
CN114697231A (en) * 2020-12-31 2022-07-01 电科云(北京)科技有限公司 Gateway-based service discovery and service registration method and device
CN112887149A (en) * 2021-01-29 2021-06-01 中汽创智科技有限公司 Service visual management system and management method thereof
CN112887149B (en) * 2021-01-29 2023-06-23 中汽创智科技有限公司 Service visual management system and management method thereof
CN113364706B (en) * 2021-06-03 2023-01-31 上海中通吉网络技术有限公司 Method for centralizing service flow
CN113364706A (en) * 2021-06-03 2021-09-07 上海中通吉网络技术有限公司 Method for centralizing service flow
CN113742100A (en) * 2021-08-27 2021-12-03 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN113742100B (en) * 2021-08-27 2024-05-31 欧电云信息科技(江苏)有限公司 Service calling method, system, equipment and medium based on micro-service architecture
CN115103008A (en) * 2022-06-13 2022-09-23 北京奇艺世纪科技有限公司 Service request forwarding system
CN115103008B (en) * 2022-06-13 2024-03-08 北京奇艺世纪科技有限公司 Service request forwarding system
CN115037785B (en) * 2022-08-12 2022-11-01 深圳市星卡软件技术开发有限公司 Instant communication system and method
CN115037785A (en) * 2022-08-12 2022-09-09 深圳市星卡软件技术开发有限公司 Instant communication system and method

Also Published As

Publication number Publication date
CN107317830B (en) 2021-05-18
CN107317830A (en) 2017-11-03

Similar Documents

Publication Publication Date Title
WO2017185961A1 (en) Method and apparatus for processing service discovery
US10498625B1 (en) Distributed testing service
CN107360010B (en) Website gray level publishing method and device
US8930409B2 (en) System and method for supporting named operations in a distributed data grid
US8959385B2 (en) Synchronized failover for active-passive applications
US9749445B2 (en) System and method for updating service information for across-domain messaging in a transactional middleware machine environment
US9367261B2 (en) Computer system, data management method and data management program
US9292278B2 (en) Providing high availability for state-aware applications
CN110377431B (en) Service calling method and device under multi-registry scene
US10979317B2 (en) Service registration method and usage method, and related apparatus
WO2017036332A1 (en) Distributed system-based gated launch method, client end and platform
US11223522B1 (en) Context-based intelligent re-initiation of microservices
CN113434249A (en) Mirror image synchronization method and device, docker host and storage medium
EP4369181A1 (en) Node for running container group, and management system and method of container group
CN112433863A (en) Micro-service calling method and device, terminal equipment and storage medium
CN105373563B (en) Database switching method and device
CN114328097A (en) File monitoring method and device, electronic equipment and storage medium
CN114363233B (en) Packet routing method, device, electronic equipment and storage medium
WO2018068655A1 (en) License management method and system
CN111737028A (en) Dubbo service detection method and device
CN114356456A (en) Service processing method, device, storage medium and electronic equipment
CN114461424A (en) Inter-unit service discovery method, device and system under unitized deployment architecture
CN115866029B (en) Method, device, computer equipment and storage medium for processing microservice offline
CN112988471B (en) Data backup method and device in industrial Internet system and electronic equipment
CN109753403B (en) Server operation method, device, equipment and system

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17788613

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 17788613

Country of ref document: EP

Kind code of ref document: A1