Business processing method, apparatus, device, and storage medium

By retrieving device information from multiple deployed devices in the cache within a distributed system and determining the target deployed device for business processing, the problem of call failures caused by registry center anomalies is resolved, thereby improving the reliability and stability of business processing.

CN116633765BActive Publication Date: 2025-11-28BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310632354.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-30
Publication Date
2025-11-28
Estimated Expiration
2043-05-30

AI Technical Summary

Technical Problem

In a distributed system, when the service registry fails, the application caller cannot call the application provider, resulting in low reliability of business processing.

Method used

By sending a call request to the first registration server, receiving feedback messages, and retrieving device information from the cache of multiple deployed devices in case of an anomaly, the target deployed device is identified and business processing is performed, ensuring that the application provider can still be called normally even in the event of an anomaly in the registration center or network.

Benefits of technology

This improves the reliability of business processing, enabling application callers to still call application providers normally even when the registry center or network is abnormal, thus improving the stability and availability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116633765B_ABST
    Figure CN116633765B_ABST
Patent Text Reader

Abstract

The application provides a service processing method, device and equipment and a storage medium, which can be used in the field of distribution. The method comprises the following steps: sending a calling request of a target service to a first registration server corresponding to a local deployment device, then receiving a feedback message of the calling request sent by the first registration server, when the feedback message indicates that the first registration server is abnormal, obtaining device information of a plurality of deployment devices corresponding to the target service from a cache, then determining a target deployment device from the plurality of deployment devices, and calling a target service application in the target deployment device for service processing according to the device information of the target deployment device to obtain a service processing result. According to the method, the application calling party can normally call the application provider in the case that the first registration server is abnormal or the network is abnormal, and the reliability of service processing is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of distribution, and particularly relates to a business processing method and device, equipment and storage medium. BACKGROUND

[0002] With the popularity of distributed system architecture, more and more enterprises change the application system from a single application to a distributed application, and multiple systems work in coordination, and the complexity increases.

[0003] At present, in order to realize dynamic management of the application under the distributed architecture to ensure mutual calling between applications, the distributed architecture adopts a service registration center decoupled from the application, which can dynamically realize application registration, application discovery, application exclusion and other functions, and ensure mutual calling between applications.

[0004] However, when the service registration center is abnormal, network exception or network jitter occurs between the application calling party and the service registration center, the application calling party cannot call the application provider, and the business processing reliability is low. SUMMARY

[0005] The present application provides a business processing method, device, equipment and storage medium, to solve the problem of low business processing reliability when the service registration center is abnormal in the related art.

[0006] In a first aspect, the present application provides a business processing method applied to a client, comprising:

[0007] sending a calling request of a target business to a first registration server, the calling request being used to request device information of a local deployment device corresponding to the target business, the local deployment device being provided with a target business application used to process the target business;

[0008] receiving a feedback message of the calling request sent by the first registration server, the feedback message being used to indicate whether the first registration server is abnormal;

[0009] when the feedback message indicates that the first registration server is abnormal, obtaining device information of a plurality of deployment devices corresponding to the target business from a cache, the plurality of deployment devices comprising the local deployment device and at least one foreign deployment device, the deployment devices being provided with the target business application used to process the target business;

[0010] determining a target deployment device from the plurality of deployment devices;

[0011] calling the target business application in the target deployment device according to the device information of the target deployment device to perform business processing, and obtaining a business processing result.

[0012] In a second aspect, the present application provides a service processing apparatus, comprising:

[0013] a sending module configured to send a calling request of a target service to a first registration server, the calling request being used to request device information of a locally deployed device corresponding to the target service, the locally deployed device being provided with a target service application used to process the target service;

[0014] a receiving module configured to receive a feedback message of the calling request sent by the first registration server, the feedback message being used to indicate whether the first registration server is abnormal;

[0015] an obtaining module configured to, when the feedback message indicates that the first registration server is abnormal, obtain device information of a plurality of deployed devices corresponding to the target service from a cache, the plurality of deployed devices comprising the locally deployed device and at least one remotely deployed device, the deployed devices being provided with the target service application used to process the target service;

[0016] a determining module configured to determine a target deployed device from the plurality of deployed devices;

[0017] a processing module configured to call the target service application in the target deployed device according to the device information of the target deployed device to perform service processing, and obtain a service processing result.

[0018] In a third aspect, the present application provides an electronic device, comprising a processor and a memory connected with the processor in communication;

[0019] the memory stores computer execution instructions;

[0020] the processor executes the computer execution instructions stored in the memory to implement the service processing method according to the first aspect.

[0021] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium storing computer execution instructions, the computer execution instructions being used to implement the service processing method according to the first aspect when executed by a computer.

[0022] In a fifth aspect, the present application provides a computer program product, comprising a computer program, the computer program being used to implement the service processing method according to the first aspect when executed by a computer.

[0023] The application provides a service processing method, device, equipment and storage medium. The application sends a calling request of a target service to a first registration server corresponding to a local deployment equipment, receives a feedback message of the calling request sent by the first registration server, obtains device information of a plurality of deployment equipments corresponding to the target service from a cache when the feedback message indicates that the first registration server is abnormal, determines a target deployment equipment from the plurality of deployment equipments, and calls a target service application in the target deployment equipment according to the device information of the target deployment equipment to obtain a service processing result. In the case that the first registration server is abnormal or the network is abnormal, the application calling party can normally call the application providing party, and the reliability of service processing is improved. BRIEF DESCRIPTION OF DRAWINGS

[0024] The accompanying drawings, which are incorporated herein and form part of the specification, illustrate embodiments consistent with the present application and, together with the description, further serve to explain the principles of the application.

[0025] Figure 1 A schematic diagram of an application scenario applicable to the application;

[0026] Figure 2 A structural schematic diagram of a distributed architecture applicable to the application;

[0027] Figure 3 A flow schematic diagram of a service processing method provided by the first embodiment of the application;

[0028] Figure 4 A flow schematic diagram of another service processing method provided by the second embodiment of the application;

[0029] Figure 5 A signaling flowchart of a service processing method provided by the third embodiment of the application;

[0030] Figure 6 A structural schematic diagram of a service processing device provided by the fourth embodiment of the application;

[0031] Figure 7 A structural schematic diagram of an electronic equipment provided by the fifth embodiment of the application.

[0032] The above-described drawings have shown the specific embodiments of the application, and the following will have a more detailed description. The drawings and the written description are not intended to limit the scope of the concept of the application by any means, but to illustrate the concept of the application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0033] The exemplary embodiments will be described in detail herein with reference to the attached drawings. The following description is made with reference to the accompanying drawings in which like reference numerals designate identical or similar elements in the several figures. The implementations described in the following exemplary embodiments are not meant to represent all implementations consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims.

[0034] It should be noted that the service processing method, device, equipment and storage medium provided by the present application can be used in the field of distribution, and can also be used in any field other than the field of distribution. The application field of the service processing method, device, equipment and storage medium provided by the present application is not limited.

[0035] With the development of big data, distributed, cloud native new technologies, more and more enterprises will change the application system from monolithic application to distributed application. In a single system, a large amount of data will cause the response time of data search to become longer, and high concurrency will make the system slow due to busy, thereby affecting the response speed, and single machine failure will also cause system crash. In order to solve the problems brought by single machine system, the Internet system evolves from single machine system to system of multiple machines, i.e. distributed system. Distributed system can meet the requirements of Internet for big data storage, high concurrency and fast response, and adopts the idea of divide and conquer. The advantages are as follows:

[0036] High performance: a large number of requests can be distributed to each application, thereby solving the problems of big data, high concurrency and fast response of the system.

[0037] High availability: business processing requests can avoid applications with faults, use applications on other machines, and the system can still work.

[0038] Scalability: the application that appears to be faulty can be reconnected after processing, and when the business is busy and the system pressure increases, the processing request flow can be increased.

[0039] High flexibility: for system update iteration, part of the application can be stopped for update in the off-peak period, and then the remaining applications are updated alternately, so that the update is flexible and the system does not need to be stopped.

[0040] At present, in order to realize dynamic management of applications under distributed architecture to ensure mutual calling between applications, the distributed architecture adopts a service registration center decoupled from the application. The service registration center stores the information of the service side, and can dynamically realize application registration, application discovery, application exclusion and other functions to ensure mutual calling between applications.

[0041] However, when the service registry is abnormal, network exception or network jitter occurs between the application invoker and the service registry, or network exception or network jitter occurs between the service registry and the application provider, the application invoker cannot call the application provider, that is, the application invoker cannot obtain the Internet Protocol (IP) list of the application provider from the service registry, the application invoker cannot call the application provider, and the business processing reliability is low.

[0042] Therefore, the application provides a business processing method. When the service registry is abnormal, the device information of the multiple deployment devices corresponding to the target business stored in the cache can be obtained, the application invoker can be called according to the device information, the business processing can be implemented, the application invoker can normally call the application provider even when the service registry is abnormal or the network is abnormal, and the reliability of the business processing is improved.

[0043] The service registry can be a first registration server in the application. The first registration server is a registration server corresponding to a local deployment device corresponding to a target business, that is, the local deployment device can send device information to the registration server, so that the first registration server stores the device information, and the client can obtain the device information to implement calling.

[0044] An application program can usually be composed of multiple components, each component representing a different functional module (which can be referred to as a business in the application), and each component includes multiple micro-service applications, for example, an application program includes “deposit business”, “credit card business” and other functional modules, and the “deposit business” further includes multiple micro-service applications to provide services for users.

[0045] For the business application of the application, it can be a micro-service application, for example, the “deposit business” component further includes multiple micro-service applications to provide services for users.

[0046] For ease of understanding, the application scenario to which the embodiments of the application are applied will be described below in conjunction with an example. Figure 1

[0047] Figure 1 A schematic diagram of an application scenario to which the application is applied is shown in FIG. 1. Figure 1 The application scenario includes a first registration server 101, a second registration server 102, a client 103, a business server A 104, a business server B 105, and a business server C 106. The first registration server 101, the second registration server 102, the client 103, the business server A 104, the business server B 105, and the business server C 106 can communicate with each other through the Internet.

[0048] ​The target service application is deployed in the service server A 104, the service server B 105, and the service server C 106.

[0049] The first registration server 101 and the service server A 104 and the service server B 105 belong to a first machine room. The service server A 104 and the service server B 105 can register by sending device information to the first registration server 101 and the second registration server 102. The registration process can also be referred to as publishing. Figure 1 The registration is successful, which means that the target service application in the service server A 104 and the service server B 105 can be called.

[0050] The second registration server 102 and the service server C 106 belong to a second machine room. It can be understood that the second machine room can also be deployed with a registration server, which is not shown in the figure and can be referred to the first machine room. The service server C 106 can register by sending device information to the second registration server 102.

[0051] The first registration server 101 can be understood as a local registration center. The device information in the first registration server 101 can be used to obtain the device information of the local deployed device when the client (for example, the client 103) in the preset range of the service server A 104 and the service server B 105 has a business processing demand, so as to facilitate the calling of the service application. The second registration server 102 can be understood as a global registration center. The device information in the second registration server 102 can be used to obtain the device information when the client in a multi-site range has a business processing demand, so as to facilitate the calling of the service application.

[0052] It can be understood that the number of service servers can be multiple, which is not shown in the figure.

[0053] In a possible implementation, the client 103 can send a calling request to the first registration server 101 to request to obtain the device information of the locally deployed device corresponding to the target service, so as to realize the preferential calling of the local service application. When the first registration server 101 is abnormal, the client 103 can obtain the device information of multiple deployed devices corresponding to the target service from the cache, and realize the calling of the service application according to the device information obtained from the cache.

[0054] The device information stored in the cache of the client 103 can be obtained by the client 103 from the first registration server 101 and the second registration server 102.

[0055] For the convenience of understanding, the following examples are given. Figure 2A distributed overall architecture applicable to the present application is described. One local registry center corresponds to multiple components, the number shown in the figure is only an example, multiple business applications are included in each component, multiple business applications in each component can include a gateway application, the gateway application is an application used for communication between components, that is, the call between components, which needs to be called through the gateway application. Among them, the gateway application involves double registration. Taking the gateway application in component 1 as an example, the device information of the deployment device corresponding to the gateway application can be registered to the local registry center 1, and also needs to be registered to the global registry center, and provided to external calls.

[0056] It can be understood that as the number of services and the access amount increase, the number of local registry centers can be multiple, and the number of global registry centers can also be multiple, which is not shown in the figure. When the number of global registry centers is multiple, multiple global registry centers can synchronize information with each other.

[0057] The client 103 can be a mobile phone, a tablet computer, a computer with wireless transceiver function (such as a notebook computer, a palm computer, etc.), a user terminal or a desktop computer, etc., which is not limited by the present application.

[0058] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes can not be described in detail in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

[0059] Figure 3 A flowchart of a business processing method provided by Embodiment One of the present application is shown. The method can be executed by a client, or by a business processing device provided in the client. The device can be a chip, a chip module, an integrated development environment (IDE), etc. Referring to Figure 3 The method includes the following steps:

[0060] S301, sending a call request of a target service to a first registration server, the call request being used to request device information of a local deployment device corresponding to the target service.

[0061] The client can send a call request of a target service to a first registration server, the call request being used to request device information of a local deployment device corresponding to the target service, and the local deployment device is provided with a target service application used to process the target service.

[0062] That is, based on the routing proximity principle, the client can preferentially invoke the target service application of the locally deployed device to achieve fast service processing.

[0063] For example, the device information can include a service address of the locally deployed device, and the client can access the target service application based on the address.

[0064] S302, receiving a feedback message of the invocation request sent by the first registration server, the feedback message being used to indicate whether the first registration server is abnormal.

[0065] After the client sends the invocation request, the client can receive the feedback message of the invocation request sent by the first registration server, and the feedback message is used to indicate whether the first registration server is abnormal.

[0066] In a possible implementation, if the device information of the locally deployed device corresponding to the target service is included in the feedback message, it can be indicated that the first registration server is not abnormal, and the client can normally obtain the device information of the locally deployed device corresponding to the target service. If the device information of the locally deployed device corresponding to the target service does not exist in the feedback message, or a preset character is included in the feedback message, it can be indicated that the first registration server is abnormal.

[0067] It can be understood that if the client can normally obtain the device information of the locally deployed device corresponding to the target service, the client can directly invoke the service application according to the device information obtained from the first registration server.

[0068] The above-mentioned abnormality of the first registration server can be caused by a failure of the first registration server, or can be caused by network abnormality or network jitter between the client and the first registration server.

[0069] S303, when the feedback message indicates that the first registration server is abnormal, obtaining the device information of a plurality of deployed devices corresponding to the target service from a cache.

[0070] When the feedback message indicates that the first registration server is abnormal, the client can obtain the device information of a plurality of deployed devices corresponding to the target service from a cache. The plurality of deployed devices include a locally deployed device and at least one remotely deployed device, and the deployed devices are provided with a target service application for processing the target service.

[0071] For example, the above-mentioned cache can be a preset memory in the client, used to store the identification of a plurality of services and the device information of a plurality of deployed devices corresponding to each service. The information can be obtained by the client from the first registration server and / or a second registration server, wherein the second registration server is a registration server corresponding to the remotely deployed device.

[0072] For example, the client can obtain the device information of the plurality of deployment devices corresponding to the target service from the plurality of service identifications and the device information of the plurality of deployment devices corresponding to each service according to the identification of the target service.

[0073] S304, determining the target deployment device from the plurality of deployment devices.

[0074] The client can determine the target deployment device from the plurality of deployment devices.

[0075] In a possible implementation, the client can determine a local deployment device from the plurality of deployment devices, and determine the local deployment device as the target deployment device. In this way, the target service application in the local deployment device can be called, and the efficiency of service processing is improved.

[0076] In another possible implementation, the client can also determine any one of at least one foreign deployment device from the plurality of deployment devices as the target deployment device.

[0077] S305, calling the target service application in the target deployment device according to the device information of the target deployment device to perform service processing, and obtaining a service processing result.

[0078] After the target deployment device is determined, the client can call the target service application in the target deployment device according to the device information of the target deployment device to perform service processing, and obtain a service processing result.

[0079] In this embodiment, the client sends a calling request of the target service to the first registration server corresponding to the local deployment device, receives a feedback message of the calling request sent by the first registration server, obtains the device information of the plurality of deployment devices corresponding to the target service from the cache when the feedback message indicates that the first registration server is abnormal, determines the target deployment device from the plurality of deployment devices, and calls the target service application in the target deployment device according to the device information of the target deployment device to perform service processing, and obtains a service processing result. In the case that the first registration server is abnormal or the network is abnormal, the application invoker can normally call the application provider, and the reliability of service processing is improved.

[0080] Next, another service processing method provided by the present application is described by way of Embodiment Two.

[0081] Figure 4 A flowchart of another service processing method provided by Embodiment Two of the present application is shown in the figure. The method can be executed by a client, or a service processing device provided in the client. The device can be a chip, a chip module, an IDE, or the like. For details, refer to Figure 4 The method includes the following steps:

[0082] S401, sending a calling request of a target service to a first registration server, the calling request being used to request device information of a locally deployed device corresponding to the target service.

[0083] S402, receiving a feedback message of the calling request sent by the first registration server, the feedback message being used to indicate whether the first registration server is abnormal.

[0084] For related descriptions of S401 and S402, refer to the above embodiments, which will not be described here again.

[0085] S403, when the feedback message indicates that the first registration server is abnormal, obtaining the device information of the multiple deployed devices corresponding to the target service from a cache.

[0086] When the feedback message indicates that the first registration server is abnormal, it means that the client cannot obtain the device information of the locally deployed device corresponding to the target service from the first registration server, and the client can obtain the device information of the multiple deployed devices corresponding to the target service from the cache.

[0087] In a possible implementation, an application calling protection function can be set in the client, and the application calling protection function can be used to enable the client to obtain the corresponding device information from the local cache when the client cannot obtain the device information of the locally deployed device corresponding to the target service from the first registration server. For example, the application calling protection function can be set in the application information of the service application set in the client, and a corresponding parameter can be set, for example, the parameter is Y when the application calling protection function is in an enabled state, and the parameter is N when the application calling protection function is in a disabled state, or other ways can be used, which are not limited in the present application. The service application in the client can call the target service application.

[0088] Specifically, the client can determine whether the application calling protection function is in an enabled state, and if the application calling protection function is in an enabled state, the client can obtain the device information of the multiple deployed devices corresponding to the target service from the cache.

[0089] For example, it is assumed that the target service application is offline due to an exception, when the application calling protection function is in an enabled state, the client continues to call the target service application and returns a connection refused message (connected refused), and when the application calling protection function is in a disabled state, the client calls the target service application and returns a no instance available message (No instances available). However, if the client probes the state of the target service application before accessing the target service application, i.e., probes whether the target service application is available, if not, the client calls the target service application and returns a no instance available message.

[0090] In another possible implementation, when the feedback message indicates that the first registration server is abnormal, the client can directly obtain the device information of the plurality of deployment devices corresponding to the target service from the cache according to the identification of the target service. That is, the client is not affected by the application calling protection function.

[0091] Since the device information in the first registration server and the second registration server is updated along with the online or offline of the service application, for example, the first service application is online, and the first registration server is sent the device information of the deployment device where the first service application is located, the device information stored in the first registration server is increased by the device information of the deployment device where the first service application is located.

[0092] In order to make the device information stored in the cache of the client consistent with the device information in the first registration server and the second registration server as much as possible, the client also needs to update the device information stored in the cache, so that the client can obtain valid device information when performing application calling, improve the efficiency of service processing, and improve the use experience of the client.

[0093] In a possible implementation, the client can update the device information stored in the cache in the following manner:

[0094] The client can request the first registration server to obtain the first device information of the local deployment device every preset time length, and request the second registration server to obtain the second device information of each foreign deployment device, and then update the device information of the plurality of deployment devices corresponding to the target service in the cache according to the first device information and the second device information.

[0095] It can be understood that the device information in the first registration server and the second registration server is valid information, that is, the device information of the deployment device where the callable service application is located, the first device information is the device information of the local deployment device where the currently available target service application is located, and the second device information is the device information of the foreign deployment device where the currently available target service application is located.

[0096] Specifically, the client can send a first data request to the first registration server and a second data request to the second registration server every preset time length, the first data request is used to request the first device information of the local deployment device where the currently available target service application is located, and the second data request is used to request the second device information of the foreign deployment device where the currently available target service application is located.

[0097] The client can then receive the first device information sent by the first registration server and the second device information sent by the second registration server, and then update the device information of the plurality of deployed devices corresponding to the target service in the cache according to the first device information and the second device information.

[0098] For example, the client can replace the device information stored in the cache with the first device information and the second device information.

[0099] S404, determine whether the first state of the target service application in the local deployed device is an available state.

[0100] If the first state is an available state, S405 is performed, and if the first state is not an available state, i.e., the first state is an unavailable state, S406 is performed.

[0101] In one possible implementation, the client can determine the first state of the target service application in the local deployed device in the following manner:

[0102] The client can send a preset HTTP request, such as a GET request, to the local deployed device, and then receive a status code sent by the local deployed device. The client can determine the first state of the target service application in the local deployed device according to the status code.

[0103] Specifically, if the status code is a preset status code, the preset status code is used to indicate that the first state is an available state, and then the client can determine that the first state is an available state. If the status code is not the preset status code, the client can determine that the first state is an unavailable state.

[0104] The detection of the first state can also be performed in other manners, which are not limited in the present application.

[0105] S405, determine that the local deployed device is a target deployed device.

[0106] If the first state of the local deployed device is an available state, it means that the target service application in the local deployed device can be called for service processing, and the client can determine that the local deployed device is a target deployed device.

[0107] S406, determine a target deployed device from at least one foreign deployed device.

[0108] If the first state of the local deployed device is an unavailable state, it means that the client cannot call the target service application in the local deployed device for service processing, and the client can determine a target deployed device from at least one foreign deployed device.

[0109] Specifically, the client can determine a target deployed device from at least one foreign deployed device in the following manner:

[0110] The client can determine a second state of the target service application in each off-site deployment device, the second state being an available state or an unavailable state.

[0111] For each off-site deployment device, the client can determine a routing distance between a machine room where the off-site deployment device is located and a machine room where the on-site deployment device is located, and then the client can determine the off-site deployment device with the second state being the available state and the minimum routing distance as the target deployment device.

[0112] S407, according to the device information of the target deployment device, calling the target service application in the target deployment device to perform service processing, obtaining a service processing result.

[0113] After determining the target deployment device, the client can obtain device information of the target deployment device, and then call the target service application in the target deployment device according to the device information of the target deployment device to perform service processing, obtaining a service processing result.

[0114] In a possible implementation, the device information of the target deployment device can include a service address of the target deployment device, which can be a service address of the target service application in the target deployment device. Through the service address, the client can call the target service application in the target deployment device, thereby realizing service processing.

[0115] Specifically, the client can send a service processing request corresponding to the target service to the target deployment device according to the service address, the service processing request being used to request the target deployment device to perform service processing through the target service application. After receiving the service processing request, the target deployment device can perform service processing through the target service application, obtaining a service processing result. Then the client can receive the service processing result sent by the target deployment device.

[0116] In the embodiment, the client sends a call request of a target service to a first registration server corresponding to a local deployment device, then receives a feedback message of the call request sent by the first registration server, obtains device information of a plurality of deployment devices corresponding to the target service from a cache when the feedback message indicates that the first registration server is abnormal, determines a first state of the target service application in the local deployment device, determines the local deployment device as the target deployment device when the first state of the local deployment device is an available state, and determines the target deployment device from at least one foreign deployment device when the first state of the local deployment device is an unavailable state. Then, the target service application in the target deployment device is called according to the device information of the target deployment device to perform service processing, and a service processing result is obtained. In the case that the first registration server is abnormal or the network is abnormal, the application invoker can normally invoke the application provider, and the reliability of service processing is improved.

[0117] Next, the interaction between the client and the first registration service and the second registration server is described through Embodiment Three.

[0118] Figure 5 A signaling flowchart of a service processing method provided in Embodiment Three of the application is shown in the figure, and the method comprises the following steps:

[0119] S501, the client sends a call request to the first registration server.

[0120] The call request is used to request device information of a local deployment device corresponding to a target service.

[0121] S502, the first registration server sends a feedback message corresponding to the call request to the client.

[0122] The feedback message is used to indicate whether the first registration server is abnormal.

[0123] S503, if the feedback message indicates that the first registration server is abnormal, the client obtains device information of a plurality of deployment devices corresponding to the target service from a cache.

[0124] S504, the client determines a target deployment device from the plurality of deployment devices.

[0125] S505, the client calls a target service application in the target deployment device according to the device information of the target deployment device to perform service processing, and obtains a service processing result.

[0126] S506, the client sends a second data request to the second registration server.

[0127] The second data request is used to request second device information of a foreign deployment device in which a target service application currently available.

[0128] S507, the client sends a first data request to the first registration server.

[0129] The first data request is used to request first device information of a local deployment device where a target service application currently available is located.

[0130] S508, the first registration server sends first device information corresponding to the first data request to the client.

[0131] S509, the second registration server sends second device information corresponding to the second data request to the client.

[0132] S510, the client updates device information of a plurality of deployment devices corresponding to the target service in the cache according to the first device information and the second device information.

[0133] It can be understood that the execution of S505 and S506 is not in a sequence, and the execution of S508 and S509 is not in a sequence. Moreover, S506 to S510 can be executed before S501, or before or after any one of the steps between S501 to S505, and the execution of S506 to S510 is not limited by the present application.

[0134] For the related description of the steps in the embodiment, reference can be made to the above-mentioned method embodiment, which will not be repeated here.

[0135] Figure 6 A structural schematic diagram of a service processing device provided in Embodiment Four of the present application is shown. Referring to Figure 6 The device 60 comprises a sending module 601, a receiving module 602, an obtaining module 603, a determining module 604, and a processing module 605.

[0136] The sending module 601 is configured to send a calling request of a target service to a first registration server, the calling request being used to request device information of a local deployment device corresponding to the target service, and the local deployment device being provided with a target service application used to process the target service.

[0137] The receiving module 602 is configured to receive a feedback message of the calling request sent by the first registration server, the feedback message being used to indicate whether the first registration server is abnormal.

[0138] The obtaining module 603 is configured to, when the feedback message indicates that the first registration server is abnormal, obtain device information of a plurality of deployment devices corresponding to the target service from a cache, the plurality of deployment devices comprising the local deployment device and at least one foreign deployment device, and the deployment devices being provided with the target service application used to process the target service.

[0139] The determining module 604 is configured to determine the target deployment device from the plurality of deployment devices.

[0140] The processing module 605 is configured to invoke the target service application in the target deployment device to perform service processing according to the device information of the target deployment device, and obtain a service processing result.

[0141] In a possible implementation, the determining module 604 is specifically configured to:

[0142] determine a first state of the target service application in the local deployment device, the first state being an available state or an unavailable state.

[0143] If the first state of the local deployment device is the available state, the local deployment device is determined as the target deployment device.

[0144] If the first state of the local deployment device is the unavailable state, the target deployment device is determined from the at least one foreign deployment device.

[0145] In a possible implementation, the determining module 604 is specifically configured to:

[0146] determine a second state of the target service application in each foreign deployment device, the second state being the available state or the unavailable state.

[0147] For each foreign deployment device, a routing distance between a machine room where the foreign deployment device is located and a machine room where the local deployment device is located is determined.

[0148] the foreign deployment device with the available second state and the minimum routing distance is determined as the target deployment device.

[0149] In a possible implementation, the determining module 604 is specifically configured to:

[0150] send a preset HTTP request to the local deployment device.

[0151] receive a status code sent by the local deployment device.

[0152] If the status code is a preset status code, the first state is determined as the available state.

[0153] If the status code is not the preset status code, the first state is determined as the unavailable state.

[0154] In a possible implementation, the obtaining module 603 is specifically configured to:

[0155] determine whether an application invocation protection function is in an enabled state.

[0156] If the application invocation protection function is in the enabled state, the device information of the plurality of deployment devices corresponding to the target service is obtained from the cache.

[0157] In a possible implementation, the device information of the target deployment device includes a service address of the target deployment device. The processing module 505 is specifically configured to:

[0158] According to the service address, a service processing request corresponding to the target service is sent to the target deployment device, and the service processing request is used to request the target deployment device to perform service processing through the target service application.

[0159] The service processing result sent by the target deployment device is received.

[0160] In a possible implementation, the apparatus 60 further includes an updating module.

[0161] The updating module is specifically configured to:

[0162] Every preset time length, the first device information of the local deployment device is requested from the first registration server.

[0163] The second device information of each foreign deployment device is requested from the second registration server, and the second registration server is a registration server corresponding to the foreign deployment device and the local deployment device.

[0164] According to the first device information and the second device information, the device information of the plurality of deployment devices corresponding to the target service in the cache is updated.

[0165] The apparatus of the embodiment can be used to execute the technical solutions of the method embodiments, and the specific implementation manners and technical effects are similar, which will not be described here.

[0166] Figure 7 A structural schematic diagram of an electronic device provided in Embodiment Five of the present application is shown in FIG. 7. Figure 7 As shown in FIG. 7, the electronic device 70 can include at least one processor 701 and a memory 702.

[0167] The memory 702 is used to store programs. Specifically, the programs can include program codes, and the program codes include computer execution instructions.

[0168] The memory 702 can include a random access memory (RAM) and can also include a non-volatile memory such as at least one disk memory.

[0169] The processor 701 is configured to execute the computer-executable instructions stored in the memory 702 to implement the methods described in the foregoing method embodiments. The processor 701 can be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0170] Optionally, the electronic device 70 further includes a communication interface 703. In a specific implementation, if the communication interface 703, the memory 702, and the processor 701 are implemented independently, the communication interface 703, the memory 702, and the processor 701 can be connected to each other through a bus and complete communication therebetween. The bus can be an industry standard architecture (ISA) bus, a peripheral component (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc., but it does not mean that there is only one bus or one type of bus.

[0171] Optionally, in a specific implementation, if the communication interface 703, the memory 702, and the processor 701 are integrated on a chip, the communication interface 703, the memory 702, and the processor 701 can complete communication through an internal interface.

[0172] The electronic device 70 can be a chip, a chip module, an IDE, a server, etc.

[0173] The electronic device of the embodiment can be used to execute the technical solutions of the method embodiments, and the specific implementation manners and technical effects are similar, which will not be described here.

[0174] Embodiment six of the present application provides a computer readable storage medium, which can include: a U disk, a mobile hard disk, a read-only memory (ROM), a RAM, a magnetic disk or an optical disk, and various media that can store computer-executable instructions. Specifically, the computer readable storage medium stores computer-executable instructions, and the computer-executable instructions are executed by a computer to implement the technical solutions shown in the foregoing method embodiments. The specific implementation manners and technical effects are similar, which will not be described here.

[0175] The embodiment seven of the present application provides a computer program product comprising a computer program, which, when executed by a computer, causes the technical solutions shown in the method embodiments to be performed, and the specific implementation manners and technical effects are similar, which will not be repeated here.

[0176] Other embodiments of the application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the specification and examples be considered as exemplary only, with the true scope and spirit of the application being indicated by the following claims.

[0177] It should be understood that the application is not limited to the precise construction that has been described above and shown in the accompanying drawings and that various modifications and changes can be made by those skilled in the art without departing from the scope of the application. The scope of the application is limited only by the claims that follow.

[0178] In the present application, "and / or", only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that there are three cases of A alone, A and B together, and B alone. In addition, the character " / " in this paper means that the front and rear associated objects are a "or" relationship.

[0179] "at least one" or the like refers to any combination of these items, including any combination of single item or multiple items. For example, at least one of a, b or c, can mean a, b, c, a and b, a and c, b and c, or a, b and c, wherein each of a, b and c can be an element or a set containing one or more elements.

[0180] In the present application, "at least one" means one or more. "Multiple" means two or more. The first, second, etc. description in the embodiments of the present application is only for illustration and differentiation of the description objects, and there is no order difference, nor does it represent a special limitation on the number of devices in the embodiments of the present application, which cannot constitute any limitation on the embodiments of the present application. For example, the first threshold and the second threshold are only used to distinguish different thresholds, and do not represent the difference in size, priority or importance of the two thresholds.

[0181] In the present application, "example", "in some embodiments", "in other embodiments" and the like are used to represent an example, illustration or description. Any embodiment or design scheme described as "example" in the present application should not be interpreted as more preferred or more advantageous than other embodiments or design schemes. Rather, the word "example" is intended to present the concept in a specific way.

[0182] The terms "of", "corresponding", "relevant", "associated" can be used interchangeably in this application. It should be noted that the meanings expressed are consistent when the distinction is not emphasized. The terms "communication" and "transmission" can be used interchangeably in the embodiments of this application. It should be noted that the meanings expressed are consistent when the distinction is not emphasized. For example, transmission can include sending and / or receiving, and can be a noun or a verb.

Claims

1. A business processing method, characterized in that, Applied to the client side, including: Send a request to the first registration server to invoke the target service. The request is used to request the device information of the local deployment device corresponding to the target service. The local deployment device is equipped with a target service application for processing the target service. Receive a feedback message from the first registration server regarding the call request, the feedback message indicating whether the first registration server has encountered an anomaly; If the feedback message does not contain device information of the local deployment device corresponding to the target service, or if the feedback message contains preset characters, the feedback message indicates that the first registration server has encountered an error. The device information of multiple deployment devices corresponding to the target service is retrieved from the cache. The multiple deployment devices include a local deployment device and at least one remote deployment device. The deployment devices are equipped with a target service application for processing the target service. From the plurality of deployed devices, determine the target deployed device; Based on the device information of the target deployment device, the target business application in the target deployment device is invoked to perform business processing and obtain the business processing result; From the plurality of deployment devices, the target deployment device is determined, including: Determine the first state of the target business application in the locally deployed device, wherein the first state is an available state or an unavailable state; If the first state of the locally deployed device is an available state, then the locally deployed device is determined to be the target deployment device; If the first state of the locally deployed device is unavailable, then the target deployed device is determined from the at least one remotely deployed device; Determining the target deployment device from the at least one remotely deployed device includes: Determine the second state of the target business application in each remotely deployed device, wherein the second state is either available or unavailable. For each remotely deployed device, determine the routing distance between the data center where the remotely deployed device is located and the data center where the locally deployed device is located; The remote deployment device that is in the second state of availability and has the smallest routing distance is identified as the target deployment device.

2. The method according to claim 1, characterized in that, Determining the first state of the target business application in the locally deployed device includes: Send a preset Hypertext Transfer Protocol (HTTP) request to the locally deployed device; Receive the status code sent by the locally deployed device; If the status code is a preset status code, then the first status is determined to be an available status; If the status code is not a preset status code, then the first status is determined to be an unavailable status.

3. The method according to claim 1, characterized in that, Retrieve device information of multiple deployed devices corresponding to the target service from the cache, including: Determine if the application call protection feature is enabled; If the application call protection function is enabled, then the device information of multiple deployed devices corresponding to the target service is obtained from the cache.

4. The method according to claim 3, characterized in that, The device information of the target deployment device includes the service address of the target deployment device; Based on the device information of the target deployment device, the target business application in the target deployment device is invoked to perform business processing, and the business processing result is obtained, including: Based on the service address, a service processing request corresponding to the target service is sent to the target deployment device. The service processing request is used to request the target deployment device to perform service processing through the target service application. Receive the service processing result sent by the target deployment device.

5. The method according to claim 1, characterized in that, The method further includes: Every preset time interval, a request is sent to the first registration server to obtain the first device information of the locally deployed device; The system requests second device information for each remotely deployed device from a second registration server, where the second registration server is the registration server corresponding to the remotely deployed device and the locally deployed device. Based on the first device information and the second device information, the device information of multiple deployment devices corresponding to the target service in the cache is updated.

6. A business processing apparatus, characterized in that, include: The sending module is used to send a call request for a target service to the first registration server. The call request is used to request device information of the locally deployed device corresponding to the target service. The locally deployed device is equipped with a target service application for processing the target service. The receiving module is configured to receive a feedback message from the first registration server regarding the call request, wherein the feedback message is used to indicate whether the first registration server has encountered an abnormality. The acquisition module is used to retrieve device information of multiple deployment devices corresponding to the target service from the cache if the feedback message does not contain device information of the local deployment device corresponding to the target service, or if the feedback message contains preset characters indicating that the first registration server has encountered an error. The multiple deployment devices include a local deployment device and at least one remote deployment device. The deployment devices are equipped with a target service application for processing the target service. A determination module is used to determine a target deployment device from the plurality of deployment devices; The processing module is used to call the target business application in the target deployment device to perform business processing based on the device information of the target deployment device, and obtain the business processing result; The determining module is specifically used for: Determine the first state of the target business application in the locally deployed device, wherein the first state is an available state or an unavailable state; If the first state of the locally deployed device is an available state, then the locally deployed device is determined to be the target deployment device; If the first state of the locally deployed device is unavailable, then the target deployed device is determined from the at least one remotely deployed device; The determining module is specifically used for: Determine the second state of the target business application in each remotely deployed device, wherein the second state is either available or unavailable. For each remotely deployed device, determine the routing distance between the data center where the remotely deployed device is located and the data center where the locally deployed device is located; The remote deployment device that is in the second state of availability and has the smallest routing distance is identified as the target deployment device.

7. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the business processing method as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the business processing method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Service discovering method based on cooperation of registration center and caching mechanism

    CN105933444A